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.
 
 
 

133824 lines
5.1 MiB

  1. // Package compute provides access to the Compute Engine API.
  2. //
  3. // See https://developers.google.com/compute/docs/reference/latest/
  4. //
  5. // Usage example:
  6. //
  7. // import "google.golang.org/api/compute/v0.alpha"
  8. // ...
  9. // computeService, err := compute.New(oauthHttpClient)
  10. package compute // import "google.golang.org/api/compute/v0.alpha"
  11. import (
  12. "bytes"
  13. "encoding/json"
  14. "errors"
  15. "fmt"
  16. context "golang.org/x/net/context"
  17. ctxhttp "golang.org/x/net/context/ctxhttp"
  18. gensupport "google.golang.org/api/gensupport"
  19. googleapi "google.golang.org/api/googleapi"
  20. "io"
  21. "net/http"
  22. "net/url"
  23. "strconv"
  24. "strings"
  25. )
  26. // Always reference these packages, just in case the auto-generated code
  27. // below doesn't.
  28. var _ = bytes.NewBuffer
  29. var _ = strconv.Itoa
  30. var _ = fmt.Sprintf
  31. var _ = json.NewDecoder
  32. var _ = io.Copy
  33. var _ = url.Parse
  34. var _ = gensupport.MarshalJSON
  35. var _ = googleapi.Version
  36. var _ = errors.New
  37. var _ = strings.Replace
  38. var _ = context.Canceled
  39. var _ = ctxhttp.Do
  40. const apiId = "compute:alpha"
  41. const apiName = "compute"
  42. const apiVersion = "alpha"
  43. const basePath = "https://www.googleapis.com/compute/alpha/projects/"
  44. // OAuth2 scopes used by this API.
  45. const (
  46. // View and manage your data across Google Cloud Platform services
  47. CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
  48. // View and manage your Google Compute Engine resources
  49. ComputeScope = "https://www.googleapis.com/auth/compute"
  50. // View your Google Compute Engine resources
  51. ComputeReadonlyScope = "https://www.googleapis.com/auth/compute.readonly"
  52. // Manage your data and permissions in Google Cloud Storage
  53. DevstorageFullControlScope = "https://www.googleapis.com/auth/devstorage.full_control"
  54. // View your data in Google Cloud Storage
  55. DevstorageReadOnlyScope = "https://www.googleapis.com/auth/devstorage.read_only"
  56. // Manage your data in Google Cloud Storage
  57. DevstorageReadWriteScope = "https://www.googleapis.com/auth/devstorage.read_write"
  58. )
  59. func New(client *http.Client) (*Service, error) {
  60. if client == nil {
  61. return nil, errors.New("client is nil")
  62. }
  63. s := &Service{client: client, BasePath: basePath}
  64. s.AcceleratorTypes = NewAcceleratorTypesService(s)
  65. s.Addresses = NewAddressesService(s)
  66. s.Autoscalers = NewAutoscalersService(s)
  67. s.BackendBuckets = NewBackendBucketsService(s)
  68. s.BackendServices = NewBackendServicesService(s)
  69. s.DiskTypes = NewDiskTypesService(s)
  70. s.Disks = NewDisksService(s)
  71. s.Firewalls = NewFirewallsService(s)
  72. s.ForwardingRules = NewForwardingRulesService(s)
  73. s.GlobalAddresses = NewGlobalAddressesService(s)
  74. s.GlobalForwardingRules = NewGlobalForwardingRulesService(s)
  75. s.GlobalOperations = NewGlobalOperationsService(s)
  76. s.HealthChecks = NewHealthChecksService(s)
  77. s.HostTypes = NewHostTypesService(s)
  78. s.Hosts = NewHostsService(s)
  79. s.HttpHealthChecks = NewHttpHealthChecksService(s)
  80. s.HttpsHealthChecks = NewHttpsHealthChecksService(s)
  81. s.Images = NewImagesService(s)
  82. s.InstanceGroupManagers = NewInstanceGroupManagersService(s)
  83. s.InstanceGroups = NewInstanceGroupsService(s)
  84. s.InstanceTemplates = NewInstanceTemplatesService(s)
  85. s.Instances = NewInstancesService(s)
  86. s.InterconnectAttachments = NewInterconnectAttachmentsService(s)
  87. s.InterconnectLocations = NewInterconnectLocationsService(s)
  88. s.Interconnects = NewInterconnectsService(s)
  89. s.LicenseCodes = NewLicenseCodesService(s)
  90. s.Licenses = NewLicensesService(s)
  91. s.MachineTypes = NewMachineTypesService(s)
  92. s.NetworkEndpointGroups = NewNetworkEndpointGroupsService(s)
  93. s.Networks = NewNetworksService(s)
  94. s.NodeGroups = NewNodeGroupsService(s)
  95. s.NodeTemplates = NewNodeTemplatesService(s)
  96. s.NodeTypes = NewNodeTypesService(s)
  97. s.Projects = NewProjectsService(s)
  98. s.RegionAutoscalers = NewRegionAutoscalersService(s)
  99. s.RegionBackendServices = NewRegionBackendServicesService(s)
  100. s.RegionCommitments = NewRegionCommitmentsService(s)
  101. s.RegionDiskTypes = NewRegionDiskTypesService(s)
  102. s.RegionDisks = NewRegionDisksService(s)
  103. s.RegionHealthChecks = NewRegionHealthChecksService(s)
  104. s.RegionInstanceGroupManagers = NewRegionInstanceGroupManagersService(s)
  105. s.RegionInstanceGroups = NewRegionInstanceGroupsService(s)
  106. s.RegionOperations = NewRegionOperationsService(s)
  107. s.RegionTargetHttpProxies = NewRegionTargetHttpProxiesService(s)
  108. s.RegionUrlMaps = NewRegionUrlMapsService(s)
  109. s.Regions = NewRegionsService(s)
  110. s.ResourcePolicies = NewResourcePoliciesService(s)
  111. s.Routers = NewRoutersService(s)
  112. s.Routes = NewRoutesService(s)
  113. s.SecurityPolicies = NewSecurityPoliciesService(s)
  114. s.Snapshots = NewSnapshotsService(s)
  115. s.SslCertificates = NewSslCertificatesService(s)
  116. s.SslPolicies = NewSslPoliciesService(s)
  117. s.Subnetworks = NewSubnetworksService(s)
  118. s.TargetHttpProxies = NewTargetHttpProxiesService(s)
  119. s.TargetHttpsProxies = NewTargetHttpsProxiesService(s)
  120. s.TargetInstances = NewTargetInstancesService(s)
  121. s.TargetPools = NewTargetPoolsService(s)
  122. s.TargetSslProxies = NewTargetSslProxiesService(s)
  123. s.TargetTcpProxies = NewTargetTcpProxiesService(s)
  124. s.TargetVpnGateways = NewTargetVpnGatewaysService(s)
  125. s.UrlMaps = NewUrlMapsService(s)
  126. s.VpnGateways = NewVpnGatewaysService(s)
  127. s.VpnTunnels = NewVpnTunnelsService(s)
  128. s.ZoneOperations = NewZoneOperationsService(s)
  129. s.Zones = NewZonesService(s)
  130. return s, nil
  131. }
  132. type Service struct {
  133. client *http.Client
  134. BasePath string // API endpoint base URL
  135. UserAgent string // optional additional User-Agent fragment
  136. AcceleratorTypes *AcceleratorTypesService
  137. Addresses *AddressesService
  138. Autoscalers *AutoscalersService
  139. BackendBuckets *BackendBucketsService
  140. BackendServices *BackendServicesService
  141. DiskTypes *DiskTypesService
  142. Disks *DisksService
  143. Firewalls *FirewallsService
  144. ForwardingRules *ForwardingRulesService
  145. GlobalAddresses *GlobalAddressesService
  146. GlobalForwardingRules *GlobalForwardingRulesService
  147. GlobalOperations *GlobalOperationsService
  148. HealthChecks *HealthChecksService
  149. HostTypes *HostTypesService
  150. Hosts *HostsService
  151. HttpHealthChecks *HttpHealthChecksService
  152. HttpsHealthChecks *HttpsHealthChecksService
  153. Images *ImagesService
  154. InstanceGroupManagers *InstanceGroupManagersService
  155. InstanceGroups *InstanceGroupsService
  156. InstanceTemplates *InstanceTemplatesService
  157. Instances *InstancesService
  158. InterconnectAttachments *InterconnectAttachmentsService
  159. InterconnectLocations *InterconnectLocationsService
  160. Interconnects *InterconnectsService
  161. LicenseCodes *LicenseCodesService
  162. Licenses *LicensesService
  163. MachineTypes *MachineTypesService
  164. NetworkEndpointGroups *NetworkEndpointGroupsService
  165. Networks *NetworksService
  166. NodeGroups *NodeGroupsService
  167. NodeTemplates *NodeTemplatesService
  168. NodeTypes *NodeTypesService
  169. Projects *ProjectsService
  170. RegionAutoscalers *RegionAutoscalersService
  171. RegionBackendServices *RegionBackendServicesService
  172. RegionCommitments *RegionCommitmentsService
  173. RegionDiskTypes *RegionDiskTypesService
  174. RegionDisks *RegionDisksService
  175. RegionHealthChecks *RegionHealthChecksService
  176. RegionInstanceGroupManagers *RegionInstanceGroupManagersService
  177. RegionInstanceGroups *RegionInstanceGroupsService
  178. RegionOperations *RegionOperationsService
  179. RegionTargetHttpProxies *RegionTargetHttpProxiesService
  180. RegionUrlMaps *RegionUrlMapsService
  181. Regions *RegionsService
  182. ResourcePolicies *ResourcePoliciesService
  183. Routers *RoutersService
  184. Routes *RoutesService
  185. SecurityPolicies *SecurityPoliciesService
  186. Snapshots *SnapshotsService
  187. SslCertificates *SslCertificatesService
  188. SslPolicies *SslPoliciesService
  189. Subnetworks *SubnetworksService
  190. TargetHttpProxies *TargetHttpProxiesService
  191. TargetHttpsProxies *TargetHttpsProxiesService
  192. TargetInstances *TargetInstancesService
  193. TargetPools *TargetPoolsService
  194. TargetSslProxies *TargetSslProxiesService
  195. TargetTcpProxies *TargetTcpProxiesService
  196. TargetVpnGateways *TargetVpnGatewaysService
  197. UrlMaps *UrlMapsService
  198. VpnGateways *VpnGatewaysService
  199. VpnTunnels *VpnTunnelsService
  200. ZoneOperations *ZoneOperationsService
  201. Zones *ZonesService
  202. }
  203. func (s *Service) userAgent() string {
  204. if s.UserAgent == "" {
  205. return googleapi.UserAgent
  206. }
  207. return googleapi.UserAgent + " " + s.UserAgent
  208. }
  209. func NewAcceleratorTypesService(s *Service) *AcceleratorTypesService {
  210. rs := &AcceleratorTypesService{s: s}
  211. return rs
  212. }
  213. type AcceleratorTypesService struct {
  214. s *Service
  215. }
  216. func NewAddressesService(s *Service) *AddressesService {
  217. rs := &AddressesService{s: s}
  218. return rs
  219. }
  220. type AddressesService struct {
  221. s *Service
  222. }
  223. func NewAutoscalersService(s *Service) *AutoscalersService {
  224. rs := &AutoscalersService{s: s}
  225. return rs
  226. }
  227. type AutoscalersService struct {
  228. s *Service
  229. }
  230. func NewBackendBucketsService(s *Service) *BackendBucketsService {
  231. rs := &BackendBucketsService{s: s}
  232. return rs
  233. }
  234. type BackendBucketsService struct {
  235. s *Service
  236. }
  237. func NewBackendServicesService(s *Service) *BackendServicesService {
  238. rs := &BackendServicesService{s: s}
  239. return rs
  240. }
  241. type BackendServicesService struct {
  242. s *Service
  243. }
  244. func NewDiskTypesService(s *Service) *DiskTypesService {
  245. rs := &DiskTypesService{s: s}
  246. return rs
  247. }
  248. type DiskTypesService struct {
  249. s *Service
  250. }
  251. func NewDisksService(s *Service) *DisksService {
  252. rs := &DisksService{s: s}
  253. return rs
  254. }
  255. type DisksService struct {
  256. s *Service
  257. }
  258. func NewFirewallsService(s *Service) *FirewallsService {
  259. rs := &FirewallsService{s: s}
  260. return rs
  261. }
  262. type FirewallsService struct {
  263. s *Service
  264. }
  265. func NewForwardingRulesService(s *Service) *ForwardingRulesService {
  266. rs := &ForwardingRulesService{s: s}
  267. return rs
  268. }
  269. type ForwardingRulesService struct {
  270. s *Service
  271. }
  272. func NewGlobalAddressesService(s *Service) *GlobalAddressesService {
  273. rs := &GlobalAddressesService{s: s}
  274. return rs
  275. }
  276. type GlobalAddressesService struct {
  277. s *Service
  278. }
  279. func NewGlobalForwardingRulesService(s *Service) *GlobalForwardingRulesService {
  280. rs := &GlobalForwardingRulesService{s: s}
  281. return rs
  282. }
  283. type GlobalForwardingRulesService struct {
  284. s *Service
  285. }
  286. func NewGlobalOperationsService(s *Service) *GlobalOperationsService {
  287. rs := &GlobalOperationsService{s: s}
  288. return rs
  289. }
  290. type GlobalOperationsService struct {
  291. s *Service
  292. }
  293. func NewHealthChecksService(s *Service) *HealthChecksService {
  294. rs := &HealthChecksService{s: s}
  295. return rs
  296. }
  297. type HealthChecksService struct {
  298. s *Service
  299. }
  300. func NewHostTypesService(s *Service) *HostTypesService {
  301. rs := &HostTypesService{s: s}
  302. return rs
  303. }
  304. type HostTypesService struct {
  305. s *Service
  306. }
  307. func NewHostsService(s *Service) *HostsService {
  308. rs := &HostsService{s: s}
  309. return rs
  310. }
  311. type HostsService struct {
  312. s *Service
  313. }
  314. func NewHttpHealthChecksService(s *Service) *HttpHealthChecksService {
  315. rs := &HttpHealthChecksService{s: s}
  316. return rs
  317. }
  318. type HttpHealthChecksService struct {
  319. s *Service
  320. }
  321. func NewHttpsHealthChecksService(s *Service) *HttpsHealthChecksService {
  322. rs := &HttpsHealthChecksService{s: s}
  323. return rs
  324. }
  325. type HttpsHealthChecksService struct {
  326. s *Service
  327. }
  328. func NewImagesService(s *Service) *ImagesService {
  329. rs := &ImagesService{s: s}
  330. return rs
  331. }
  332. type ImagesService struct {
  333. s *Service
  334. }
  335. func NewInstanceGroupManagersService(s *Service) *InstanceGroupManagersService {
  336. rs := &InstanceGroupManagersService{s: s}
  337. return rs
  338. }
  339. type InstanceGroupManagersService struct {
  340. s *Service
  341. }
  342. func NewInstanceGroupsService(s *Service) *InstanceGroupsService {
  343. rs := &InstanceGroupsService{s: s}
  344. return rs
  345. }
  346. type InstanceGroupsService struct {
  347. s *Service
  348. }
  349. func NewInstanceTemplatesService(s *Service) *InstanceTemplatesService {
  350. rs := &InstanceTemplatesService{s: s}
  351. return rs
  352. }
  353. type InstanceTemplatesService struct {
  354. s *Service
  355. }
  356. func NewInstancesService(s *Service) *InstancesService {
  357. rs := &InstancesService{s: s}
  358. return rs
  359. }
  360. type InstancesService struct {
  361. s *Service
  362. }
  363. func NewInterconnectAttachmentsService(s *Service) *InterconnectAttachmentsService {
  364. rs := &InterconnectAttachmentsService{s: s}
  365. return rs
  366. }
  367. type InterconnectAttachmentsService struct {
  368. s *Service
  369. }
  370. func NewInterconnectLocationsService(s *Service) *InterconnectLocationsService {
  371. rs := &InterconnectLocationsService{s: s}
  372. return rs
  373. }
  374. type InterconnectLocationsService struct {
  375. s *Service
  376. }
  377. func NewInterconnectsService(s *Service) *InterconnectsService {
  378. rs := &InterconnectsService{s: s}
  379. return rs
  380. }
  381. type InterconnectsService struct {
  382. s *Service
  383. }
  384. func NewLicenseCodesService(s *Service) *LicenseCodesService {
  385. rs := &LicenseCodesService{s: s}
  386. return rs
  387. }
  388. type LicenseCodesService struct {
  389. s *Service
  390. }
  391. func NewLicensesService(s *Service) *LicensesService {
  392. rs := &LicensesService{s: s}
  393. return rs
  394. }
  395. type LicensesService struct {
  396. s *Service
  397. }
  398. func NewMachineTypesService(s *Service) *MachineTypesService {
  399. rs := &MachineTypesService{s: s}
  400. return rs
  401. }
  402. type MachineTypesService struct {
  403. s *Service
  404. }
  405. func NewNetworkEndpointGroupsService(s *Service) *NetworkEndpointGroupsService {
  406. rs := &NetworkEndpointGroupsService{s: s}
  407. return rs
  408. }
  409. type NetworkEndpointGroupsService struct {
  410. s *Service
  411. }
  412. func NewNetworksService(s *Service) *NetworksService {
  413. rs := &NetworksService{s: s}
  414. return rs
  415. }
  416. type NetworksService struct {
  417. s *Service
  418. }
  419. func NewNodeGroupsService(s *Service) *NodeGroupsService {
  420. rs := &NodeGroupsService{s: s}
  421. return rs
  422. }
  423. type NodeGroupsService struct {
  424. s *Service
  425. }
  426. func NewNodeTemplatesService(s *Service) *NodeTemplatesService {
  427. rs := &NodeTemplatesService{s: s}
  428. return rs
  429. }
  430. type NodeTemplatesService struct {
  431. s *Service
  432. }
  433. func NewNodeTypesService(s *Service) *NodeTypesService {
  434. rs := &NodeTypesService{s: s}
  435. return rs
  436. }
  437. type NodeTypesService struct {
  438. s *Service
  439. }
  440. func NewProjectsService(s *Service) *ProjectsService {
  441. rs := &ProjectsService{s: s}
  442. return rs
  443. }
  444. type ProjectsService struct {
  445. s *Service
  446. }
  447. func NewRegionAutoscalersService(s *Service) *RegionAutoscalersService {
  448. rs := &RegionAutoscalersService{s: s}
  449. return rs
  450. }
  451. type RegionAutoscalersService struct {
  452. s *Service
  453. }
  454. func NewRegionBackendServicesService(s *Service) *RegionBackendServicesService {
  455. rs := &RegionBackendServicesService{s: s}
  456. return rs
  457. }
  458. type RegionBackendServicesService struct {
  459. s *Service
  460. }
  461. func NewRegionCommitmentsService(s *Service) *RegionCommitmentsService {
  462. rs := &RegionCommitmentsService{s: s}
  463. return rs
  464. }
  465. type RegionCommitmentsService struct {
  466. s *Service
  467. }
  468. func NewRegionDiskTypesService(s *Service) *RegionDiskTypesService {
  469. rs := &RegionDiskTypesService{s: s}
  470. return rs
  471. }
  472. type RegionDiskTypesService struct {
  473. s *Service
  474. }
  475. func NewRegionDisksService(s *Service) *RegionDisksService {
  476. rs := &RegionDisksService{s: s}
  477. return rs
  478. }
  479. type RegionDisksService struct {
  480. s *Service
  481. }
  482. func NewRegionHealthChecksService(s *Service) *RegionHealthChecksService {
  483. rs := &RegionHealthChecksService{s: s}
  484. return rs
  485. }
  486. type RegionHealthChecksService struct {
  487. s *Service
  488. }
  489. func NewRegionInstanceGroupManagersService(s *Service) *RegionInstanceGroupManagersService {
  490. rs := &RegionInstanceGroupManagersService{s: s}
  491. return rs
  492. }
  493. type RegionInstanceGroupManagersService struct {
  494. s *Service
  495. }
  496. func NewRegionInstanceGroupsService(s *Service) *RegionInstanceGroupsService {
  497. rs := &RegionInstanceGroupsService{s: s}
  498. return rs
  499. }
  500. type RegionInstanceGroupsService struct {
  501. s *Service
  502. }
  503. func NewRegionOperationsService(s *Service) *RegionOperationsService {
  504. rs := &RegionOperationsService{s: s}
  505. return rs
  506. }
  507. type RegionOperationsService struct {
  508. s *Service
  509. }
  510. func NewRegionTargetHttpProxiesService(s *Service) *RegionTargetHttpProxiesService {
  511. rs := &RegionTargetHttpProxiesService{s: s}
  512. return rs
  513. }
  514. type RegionTargetHttpProxiesService struct {
  515. s *Service
  516. }
  517. func NewRegionUrlMapsService(s *Service) *RegionUrlMapsService {
  518. rs := &RegionUrlMapsService{s: s}
  519. return rs
  520. }
  521. type RegionUrlMapsService struct {
  522. s *Service
  523. }
  524. func NewRegionsService(s *Service) *RegionsService {
  525. rs := &RegionsService{s: s}
  526. return rs
  527. }
  528. type RegionsService struct {
  529. s *Service
  530. }
  531. func NewResourcePoliciesService(s *Service) *ResourcePoliciesService {
  532. rs := &ResourcePoliciesService{s: s}
  533. return rs
  534. }
  535. type ResourcePoliciesService struct {
  536. s *Service
  537. }
  538. func NewRoutersService(s *Service) *RoutersService {
  539. rs := &RoutersService{s: s}
  540. return rs
  541. }
  542. type RoutersService struct {
  543. s *Service
  544. }
  545. func NewRoutesService(s *Service) *RoutesService {
  546. rs := &RoutesService{s: s}
  547. return rs
  548. }
  549. type RoutesService struct {
  550. s *Service
  551. }
  552. func NewSecurityPoliciesService(s *Service) *SecurityPoliciesService {
  553. rs := &SecurityPoliciesService{s: s}
  554. return rs
  555. }
  556. type SecurityPoliciesService struct {
  557. s *Service
  558. }
  559. func NewSnapshotsService(s *Service) *SnapshotsService {
  560. rs := &SnapshotsService{s: s}
  561. return rs
  562. }
  563. type SnapshotsService struct {
  564. s *Service
  565. }
  566. func NewSslCertificatesService(s *Service) *SslCertificatesService {
  567. rs := &SslCertificatesService{s: s}
  568. return rs
  569. }
  570. type SslCertificatesService struct {
  571. s *Service
  572. }
  573. func NewSslPoliciesService(s *Service) *SslPoliciesService {
  574. rs := &SslPoliciesService{s: s}
  575. return rs
  576. }
  577. type SslPoliciesService struct {
  578. s *Service
  579. }
  580. func NewSubnetworksService(s *Service) *SubnetworksService {
  581. rs := &SubnetworksService{s: s}
  582. return rs
  583. }
  584. type SubnetworksService struct {
  585. s *Service
  586. }
  587. func NewTargetHttpProxiesService(s *Service) *TargetHttpProxiesService {
  588. rs := &TargetHttpProxiesService{s: s}
  589. return rs
  590. }
  591. type TargetHttpProxiesService struct {
  592. s *Service
  593. }
  594. func NewTargetHttpsProxiesService(s *Service) *TargetHttpsProxiesService {
  595. rs := &TargetHttpsProxiesService{s: s}
  596. return rs
  597. }
  598. type TargetHttpsProxiesService struct {
  599. s *Service
  600. }
  601. func NewTargetInstancesService(s *Service) *TargetInstancesService {
  602. rs := &TargetInstancesService{s: s}
  603. return rs
  604. }
  605. type TargetInstancesService struct {
  606. s *Service
  607. }
  608. func NewTargetPoolsService(s *Service) *TargetPoolsService {
  609. rs := &TargetPoolsService{s: s}
  610. return rs
  611. }
  612. type TargetPoolsService struct {
  613. s *Service
  614. }
  615. func NewTargetSslProxiesService(s *Service) *TargetSslProxiesService {
  616. rs := &TargetSslProxiesService{s: s}
  617. return rs
  618. }
  619. type TargetSslProxiesService struct {
  620. s *Service
  621. }
  622. func NewTargetTcpProxiesService(s *Service) *TargetTcpProxiesService {
  623. rs := &TargetTcpProxiesService{s: s}
  624. return rs
  625. }
  626. type TargetTcpProxiesService struct {
  627. s *Service
  628. }
  629. func NewTargetVpnGatewaysService(s *Service) *TargetVpnGatewaysService {
  630. rs := &TargetVpnGatewaysService{s: s}
  631. return rs
  632. }
  633. type TargetVpnGatewaysService struct {
  634. s *Service
  635. }
  636. func NewUrlMapsService(s *Service) *UrlMapsService {
  637. rs := &UrlMapsService{s: s}
  638. return rs
  639. }
  640. type UrlMapsService struct {
  641. s *Service
  642. }
  643. func NewVpnGatewaysService(s *Service) *VpnGatewaysService {
  644. rs := &VpnGatewaysService{s: s}
  645. return rs
  646. }
  647. type VpnGatewaysService struct {
  648. s *Service
  649. }
  650. func NewVpnTunnelsService(s *Service) *VpnTunnelsService {
  651. rs := &VpnTunnelsService{s: s}
  652. return rs
  653. }
  654. type VpnTunnelsService struct {
  655. s *Service
  656. }
  657. func NewZoneOperationsService(s *Service) *ZoneOperationsService {
  658. rs := &ZoneOperationsService{s: s}
  659. return rs
  660. }
  661. type ZoneOperationsService struct {
  662. s *Service
  663. }
  664. func NewZonesService(s *Service) *ZonesService {
  665. rs := &ZonesService{s: s}
  666. return rs
  667. }
  668. type ZonesService struct {
  669. s *Service
  670. }
  671. // AcceleratorConfig: A specification of the type and number of
  672. // accelerator cards attached to the instance.
  673. type AcceleratorConfig struct {
  674. // AcceleratorCount: The number of the guest accelerator cards exposed
  675. // to this instance.
  676. AcceleratorCount int64 `json:"acceleratorCount,omitempty"`
  677. // AcceleratorType: Full or partial URL of the accelerator type resource
  678. // to attach to this instance. If you are creating an instance template,
  679. // specify only the accelerator name.
  680. AcceleratorType string `json:"acceleratorType,omitempty"`
  681. // ForceSendFields is a list of field names (e.g. "AcceleratorCount") to
  682. // unconditionally include in API requests. By default, fields with
  683. // empty values are omitted from API requests. However, any non-pointer,
  684. // non-interface field appearing in ForceSendFields will be sent to the
  685. // server regardless of whether the field is empty or not. This may be
  686. // used to include empty fields in Patch requests.
  687. ForceSendFields []string `json:"-"`
  688. // NullFields is a list of field names (e.g. "AcceleratorCount") to
  689. // include in API requests with the JSON null value. By default, fields
  690. // with empty values are omitted from API requests. However, any field
  691. // with an empty value appearing in NullFields will be sent to the
  692. // server as null. It is an error if a field in this list has a
  693. // non-empty value. This may be used to include null fields in Patch
  694. // requests.
  695. NullFields []string `json:"-"`
  696. }
  697. func (s *AcceleratorConfig) MarshalJSON() ([]byte, error) {
  698. type NoMethod AcceleratorConfig
  699. raw := NoMethod(*s)
  700. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  701. }
  702. // AcceleratorType: An Accelerator Type resource. (== resource_for
  703. // beta.acceleratorTypes ==) (== resource_for v1.acceleratorTypes ==)
  704. type AcceleratorType struct {
  705. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  706. // format.
  707. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  708. // Deprecated: [Output Only] The deprecation status associated with this
  709. // accelerator type.
  710. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  711. // Description: [Output Only] An optional textual description of the
  712. // resource.
  713. Description string `json:"description,omitempty"`
  714. // Id: [Output Only] The unique identifier for the resource. This
  715. // identifier is defined by the server.
  716. Id uint64 `json:"id,omitempty,string"`
  717. // Kind: [Output Only] The type of the resource. Always
  718. // compute#acceleratorType for accelerator types.
  719. Kind string `json:"kind,omitempty"`
  720. // MaximumCardsPerInstance: [Output Only] Maximum accelerator cards
  721. // allowed per instance.
  722. MaximumCardsPerInstance int64 `json:"maximumCardsPerInstance,omitempty"`
  723. // Name: [Output Only] Name of the resource.
  724. Name string `json:"name,omitempty"`
  725. // SelfLink: [Output Only] Server-defined fully-qualified URL for this
  726. // resource.
  727. SelfLink string `json:"selfLink,omitempty"`
  728. // Zone: [Output Only] The name of the zone where the accelerator type
  729. // resides, such as us-central1-a. You must specify this field as part
  730. // of the HTTP request URL. It is not settable as a field in the request
  731. // body.
  732. Zone string `json:"zone,omitempty"`
  733. // ServerResponse contains the HTTP response code and headers from the
  734. // server.
  735. googleapi.ServerResponse `json:"-"`
  736. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  737. // to unconditionally include in API requests. By default, fields with
  738. // empty values are omitted from API requests. However, any non-pointer,
  739. // non-interface field appearing in ForceSendFields will be sent to the
  740. // server regardless of whether the field is empty or not. This may be
  741. // used to include empty fields in Patch requests.
  742. ForceSendFields []string `json:"-"`
  743. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  744. // include in API requests with the JSON null value. By default, fields
  745. // with empty values are omitted from API requests. However, any field
  746. // with an empty value appearing in NullFields will be sent to the
  747. // server as null. It is an error if a field in this list has a
  748. // non-empty value. This may be used to include null fields in Patch
  749. // requests.
  750. NullFields []string `json:"-"`
  751. }
  752. func (s *AcceleratorType) MarshalJSON() ([]byte, error) {
  753. type NoMethod AcceleratorType
  754. raw := NoMethod(*s)
  755. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  756. }
  757. type AcceleratorTypeAggregatedList struct {
  758. // Id: [Output Only] Unique identifier for the resource; defined by the
  759. // server.
  760. Id string `json:"id,omitempty"`
  761. // Items: A list of AcceleratorTypesScopedList resources.
  762. Items map[string]AcceleratorTypesScopedList `json:"items,omitempty"`
  763. // Kind: [Output Only] Type of resource. Always
  764. // compute#acceleratorTypeAggregatedList for aggregated lists of
  765. // accelerator types.
  766. Kind string `json:"kind,omitempty"`
  767. // NextPageToken: [Output Only] This token allows you to get the next
  768. // page of results for list requests. If the number of results is larger
  769. // than maxResults, use the nextPageToken as a value for the query
  770. // parameter pageToken in the next list request. Subsequent list
  771. // requests will have their own nextPageToken to continue paging through
  772. // the results.
  773. NextPageToken string `json:"nextPageToken,omitempty"`
  774. // SelfLink: [Output Only] Server-defined URL for this resource.
  775. SelfLink string `json:"selfLink,omitempty"`
  776. // Warning: [Output Only] Informational warning message.
  777. Warning *AcceleratorTypeAggregatedListWarning `json:"warning,omitempty"`
  778. // ServerResponse contains the HTTP response code and headers from the
  779. // server.
  780. googleapi.ServerResponse `json:"-"`
  781. // ForceSendFields is a list of field names (e.g. "Id") to
  782. // unconditionally include in API requests. By default, fields with
  783. // empty values are omitted from API requests. However, any non-pointer,
  784. // non-interface field appearing in ForceSendFields will be sent to the
  785. // server regardless of whether the field is empty or not. This may be
  786. // used to include empty fields in Patch requests.
  787. ForceSendFields []string `json:"-"`
  788. // NullFields is a list of field names (e.g. "Id") to include in API
  789. // requests with the JSON null value. By default, fields with empty
  790. // values are omitted from API requests. However, any field with an
  791. // empty value appearing in NullFields will be sent to the server as
  792. // null. It is an error if a field in this list has a non-empty value.
  793. // This may be used to include null fields in Patch requests.
  794. NullFields []string `json:"-"`
  795. }
  796. func (s *AcceleratorTypeAggregatedList) MarshalJSON() ([]byte, error) {
  797. type NoMethod AcceleratorTypeAggregatedList
  798. raw := NoMethod(*s)
  799. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  800. }
  801. // AcceleratorTypeAggregatedListWarning: [Output Only] Informational
  802. // warning message.
  803. type AcceleratorTypeAggregatedListWarning struct {
  804. // Code: [Output Only] A warning code, if applicable. For example,
  805. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  806. // the response.
  807. //
  808. // Possible values:
  809. // "CLEANUP_FAILED"
  810. // "DEPRECATED_RESOURCE_USED"
  811. // "DEPRECATED_TYPE_USED"
  812. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  813. // "EXPERIMENTAL_TYPE_USED"
  814. // "EXTERNAL_API_WARNING"
  815. // "FIELD_VALUE_OVERRIDEN"
  816. // "INJECTED_KERNELS_DEPRECATED"
  817. // "MISSING_TYPE_DEPENDENCY"
  818. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  819. // "NEXT_HOP_CANNOT_IP_FORWARD"
  820. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  821. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  822. // "NEXT_HOP_NOT_RUNNING"
  823. // "NOT_CRITICAL_ERROR"
  824. // "NO_RESULTS_ON_PAGE"
  825. // "REQUIRED_TOS_AGREEMENT"
  826. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  827. // "RESOURCE_NOT_DELETED"
  828. // "SCHEMA_VALIDATION_IGNORED"
  829. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  830. // "UNDECLARED_PROPERTIES"
  831. // "UNREACHABLE"
  832. Code string `json:"code,omitempty"`
  833. // Data: [Output Only] Metadata about this warning in key: value format.
  834. // For example:
  835. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  836. Data []*AcceleratorTypeAggregatedListWarningData `json:"data,omitempty"`
  837. // Message: [Output Only] A human-readable description of the warning
  838. // code.
  839. Message string `json:"message,omitempty"`
  840. // ForceSendFields is a list of field names (e.g. "Code") to
  841. // unconditionally include in API requests. By default, fields with
  842. // empty values are omitted from API requests. However, any non-pointer,
  843. // non-interface field appearing in ForceSendFields will be sent to the
  844. // server regardless of whether the field is empty or not. This may be
  845. // used to include empty fields in Patch requests.
  846. ForceSendFields []string `json:"-"`
  847. // NullFields is a list of field names (e.g. "Code") to include in API
  848. // requests with the JSON null value. By default, fields with empty
  849. // values are omitted from API requests. However, any field with an
  850. // empty value appearing in NullFields will be sent to the server as
  851. // null. It is an error if a field in this list has a non-empty value.
  852. // This may be used to include null fields in Patch requests.
  853. NullFields []string `json:"-"`
  854. }
  855. func (s *AcceleratorTypeAggregatedListWarning) MarshalJSON() ([]byte, error) {
  856. type NoMethod AcceleratorTypeAggregatedListWarning
  857. raw := NoMethod(*s)
  858. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  859. }
  860. type AcceleratorTypeAggregatedListWarningData struct {
  861. // Key: [Output Only] A key that provides more detail on the warning
  862. // being returned. For example, for warnings where there are no results
  863. // in a list request for a particular zone, this key might be scope and
  864. // the key value might be the zone name. Other examples might be a key
  865. // indicating a deprecated resource and a suggested replacement, or a
  866. // warning about invalid network settings (for example, if an instance
  867. // attempts to perform IP forwarding but is not enabled for IP
  868. // forwarding).
  869. Key string `json:"key,omitempty"`
  870. // Value: [Output Only] A warning data value corresponding to the key.
  871. Value string `json:"value,omitempty"`
  872. // ForceSendFields is a list of field names (e.g. "Key") to
  873. // unconditionally include in API requests. By default, fields with
  874. // empty values are omitted from API requests. However, any non-pointer,
  875. // non-interface field appearing in ForceSendFields will be sent to the
  876. // server regardless of whether the field is empty or not. This may be
  877. // used to include empty fields in Patch requests.
  878. ForceSendFields []string `json:"-"`
  879. // NullFields is a list of field names (e.g. "Key") to include in API
  880. // requests with the JSON null value. By default, fields with empty
  881. // values are omitted from API requests. However, any field with an
  882. // empty value appearing in NullFields will be sent to the server as
  883. // null. It is an error if a field in this list has a non-empty value.
  884. // This may be used to include null fields in Patch requests.
  885. NullFields []string `json:"-"`
  886. }
  887. func (s *AcceleratorTypeAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  888. type NoMethod AcceleratorTypeAggregatedListWarningData
  889. raw := NoMethod(*s)
  890. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  891. }
  892. // AcceleratorTypeList: Contains a list of accelerator types.
  893. type AcceleratorTypeList struct {
  894. // Id: [Output Only] Unique identifier for the resource; defined by the
  895. // server.
  896. Id string `json:"id,omitempty"`
  897. // Items: A list of AcceleratorType resources.
  898. Items []*AcceleratorType `json:"items,omitempty"`
  899. // Kind: [Output Only] Type of resource. Always
  900. // compute#acceleratorTypeList for lists of accelerator types.
  901. Kind string `json:"kind,omitempty"`
  902. // NextPageToken: [Output Only] This token allows you to get the next
  903. // page of results for list requests. If the number of results is larger
  904. // than maxResults, use the nextPageToken as a value for the query
  905. // parameter pageToken in the next list request. Subsequent list
  906. // requests will have their own nextPageToken to continue paging through
  907. // the results.
  908. NextPageToken string `json:"nextPageToken,omitempty"`
  909. // SelfLink: [Output Only] Server-defined URL for this resource.
  910. SelfLink string `json:"selfLink,omitempty"`
  911. // Warning: [Output Only] Informational warning message.
  912. Warning *AcceleratorTypeListWarning `json:"warning,omitempty"`
  913. // ServerResponse contains the HTTP response code and headers from the
  914. // server.
  915. googleapi.ServerResponse `json:"-"`
  916. // ForceSendFields is a list of field names (e.g. "Id") to
  917. // unconditionally include in API requests. By default, fields with
  918. // empty values are omitted from API requests. However, any non-pointer,
  919. // non-interface field appearing in ForceSendFields will be sent to the
  920. // server regardless of whether the field is empty or not. This may be
  921. // used to include empty fields in Patch requests.
  922. ForceSendFields []string `json:"-"`
  923. // NullFields is a list of field names (e.g. "Id") to include in API
  924. // requests with the JSON null value. By default, fields with empty
  925. // values are omitted from API requests. However, any field with an
  926. // empty value appearing in NullFields will be sent to the server as
  927. // null. It is an error if a field in this list has a non-empty value.
  928. // This may be used to include null fields in Patch requests.
  929. NullFields []string `json:"-"`
  930. }
  931. func (s *AcceleratorTypeList) MarshalJSON() ([]byte, error) {
  932. type NoMethod AcceleratorTypeList
  933. raw := NoMethod(*s)
  934. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  935. }
  936. // AcceleratorTypeListWarning: [Output Only] Informational warning
  937. // message.
  938. type AcceleratorTypeListWarning struct {
  939. // Code: [Output Only] A warning code, if applicable. For example,
  940. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  941. // the response.
  942. //
  943. // Possible values:
  944. // "CLEANUP_FAILED"
  945. // "DEPRECATED_RESOURCE_USED"
  946. // "DEPRECATED_TYPE_USED"
  947. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  948. // "EXPERIMENTAL_TYPE_USED"
  949. // "EXTERNAL_API_WARNING"
  950. // "FIELD_VALUE_OVERRIDEN"
  951. // "INJECTED_KERNELS_DEPRECATED"
  952. // "MISSING_TYPE_DEPENDENCY"
  953. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  954. // "NEXT_HOP_CANNOT_IP_FORWARD"
  955. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  956. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  957. // "NEXT_HOP_NOT_RUNNING"
  958. // "NOT_CRITICAL_ERROR"
  959. // "NO_RESULTS_ON_PAGE"
  960. // "REQUIRED_TOS_AGREEMENT"
  961. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  962. // "RESOURCE_NOT_DELETED"
  963. // "SCHEMA_VALIDATION_IGNORED"
  964. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  965. // "UNDECLARED_PROPERTIES"
  966. // "UNREACHABLE"
  967. Code string `json:"code,omitempty"`
  968. // Data: [Output Only] Metadata about this warning in key: value format.
  969. // For example:
  970. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  971. Data []*AcceleratorTypeListWarningData `json:"data,omitempty"`
  972. // Message: [Output Only] A human-readable description of the warning
  973. // code.
  974. Message string `json:"message,omitempty"`
  975. // ForceSendFields is a list of field names (e.g. "Code") to
  976. // unconditionally include in API requests. By default, fields with
  977. // empty values are omitted from API requests. However, any non-pointer,
  978. // non-interface field appearing in ForceSendFields will be sent to the
  979. // server regardless of whether the field is empty or not. This may be
  980. // used to include empty fields in Patch requests.
  981. ForceSendFields []string `json:"-"`
  982. // NullFields is a list of field names (e.g. "Code") to include in API
  983. // requests with the JSON null value. By default, fields with empty
  984. // values are omitted from API requests. However, any field with an
  985. // empty value appearing in NullFields will be sent to the server as
  986. // null. It is an error if a field in this list has a non-empty value.
  987. // This may be used to include null fields in Patch requests.
  988. NullFields []string `json:"-"`
  989. }
  990. func (s *AcceleratorTypeListWarning) MarshalJSON() ([]byte, error) {
  991. type NoMethod AcceleratorTypeListWarning
  992. raw := NoMethod(*s)
  993. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  994. }
  995. type AcceleratorTypeListWarningData struct {
  996. // Key: [Output Only] A key that provides more detail on the warning
  997. // being returned. For example, for warnings where there are no results
  998. // in a list request for a particular zone, this key might be scope and
  999. // the key value might be the zone name. Other examples might be a key
  1000. // indicating a deprecated resource and a suggested replacement, or a
  1001. // warning about invalid network settings (for example, if an instance
  1002. // attempts to perform IP forwarding but is not enabled for IP
  1003. // forwarding).
  1004. Key string `json:"key,omitempty"`
  1005. // Value: [Output Only] A warning data value corresponding to the key.
  1006. Value string `json:"value,omitempty"`
  1007. // ForceSendFields is a list of field names (e.g. "Key") to
  1008. // unconditionally include in API requests. By default, fields with
  1009. // empty values are omitted from API requests. However, any non-pointer,
  1010. // non-interface field appearing in ForceSendFields will be sent to the
  1011. // server regardless of whether the field is empty or not. This may be
  1012. // used to include empty fields in Patch requests.
  1013. ForceSendFields []string `json:"-"`
  1014. // NullFields is a list of field names (e.g. "Key") to include in API
  1015. // requests with the JSON null value. By default, fields with empty
  1016. // values are omitted from API requests. However, any field with an
  1017. // empty value appearing in NullFields will be sent to the server as
  1018. // null. It is an error if a field in this list has a non-empty value.
  1019. // This may be used to include null fields in Patch requests.
  1020. NullFields []string `json:"-"`
  1021. }
  1022. func (s *AcceleratorTypeListWarningData) MarshalJSON() ([]byte, error) {
  1023. type NoMethod AcceleratorTypeListWarningData
  1024. raw := NoMethod(*s)
  1025. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1026. }
  1027. type AcceleratorTypesScopedList struct {
  1028. // AcceleratorTypes: [Output Only] A list of accelerator types contained
  1029. // in this scope.
  1030. AcceleratorTypes []*AcceleratorType `json:"acceleratorTypes,omitempty"`
  1031. // Warning: [Output Only] An informational warning that appears when the
  1032. // accelerator types list is empty.
  1033. Warning *AcceleratorTypesScopedListWarning `json:"warning,omitempty"`
  1034. // ForceSendFields is a list of field names (e.g. "AcceleratorTypes") to
  1035. // unconditionally include in API requests. By default, fields with
  1036. // empty values are omitted from API requests. However, any non-pointer,
  1037. // non-interface field appearing in ForceSendFields will be sent to the
  1038. // server regardless of whether the field is empty or not. This may be
  1039. // used to include empty fields in Patch requests.
  1040. ForceSendFields []string `json:"-"`
  1041. // NullFields is a list of field names (e.g. "AcceleratorTypes") to
  1042. // include in API requests with the JSON null value. By default, fields
  1043. // with empty values are omitted from API requests. However, any field
  1044. // with an empty value appearing in NullFields will be sent to the
  1045. // server as null. It is an error if a field in this list has a
  1046. // non-empty value. This may be used to include null fields in Patch
  1047. // requests.
  1048. NullFields []string `json:"-"`
  1049. }
  1050. func (s *AcceleratorTypesScopedList) MarshalJSON() ([]byte, error) {
  1051. type NoMethod AcceleratorTypesScopedList
  1052. raw := NoMethod(*s)
  1053. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1054. }
  1055. // AcceleratorTypesScopedListWarning: [Output Only] An informational
  1056. // warning that appears when the accelerator types list is empty.
  1057. type AcceleratorTypesScopedListWarning struct {
  1058. // Code: [Output Only] A warning code, if applicable. For example,
  1059. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  1060. // the response.
  1061. //
  1062. // Possible values:
  1063. // "CLEANUP_FAILED"
  1064. // "DEPRECATED_RESOURCE_USED"
  1065. // "DEPRECATED_TYPE_USED"
  1066. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  1067. // "EXPERIMENTAL_TYPE_USED"
  1068. // "EXTERNAL_API_WARNING"
  1069. // "FIELD_VALUE_OVERRIDEN"
  1070. // "INJECTED_KERNELS_DEPRECATED"
  1071. // "MISSING_TYPE_DEPENDENCY"
  1072. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  1073. // "NEXT_HOP_CANNOT_IP_FORWARD"
  1074. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  1075. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  1076. // "NEXT_HOP_NOT_RUNNING"
  1077. // "NOT_CRITICAL_ERROR"
  1078. // "NO_RESULTS_ON_PAGE"
  1079. // "REQUIRED_TOS_AGREEMENT"
  1080. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  1081. // "RESOURCE_NOT_DELETED"
  1082. // "SCHEMA_VALIDATION_IGNORED"
  1083. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  1084. // "UNDECLARED_PROPERTIES"
  1085. // "UNREACHABLE"
  1086. Code string `json:"code,omitempty"`
  1087. // Data: [Output Only] Metadata about this warning in key: value format.
  1088. // For example:
  1089. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  1090. Data []*AcceleratorTypesScopedListWarningData `json:"data,omitempty"`
  1091. // Message: [Output Only] A human-readable description of the warning
  1092. // code.
  1093. Message string `json:"message,omitempty"`
  1094. // ForceSendFields is a list of field names (e.g. "Code") to
  1095. // unconditionally include in API requests. By default, fields with
  1096. // empty values are omitted from API requests. However, any non-pointer,
  1097. // non-interface field appearing in ForceSendFields will be sent to the
  1098. // server regardless of whether the field is empty or not. This may be
  1099. // used to include empty fields in Patch requests.
  1100. ForceSendFields []string `json:"-"`
  1101. // NullFields is a list of field names (e.g. "Code") to include in API
  1102. // requests with the JSON null value. By default, fields with empty
  1103. // values are omitted from API requests. However, any field with an
  1104. // empty value appearing in NullFields will be sent to the server as
  1105. // null. It is an error if a field in this list has a non-empty value.
  1106. // This may be used to include null fields in Patch requests.
  1107. NullFields []string `json:"-"`
  1108. }
  1109. func (s *AcceleratorTypesScopedListWarning) MarshalJSON() ([]byte, error) {
  1110. type NoMethod AcceleratorTypesScopedListWarning
  1111. raw := NoMethod(*s)
  1112. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1113. }
  1114. type AcceleratorTypesScopedListWarningData struct {
  1115. // Key: [Output Only] A key that provides more detail on the warning
  1116. // being returned. For example, for warnings where there are no results
  1117. // in a list request for a particular zone, this key might be scope and
  1118. // the key value might be the zone name. Other examples might be a key
  1119. // indicating a deprecated resource and a suggested replacement, or a
  1120. // warning about invalid network settings (for example, if an instance
  1121. // attempts to perform IP forwarding but is not enabled for IP
  1122. // forwarding).
  1123. Key string `json:"key,omitempty"`
  1124. // Value: [Output Only] A warning data value corresponding to the key.
  1125. Value string `json:"value,omitempty"`
  1126. // ForceSendFields is a list of field names (e.g. "Key") to
  1127. // unconditionally include in API requests. By default, fields with
  1128. // empty values are omitted from API requests. However, any non-pointer,
  1129. // non-interface field appearing in ForceSendFields will be sent to the
  1130. // server regardless of whether the field is empty or not. This may be
  1131. // used to include empty fields in Patch requests.
  1132. ForceSendFields []string `json:"-"`
  1133. // NullFields is a list of field names (e.g. "Key") to include in API
  1134. // requests with the JSON null value. By default, fields with empty
  1135. // values are omitted from API requests. However, any field with an
  1136. // empty value appearing in NullFields will be sent to the server as
  1137. // null. It is an error if a field in this list has a non-empty value.
  1138. // This may be used to include null fields in Patch requests.
  1139. NullFields []string `json:"-"`
  1140. }
  1141. func (s *AcceleratorTypesScopedListWarningData) MarshalJSON() ([]byte, error) {
  1142. type NoMethod AcceleratorTypesScopedListWarningData
  1143. raw := NoMethod(*s)
  1144. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1145. }
  1146. // AccessConfig: An access configuration attached to an instance's
  1147. // network interface. Only one access config per instance is supported.
  1148. type AccessConfig struct {
  1149. // Kind: [Output Only] Type of the resource. Always compute#accessConfig
  1150. // for access configs.
  1151. Kind string `json:"kind,omitempty"`
  1152. // Name: The name of this access configuration. The default and
  1153. // recommended name is External NAT but you can use any arbitrary string
  1154. // you would like. For example, My external IP or Network Access.
  1155. Name string `json:"name,omitempty"`
  1156. // NatIP: An external IP address associated with this instance. Specify
  1157. // an unused static external IP address available to the project or
  1158. // leave this field undefined to use an IP from a shared ephemeral IP
  1159. // address pool. If you specify a static external IP address, it must
  1160. // live in the same region as the zone of the instance.
  1161. NatIP string `json:"natIP,omitempty"`
  1162. // NetworkTier: This signifies the networking tier used for configuring
  1163. // this access configuration and can only take the following values:
  1164. // PREMIUM, STANDARD.
  1165. //
  1166. // If an AccessConfig is specified without a valid external IP address,
  1167. // an ephemeral IP will be created with this networkTier.
  1168. //
  1169. // If an AccessConfig with a valid external IP address is specified, it
  1170. // must match that of the networkTier associated with the Address
  1171. // resource owning that IP.
  1172. //
  1173. // Possible values:
  1174. // "PREMIUM"
  1175. // "SELECT"
  1176. // "STANDARD"
  1177. NetworkTier string `json:"networkTier,omitempty"`
  1178. // PublicDnsName: [Output Only] The public DNS domain name for the
  1179. // instance.
  1180. PublicDnsName string `json:"publicDnsName,omitempty"`
  1181. // PublicPtrDomainName: The DNS domain name for the public PTR record.
  1182. // This field can only be set when the set_public_ptr field is enabled.
  1183. PublicPtrDomainName string `json:"publicPtrDomainName,omitempty"`
  1184. // SetPublicDns: Specifies whether a public DNS ?A? record should be
  1185. // created for the external IP address of this access configuration.
  1186. SetPublicDns bool `json:"setPublicDns,omitempty"`
  1187. // SetPublicPtr: Specifies whether a public DNS ?PTR? record should be
  1188. // created to map the external IP address of the instance to a DNS
  1189. // domain name.
  1190. SetPublicPtr bool `json:"setPublicPtr,omitempty"`
  1191. // Type: The type of configuration. The default and only option is
  1192. // ONE_TO_ONE_NAT.
  1193. //
  1194. // Possible values:
  1195. // "ONE_TO_ONE_NAT" (default)
  1196. Type string `json:"type,omitempty"`
  1197. // ForceSendFields is a list of field names (e.g. "Kind") to
  1198. // unconditionally include in API requests. By default, fields with
  1199. // empty values are omitted from API requests. However, any non-pointer,
  1200. // non-interface field appearing in ForceSendFields will be sent to the
  1201. // server regardless of whether the field is empty or not. This may be
  1202. // used to include empty fields in Patch requests.
  1203. ForceSendFields []string `json:"-"`
  1204. // NullFields is a list of field names (e.g. "Kind") to include in API
  1205. // requests with the JSON null value. By default, fields with empty
  1206. // values are omitted from API requests. However, any field with an
  1207. // empty value appearing in NullFields will be sent to the server as
  1208. // null. It is an error if a field in this list has a non-empty value.
  1209. // This may be used to include null fields in Patch requests.
  1210. NullFields []string `json:"-"`
  1211. }
  1212. func (s *AccessConfig) MarshalJSON() ([]byte, error) {
  1213. type NoMethod AccessConfig
  1214. raw := NoMethod(*s)
  1215. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1216. }
  1217. // Address: A reserved address resource. (== resource_for beta.addresses
  1218. // ==) (== resource_for v1.addresses ==) (== resource_for
  1219. // beta.globalAddresses ==) (== resource_for v1.globalAddresses ==)
  1220. type Address struct {
  1221. // Address: The static IP address represented by this resource.
  1222. Address string `json:"address,omitempty"`
  1223. // AddressType: The type of address to reserve, either INTERNAL or
  1224. // EXTERNAL. If unspecified, defaults to EXTERNAL.
  1225. //
  1226. // Possible values:
  1227. // "DNS_FORWARDING"
  1228. // "EXTERNAL"
  1229. // "INTERNAL"
  1230. // "UNSPECIFIED_TYPE"
  1231. AddressType string `json:"addressType,omitempty"`
  1232. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  1233. // format.
  1234. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  1235. // Description: An optional description of this resource. Provide this
  1236. // property when you create the resource.
  1237. Description string `json:"description,omitempty"`
  1238. // Id: [Output Only] The unique identifier for the resource. This
  1239. // identifier is defined by the server.
  1240. Id uint64 `json:"id,omitempty,string"`
  1241. // IpVersion: The IP Version that will be used by this address. Valid
  1242. // options are IPV4 or IPV6. This can only be specified for a global
  1243. // address.
  1244. //
  1245. // Possible values:
  1246. // "IPV4"
  1247. // "IPV6"
  1248. // "UNSPECIFIED_VERSION"
  1249. IpVersion string `json:"ipVersion,omitempty"`
  1250. // Kind: [Output Only] Type of the resource. Always compute#address for
  1251. // addresses.
  1252. Kind string `json:"kind,omitempty"`
  1253. // LabelFingerprint: A fingerprint for the labels being applied to this
  1254. // Address, which is essentially a hash of the labels set used for
  1255. // optimistic locking. The fingerprint is initially generated by Compute
  1256. // Engine and changes after every request to modify or update labels.
  1257. // You must always provide an up-to-date fingerprint hash in order to
  1258. // update or change labels.
  1259. //
  1260. // To see the latest fingerprint, make a get() request to retrieve an
  1261. // Address.
  1262. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  1263. // Labels: Labels to apply to this Address resource. These can be later
  1264. // modified by the setLabels method. Each label key/value must comply
  1265. // with RFC1035. Label values may be empty.
  1266. Labels map[string]string `json:"labels,omitempty"`
  1267. // Name: Name of the resource. Provided by the client when the resource
  1268. // is created. The name must be 1-63 characters long, and comply with
  1269. // RFC1035. Specifically, the name must be 1-63 characters long and
  1270. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  1271. // the first character must be a lowercase letter, and all following
  1272. // characters must be a dash, lowercase letter, or digit, except the
  1273. // last character, which cannot be a dash.
  1274. Name string `json:"name,omitempty"`
  1275. // Network: The URL of the network in which to reserve the address. This
  1276. // field can only be used with INTERNAL type with VPC_PEERING purpose.
  1277. Network string `json:"network,omitempty"`
  1278. // NetworkTier: This signifies the networking tier used for configuring
  1279. // this Address and can only take the following values: PREMIUM ,
  1280. // STANDARD.
  1281. //
  1282. // If this field is not specified, it is assumed to be PREMIUM.
  1283. //
  1284. // Possible values:
  1285. // "PREMIUM"
  1286. // "SELECT"
  1287. // "STANDARD"
  1288. NetworkTier string `json:"networkTier,omitempty"`
  1289. // PrefixLength: The prefix length if the resource reprensents an IP
  1290. // range.
  1291. PrefixLength int64 `json:"prefixLength,omitempty"`
  1292. // Purpose: The purpose of resource, only used with INTERNAL type.
  1293. //
  1294. // Possible values:
  1295. // "DNS_RESOLVER"
  1296. // "GCE_ENDPOINT"
  1297. // "UNSPECIFIED_PURPOSE"
  1298. // "VPC_PEERING"
  1299. Purpose string `json:"purpose,omitempty"`
  1300. // Region: [Output Only] URL of the region where the regional address
  1301. // resides. This field is not applicable to global addresses. You must
  1302. // specify this field as part of the HTTP request URL. You cannot set
  1303. // this field in the request body.
  1304. Region string `json:"region,omitempty"`
  1305. // SelfLink: [Output Only] Server-defined URL for the resource.
  1306. SelfLink string `json:"selfLink,omitempty"`
  1307. // Status: [Output Only] The status of the address, which can be one of
  1308. // RESERVING, RESERVED, or IN_USE. An address that is RESERVING is
  1309. // currently in the process of being reserved. A RESERVED address is
  1310. // currently reserved and available to use. An IN_USE address is
  1311. // currently being used by another resource and is not available.
  1312. //
  1313. // Possible values:
  1314. // "IN_USE"
  1315. // "RESERVED"
  1316. // "RESERVING"
  1317. Status string `json:"status,omitempty"`
  1318. // Subnetwork: The URL of the subnetwork in which to reserve the
  1319. // address. If an IP address is specified, it must be within the
  1320. // subnetwork's IP range. This field can only be used with INTERNAL type
  1321. // with GCE_ENDPOINT/DNS_RESOLVER purposes.
  1322. Subnetwork string `json:"subnetwork,omitempty"`
  1323. // Users: [Output Only] The URLs of the resources that are using this
  1324. // address.
  1325. Users []string `json:"users,omitempty"`
  1326. // ServerResponse contains the HTTP response code and headers from the
  1327. // server.
  1328. googleapi.ServerResponse `json:"-"`
  1329. // ForceSendFields is a list of field names (e.g. "Address") to
  1330. // unconditionally include in API requests. By default, fields with
  1331. // empty values are omitted from API requests. However, any non-pointer,
  1332. // non-interface field appearing in ForceSendFields will be sent to the
  1333. // server regardless of whether the field is empty or not. This may be
  1334. // used to include empty fields in Patch requests.
  1335. ForceSendFields []string `json:"-"`
  1336. // NullFields is a list of field names (e.g. "Address") to include in
  1337. // API requests with the JSON null value. By default, fields with empty
  1338. // values are omitted from API requests. However, any field with an
  1339. // empty value appearing in NullFields will be sent to the server as
  1340. // null. It is an error if a field in this list has a non-empty value.
  1341. // This may be used to include null fields in Patch requests.
  1342. NullFields []string `json:"-"`
  1343. }
  1344. func (s *Address) MarshalJSON() ([]byte, error) {
  1345. type NoMethod Address
  1346. raw := NoMethod(*s)
  1347. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1348. }
  1349. type AddressAggregatedList struct {
  1350. // Id: [Output Only] Unique identifier for the resource; defined by the
  1351. // server.
  1352. Id string `json:"id,omitempty"`
  1353. // Items: A list of AddressesScopedList resources.
  1354. Items map[string]AddressesScopedList `json:"items,omitempty"`
  1355. // Kind: [Output Only] Type of resource. Always
  1356. // compute#addressAggregatedList for aggregated lists of addresses.
  1357. Kind string `json:"kind,omitempty"`
  1358. // NextPageToken: [Output Only] This token allows you to get the next
  1359. // page of results for list requests. If the number of results is larger
  1360. // than maxResults, use the nextPageToken as a value for the query
  1361. // parameter pageToken in the next list request. Subsequent list
  1362. // requests will have their own nextPageToken to continue paging through
  1363. // the results.
  1364. NextPageToken string `json:"nextPageToken,omitempty"`
  1365. // SelfLink: [Output Only] Server-defined URL for this resource.
  1366. SelfLink string `json:"selfLink,omitempty"`
  1367. // Warning: [Output Only] Informational warning message.
  1368. Warning *AddressAggregatedListWarning `json:"warning,omitempty"`
  1369. // ServerResponse contains the HTTP response code and headers from the
  1370. // server.
  1371. googleapi.ServerResponse `json:"-"`
  1372. // ForceSendFields is a list of field names (e.g. "Id") to
  1373. // unconditionally include in API requests. By default, fields with
  1374. // empty values are omitted from API requests. However, any non-pointer,
  1375. // non-interface field appearing in ForceSendFields will be sent to the
  1376. // server regardless of whether the field is empty or not. This may be
  1377. // used to include empty fields in Patch requests.
  1378. ForceSendFields []string `json:"-"`
  1379. // NullFields is a list of field names (e.g. "Id") to include in API
  1380. // requests with the JSON null value. By default, fields with empty
  1381. // values are omitted from API requests. However, any field with an
  1382. // empty value appearing in NullFields will be sent to the server as
  1383. // null. It is an error if a field in this list has a non-empty value.
  1384. // This may be used to include null fields in Patch requests.
  1385. NullFields []string `json:"-"`
  1386. }
  1387. func (s *AddressAggregatedList) MarshalJSON() ([]byte, error) {
  1388. type NoMethod AddressAggregatedList
  1389. raw := NoMethod(*s)
  1390. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1391. }
  1392. // AddressAggregatedListWarning: [Output Only] Informational warning
  1393. // message.
  1394. type AddressAggregatedListWarning struct {
  1395. // Code: [Output Only] A warning code, if applicable. For example,
  1396. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  1397. // the response.
  1398. //
  1399. // Possible values:
  1400. // "CLEANUP_FAILED"
  1401. // "DEPRECATED_RESOURCE_USED"
  1402. // "DEPRECATED_TYPE_USED"
  1403. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  1404. // "EXPERIMENTAL_TYPE_USED"
  1405. // "EXTERNAL_API_WARNING"
  1406. // "FIELD_VALUE_OVERRIDEN"
  1407. // "INJECTED_KERNELS_DEPRECATED"
  1408. // "MISSING_TYPE_DEPENDENCY"
  1409. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  1410. // "NEXT_HOP_CANNOT_IP_FORWARD"
  1411. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  1412. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  1413. // "NEXT_HOP_NOT_RUNNING"
  1414. // "NOT_CRITICAL_ERROR"
  1415. // "NO_RESULTS_ON_PAGE"
  1416. // "REQUIRED_TOS_AGREEMENT"
  1417. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  1418. // "RESOURCE_NOT_DELETED"
  1419. // "SCHEMA_VALIDATION_IGNORED"
  1420. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  1421. // "UNDECLARED_PROPERTIES"
  1422. // "UNREACHABLE"
  1423. Code string `json:"code,omitempty"`
  1424. // Data: [Output Only] Metadata about this warning in key: value format.
  1425. // For example:
  1426. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  1427. Data []*AddressAggregatedListWarningData `json:"data,omitempty"`
  1428. // Message: [Output Only] A human-readable description of the warning
  1429. // code.
  1430. Message string `json:"message,omitempty"`
  1431. // ForceSendFields is a list of field names (e.g. "Code") to
  1432. // unconditionally include in API requests. By default, fields with
  1433. // empty values are omitted from API requests. However, any non-pointer,
  1434. // non-interface field appearing in ForceSendFields will be sent to the
  1435. // server regardless of whether the field is empty or not. This may be
  1436. // used to include empty fields in Patch requests.
  1437. ForceSendFields []string `json:"-"`
  1438. // NullFields is a list of field names (e.g. "Code") to include in API
  1439. // requests with the JSON null value. By default, fields with empty
  1440. // values are omitted from API requests. However, any field with an
  1441. // empty value appearing in NullFields will be sent to the server as
  1442. // null. It is an error if a field in this list has a non-empty value.
  1443. // This may be used to include null fields in Patch requests.
  1444. NullFields []string `json:"-"`
  1445. }
  1446. func (s *AddressAggregatedListWarning) MarshalJSON() ([]byte, error) {
  1447. type NoMethod AddressAggregatedListWarning
  1448. raw := NoMethod(*s)
  1449. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1450. }
  1451. type AddressAggregatedListWarningData struct {
  1452. // Key: [Output Only] A key that provides more detail on the warning
  1453. // being returned. For example, for warnings where there are no results
  1454. // in a list request for a particular zone, this key might be scope and
  1455. // the key value might be the zone name. Other examples might be a key
  1456. // indicating a deprecated resource and a suggested replacement, or a
  1457. // warning about invalid network settings (for example, if an instance
  1458. // attempts to perform IP forwarding but is not enabled for IP
  1459. // forwarding).
  1460. Key string `json:"key,omitempty"`
  1461. // Value: [Output Only] A warning data value corresponding to the key.
  1462. Value string `json:"value,omitempty"`
  1463. // ForceSendFields is a list of field names (e.g. "Key") 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. "Key") 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 *AddressAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  1479. type NoMethod AddressAggregatedListWarningData
  1480. raw := NoMethod(*s)
  1481. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1482. }
  1483. // AddressList: Contains a list of addresses.
  1484. type AddressList struct {
  1485. // Id: [Output Only] Unique identifier for the resource; defined by the
  1486. // server.
  1487. Id string `json:"id,omitempty"`
  1488. // Items: A list of Address resources.
  1489. Items []*Address `json:"items,omitempty"`
  1490. // Kind: [Output Only] Type of resource. Always compute#addressList for
  1491. // lists of addresses.
  1492. Kind string `json:"kind,omitempty"`
  1493. // NextPageToken: [Output Only] This token allows you to get the next
  1494. // page of results for list requests. If the number of results is larger
  1495. // than maxResults, use the nextPageToken as a value for the query
  1496. // parameter pageToken in the next list request. Subsequent list
  1497. // requests will have their own nextPageToken to continue paging through
  1498. // the results.
  1499. NextPageToken string `json:"nextPageToken,omitempty"`
  1500. // SelfLink: [Output Only] Server-defined URL for this resource.
  1501. SelfLink string `json:"selfLink,omitempty"`
  1502. // Warning: [Output Only] Informational warning message.
  1503. Warning *AddressListWarning `json:"warning,omitempty"`
  1504. // ServerResponse contains the HTTP response code and headers from the
  1505. // server.
  1506. googleapi.ServerResponse `json:"-"`
  1507. // ForceSendFields is a list of field names (e.g. "Id") to
  1508. // unconditionally include in API requests. By default, fields with
  1509. // empty values are omitted from API requests. However, any non-pointer,
  1510. // non-interface field appearing in ForceSendFields will be sent to the
  1511. // server regardless of whether the field is empty or not. This may be
  1512. // used to include empty fields in Patch requests.
  1513. ForceSendFields []string `json:"-"`
  1514. // NullFields is a list of field names (e.g. "Id") to include in API
  1515. // requests with the JSON null value. By default, fields with empty
  1516. // values are omitted from API requests. However, any field with an
  1517. // empty value appearing in NullFields will be sent to the server as
  1518. // null. It is an error if a field in this list has a non-empty value.
  1519. // This may be used to include null fields in Patch requests.
  1520. NullFields []string `json:"-"`
  1521. }
  1522. func (s *AddressList) MarshalJSON() ([]byte, error) {
  1523. type NoMethod AddressList
  1524. raw := NoMethod(*s)
  1525. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1526. }
  1527. // AddressListWarning: [Output Only] Informational warning message.
  1528. type AddressListWarning struct {
  1529. // Code: [Output Only] A warning code, if applicable. For example,
  1530. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  1531. // the response.
  1532. //
  1533. // Possible values:
  1534. // "CLEANUP_FAILED"
  1535. // "DEPRECATED_RESOURCE_USED"
  1536. // "DEPRECATED_TYPE_USED"
  1537. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  1538. // "EXPERIMENTAL_TYPE_USED"
  1539. // "EXTERNAL_API_WARNING"
  1540. // "FIELD_VALUE_OVERRIDEN"
  1541. // "INJECTED_KERNELS_DEPRECATED"
  1542. // "MISSING_TYPE_DEPENDENCY"
  1543. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  1544. // "NEXT_HOP_CANNOT_IP_FORWARD"
  1545. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  1546. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  1547. // "NEXT_HOP_NOT_RUNNING"
  1548. // "NOT_CRITICAL_ERROR"
  1549. // "NO_RESULTS_ON_PAGE"
  1550. // "REQUIRED_TOS_AGREEMENT"
  1551. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  1552. // "RESOURCE_NOT_DELETED"
  1553. // "SCHEMA_VALIDATION_IGNORED"
  1554. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  1555. // "UNDECLARED_PROPERTIES"
  1556. // "UNREACHABLE"
  1557. Code string `json:"code,omitempty"`
  1558. // Data: [Output Only] Metadata about this warning in key: value format.
  1559. // For example:
  1560. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  1561. Data []*AddressListWarningData `json:"data,omitempty"`
  1562. // Message: [Output Only] A human-readable description of the warning
  1563. // code.
  1564. Message string `json:"message,omitempty"`
  1565. // ForceSendFields is a list of field names (e.g. "Code") to
  1566. // unconditionally include in API requests. By default, fields with
  1567. // empty values are omitted from API requests. However, any non-pointer,
  1568. // non-interface field appearing in ForceSendFields will be sent to the
  1569. // server regardless of whether the field is empty or not. This may be
  1570. // used to include empty fields in Patch requests.
  1571. ForceSendFields []string `json:"-"`
  1572. // NullFields is a list of field names (e.g. "Code") to include in API
  1573. // requests with the JSON null value. By default, fields with empty
  1574. // values are omitted from API requests. However, any field with an
  1575. // empty value appearing in NullFields will be sent to the server as
  1576. // null. It is an error if a field in this list has a non-empty value.
  1577. // This may be used to include null fields in Patch requests.
  1578. NullFields []string `json:"-"`
  1579. }
  1580. func (s *AddressListWarning) MarshalJSON() ([]byte, error) {
  1581. type NoMethod AddressListWarning
  1582. raw := NoMethod(*s)
  1583. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1584. }
  1585. type AddressListWarningData struct {
  1586. // Key: [Output Only] A key that provides more detail on the warning
  1587. // being returned. For example, for warnings where there are no results
  1588. // in a list request for a particular zone, this key might be scope and
  1589. // the key value might be the zone name. Other examples might be a key
  1590. // indicating a deprecated resource and a suggested replacement, or a
  1591. // warning about invalid network settings (for example, if an instance
  1592. // attempts to perform IP forwarding but is not enabled for IP
  1593. // forwarding).
  1594. Key string `json:"key,omitempty"`
  1595. // Value: [Output Only] A warning data value corresponding to the key.
  1596. Value string `json:"value,omitempty"`
  1597. // ForceSendFields is a list of field names (e.g. "Key") 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. "Key") 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 *AddressListWarningData) MarshalJSON() ([]byte, error) {
  1613. type NoMethod AddressListWarningData
  1614. raw := NoMethod(*s)
  1615. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1616. }
  1617. type AddressesScopedList struct {
  1618. // Addresses: [Output Only] A list of addresses contained in this scope.
  1619. Addresses []*Address `json:"addresses,omitempty"`
  1620. // Warning: [Output Only] Informational warning which replaces the list
  1621. // of addresses when the list is empty.
  1622. Warning *AddressesScopedListWarning `json:"warning,omitempty"`
  1623. // ForceSendFields is a list of field names (e.g. "Addresses") to
  1624. // unconditionally include in API requests. By default, fields with
  1625. // empty values are omitted from API requests. However, any non-pointer,
  1626. // non-interface field appearing in ForceSendFields will be sent to the
  1627. // server regardless of whether the field is empty or not. This may be
  1628. // used to include empty fields in Patch requests.
  1629. ForceSendFields []string `json:"-"`
  1630. // NullFields is a list of field names (e.g. "Addresses") to include in
  1631. // API requests with the JSON null value. By default, fields with empty
  1632. // values are omitted from API requests. However, any field with an
  1633. // empty value appearing in NullFields will be sent to the server as
  1634. // null. It is an error if a field in this list has a non-empty value.
  1635. // This may be used to include null fields in Patch requests.
  1636. NullFields []string `json:"-"`
  1637. }
  1638. func (s *AddressesScopedList) MarshalJSON() ([]byte, error) {
  1639. type NoMethod AddressesScopedList
  1640. raw := NoMethod(*s)
  1641. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1642. }
  1643. // AddressesScopedListWarning: [Output Only] Informational warning which
  1644. // replaces the list of addresses when the list is empty.
  1645. type AddressesScopedListWarning struct {
  1646. // Code: [Output Only] A warning code, if applicable. For example,
  1647. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  1648. // the response.
  1649. //
  1650. // Possible values:
  1651. // "CLEANUP_FAILED"
  1652. // "DEPRECATED_RESOURCE_USED"
  1653. // "DEPRECATED_TYPE_USED"
  1654. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  1655. // "EXPERIMENTAL_TYPE_USED"
  1656. // "EXTERNAL_API_WARNING"
  1657. // "FIELD_VALUE_OVERRIDEN"
  1658. // "INJECTED_KERNELS_DEPRECATED"
  1659. // "MISSING_TYPE_DEPENDENCY"
  1660. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  1661. // "NEXT_HOP_CANNOT_IP_FORWARD"
  1662. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  1663. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  1664. // "NEXT_HOP_NOT_RUNNING"
  1665. // "NOT_CRITICAL_ERROR"
  1666. // "NO_RESULTS_ON_PAGE"
  1667. // "REQUIRED_TOS_AGREEMENT"
  1668. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  1669. // "RESOURCE_NOT_DELETED"
  1670. // "SCHEMA_VALIDATION_IGNORED"
  1671. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  1672. // "UNDECLARED_PROPERTIES"
  1673. // "UNREACHABLE"
  1674. Code string `json:"code,omitempty"`
  1675. // Data: [Output Only] Metadata about this warning in key: value format.
  1676. // For example:
  1677. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  1678. Data []*AddressesScopedListWarningData `json:"data,omitempty"`
  1679. // Message: [Output Only] A human-readable description of the warning
  1680. // code.
  1681. Message string `json:"message,omitempty"`
  1682. // ForceSendFields is a list of field names (e.g. "Code") to
  1683. // unconditionally include in API requests. By default, fields with
  1684. // empty values are omitted from API requests. However, any non-pointer,
  1685. // non-interface field appearing in ForceSendFields will be sent to the
  1686. // server regardless of whether the field is empty or not. This may be
  1687. // used to include empty fields in Patch requests.
  1688. ForceSendFields []string `json:"-"`
  1689. // NullFields is a list of field names (e.g. "Code") to include in API
  1690. // requests with the JSON null value. By default, fields with empty
  1691. // values are omitted from API requests. However, any field with an
  1692. // empty value appearing in NullFields will be sent to the server as
  1693. // null. It is an error if a field in this list has a non-empty value.
  1694. // This may be used to include null fields in Patch requests.
  1695. NullFields []string `json:"-"`
  1696. }
  1697. func (s *AddressesScopedListWarning) MarshalJSON() ([]byte, error) {
  1698. type NoMethod AddressesScopedListWarning
  1699. raw := NoMethod(*s)
  1700. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1701. }
  1702. type AddressesScopedListWarningData struct {
  1703. // Key: [Output Only] A key that provides more detail on the warning
  1704. // being returned. For example, for warnings where there are no results
  1705. // in a list request for a particular zone, this key might be scope and
  1706. // the key value might be the zone name. Other examples might be a key
  1707. // indicating a deprecated resource and a suggested replacement, or a
  1708. // warning about invalid network settings (for example, if an instance
  1709. // attempts to perform IP forwarding but is not enabled for IP
  1710. // forwarding).
  1711. Key string `json:"key,omitempty"`
  1712. // Value: [Output Only] A warning data value corresponding to the key.
  1713. Value string `json:"value,omitempty"`
  1714. // ForceSendFields is a list of field names (e.g. "Key") 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. "Key") 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 *AddressesScopedListWarningData) MarshalJSON() ([]byte, error) {
  1730. type NoMethod AddressesScopedListWarningData
  1731. raw := NoMethod(*s)
  1732. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1733. }
  1734. // AliasIpRange: An alias IP range attached to an instance's network
  1735. // interface.
  1736. type AliasIpRange struct {
  1737. // IpCidrRange: The IP CIDR range represented by this alias IP range.
  1738. // This IP CIDR range must belong to the specified subnetwork and cannot
  1739. // contain IP addresses reserved by system or used by other network
  1740. // interfaces. This range may be a single IP address (e.g. 10.2.3.4), a
  1741. // netmask (e.g. /24) or a CIDR format string (e.g. 10.1.2.0/24).
  1742. IpCidrRange string `json:"ipCidrRange,omitempty"`
  1743. // SubnetworkRangeName: Optional subnetwork secondary range name
  1744. // specifying the secondary range from which to allocate the IP CIDR
  1745. // range for this alias IP range. If left unspecified, the primary range
  1746. // of the subnetwork will be used.
  1747. SubnetworkRangeName string `json:"subnetworkRangeName,omitempty"`
  1748. // ForceSendFields is a list of field names (e.g. "IpCidrRange") to
  1749. // unconditionally include in API requests. By default, fields with
  1750. // empty values are omitted from API requests. However, any non-pointer,
  1751. // non-interface field appearing in ForceSendFields will be sent to the
  1752. // server regardless of whether the field is empty or not. This may be
  1753. // used to include empty fields in Patch requests.
  1754. ForceSendFields []string `json:"-"`
  1755. // NullFields is a list of field names (e.g. "IpCidrRange") to include
  1756. // in API requests with the JSON null value. By default, fields with
  1757. // empty values are omitted from API requests. However, any field with
  1758. // an empty value appearing in NullFields will be sent to the server as
  1759. // null. It is an error if a field in this list has a non-empty value.
  1760. // This may be used to include null fields in Patch requests.
  1761. NullFields []string `json:"-"`
  1762. }
  1763. func (s *AliasIpRange) MarshalJSON() ([]byte, error) {
  1764. type NoMethod AliasIpRange
  1765. raw := NoMethod(*s)
  1766. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1767. }
  1768. // AttachedDisk: An instance-attached disk resource.
  1769. type AttachedDisk struct {
  1770. // AutoDelete: Specifies whether the disk will be auto-deleted when the
  1771. // instance is deleted (but not when the disk is detached from the
  1772. // instance).
  1773. AutoDelete bool `json:"autoDelete,omitempty"`
  1774. // Boot: Indicates that this is a boot disk. The virtual machine will
  1775. // use the first partition of the disk for its root filesystem.
  1776. Boot bool `json:"boot,omitempty"`
  1777. // DeviceName: Specifies a unique device name of your choice that is
  1778. // reflected into the /dev/disk/by-id/google-* tree of a Linux operating
  1779. // system running within the instance. This name can be used to
  1780. // reference the device for mounting, resizing, and so on, from within
  1781. // the instance.
  1782. //
  1783. // If not specified, the server chooses a default device name to apply
  1784. // to this disk, in the form persistent-disks-x, where x is a number
  1785. // assigned by Google Compute Engine. This field is only applicable for
  1786. // persistent disks.
  1787. DeviceName string `json:"deviceName,omitempty"`
  1788. // DiskEncryptionKey: Encrypts or decrypts a disk using a
  1789. // customer-supplied encryption key.
  1790. //
  1791. // If you are creating a new disk, this field encrypts the new disk
  1792. // using an encryption key that you provide. If you are attaching an
  1793. // existing disk that is already encrypted, this field decrypts the disk
  1794. // using the customer-supplied encryption key.
  1795. //
  1796. // If you encrypt a disk using a customer-supplied key, you must provide
  1797. // the same key again when you attempt to use this resource at a later
  1798. // time. For example, you must provide the key when you create a
  1799. // snapshot or an image from the disk or when you attach the disk to a
  1800. // virtual machine instance.
  1801. //
  1802. // If you do not provide an encryption key, then the disk will be
  1803. // encrypted using an automatically generated key and you do not need to
  1804. // provide a key to use the disk later.
  1805. //
  1806. // Instance templates do not store customer-supplied encryption keys, so
  1807. // you cannot use your own keys to encrypt disks in a managed instance
  1808. // group.
  1809. DiskEncryptionKey *CustomerEncryptionKey `json:"diskEncryptionKey,omitempty"`
  1810. // DiskSizeGb: The size of the disk in base-2 GB. This supersedes
  1811. // disk_size_gb in InitializeParams.
  1812. DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"`
  1813. // GuestOsFeatures: A list of features to enable on the guest operating
  1814. // system. Applicable only for bootable images. Read Enabling guest
  1815. // operating system features to see a list of available options.
  1816. GuestOsFeatures []*GuestOsFeature `json:"guestOsFeatures,omitempty"`
  1817. // Index: [Output Only] A zero-based index to this disk, where 0 is
  1818. // reserved for the boot disk. If you have many disks attached to an
  1819. // instance, each disk would have a unique index number.
  1820. Index int64 `json:"index,omitempty"`
  1821. // InitializeParams: [Input Only] Specifies the parameters for a new
  1822. // disk that will be created alongside the new instance. Use
  1823. // initialization parameters to create boot disks or local SSDs attached
  1824. // to the new instance.
  1825. //
  1826. // This property is mutually exclusive with the source property; you can
  1827. // only define one or the other, but not both.
  1828. InitializeParams *AttachedDiskInitializeParams `json:"initializeParams,omitempty"`
  1829. // Interface: Specifies the disk interface to use for attaching this
  1830. // disk, which is either SCSI or NVME. The default is SCSI. Persistent
  1831. // disks must always use SCSI and the request will fail if you attempt
  1832. // to attach a persistent disk in any other format than SCSI. Local SSDs
  1833. // can use either NVME or SCSI. For performance characteristics of SCSI
  1834. // over NVMe, see Local SSD performance.
  1835. //
  1836. // Possible values:
  1837. // "NVME"
  1838. // "SCSI"
  1839. Interface string `json:"interface,omitempty"`
  1840. // Kind: [Output Only] Type of the resource. Always compute#attachedDisk
  1841. // for attached disks.
  1842. Kind string `json:"kind,omitempty"`
  1843. // Licenses: [Output Only] Any valid publicly visible licenses.
  1844. Licenses []string `json:"licenses,omitempty"`
  1845. // Mode: The mode in which to attach this disk, either READ_WRITE or
  1846. // READ_ONLY. If not specified, the default is to attach the disk in
  1847. // READ_WRITE mode.
  1848. //
  1849. // Possible values:
  1850. // "READ_ONLY"
  1851. // "READ_WRITE"
  1852. Mode string `json:"mode,omitempty"`
  1853. // SavedState: For LocalSSD disks on VM Instances in STOPPED or
  1854. // SUSPENDED state, this field is set to PRESERVED if the LocalSSD data
  1855. // has been saved to a persistent location by customer request. (see the
  1856. // discard_local_ssd option on Stop/Suspend). Read-only in the api.
  1857. //
  1858. // Possible values:
  1859. // "DISK_SAVED_STATE_UNSPECIFIED"
  1860. // "PRESERVED"
  1861. SavedState string `json:"savedState,omitempty"`
  1862. // Source: Specifies a valid partial or full URL to an existing
  1863. // Persistent Disk resource. When creating a new instance, one of
  1864. // initializeParams.sourceImage or disks.source is required except for
  1865. // local SSD.
  1866. //
  1867. // If desired, you can also attach existing non-root persistent disks
  1868. // using this property. This field is only applicable for persistent
  1869. // disks.
  1870. //
  1871. // Note that for InstanceTemplate, specify the disk name, not the URL
  1872. // for the disk.
  1873. Source string `json:"source,omitempty"`
  1874. // Type: Specifies the type of the disk, either SCRATCH or PERSISTENT.
  1875. // If not specified, the default is PERSISTENT.
  1876. //
  1877. // Possible values:
  1878. // "PERSISTENT"
  1879. // "SCRATCH"
  1880. Type string `json:"type,omitempty"`
  1881. // ForceSendFields is a list of field names (e.g. "AutoDelete") to
  1882. // unconditionally include in API requests. By default, fields with
  1883. // empty values are omitted from API requests. However, any non-pointer,
  1884. // non-interface field appearing in ForceSendFields will be sent to the
  1885. // server regardless of whether the field is empty or not. This may be
  1886. // used to include empty fields in Patch requests.
  1887. ForceSendFields []string `json:"-"`
  1888. // NullFields is a list of field names (e.g. "AutoDelete") to include in
  1889. // API requests with the JSON null value. By default, fields with empty
  1890. // values are omitted from API requests. However, any field with an
  1891. // empty value appearing in NullFields will be sent to the server as
  1892. // null. It is an error if a field in this list has a non-empty value.
  1893. // This may be used to include null fields in Patch requests.
  1894. NullFields []string `json:"-"`
  1895. }
  1896. func (s *AttachedDisk) MarshalJSON() ([]byte, error) {
  1897. type NoMethod AttachedDisk
  1898. raw := NoMethod(*s)
  1899. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1900. }
  1901. // AttachedDiskInitializeParams: [Input Only] Specifies the parameters
  1902. // for a new disk that will be created alongside the new instance. Use
  1903. // initialization parameters to create boot disks or local SSDs attached
  1904. // to the new instance.
  1905. //
  1906. // This property is mutually exclusive with the source property; you can
  1907. // only define one or the other, but not both.
  1908. type AttachedDiskInitializeParams struct {
  1909. // DiskName: Specifies the disk name. If not specified, the default is
  1910. // to use the name of the instance.
  1911. DiskName string `json:"diskName,omitempty"`
  1912. // DiskSizeGb: Specifies the size of the disk in base-2 GB.
  1913. DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"`
  1914. // DiskStorageType: [Deprecated] Storage type of the disk.
  1915. //
  1916. // Possible values:
  1917. // "HDD"
  1918. // "SSD"
  1919. DiskStorageType string `json:"diskStorageType,omitempty"`
  1920. // DiskType: Specifies the disk type to use to create the instance. If
  1921. // not specified, the default is pd-standard, specified using the full
  1922. // URL. For
  1923. // example:
  1924. // https://www.googleapis.com/compute/v1/projects/project/zones/
  1925. // zone/diskTypes/pd-standard
  1926. //
  1927. //
  1928. // Other values include pd-ssd and local-ssd. If you define this field,
  1929. // you can provide either the full or partial URL. For example, the
  1930. // following are valid values:
  1931. // -
  1932. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType
  1933. // - projects/project/zones/zone/diskTypes/diskType
  1934. // - zones/zone/diskTypes/diskType Note that for InstanceTemplate, this
  1935. // is the name of the disk type, not URL.
  1936. DiskType string `json:"diskType,omitempty"`
  1937. // Labels: Labels to apply to this disk. These can be later modified by
  1938. // the disks.setLabels method. This field is only applicable for
  1939. // persistent disks.
  1940. Labels map[string]string `json:"labels,omitempty"`
  1941. // SourceImage: The source image to create this disk. When creating a
  1942. // new instance, one of initializeParams.sourceImage or disks.source is
  1943. // required except for local SSD.
  1944. //
  1945. // To create a disk with one of the public operating system images,
  1946. // specify the image by its family name. For example, specify
  1947. // family/debian-8 to use the latest Debian 8
  1948. // image:
  1949. // projects/debian-cloud/global/images/family/debian-8
  1950. //
  1951. //
  1952. // Alternati
  1953. // vely, use a specific version of a public operating system
  1954. // image:
  1955. // projects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD
  1956. //
  1957. //
  1958. //
  1959. // To create a disk with a custom image that you created, specify the
  1960. // image name in the following
  1961. // format:
  1962. // global/images/my-custom-image
  1963. //
  1964. //
  1965. // You can also specify a custom image by its image family, which
  1966. // returns the latest version of the image in that family. Replace the
  1967. // image name with
  1968. // family/family-name:
  1969. // global/images/family/my-image-family
  1970. //
  1971. //
  1972. // If the source image is deleted later, this field will not be set.
  1973. SourceImage string `json:"sourceImage,omitempty"`
  1974. // SourceImageEncryptionKey: The customer-supplied encryption key of the
  1975. // source image. Required if the source image is protected by a
  1976. // customer-supplied encryption key.
  1977. //
  1978. // Instance templates do not store customer-supplied encryption keys, so
  1979. // you cannot create disks for instances in a managed instance group if
  1980. // the source images are encrypted with your own keys.
  1981. SourceImageEncryptionKey *CustomerEncryptionKey `json:"sourceImageEncryptionKey,omitempty"`
  1982. // SourceSnapshot: The source snapshot to create this disk. When
  1983. // creating a new instance, one of initializeParams.sourceSnapshot or
  1984. // disks.source is required except for local SSD.
  1985. //
  1986. // To create a disk with a snapshot that you created, specify the
  1987. // snapshot name in the following
  1988. // format:
  1989. // global/snapshots/my-backup
  1990. //
  1991. //
  1992. // If the source snapshot is deleted later, this field will not be set.
  1993. SourceSnapshot string `json:"sourceSnapshot,omitempty"`
  1994. // ForceSendFields is a list of field names (e.g. "DiskName") to
  1995. // unconditionally include in API requests. By default, fields with
  1996. // empty values are omitted from API requests. However, any non-pointer,
  1997. // non-interface field appearing in ForceSendFields will be sent to the
  1998. // server regardless of whether the field is empty or not. This may be
  1999. // used to include empty fields in Patch requests.
  2000. ForceSendFields []string `json:"-"`
  2001. // NullFields is a list of field names (e.g. "DiskName") to include in
  2002. // API requests with the JSON null value. By default, fields with empty
  2003. // values are omitted from API requests. However, any field with an
  2004. // empty value appearing in NullFields will be sent to the server as
  2005. // null. It is an error if a field in this list has a non-empty value.
  2006. // This may be used to include null fields in Patch requests.
  2007. NullFields []string `json:"-"`
  2008. }
  2009. func (s *AttachedDiskInitializeParams) MarshalJSON() ([]byte, error) {
  2010. type NoMethod AttachedDiskInitializeParams
  2011. raw := NoMethod(*s)
  2012. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2013. }
  2014. // AuditConfig: Specifies the audit configuration for a service. The
  2015. // configuration determines which permission types are logged, and what
  2016. // identities, if any, are exempted from logging. An AuditConfig must
  2017. // have one or more AuditLogConfigs.
  2018. //
  2019. // If there are AuditConfigs for both `allServices` and a specific
  2020. // service, the union of the two AuditConfigs is used for that service:
  2021. // the log_types specified in each AuditConfig are enabled, and the
  2022. // exempted_members in each AuditLogConfig are exempted.
  2023. //
  2024. // Example Policy with multiple AuditConfigs:
  2025. //
  2026. // { "audit_configs": [ { "service": "allServices" "audit_log_configs":
  2027. // [ { "log_type": "DATA_READ", "exempted_members": [
  2028. // "user:foo@gmail.com" ] }, { "log_type": "DATA_WRITE", }, {
  2029. // "log_type": "ADMIN_READ", } ] }, { "service":
  2030. // "fooservice.googleapis.com" "audit_log_configs": [ { "log_type":
  2031. // "DATA_READ", }, { "log_type": "DATA_WRITE", "exempted_members": [
  2032. // "user:bar@gmail.com" ] } ] } ] }
  2033. //
  2034. // For fooservice, this policy enables DATA_READ, DATA_WRITE and
  2035. // ADMIN_READ logging. It also exempts foo@gmail.com from DATA_READ
  2036. // logging, and bar@gmail.com from DATA_WRITE logging.
  2037. type AuditConfig struct {
  2038. // AuditLogConfigs: The configuration for logging of each type of
  2039. // permission.
  2040. AuditLogConfigs []*AuditLogConfig `json:"auditLogConfigs,omitempty"`
  2041. ExemptedMembers []string `json:"exemptedMembers,omitempty"`
  2042. // Service: Specifies a service that will be enabled for audit logging.
  2043. // For example, `storage.googleapis.com`, `cloudsql.googleapis.com`.
  2044. // `allServices` is a special value that covers all services.
  2045. Service string `json:"service,omitempty"`
  2046. // ForceSendFields is a list of field names (e.g. "AuditLogConfigs") to
  2047. // unconditionally include in API requests. By default, fields with
  2048. // empty values are omitted from API requests. However, any non-pointer,
  2049. // non-interface field appearing in ForceSendFields will be sent to the
  2050. // server regardless of whether the field is empty or not. This may be
  2051. // used to include empty fields in Patch requests.
  2052. ForceSendFields []string `json:"-"`
  2053. // NullFields is a list of field names (e.g. "AuditLogConfigs") to
  2054. // include in API requests with the JSON null value. By default, fields
  2055. // with empty values are omitted from API requests. However, any field
  2056. // with an empty value appearing in NullFields will be sent to the
  2057. // server as null. It is an error if a field in this list has a
  2058. // non-empty value. This may be used to include null fields in Patch
  2059. // requests.
  2060. NullFields []string `json:"-"`
  2061. }
  2062. func (s *AuditConfig) MarshalJSON() ([]byte, error) {
  2063. type NoMethod AuditConfig
  2064. raw := NoMethod(*s)
  2065. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2066. }
  2067. // AuditLogConfig: Provides the configuration for logging a type of
  2068. // permissions. Example:
  2069. //
  2070. // { "audit_log_configs": [ { "log_type": "DATA_READ",
  2071. // "exempted_members": [ "user:foo@gmail.com" ] }, { "log_type":
  2072. // "DATA_WRITE", } ] }
  2073. //
  2074. // This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting
  2075. // foo@gmail.com from DATA_READ logging.
  2076. type AuditLogConfig struct {
  2077. // ExemptedMembers: Specifies the identities that do not cause logging
  2078. // for this type of permission. Follows the same format of
  2079. // [Binding.members][].
  2080. ExemptedMembers []string `json:"exemptedMembers,omitempty"`
  2081. // LogType: The log type that this config enables.
  2082. //
  2083. // Possible values:
  2084. // "ADMIN_READ"
  2085. // "DATA_READ"
  2086. // "DATA_WRITE"
  2087. // "LOG_TYPE_UNSPECIFIED"
  2088. LogType string `json:"logType,omitempty"`
  2089. // ForceSendFields is a list of field names (e.g. "ExemptedMembers") to
  2090. // unconditionally include in API requests. By default, fields with
  2091. // empty values are omitted from API requests. However, any non-pointer,
  2092. // non-interface field appearing in ForceSendFields will be sent to the
  2093. // server regardless of whether the field is empty or not. This may be
  2094. // used to include empty fields in Patch requests.
  2095. ForceSendFields []string `json:"-"`
  2096. // NullFields is a list of field names (e.g. "ExemptedMembers") to
  2097. // include in API requests with the JSON null value. By default, fields
  2098. // with empty values are omitted from API requests. However, any field
  2099. // with an empty value appearing in NullFields will be sent to the
  2100. // server as null. It is an error if a field in this list has a
  2101. // non-empty value. This may be used to include null fields in Patch
  2102. // requests.
  2103. NullFields []string `json:"-"`
  2104. }
  2105. func (s *AuditLogConfig) MarshalJSON() ([]byte, error) {
  2106. type NoMethod AuditLogConfig
  2107. raw := NoMethod(*s)
  2108. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2109. }
  2110. // AuthorizationLoggingOptions: Authorization-related information used
  2111. // by Cloud Audit Logging.
  2112. type AuthorizationLoggingOptions struct {
  2113. // PermissionType: The type of the permission that was checked.
  2114. //
  2115. // Possible values:
  2116. // "ADMIN_READ"
  2117. // "ADMIN_WRITE"
  2118. // "DATA_READ"
  2119. // "DATA_WRITE"
  2120. // "PERMISSION_TYPE_UNSPECIFIED"
  2121. PermissionType string `json:"permissionType,omitempty"`
  2122. // ForceSendFields is a list of field names (e.g. "PermissionType") to
  2123. // unconditionally include in API requests. By default, fields with
  2124. // empty values are omitted from API requests. However, any non-pointer,
  2125. // non-interface field appearing in ForceSendFields will be sent to the
  2126. // server regardless of whether the field is empty or not. This may be
  2127. // used to include empty fields in Patch requests.
  2128. ForceSendFields []string `json:"-"`
  2129. // NullFields is a list of field names (e.g. "PermissionType") to
  2130. // include in API requests with the JSON null value. By default, fields
  2131. // with empty values are omitted from API requests. However, any field
  2132. // with an empty value appearing in NullFields will be sent to the
  2133. // server as null. It is an error if a field in this list has a
  2134. // non-empty value. This may be used to include null fields in Patch
  2135. // requests.
  2136. NullFields []string `json:"-"`
  2137. }
  2138. func (s *AuthorizationLoggingOptions) MarshalJSON() ([]byte, error) {
  2139. type NoMethod AuthorizationLoggingOptions
  2140. raw := NoMethod(*s)
  2141. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2142. }
  2143. // Autoscaler: Represents an Autoscaler resource. Autoscalers allow you
  2144. // to automatically scale virtual machine instances in managed instance
  2145. // groups according to an autoscaling policy that you define. For more
  2146. // information, read Autoscaling Groups of Instances. (== resource_for
  2147. // beta.autoscalers ==) (== resource_for v1.autoscalers ==) (==
  2148. // resource_for beta.regionAutoscalers ==) (== resource_for
  2149. // v1.regionAutoscalers ==)
  2150. type Autoscaler struct {
  2151. // AutoscalingPolicy: The configuration parameters for the autoscaling
  2152. // algorithm. You can define one or more of the policies for an
  2153. // autoscaler: cpuUtilization, customMetricUtilizations, and
  2154. // loadBalancingUtilization.
  2155. //
  2156. // If none of these are specified, the default will be to autoscale
  2157. // based on cpuUtilization to 0.6 or 60%.
  2158. AutoscalingPolicy *AutoscalingPolicy `json:"autoscalingPolicy,omitempty"`
  2159. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  2160. // format.
  2161. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  2162. // Description: An optional description of this resource. Provide this
  2163. // property when you create the resource.
  2164. Description string `json:"description,omitempty"`
  2165. // Id: [Output Only] The unique identifier for the resource. This
  2166. // identifier is defined by the server.
  2167. Id uint64 `json:"id,omitempty,string"`
  2168. // Kind: [Output Only] Type of the resource. Always compute#autoscaler
  2169. // for autoscalers.
  2170. Kind string `json:"kind,omitempty"`
  2171. // Name: Name of the resource. Provided by the client when the resource
  2172. // is created. The name must be 1-63 characters long, and comply with
  2173. // RFC1035. Specifically, the name must be 1-63 characters long and
  2174. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  2175. // the first character must be a lowercase letter, and all following
  2176. // characters must be a dash, lowercase letter, or digit, except the
  2177. // last character, which cannot be a dash.
  2178. Name string `json:"name,omitempty"`
  2179. // RecommendedSize: [Output Only] Target recommended MIG size (number of
  2180. // instances) computed by autoscaler. Autoscaler calculates recommended
  2181. // MIG size even when autoscaling policy mode is different from ON. This
  2182. // field is empty when autoscaler is not connected to the existing
  2183. // managed instance group or autoscaler did not generate its prediction.
  2184. RecommendedSize int64 `json:"recommendedSize,omitempty"`
  2185. // Region: [Output Only] URL of the region where the instance group
  2186. // resides (for autoscalers living in regional scope).
  2187. Region string `json:"region,omitempty"`
  2188. // SelfLink: [Output Only] Server-defined URL for the resource.
  2189. SelfLink string `json:"selfLink,omitempty"`
  2190. // Status: [Output Only] The status of the autoscaler configuration.
  2191. //
  2192. // Possible values:
  2193. // "ACTIVE"
  2194. // "DELETING"
  2195. // "ERROR"
  2196. // "PENDING"
  2197. Status string `json:"status,omitempty"`
  2198. // StatusDetails: [Output Only] Human-readable details about the current
  2199. // state of the autoscaler. Read the documentation for Commonly returned
  2200. // status messages for examples of status messages you might encounter.
  2201. StatusDetails []*AutoscalerStatusDetails `json:"statusDetails,omitempty"`
  2202. // Target: URL of the managed instance group that this autoscaler will
  2203. // scale.
  2204. Target string `json:"target,omitempty"`
  2205. // Zone: [Output Only] URL of the zone where the instance group resides
  2206. // (for autoscalers living in zonal scope).
  2207. Zone string `json:"zone,omitempty"`
  2208. // ServerResponse contains the HTTP response code and headers from the
  2209. // server.
  2210. googleapi.ServerResponse `json:"-"`
  2211. // ForceSendFields is a list of field names (e.g. "AutoscalingPolicy")
  2212. // to unconditionally include in API requests. By default, fields with
  2213. // empty values are omitted from API requests. However, any non-pointer,
  2214. // non-interface field appearing in ForceSendFields will be sent to the
  2215. // server regardless of whether the field is empty or not. This may be
  2216. // used to include empty fields in Patch requests.
  2217. ForceSendFields []string `json:"-"`
  2218. // NullFields is a list of field names (e.g. "AutoscalingPolicy") to
  2219. // include in API requests with the JSON null value. By default, fields
  2220. // with empty values are omitted from API requests. However, any field
  2221. // with an empty value appearing in NullFields will be sent to the
  2222. // server as null. It is an error if a field in this list has a
  2223. // non-empty value. This may be used to include null fields in Patch
  2224. // requests.
  2225. NullFields []string `json:"-"`
  2226. }
  2227. func (s *Autoscaler) MarshalJSON() ([]byte, error) {
  2228. type NoMethod Autoscaler
  2229. raw := NoMethod(*s)
  2230. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2231. }
  2232. type AutoscalerAggregatedList struct {
  2233. // Id: [Output Only] Unique identifier for the resource; defined by the
  2234. // server.
  2235. Id string `json:"id,omitempty"`
  2236. // Items: A list of AutoscalersScopedList resources.
  2237. Items map[string]AutoscalersScopedList `json:"items,omitempty"`
  2238. // Kind: [Output Only] Type of resource. Always
  2239. // compute#autoscalerAggregatedList for aggregated lists of autoscalers.
  2240. Kind string `json:"kind,omitempty"`
  2241. // NextPageToken: [Output Only] This token allows you to get the next
  2242. // page of results for list requests. If the number of results is larger
  2243. // than maxResults, use the nextPageToken as a value for the query
  2244. // parameter pageToken in the next list request. Subsequent list
  2245. // requests will have their own nextPageToken to continue paging through
  2246. // the results.
  2247. NextPageToken string `json:"nextPageToken,omitempty"`
  2248. // SelfLink: [Output Only] Server-defined URL for this resource.
  2249. SelfLink string `json:"selfLink,omitempty"`
  2250. // Warning: [Output Only] Informational warning message.
  2251. Warning *AutoscalerAggregatedListWarning `json:"warning,omitempty"`
  2252. // ServerResponse contains the HTTP response code and headers from the
  2253. // server.
  2254. googleapi.ServerResponse `json:"-"`
  2255. // ForceSendFields is a list of field names (e.g. "Id") to
  2256. // unconditionally include in API requests. By default, fields with
  2257. // empty values are omitted from API requests. However, any non-pointer,
  2258. // non-interface field appearing in ForceSendFields will be sent to the
  2259. // server regardless of whether the field is empty or not. This may be
  2260. // used to include empty fields in Patch requests.
  2261. ForceSendFields []string `json:"-"`
  2262. // NullFields is a list of field names (e.g. "Id") to include in API
  2263. // requests with the JSON null value. By default, fields with empty
  2264. // values are omitted from API requests. However, any field with an
  2265. // empty value appearing in NullFields will be sent to the server as
  2266. // null. It is an error if a field in this list has a non-empty value.
  2267. // This may be used to include null fields in Patch requests.
  2268. NullFields []string `json:"-"`
  2269. }
  2270. func (s *AutoscalerAggregatedList) MarshalJSON() ([]byte, error) {
  2271. type NoMethod AutoscalerAggregatedList
  2272. raw := NoMethod(*s)
  2273. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2274. }
  2275. // AutoscalerAggregatedListWarning: [Output Only] Informational warning
  2276. // message.
  2277. type AutoscalerAggregatedListWarning struct {
  2278. // Code: [Output Only] A warning code, if applicable. For example,
  2279. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  2280. // the response.
  2281. //
  2282. // Possible values:
  2283. // "CLEANUP_FAILED"
  2284. // "DEPRECATED_RESOURCE_USED"
  2285. // "DEPRECATED_TYPE_USED"
  2286. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  2287. // "EXPERIMENTAL_TYPE_USED"
  2288. // "EXTERNAL_API_WARNING"
  2289. // "FIELD_VALUE_OVERRIDEN"
  2290. // "INJECTED_KERNELS_DEPRECATED"
  2291. // "MISSING_TYPE_DEPENDENCY"
  2292. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  2293. // "NEXT_HOP_CANNOT_IP_FORWARD"
  2294. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  2295. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  2296. // "NEXT_HOP_NOT_RUNNING"
  2297. // "NOT_CRITICAL_ERROR"
  2298. // "NO_RESULTS_ON_PAGE"
  2299. // "REQUIRED_TOS_AGREEMENT"
  2300. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  2301. // "RESOURCE_NOT_DELETED"
  2302. // "SCHEMA_VALIDATION_IGNORED"
  2303. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  2304. // "UNDECLARED_PROPERTIES"
  2305. // "UNREACHABLE"
  2306. Code string `json:"code,omitempty"`
  2307. // Data: [Output Only] Metadata about this warning in key: value format.
  2308. // For example:
  2309. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  2310. Data []*AutoscalerAggregatedListWarningData `json:"data,omitempty"`
  2311. // Message: [Output Only] A human-readable description of the warning
  2312. // code.
  2313. Message string `json:"message,omitempty"`
  2314. // ForceSendFields is a list of field names (e.g. "Code") to
  2315. // unconditionally include in API requests. By default, fields with
  2316. // empty values are omitted from API requests. However, any non-pointer,
  2317. // non-interface field appearing in ForceSendFields will be sent to the
  2318. // server regardless of whether the field is empty or not. This may be
  2319. // used to include empty fields in Patch requests.
  2320. ForceSendFields []string `json:"-"`
  2321. // NullFields is a list of field names (e.g. "Code") to include in API
  2322. // requests with the JSON null value. By default, fields with empty
  2323. // values are omitted from API requests. However, any field with an
  2324. // empty value appearing in NullFields will be sent to the server as
  2325. // null. It is an error if a field in this list has a non-empty value.
  2326. // This may be used to include null fields in Patch requests.
  2327. NullFields []string `json:"-"`
  2328. }
  2329. func (s *AutoscalerAggregatedListWarning) MarshalJSON() ([]byte, error) {
  2330. type NoMethod AutoscalerAggregatedListWarning
  2331. raw := NoMethod(*s)
  2332. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2333. }
  2334. type AutoscalerAggregatedListWarningData struct {
  2335. // Key: [Output Only] A key that provides more detail on the warning
  2336. // being returned. For example, for warnings where there are no results
  2337. // in a list request for a particular zone, this key might be scope and
  2338. // the key value might be the zone name. Other examples might be a key
  2339. // indicating a deprecated resource and a suggested replacement, or a
  2340. // warning about invalid network settings (for example, if an instance
  2341. // attempts to perform IP forwarding but is not enabled for IP
  2342. // forwarding).
  2343. Key string `json:"key,omitempty"`
  2344. // Value: [Output Only] A warning data value corresponding to the key.
  2345. Value string `json:"value,omitempty"`
  2346. // ForceSendFields is a list of field names (e.g. "Key") to
  2347. // unconditionally include in API requests. By default, fields with
  2348. // empty values are omitted from API requests. However, any non-pointer,
  2349. // non-interface field appearing in ForceSendFields will be sent to the
  2350. // server regardless of whether the field is empty or not. This may be
  2351. // used to include empty fields in Patch requests.
  2352. ForceSendFields []string `json:"-"`
  2353. // NullFields is a list of field names (e.g. "Key") to include in API
  2354. // requests with the JSON null value. By default, fields with empty
  2355. // values are omitted from API requests. However, any field with an
  2356. // empty value appearing in NullFields will be sent to the server as
  2357. // null. It is an error if a field in this list has a non-empty value.
  2358. // This may be used to include null fields in Patch requests.
  2359. NullFields []string `json:"-"`
  2360. }
  2361. func (s *AutoscalerAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  2362. type NoMethod AutoscalerAggregatedListWarningData
  2363. raw := NoMethod(*s)
  2364. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2365. }
  2366. // AutoscalerList: Contains a list of Autoscaler resources.
  2367. type AutoscalerList struct {
  2368. // Id: [Output Only] Unique identifier for the resource; defined by the
  2369. // server.
  2370. Id string `json:"id,omitempty"`
  2371. // Items: A list of Autoscaler resources.
  2372. Items []*Autoscaler `json:"items,omitempty"`
  2373. // Kind: [Output Only] Type of resource. Always compute#autoscalerList
  2374. // for lists of autoscalers.
  2375. Kind string `json:"kind,omitempty"`
  2376. // NextPageToken: [Output Only] This token allows you to get the next
  2377. // page of results for list requests. If the number of results is larger
  2378. // than maxResults, use the nextPageToken as a value for the query
  2379. // parameter pageToken in the next list request. Subsequent list
  2380. // requests will have their own nextPageToken to continue paging through
  2381. // the results.
  2382. NextPageToken string `json:"nextPageToken,omitempty"`
  2383. // SelfLink: [Output Only] Server-defined URL for this resource.
  2384. SelfLink string `json:"selfLink,omitempty"`
  2385. // Warning: [Output Only] Informational warning message.
  2386. Warning *AutoscalerListWarning `json:"warning,omitempty"`
  2387. // ServerResponse contains the HTTP response code and headers from the
  2388. // server.
  2389. googleapi.ServerResponse `json:"-"`
  2390. // ForceSendFields is a list of field names (e.g. "Id") to
  2391. // unconditionally include in API requests. By default, fields with
  2392. // empty values are omitted from API requests. However, any non-pointer,
  2393. // non-interface field appearing in ForceSendFields will be sent to the
  2394. // server regardless of whether the field is empty or not. This may be
  2395. // used to include empty fields in Patch requests.
  2396. ForceSendFields []string `json:"-"`
  2397. // NullFields is a list of field names (e.g. "Id") to include in API
  2398. // requests with the JSON null value. By default, fields with empty
  2399. // values are omitted from API requests. However, any field with an
  2400. // empty value appearing in NullFields will be sent to the server as
  2401. // null. It is an error if a field in this list has a non-empty value.
  2402. // This may be used to include null fields in Patch requests.
  2403. NullFields []string `json:"-"`
  2404. }
  2405. func (s *AutoscalerList) MarshalJSON() ([]byte, error) {
  2406. type NoMethod AutoscalerList
  2407. raw := NoMethod(*s)
  2408. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2409. }
  2410. // AutoscalerListWarning: [Output Only] Informational warning message.
  2411. type AutoscalerListWarning struct {
  2412. // Code: [Output Only] A warning code, if applicable. For example,
  2413. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  2414. // the response.
  2415. //
  2416. // Possible values:
  2417. // "CLEANUP_FAILED"
  2418. // "DEPRECATED_RESOURCE_USED"
  2419. // "DEPRECATED_TYPE_USED"
  2420. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  2421. // "EXPERIMENTAL_TYPE_USED"
  2422. // "EXTERNAL_API_WARNING"
  2423. // "FIELD_VALUE_OVERRIDEN"
  2424. // "INJECTED_KERNELS_DEPRECATED"
  2425. // "MISSING_TYPE_DEPENDENCY"
  2426. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  2427. // "NEXT_HOP_CANNOT_IP_FORWARD"
  2428. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  2429. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  2430. // "NEXT_HOP_NOT_RUNNING"
  2431. // "NOT_CRITICAL_ERROR"
  2432. // "NO_RESULTS_ON_PAGE"
  2433. // "REQUIRED_TOS_AGREEMENT"
  2434. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  2435. // "RESOURCE_NOT_DELETED"
  2436. // "SCHEMA_VALIDATION_IGNORED"
  2437. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  2438. // "UNDECLARED_PROPERTIES"
  2439. // "UNREACHABLE"
  2440. Code string `json:"code,omitempty"`
  2441. // Data: [Output Only] Metadata about this warning in key: value format.
  2442. // For example:
  2443. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  2444. Data []*AutoscalerListWarningData `json:"data,omitempty"`
  2445. // Message: [Output Only] A human-readable description of the warning
  2446. // code.
  2447. Message string `json:"message,omitempty"`
  2448. // ForceSendFields is a list of field names (e.g. "Code") to
  2449. // unconditionally include in API requests. By default, fields with
  2450. // empty values are omitted from API requests. However, any non-pointer,
  2451. // non-interface field appearing in ForceSendFields will be sent to the
  2452. // server regardless of whether the field is empty or not. This may be
  2453. // used to include empty fields in Patch requests.
  2454. ForceSendFields []string `json:"-"`
  2455. // NullFields is a list of field names (e.g. "Code") to include in API
  2456. // requests with the JSON null value. By default, fields with empty
  2457. // values are omitted from API requests. However, any field with an
  2458. // empty value appearing in NullFields will be sent to the server as
  2459. // null. It is an error if a field in this list has a non-empty value.
  2460. // This may be used to include null fields in Patch requests.
  2461. NullFields []string `json:"-"`
  2462. }
  2463. func (s *AutoscalerListWarning) MarshalJSON() ([]byte, error) {
  2464. type NoMethod AutoscalerListWarning
  2465. raw := NoMethod(*s)
  2466. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2467. }
  2468. type AutoscalerListWarningData struct {
  2469. // Key: [Output Only] A key that provides more detail on the warning
  2470. // being returned. For example, for warnings where there are no results
  2471. // in a list request for a particular zone, this key might be scope and
  2472. // the key value might be the zone name. Other examples might be a key
  2473. // indicating a deprecated resource and a suggested replacement, or a
  2474. // warning about invalid network settings (for example, if an instance
  2475. // attempts to perform IP forwarding but is not enabled for IP
  2476. // forwarding).
  2477. Key string `json:"key,omitempty"`
  2478. // Value: [Output Only] A warning data value corresponding to the key.
  2479. Value string `json:"value,omitempty"`
  2480. // ForceSendFields is a list of field names (e.g. "Key") to
  2481. // unconditionally include in API requests. By default, fields with
  2482. // empty values are omitted from API requests. However, any non-pointer,
  2483. // non-interface field appearing in ForceSendFields will be sent to the
  2484. // server regardless of whether the field is empty or not. This may be
  2485. // used to include empty fields in Patch requests.
  2486. ForceSendFields []string `json:"-"`
  2487. // NullFields is a list of field names (e.g. "Key") to include in API
  2488. // requests with the JSON null value. By default, fields with empty
  2489. // values are omitted from API requests. However, any field with an
  2490. // empty value appearing in NullFields will be sent to the server as
  2491. // null. It is an error if a field in this list has a non-empty value.
  2492. // This may be used to include null fields in Patch requests.
  2493. NullFields []string `json:"-"`
  2494. }
  2495. func (s *AutoscalerListWarningData) MarshalJSON() ([]byte, error) {
  2496. type NoMethod AutoscalerListWarningData
  2497. raw := NoMethod(*s)
  2498. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2499. }
  2500. type AutoscalerStatusDetails struct {
  2501. // Message: The status message.
  2502. Message string `json:"message,omitempty"`
  2503. // Type: The type of error returned.
  2504. //
  2505. // Possible values:
  2506. // "ALL_INSTANCES_UNHEALTHY"
  2507. // "BACKEND_SERVICE_DOES_NOT_EXIST"
  2508. // "CAPPED_AT_MAX_NUM_REPLICAS"
  2509. // "CUSTOM_METRIC_DATA_POINTS_TOO_SPARSE"
  2510. // "CUSTOM_METRIC_INVALID"
  2511. // "MIN_EQUALS_MAX"
  2512. // "MISSING_CUSTOM_METRIC_DATA_POINTS"
  2513. // "MISSING_LOAD_BALANCING_DATA_POINTS"
  2514. // "MORE_THAN_ONE_BACKEND_SERVICE"
  2515. // "NOT_ENOUGH_QUOTA_AVAILABLE"
  2516. // "REGION_RESOURCE_STOCKOUT"
  2517. // "SCALING_TARGET_DOES_NOT_EXIST"
  2518. // "UNKNOWN"
  2519. // "UNSUPPORTED_MAX_RATE_LOAD_BALANCING_CONFIGURATION"
  2520. // "ZONE_RESOURCE_STOCKOUT"
  2521. Type string `json:"type,omitempty"`
  2522. // ForceSendFields is a list of field names (e.g. "Message") to
  2523. // unconditionally include in API requests. By default, fields with
  2524. // empty values are omitted from API requests. However, any non-pointer,
  2525. // non-interface field appearing in ForceSendFields will be sent to the
  2526. // server regardless of whether the field is empty or not. This may be
  2527. // used to include empty fields in Patch requests.
  2528. ForceSendFields []string `json:"-"`
  2529. // NullFields is a list of field names (e.g. "Message") to include in
  2530. // API requests with the JSON null value. By default, fields with empty
  2531. // values are omitted from API requests. However, any field with an
  2532. // empty value appearing in NullFields will be sent to the server as
  2533. // null. It is an error if a field in this list has a non-empty value.
  2534. // This may be used to include null fields in Patch requests.
  2535. NullFields []string `json:"-"`
  2536. }
  2537. func (s *AutoscalerStatusDetails) MarshalJSON() ([]byte, error) {
  2538. type NoMethod AutoscalerStatusDetails
  2539. raw := NoMethod(*s)
  2540. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2541. }
  2542. type AutoscalersScopedList struct {
  2543. // Autoscalers: [Output Only] A list of autoscalers contained in this
  2544. // scope.
  2545. Autoscalers []*Autoscaler `json:"autoscalers,omitempty"`
  2546. // Warning: [Output Only] Informational warning which replaces the list
  2547. // of autoscalers when the list is empty.
  2548. Warning *AutoscalersScopedListWarning `json:"warning,omitempty"`
  2549. // ForceSendFields is a list of field names (e.g. "Autoscalers") to
  2550. // unconditionally include in API requests. By default, fields with
  2551. // empty values are omitted from API requests. However, any non-pointer,
  2552. // non-interface field appearing in ForceSendFields will be sent to the
  2553. // server regardless of whether the field is empty or not. This may be
  2554. // used to include empty fields in Patch requests.
  2555. ForceSendFields []string `json:"-"`
  2556. // NullFields is a list of field names (e.g. "Autoscalers") to include
  2557. // in API requests with the JSON null value. By default, fields with
  2558. // empty values are omitted from API requests. However, any field with
  2559. // an empty value appearing in NullFields will be sent to the server as
  2560. // null. It is an error if a field in this list has a non-empty value.
  2561. // This may be used to include null fields in Patch requests.
  2562. NullFields []string `json:"-"`
  2563. }
  2564. func (s *AutoscalersScopedList) MarshalJSON() ([]byte, error) {
  2565. type NoMethod AutoscalersScopedList
  2566. raw := NoMethod(*s)
  2567. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2568. }
  2569. // AutoscalersScopedListWarning: [Output Only] Informational warning
  2570. // which replaces the list of autoscalers when the list is empty.
  2571. type AutoscalersScopedListWarning struct {
  2572. // Code: [Output Only] A warning code, if applicable. For example,
  2573. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  2574. // the response.
  2575. //
  2576. // Possible values:
  2577. // "CLEANUP_FAILED"
  2578. // "DEPRECATED_RESOURCE_USED"
  2579. // "DEPRECATED_TYPE_USED"
  2580. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  2581. // "EXPERIMENTAL_TYPE_USED"
  2582. // "EXTERNAL_API_WARNING"
  2583. // "FIELD_VALUE_OVERRIDEN"
  2584. // "INJECTED_KERNELS_DEPRECATED"
  2585. // "MISSING_TYPE_DEPENDENCY"
  2586. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  2587. // "NEXT_HOP_CANNOT_IP_FORWARD"
  2588. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  2589. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  2590. // "NEXT_HOP_NOT_RUNNING"
  2591. // "NOT_CRITICAL_ERROR"
  2592. // "NO_RESULTS_ON_PAGE"
  2593. // "REQUIRED_TOS_AGREEMENT"
  2594. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  2595. // "RESOURCE_NOT_DELETED"
  2596. // "SCHEMA_VALIDATION_IGNORED"
  2597. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  2598. // "UNDECLARED_PROPERTIES"
  2599. // "UNREACHABLE"
  2600. Code string `json:"code,omitempty"`
  2601. // Data: [Output Only] Metadata about this warning in key: value format.
  2602. // For example:
  2603. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  2604. Data []*AutoscalersScopedListWarningData `json:"data,omitempty"`
  2605. // Message: [Output Only] A human-readable description of the warning
  2606. // code.
  2607. Message string `json:"message,omitempty"`
  2608. // ForceSendFields is a list of field names (e.g. "Code") to
  2609. // unconditionally include in API requests. By default, fields with
  2610. // empty values are omitted from API requests. However, any non-pointer,
  2611. // non-interface field appearing in ForceSendFields will be sent to the
  2612. // server regardless of whether the field is empty or not. This may be
  2613. // used to include empty fields in Patch requests.
  2614. ForceSendFields []string `json:"-"`
  2615. // NullFields is a list of field names (e.g. "Code") to include in API
  2616. // requests with the JSON null value. By default, fields with empty
  2617. // values are omitted from API requests. However, any field with an
  2618. // empty value appearing in NullFields will be sent to the server as
  2619. // null. It is an error if a field in this list has a non-empty value.
  2620. // This may be used to include null fields in Patch requests.
  2621. NullFields []string `json:"-"`
  2622. }
  2623. func (s *AutoscalersScopedListWarning) MarshalJSON() ([]byte, error) {
  2624. type NoMethod AutoscalersScopedListWarning
  2625. raw := NoMethod(*s)
  2626. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2627. }
  2628. type AutoscalersScopedListWarningData struct {
  2629. // Key: [Output Only] A key that provides more detail on the warning
  2630. // being returned. For example, for warnings where there are no results
  2631. // in a list request for a particular zone, this key might be scope and
  2632. // the key value might be the zone name. Other examples might be a key
  2633. // indicating a deprecated resource and a suggested replacement, or a
  2634. // warning about invalid network settings (for example, if an instance
  2635. // attempts to perform IP forwarding but is not enabled for IP
  2636. // forwarding).
  2637. Key string `json:"key,omitempty"`
  2638. // Value: [Output Only] A warning data value corresponding to the key.
  2639. Value string `json:"value,omitempty"`
  2640. // ForceSendFields is a list of field names (e.g. "Key") to
  2641. // unconditionally include in API requests. By default, fields with
  2642. // empty values are omitted from API requests. However, any non-pointer,
  2643. // non-interface field appearing in ForceSendFields will be sent to the
  2644. // server regardless of whether the field is empty or not. This may be
  2645. // used to include empty fields in Patch requests.
  2646. ForceSendFields []string `json:"-"`
  2647. // NullFields is a list of field names (e.g. "Key") to include in API
  2648. // requests with the JSON null value. By default, fields with empty
  2649. // values are omitted from API requests. However, any field with an
  2650. // empty value appearing in NullFields will be sent to the server as
  2651. // null. It is an error if a field in this list has a non-empty value.
  2652. // This may be used to include null fields in Patch requests.
  2653. NullFields []string `json:"-"`
  2654. }
  2655. func (s *AutoscalersScopedListWarningData) MarshalJSON() ([]byte, error) {
  2656. type NoMethod AutoscalersScopedListWarningData
  2657. raw := NoMethod(*s)
  2658. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2659. }
  2660. // AutoscalingPolicy: Cloud Autoscaler policy.
  2661. type AutoscalingPolicy struct {
  2662. // CoolDownPeriodSec: The number of seconds that the autoscaler should
  2663. // wait before it starts collecting information from a new instance.
  2664. // This prevents the autoscaler from collecting information when the
  2665. // instance is initializing, during which the collected usage would not
  2666. // be reliable. The default time autoscaler waits is 60
  2667. // seconds.
  2668. //
  2669. // Virtual machine initialization times might vary because of numerous
  2670. // factors. We recommend that you test how long an instance may take to
  2671. // initialize. To do this, create an instance and time the startup
  2672. // process.
  2673. CoolDownPeriodSec int64 `json:"coolDownPeriodSec,omitempty"`
  2674. // CpuUtilization: Defines the CPU utilization policy that allows the
  2675. // autoscaler to scale based on the average CPU utilization of a managed
  2676. // instance group.
  2677. CpuUtilization *AutoscalingPolicyCpuUtilization `json:"cpuUtilization,omitempty"`
  2678. // CustomMetricUtilizations: Configuration parameters of autoscaling
  2679. // based on a custom metric.
  2680. CustomMetricUtilizations []*AutoscalingPolicyCustomMetricUtilization `json:"customMetricUtilizations,omitempty"`
  2681. // LoadBalancingUtilization: Configuration parameters of autoscaling
  2682. // based on load balancer.
  2683. LoadBalancingUtilization *AutoscalingPolicyLoadBalancingUtilization `json:"loadBalancingUtilization,omitempty"`
  2684. // MaxNumReplicas: The maximum number of instances that the autoscaler
  2685. // can scale up to. This is required when creating or updating an
  2686. // autoscaler. The maximum number of replicas should not be lower than
  2687. // minimal number of replicas.
  2688. MaxNumReplicas int64 `json:"maxNumReplicas,omitempty"`
  2689. // MinNumReplicas: The minimum number of replicas that the autoscaler
  2690. // can scale down to. This cannot be less than 0. If not provided,
  2691. // autoscaler will choose a default value depending on maximum number of
  2692. // instances allowed.
  2693. MinNumReplicas int64 `json:"minNumReplicas,omitempty"`
  2694. // Mode: Defines operating mode for this policy.
  2695. //
  2696. // Possible values:
  2697. // "OFF"
  2698. // "ON"
  2699. // "ONLY_DOWN"
  2700. // "ONLY_UP"
  2701. Mode string `json:"mode,omitempty"`
  2702. // QueueBasedScaling: Configuration parameters of autoscaling based on
  2703. // queuing system.
  2704. QueueBasedScaling *AutoscalingPolicyQueueBasedScaling `json:"queueBasedScaling,omitempty"`
  2705. // ForceSendFields is a list of field names (e.g. "CoolDownPeriodSec")
  2706. // to unconditionally include in API requests. By default, fields with
  2707. // empty values are omitted from API requests. However, any non-pointer,
  2708. // non-interface field appearing in ForceSendFields will be sent to the
  2709. // server regardless of whether the field is empty or not. This may be
  2710. // used to include empty fields in Patch requests.
  2711. ForceSendFields []string `json:"-"`
  2712. // NullFields is a list of field names (e.g. "CoolDownPeriodSec") to
  2713. // include in API requests with the JSON null value. By default, fields
  2714. // with empty values are omitted from API requests. However, any field
  2715. // with an empty value appearing in NullFields will be sent to the
  2716. // server as null. It is an error if a field in this list has a
  2717. // non-empty value. This may be used to include null fields in Patch
  2718. // requests.
  2719. NullFields []string `json:"-"`
  2720. }
  2721. func (s *AutoscalingPolicy) MarshalJSON() ([]byte, error) {
  2722. type NoMethod AutoscalingPolicy
  2723. raw := NoMethod(*s)
  2724. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2725. }
  2726. // AutoscalingPolicyCpuUtilization: CPU utilization policy.
  2727. type AutoscalingPolicyCpuUtilization struct {
  2728. // UtilizationTarget: The target CPU utilization that the autoscaler
  2729. // should maintain. Must be a float value in the range (0, 1]. If not
  2730. // specified, the default is 0.6.
  2731. //
  2732. // If the CPU level is below the target utilization, the autoscaler
  2733. // scales down the number of instances until it reaches the minimum
  2734. // number of instances you specified or until the average CPU of your
  2735. // instances reaches the target utilization.
  2736. //
  2737. // If the average CPU is above the target utilization, the autoscaler
  2738. // scales up until it reaches the maximum number of instances you
  2739. // specified or until the average utilization reaches the target
  2740. // utilization.
  2741. UtilizationTarget float64 `json:"utilizationTarget,omitempty"`
  2742. // ForceSendFields is a list of field names (e.g. "UtilizationTarget")
  2743. // to unconditionally include in API requests. By default, fields with
  2744. // empty values are omitted from API requests. However, any non-pointer,
  2745. // non-interface field appearing in ForceSendFields will be sent to the
  2746. // server regardless of whether the field is empty or not. This may be
  2747. // used to include empty fields in Patch requests.
  2748. ForceSendFields []string `json:"-"`
  2749. // NullFields is a list of field names (e.g. "UtilizationTarget") to
  2750. // include in API requests with the JSON null value. By default, fields
  2751. // with empty values are omitted from API requests. However, any field
  2752. // with an empty value appearing in NullFields will be sent to the
  2753. // server as null. It is an error if a field in this list has a
  2754. // non-empty value. This may be used to include null fields in Patch
  2755. // requests.
  2756. NullFields []string `json:"-"`
  2757. }
  2758. func (s *AutoscalingPolicyCpuUtilization) MarshalJSON() ([]byte, error) {
  2759. type NoMethod AutoscalingPolicyCpuUtilization
  2760. raw := NoMethod(*s)
  2761. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2762. }
  2763. func (s *AutoscalingPolicyCpuUtilization) UnmarshalJSON(data []byte) error {
  2764. type NoMethod AutoscalingPolicyCpuUtilization
  2765. var s1 struct {
  2766. UtilizationTarget gensupport.JSONFloat64 `json:"utilizationTarget"`
  2767. *NoMethod
  2768. }
  2769. s1.NoMethod = (*NoMethod)(s)
  2770. if err := json.Unmarshal(data, &s1); err != nil {
  2771. return err
  2772. }
  2773. s.UtilizationTarget = float64(s1.UtilizationTarget)
  2774. return nil
  2775. }
  2776. // AutoscalingPolicyCustomMetricUtilization: Custom utilization metric
  2777. // policy.
  2778. type AutoscalingPolicyCustomMetricUtilization struct {
  2779. // Filter: A filter string, compatible with a Stackdriver Monitoring
  2780. // filter string for TimeSeries.list API call. This filter is used to
  2781. // select a specific TimeSeries for the purpose of autoscaling and to
  2782. // determine whether the metric is exporting per-instance or per-group
  2783. // data.
  2784. //
  2785. // For the filter to be valid for autoscaling purposes, the following
  2786. // rules apply:
  2787. // - You can only use the AND operator for joining selectors.
  2788. // - You can only use direct equality comparison operator (=) without
  2789. // any functions for each selector.
  2790. // - You can specify the metric in both the filter string and in the
  2791. // metric field. However, if specified in both places, the metric must
  2792. // be identical.
  2793. // - The monitored resource type determines what kind of values are
  2794. // expected for the metric. If it is a gce_instance, the autoscaler
  2795. // expects the metric to include a separate TimeSeries for each instance
  2796. // in a group. In such a case, you cannot filter on resource labels.
  2797. // If the resource type is any other value, the autoscaler expects this
  2798. // metric to contain values that apply to the entire autoscaled instance
  2799. // group and resource label filtering can be performed to point
  2800. // autoscaler at the correct TimeSeries to scale upon. This is called a
  2801. // per-group metric for the purpose of autoscaling.
  2802. //
  2803. // If not specified, the type defaults to gce_instance.
  2804. //
  2805. // You should provide a filter that is selective enough to pick just one
  2806. // TimeSeries for the autoscaled group or for each of the instances (if
  2807. // you are using gce_instance resource type). If multiple TimeSeries are
  2808. // returned upon the query execution, the autoscaler will sum their
  2809. // respective values to obtain its scaling value.
  2810. Filter string `json:"filter,omitempty"`
  2811. // Metric: The identifier (type) of the Stackdriver Monitoring metric.
  2812. // The metric cannot have negative values.
  2813. //
  2814. // The metric must have a value type of INT64 or DOUBLE.
  2815. Metric string `json:"metric,omitempty"`
  2816. // SingleInstanceAssignment: If scaling is based on a per-group metric
  2817. // value that represents the total amount of work to be done or resource
  2818. // usage, set this value to an amount assigned for a single instance of
  2819. // the scaled group. Autoscaler will keep the number of instances
  2820. // proportional to the value of this metric, the metric itself should
  2821. // not change value due to group resizing.
  2822. //
  2823. // A good metric to use with the target is for example
  2824. // pubsub.googleapis.com/subscription/num_undelivered_messages or a
  2825. // custom metric exporting the total number of requests coming to your
  2826. // instances.
  2827. //
  2828. // A bad example would be a metric exporting an average or median
  2829. // latency, since this value can't include a chunk assignable to a
  2830. // single instance, it could be better used with utilization_target
  2831. // instead.
  2832. SingleInstanceAssignment float64 `json:"singleInstanceAssignment,omitempty"`
  2833. // UtilizationTarget: The target value of the metric that autoscaler
  2834. // should maintain. This must be a positive value. A utilization metric
  2835. // scales number of virtual machines handling requests to increase or
  2836. // decrease proportionally to the metric.
  2837. //
  2838. // For example, a good metric to use as a utilization_target is
  2839. // compute.googleapis.com/instance/network/received_bytes_count. The
  2840. // autoscaler will work to keep this value constant for each of the
  2841. // instances.
  2842. UtilizationTarget float64 `json:"utilizationTarget,omitempty"`
  2843. // UtilizationTargetType: Defines how target utilization value is
  2844. // expressed for a Stackdriver Monitoring metric. Either GAUGE,
  2845. // DELTA_PER_SECOND, or DELTA_PER_MINUTE. If not specified, the default
  2846. // is GAUGE.
  2847. //
  2848. // Possible values:
  2849. // "DELTA_PER_MINUTE"
  2850. // "DELTA_PER_SECOND"
  2851. // "GAUGE"
  2852. UtilizationTargetType string `json:"utilizationTargetType,omitempty"`
  2853. // ForceSendFields is a list of field names (e.g. "Filter") to
  2854. // unconditionally include in API requests. By default, fields with
  2855. // empty values are omitted from API requests. However, any non-pointer,
  2856. // non-interface field appearing in ForceSendFields will be sent to the
  2857. // server regardless of whether the field is empty or not. This may be
  2858. // used to include empty fields in Patch requests.
  2859. ForceSendFields []string `json:"-"`
  2860. // NullFields is a list of field names (e.g. "Filter") to include in API
  2861. // requests with the JSON null value. By default, fields with empty
  2862. // values are omitted from API requests. However, any field with an
  2863. // empty value appearing in NullFields will be sent to the server as
  2864. // null. It is an error if a field in this list has a non-empty value.
  2865. // This may be used to include null fields in Patch requests.
  2866. NullFields []string `json:"-"`
  2867. }
  2868. func (s *AutoscalingPolicyCustomMetricUtilization) MarshalJSON() ([]byte, error) {
  2869. type NoMethod AutoscalingPolicyCustomMetricUtilization
  2870. raw := NoMethod(*s)
  2871. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2872. }
  2873. func (s *AutoscalingPolicyCustomMetricUtilization) UnmarshalJSON(data []byte) error {
  2874. type NoMethod AutoscalingPolicyCustomMetricUtilization
  2875. var s1 struct {
  2876. SingleInstanceAssignment gensupport.JSONFloat64 `json:"singleInstanceAssignment"`
  2877. UtilizationTarget gensupport.JSONFloat64 `json:"utilizationTarget"`
  2878. *NoMethod
  2879. }
  2880. s1.NoMethod = (*NoMethod)(s)
  2881. if err := json.Unmarshal(data, &s1); err != nil {
  2882. return err
  2883. }
  2884. s.SingleInstanceAssignment = float64(s1.SingleInstanceAssignment)
  2885. s.UtilizationTarget = float64(s1.UtilizationTarget)
  2886. return nil
  2887. }
  2888. // AutoscalingPolicyLoadBalancingUtilization: Configuration parameters
  2889. // of autoscaling based on load balancing.
  2890. type AutoscalingPolicyLoadBalancingUtilization struct {
  2891. // UtilizationTarget: Fraction of backend capacity utilization (set in
  2892. // HTTP(s) load balancing configuration) that autoscaler should
  2893. // maintain. Must be a positive float value. If not defined, the default
  2894. // is 0.8.
  2895. UtilizationTarget float64 `json:"utilizationTarget,omitempty"`
  2896. // ForceSendFields is a list of field names (e.g. "UtilizationTarget")
  2897. // to unconditionally include in API requests. By default, fields with
  2898. // empty values are omitted from API requests. However, any non-pointer,
  2899. // non-interface field appearing in ForceSendFields will be sent to the
  2900. // server regardless of whether the field is empty or not. This may be
  2901. // used to include empty fields in Patch requests.
  2902. ForceSendFields []string `json:"-"`
  2903. // NullFields is a list of field names (e.g. "UtilizationTarget") to
  2904. // include in API requests with the JSON null value. By default, fields
  2905. // with empty values are omitted from API requests. However, any field
  2906. // with an empty value appearing in NullFields will be sent to the
  2907. // server as null. It is an error if a field in this list has a
  2908. // non-empty value. This may be used to include null fields in Patch
  2909. // requests.
  2910. NullFields []string `json:"-"`
  2911. }
  2912. func (s *AutoscalingPolicyLoadBalancingUtilization) MarshalJSON() ([]byte, error) {
  2913. type NoMethod AutoscalingPolicyLoadBalancingUtilization
  2914. raw := NoMethod(*s)
  2915. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2916. }
  2917. func (s *AutoscalingPolicyLoadBalancingUtilization) UnmarshalJSON(data []byte) error {
  2918. type NoMethod AutoscalingPolicyLoadBalancingUtilization
  2919. var s1 struct {
  2920. UtilizationTarget gensupport.JSONFloat64 `json:"utilizationTarget"`
  2921. *NoMethod
  2922. }
  2923. s1.NoMethod = (*NoMethod)(s)
  2924. if err := json.Unmarshal(data, &s1); err != nil {
  2925. return err
  2926. }
  2927. s.UtilizationTarget = float64(s1.UtilizationTarget)
  2928. return nil
  2929. }
  2930. // AutoscalingPolicyQueueBasedScaling: Configuration parameters of
  2931. // autoscaling based on queuing system.
  2932. type AutoscalingPolicyQueueBasedScaling struct {
  2933. // AcceptableBacklogPerInstance: Scaling based on the average number of
  2934. // tasks in the queue per each active instance. The autoscaler keeps the
  2935. // average number of tasks per instance below this number, based on data
  2936. // collected in the last couple of minutes. The autoscaler will also
  2937. // take into account incoming tasks when calculating when to scale.
  2938. AcceptableBacklogPerInstance float64 `json:"acceptableBacklogPerInstance,omitempty"`
  2939. // CloudPubSub: Configuration for Cloud Pub/Sub subscription queue.
  2940. CloudPubSub *AutoscalingPolicyQueueBasedScalingCloudPubSub `json:"cloudPubSub,omitempty"`
  2941. // SingleWorkerThroughputPerSec: The scaling algorithm will also
  2942. // calculate throughput estimates on its own; if you explicitly provide
  2943. // this value, the autoscaler will take into account your value as well
  2944. // as automatic estimates when deciding how to scale.
  2945. SingleWorkerThroughputPerSec float64 `json:"singleWorkerThroughputPerSec,omitempty"`
  2946. // ForceSendFields is a list of field names (e.g.
  2947. // "AcceptableBacklogPerInstance") to unconditionally include in API
  2948. // requests. By default, fields with empty values are omitted from API
  2949. // requests. However, any non-pointer, non-interface field appearing in
  2950. // ForceSendFields will be sent to the server regardless of whether the
  2951. // field is empty or not. This may be used to include empty fields in
  2952. // Patch requests.
  2953. ForceSendFields []string `json:"-"`
  2954. // NullFields is a list of field names (e.g.
  2955. // "AcceptableBacklogPerInstance") to include in API requests with the
  2956. // JSON null value. By default, fields with empty values are omitted
  2957. // from API requests. However, any field with an empty value appearing
  2958. // in NullFields will be sent to the server as null. It is an error if a
  2959. // field in this list has a non-empty value. This may be used to include
  2960. // null fields in Patch requests.
  2961. NullFields []string `json:"-"`
  2962. }
  2963. func (s *AutoscalingPolicyQueueBasedScaling) MarshalJSON() ([]byte, error) {
  2964. type NoMethod AutoscalingPolicyQueueBasedScaling
  2965. raw := NoMethod(*s)
  2966. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2967. }
  2968. func (s *AutoscalingPolicyQueueBasedScaling) UnmarshalJSON(data []byte) error {
  2969. type NoMethod AutoscalingPolicyQueueBasedScaling
  2970. var s1 struct {
  2971. AcceptableBacklogPerInstance gensupport.JSONFloat64 `json:"acceptableBacklogPerInstance"`
  2972. SingleWorkerThroughputPerSec gensupport.JSONFloat64 `json:"singleWorkerThroughputPerSec"`
  2973. *NoMethod
  2974. }
  2975. s1.NoMethod = (*NoMethod)(s)
  2976. if err := json.Unmarshal(data, &s1); err != nil {
  2977. return err
  2978. }
  2979. s.AcceptableBacklogPerInstance = float64(s1.AcceptableBacklogPerInstance)
  2980. s.SingleWorkerThroughputPerSec = float64(s1.SingleWorkerThroughputPerSec)
  2981. return nil
  2982. }
  2983. // AutoscalingPolicyQueueBasedScalingCloudPubSub: Configuration
  2984. // parameters for scaling based on Cloud Pub/Sub subscription queue.
  2985. type AutoscalingPolicyQueueBasedScalingCloudPubSub struct {
  2986. // Subscription: Cloud Pub/Sub subscription used for scaling. Provide
  2987. // the partial URL (starting with projects/) or just the subscription
  2988. // name. The subscription must be assigned to the topic specified in
  2989. // topicName and must be in a pull configuration. The subscription must
  2990. // belong to the same project as the Autoscaler.
  2991. Subscription string `json:"subscription,omitempty"`
  2992. // Topic: Cloud Pub/Sub topic used for scaling. Provide the partial URL
  2993. // or partial URL (starting with projects/) or just the topic name. The
  2994. // topic must belong to the same project as the Autoscaler resource.
  2995. Topic string `json:"topic,omitempty"`
  2996. // ForceSendFields is a list of field names (e.g. "Subscription") to
  2997. // unconditionally include in API requests. By default, fields with
  2998. // empty values are omitted from API requests. However, any non-pointer,
  2999. // non-interface field appearing in ForceSendFields will be sent to the
  3000. // server regardless of whether the field is empty or not. This may be
  3001. // used to include empty fields in Patch requests.
  3002. ForceSendFields []string `json:"-"`
  3003. // NullFields is a list of field names (e.g. "Subscription") to include
  3004. // in API requests with the JSON null value. By default, fields with
  3005. // empty values are omitted from API requests. However, any field with
  3006. // an empty value appearing in NullFields will be sent to the server as
  3007. // null. It is an error if a field in this list has a non-empty value.
  3008. // This may be used to include null fields in Patch requests.
  3009. NullFields []string `json:"-"`
  3010. }
  3011. func (s *AutoscalingPolicyQueueBasedScalingCloudPubSub) MarshalJSON() ([]byte, error) {
  3012. type NoMethod AutoscalingPolicyQueueBasedScalingCloudPubSub
  3013. raw := NoMethod(*s)
  3014. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3015. }
  3016. // Backend: Message containing information of one individual backend.
  3017. type Backend struct {
  3018. // BalancingMode: Specifies the balancing mode for this backend. For
  3019. // global HTTP(S) or TCP/SSL load balancing, the default is UTILIZATION.
  3020. // Valid values are UTILIZATION, RATE (for HTTP(S)) and CONNECTION (for
  3021. // TCP/SSL).
  3022. //
  3023. // For Internal Load Balancing, the default and only supported mode is
  3024. // CONNECTION.
  3025. //
  3026. // Possible values:
  3027. // "CONNECTION"
  3028. // "RATE"
  3029. // "UTILIZATION"
  3030. BalancingMode string `json:"balancingMode,omitempty"`
  3031. // CapacityScaler: A multiplier applied to the group's maximum servicing
  3032. // capacity (based on UTILIZATION, RATE or CONNECTION). Default value is
  3033. // 1, which means the group will serve up to 100% of its configured
  3034. // capacity (depending on balancingMode). A setting of 0 means the group
  3035. // is completely drained, offering 0% of its available Capacity. Valid
  3036. // range is [0.0,1.0].
  3037. //
  3038. // This cannot be used for internal load balancing.
  3039. CapacityScaler float64 `json:"capacityScaler,omitempty"`
  3040. // Description: An optional description of this resource. Provide this
  3041. // property when you create the resource.
  3042. Description string `json:"description,omitempty"`
  3043. // Failover: This field designates whether this is a failover backend.
  3044. // More than one failover backend can be configured for a given
  3045. // BackendService.
  3046. Failover bool `json:"failover,omitempty"`
  3047. // Group: The fully-qualified URL of a Instance Group resource. This
  3048. // instance group defines the list of instances that serve traffic.
  3049. // Member virtual machine instances from each instance group must live
  3050. // in the same zone as the instance group itself. No two backends in a
  3051. // backend service are allowed to use same Instance Group
  3052. // resource.
  3053. //
  3054. // Note that you must specify an Instance Group resource using the
  3055. // fully-qualified URL, rather than a partial URL.
  3056. //
  3057. // When the BackendService has load balancing scheme INTERNAL, the
  3058. // instance group must be within the same region as the BackendService.
  3059. Group string `json:"group,omitempty"`
  3060. // MaxConnections: The max number of simultaneous connections for the
  3061. // group. Can be used with either CONNECTION or UTILIZATION balancing
  3062. // modes. For CONNECTION mode, either maxConnections or
  3063. // maxConnectionsPerInstance must be set.
  3064. //
  3065. // This cannot be used for internal load balancing.
  3066. MaxConnections int64 `json:"maxConnections,omitempty"`
  3067. // MaxConnectionsPerEndpoint: The max number of simultaneous connections
  3068. // that a single backend network endpoint can handle. This is used to
  3069. // calculate the capacity of the group. Can be used in either CONNECTION
  3070. // or UTILIZATION balancing modes. For CONNECTION mode, either
  3071. // maxConnections or maxConnectionsPerEndpoint must be set.
  3072. //
  3073. // This cannot be used for internal load balancing.
  3074. MaxConnectionsPerEndpoint int64 `json:"maxConnectionsPerEndpoint,omitempty"`
  3075. // MaxConnectionsPerInstance: The max number of simultaneous connections
  3076. // that a single backend instance can handle. This is used to calculate
  3077. // the capacity of the group. Can be used in either CONNECTION or
  3078. // UTILIZATION balancing modes. For CONNECTION mode, either
  3079. // maxConnections or maxConnectionsPerInstance must be set.
  3080. //
  3081. // This cannot be used for internal load balancing.
  3082. MaxConnectionsPerInstance int64 `json:"maxConnectionsPerInstance,omitempty"`
  3083. // MaxRate: The max requests per second (RPS) of the group. Can be used
  3084. // with either RATE or UTILIZATION balancing modes, but required if RATE
  3085. // mode. For RATE mode, either maxRate or maxRatePerInstance must be
  3086. // set.
  3087. //
  3088. // This cannot be used for internal load balancing.
  3089. MaxRate int64 `json:"maxRate,omitempty"`
  3090. // MaxRatePerEndpoint: The max requests per second (RPS) that a single
  3091. // backend network endpoint can handle. This is used to calculate the
  3092. // capacity of the group. Can be used in either balancing mode. For RATE
  3093. // mode, either maxRate or maxRatePerEndpoint must be set.
  3094. //
  3095. // This cannot be used for internal load balancing.
  3096. MaxRatePerEndpoint float64 `json:"maxRatePerEndpoint,omitempty"`
  3097. // MaxRatePerInstance: The max requests per second (RPS) that a single
  3098. // backend instance can handle. This is used to calculate the capacity
  3099. // of the group. Can be used in either balancing mode. For RATE mode,
  3100. // either maxRate or maxRatePerInstance must be set.
  3101. //
  3102. // This cannot be used for internal load balancing.
  3103. MaxRatePerInstance float64 `json:"maxRatePerInstance,omitempty"`
  3104. // MaxUtilization: Used when balancingMode is UTILIZATION. This ratio
  3105. // defines the CPU utilization target for the group. The default is 0.8.
  3106. // Valid range is [0.0, 1.0].
  3107. //
  3108. // This cannot be used for internal load balancing.
  3109. MaxUtilization float64 `json:"maxUtilization,omitempty"`
  3110. // ForceSendFields is a list of field names (e.g. "BalancingMode") to
  3111. // unconditionally include in API requests. By default, fields with
  3112. // empty values are omitted from API requests. However, any non-pointer,
  3113. // non-interface field appearing in ForceSendFields will be sent to the
  3114. // server regardless of whether the field is empty or not. This may be
  3115. // used to include empty fields in Patch requests.
  3116. ForceSendFields []string `json:"-"`
  3117. // NullFields is a list of field names (e.g. "BalancingMode") to include
  3118. // in API requests with the JSON null value. By default, fields with
  3119. // empty values are omitted from API requests. However, any field with
  3120. // an empty value appearing in NullFields will be sent to the server as
  3121. // null. It is an error if a field in this list has a non-empty value.
  3122. // This may be used to include null fields in Patch requests.
  3123. NullFields []string `json:"-"`
  3124. }
  3125. func (s *Backend) MarshalJSON() ([]byte, error) {
  3126. type NoMethod Backend
  3127. raw := NoMethod(*s)
  3128. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3129. }
  3130. func (s *Backend) UnmarshalJSON(data []byte) error {
  3131. type NoMethod Backend
  3132. var s1 struct {
  3133. CapacityScaler gensupport.JSONFloat64 `json:"capacityScaler"`
  3134. MaxRatePerEndpoint gensupport.JSONFloat64 `json:"maxRatePerEndpoint"`
  3135. MaxRatePerInstance gensupport.JSONFloat64 `json:"maxRatePerInstance"`
  3136. MaxUtilization gensupport.JSONFloat64 `json:"maxUtilization"`
  3137. *NoMethod
  3138. }
  3139. s1.NoMethod = (*NoMethod)(s)
  3140. if err := json.Unmarshal(data, &s1); err != nil {
  3141. return err
  3142. }
  3143. s.CapacityScaler = float64(s1.CapacityScaler)
  3144. s.MaxRatePerEndpoint = float64(s1.MaxRatePerEndpoint)
  3145. s.MaxRatePerInstance = float64(s1.MaxRatePerInstance)
  3146. s.MaxUtilization = float64(s1.MaxUtilization)
  3147. return nil
  3148. }
  3149. // BackendBucket: A BackendBucket resource. This resource defines a
  3150. // Cloud Storage bucket.
  3151. type BackendBucket struct {
  3152. // BucketName: Cloud Storage bucket name.
  3153. BucketName string `json:"bucketName,omitempty"`
  3154. // CdnPolicy: Cloud CDN Coniguration for this BackendBucket.
  3155. CdnPolicy *BackendBucketCdnPolicy `json:"cdnPolicy,omitempty"`
  3156. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  3157. // format.
  3158. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  3159. // Description: An optional textual description of the resource;
  3160. // provided by the client when the resource is created.
  3161. Description string `json:"description,omitempty"`
  3162. // EnableCdn: If true, enable Cloud CDN for this BackendBucket.
  3163. EnableCdn bool `json:"enableCdn,omitempty"`
  3164. // Id: [Output Only] Unique identifier for the resource; defined by the
  3165. // server.
  3166. Id uint64 `json:"id,omitempty,string"`
  3167. // Kind: Type of the resource.
  3168. Kind string `json:"kind,omitempty"`
  3169. // Name: Name of the resource. Provided by the client when the resource
  3170. // is created. The name must be 1-63 characters long, and comply with
  3171. // RFC1035. Specifically, the name must be 1-63 characters long and
  3172. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  3173. // the first character must be a lowercase letter, and all following
  3174. // characters must be a dash, lowercase letter, or digit, except the
  3175. // last character, which cannot be a dash.
  3176. Name string `json:"name,omitempty"`
  3177. // SelfLink: [Output Only] Server-defined URL for the resource.
  3178. SelfLink string `json:"selfLink,omitempty"`
  3179. // ServerResponse contains the HTTP response code and headers from the
  3180. // server.
  3181. googleapi.ServerResponse `json:"-"`
  3182. // ForceSendFields is a list of field names (e.g. "BucketName") to
  3183. // unconditionally include in API requests. By default, fields with
  3184. // empty values are omitted from API requests. However, any non-pointer,
  3185. // non-interface field appearing in ForceSendFields will be sent to the
  3186. // server regardless of whether the field is empty or not. This may be
  3187. // used to include empty fields in Patch requests.
  3188. ForceSendFields []string `json:"-"`
  3189. // NullFields is a list of field names (e.g. "BucketName") to include in
  3190. // API requests with the JSON null value. By default, fields with empty
  3191. // values are omitted from API requests. However, any field with an
  3192. // empty value appearing in NullFields will be sent to the server as
  3193. // null. It is an error if a field in this list has a non-empty value.
  3194. // This may be used to include null fields in Patch requests.
  3195. NullFields []string `json:"-"`
  3196. }
  3197. func (s *BackendBucket) MarshalJSON() ([]byte, error) {
  3198. type NoMethod BackendBucket
  3199. raw := NoMethod(*s)
  3200. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3201. }
  3202. // BackendBucketCdnPolicy: Message containing Cloud CDN configuration
  3203. // for a backend bucket.
  3204. type BackendBucketCdnPolicy struct {
  3205. // SignedUrlCacheMaxAgeSec: Number of seconds up to which the response
  3206. // to a signed URL request will be cached in the CDN. After this time
  3207. // period, the Signed URL will be revalidated before being served.
  3208. // Defaults to 1hr (3600s). If this field is set, Cloud CDN will
  3209. // internally act as though all responses from this bucket had a
  3210. // ?Cache-Control: public, max-age=[TTL]? header, regardless of any
  3211. // existing Cache-Control header. The actual headers served in responses
  3212. // will not be altered.
  3213. SignedUrlCacheMaxAgeSec int64 `json:"signedUrlCacheMaxAgeSec,omitempty,string"`
  3214. // SignedUrlKeyNames: [Output Only] Names of the keys currently
  3215. // configured for Cloud CDN Signed URL on this backend bucket.
  3216. SignedUrlKeyNames []string `json:"signedUrlKeyNames,omitempty"`
  3217. // ForceSendFields is a list of field names (e.g.
  3218. // "SignedUrlCacheMaxAgeSec") to unconditionally include in API
  3219. // requests. By default, fields with empty values are omitted from API
  3220. // requests. However, any non-pointer, non-interface field appearing in
  3221. // ForceSendFields will be sent to the server regardless of whether the
  3222. // field is empty or not. This may be used to include empty fields in
  3223. // Patch requests.
  3224. ForceSendFields []string `json:"-"`
  3225. // NullFields is a list of field names (e.g. "SignedUrlCacheMaxAgeSec")
  3226. // to include in API requests with the JSON null value. By default,
  3227. // fields with empty values are omitted from API requests. However, any
  3228. // field with an empty value appearing in NullFields will be sent to the
  3229. // server as null. It is an error if a field in this list has a
  3230. // non-empty value. This may be used to include null fields in Patch
  3231. // requests.
  3232. NullFields []string `json:"-"`
  3233. }
  3234. func (s *BackendBucketCdnPolicy) MarshalJSON() ([]byte, error) {
  3235. type NoMethod BackendBucketCdnPolicy
  3236. raw := NoMethod(*s)
  3237. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3238. }
  3239. // BackendBucketList: Contains a list of BackendBucket resources.
  3240. type BackendBucketList struct {
  3241. // Id: [Output Only] Unique identifier for the resource; defined by the
  3242. // server.
  3243. Id string `json:"id,omitempty"`
  3244. // Items: A list of BackendBucket resources.
  3245. Items []*BackendBucket `json:"items,omitempty"`
  3246. // Kind: Type of resource.
  3247. Kind string `json:"kind,omitempty"`
  3248. // NextPageToken: [Output Only] This token allows you to get the next
  3249. // page of results for list requests. If the number of results is larger
  3250. // than maxResults, use the nextPageToken as a value for the query
  3251. // parameter pageToken in the next list request. Subsequent list
  3252. // requests will have their own nextPageToken to continue paging through
  3253. // the results.
  3254. NextPageToken string `json:"nextPageToken,omitempty"`
  3255. // SelfLink: [Output Only] Server-defined URL for this resource.
  3256. SelfLink string `json:"selfLink,omitempty"`
  3257. // Warning: [Output Only] Informational warning message.
  3258. Warning *BackendBucketListWarning `json:"warning,omitempty"`
  3259. // ServerResponse contains the HTTP response code and headers from the
  3260. // server.
  3261. googleapi.ServerResponse `json:"-"`
  3262. // ForceSendFields is a list of field names (e.g. "Id") to
  3263. // unconditionally include in API requests. By default, fields with
  3264. // empty values are omitted from API requests. However, any non-pointer,
  3265. // non-interface field appearing in ForceSendFields will be sent to the
  3266. // server regardless of whether the field is empty or not. This may be
  3267. // used to include empty fields in Patch requests.
  3268. ForceSendFields []string `json:"-"`
  3269. // NullFields is a list of field names (e.g. "Id") to include in API
  3270. // requests with the JSON null value. By default, fields with empty
  3271. // values are omitted from API requests. However, any field with an
  3272. // empty value appearing in NullFields will be sent to the server as
  3273. // null. It is an error if a field in this list has a non-empty value.
  3274. // This may be used to include null fields in Patch requests.
  3275. NullFields []string `json:"-"`
  3276. }
  3277. func (s *BackendBucketList) MarshalJSON() ([]byte, error) {
  3278. type NoMethod BackendBucketList
  3279. raw := NoMethod(*s)
  3280. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3281. }
  3282. // BackendBucketListWarning: [Output Only] Informational warning
  3283. // message.
  3284. type BackendBucketListWarning struct {
  3285. // Code: [Output Only] A warning code, if applicable. For example,
  3286. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  3287. // the response.
  3288. //
  3289. // Possible values:
  3290. // "CLEANUP_FAILED"
  3291. // "DEPRECATED_RESOURCE_USED"
  3292. // "DEPRECATED_TYPE_USED"
  3293. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  3294. // "EXPERIMENTAL_TYPE_USED"
  3295. // "EXTERNAL_API_WARNING"
  3296. // "FIELD_VALUE_OVERRIDEN"
  3297. // "INJECTED_KERNELS_DEPRECATED"
  3298. // "MISSING_TYPE_DEPENDENCY"
  3299. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  3300. // "NEXT_HOP_CANNOT_IP_FORWARD"
  3301. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  3302. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  3303. // "NEXT_HOP_NOT_RUNNING"
  3304. // "NOT_CRITICAL_ERROR"
  3305. // "NO_RESULTS_ON_PAGE"
  3306. // "REQUIRED_TOS_AGREEMENT"
  3307. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  3308. // "RESOURCE_NOT_DELETED"
  3309. // "SCHEMA_VALIDATION_IGNORED"
  3310. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  3311. // "UNDECLARED_PROPERTIES"
  3312. // "UNREACHABLE"
  3313. Code string `json:"code,omitempty"`
  3314. // Data: [Output Only] Metadata about this warning in key: value format.
  3315. // For example:
  3316. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  3317. Data []*BackendBucketListWarningData `json:"data,omitempty"`
  3318. // Message: [Output Only] A human-readable description of the warning
  3319. // code.
  3320. Message string `json:"message,omitempty"`
  3321. // ForceSendFields is a list of field names (e.g. "Code") to
  3322. // unconditionally include in API requests. By default, fields with
  3323. // empty values are omitted from API requests. However, any non-pointer,
  3324. // non-interface field appearing in ForceSendFields will be sent to the
  3325. // server regardless of whether the field is empty or not. This may be
  3326. // used to include empty fields in Patch requests.
  3327. ForceSendFields []string `json:"-"`
  3328. // NullFields is a list of field names (e.g. "Code") to include in API
  3329. // requests with the JSON null value. By default, fields with empty
  3330. // values are omitted from API requests. However, any field with an
  3331. // empty value appearing in NullFields will be sent to the server as
  3332. // null. It is an error if a field in this list has a non-empty value.
  3333. // This may be used to include null fields in Patch requests.
  3334. NullFields []string `json:"-"`
  3335. }
  3336. func (s *BackendBucketListWarning) MarshalJSON() ([]byte, error) {
  3337. type NoMethod BackendBucketListWarning
  3338. raw := NoMethod(*s)
  3339. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3340. }
  3341. type BackendBucketListWarningData struct {
  3342. // Key: [Output Only] A key that provides more detail on the warning
  3343. // being returned. For example, for warnings where there are no results
  3344. // in a list request for a particular zone, this key might be scope and
  3345. // the key value might be the zone name. Other examples might be a key
  3346. // indicating a deprecated resource and a suggested replacement, or a
  3347. // warning about invalid network settings (for example, if an instance
  3348. // attempts to perform IP forwarding but is not enabled for IP
  3349. // forwarding).
  3350. Key string `json:"key,omitempty"`
  3351. // Value: [Output Only] A warning data value corresponding to the key.
  3352. Value string `json:"value,omitempty"`
  3353. // ForceSendFields is a list of field names (e.g. "Key") to
  3354. // unconditionally include in API requests. By default, fields with
  3355. // empty values are omitted from API requests. However, any non-pointer,
  3356. // non-interface field appearing in ForceSendFields will be sent to the
  3357. // server regardless of whether the field is empty or not. This may be
  3358. // used to include empty fields in Patch requests.
  3359. ForceSendFields []string `json:"-"`
  3360. // NullFields is a list of field names (e.g. "Key") to include in API
  3361. // requests with the JSON null value. By default, fields with empty
  3362. // values are omitted from API requests. However, any field with an
  3363. // empty value appearing in NullFields will be sent to the server as
  3364. // null. It is an error if a field in this list has a non-empty value.
  3365. // This may be used to include null fields in Patch requests.
  3366. NullFields []string `json:"-"`
  3367. }
  3368. func (s *BackendBucketListWarningData) MarshalJSON() ([]byte, error) {
  3369. type NoMethod BackendBucketListWarningData
  3370. raw := NoMethod(*s)
  3371. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3372. }
  3373. // BackendService: A BackendService resource. This resource defines a
  3374. // group of backend virtual machines and their serving capacity. (==
  3375. // resource_for v1.backendService ==) (== resource_for
  3376. // beta.backendService ==)
  3377. type BackendService struct {
  3378. // AffinityCookieTtlSec: Lifetime of cookies in seconds if
  3379. // session_affinity is GENERATED_COOKIE. If set to 0, the cookie is
  3380. // non-persistent and lasts only until the end of the browser session
  3381. // (or equivalent). The maximum allowed value for TTL is one day.
  3382. //
  3383. // When the load balancing scheme is INTERNAL, this field is not used.
  3384. AffinityCookieTtlSec int64 `json:"affinityCookieTtlSec,omitempty"`
  3385. // AppEngineBackend: Directs request to an App Engine app.
  3386. // cloudFunctionBackend and backends[] must be empty if this is set.
  3387. AppEngineBackend *BackendServiceAppEngineBackend `json:"appEngineBackend,omitempty"`
  3388. // Backends: The list of backends that serve this BackendService.
  3389. Backends []*Backend `json:"backends,omitempty"`
  3390. // CdnPolicy: Cloud CDN configuration for this BackendService.
  3391. CdnPolicy *BackendServiceCdnPolicy `json:"cdnPolicy,omitempty"`
  3392. // CloudFunctionBackend: Directs request to a cloud function.
  3393. // appEngineBackend and backends[] must be empty if this is set.
  3394. CloudFunctionBackend *BackendServiceCloudFunctionBackend `json:"cloudFunctionBackend,omitempty"`
  3395. ConnectionDraining *ConnectionDraining `json:"connectionDraining,omitempty"`
  3396. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  3397. // format.
  3398. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  3399. // CustomRequestHeaders: Headers that the HTTP/S load balancer should
  3400. // add to proxied requests.
  3401. CustomRequestHeaders []string `json:"customRequestHeaders,omitempty"`
  3402. // Description: An optional description of this resource. Provide this
  3403. // property when you create the resource.
  3404. Description string `json:"description,omitempty"`
  3405. // EnableCDN: If true, enable Cloud CDN for this BackendService.
  3406. //
  3407. // When the load balancing scheme is INTERNAL, this field is not used.
  3408. EnableCDN bool `json:"enableCDN,omitempty"`
  3409. FailoverPolicy *BackendServiceFailoverPolicy `json:"failoverPolicy,omitempty"`
  3410. // Fingerprint: Fingerprint of this resource. A hash of the contents
  3411. // stored in this object. This field is used in optimistic locking. This
  3412. // field will be ignored when inserting a BackendService. An up-to-date
  3413. // fingerprint must be provided in order to update the BackendService.
  3414. Fingerprint string `json:"fingerprint,omitempty"`
  3415. // HealthChecks: The list of URLs to the HttpHealthCheck or
  3416. // HttpsHealthCheck resource for health checking this BackendService.
  3417. // Currently at most one health check can be specified, and a health
  3418. // check is required for Compute Engine backend services. A health check
  3419. // must not be specified for App Engine backend and Cloud Function
  3420. // backend.
  3421. //
  3422. // For internal load balancing, a URL to a HealthCheck resource must be
  3423. // specified instead.
  3424. HealthChecks []string `json:"healthChecks,omitempty"`
  3425. Iap *BackendServiceIAP `json:"iap,omitempty"`
  3426. // Id: [Output Only] The unique identifier for the resource. This
  3427. // identifier is defined by the server.
  3428. Id uint64 `json:"id,omitempty,string"`
  3429. // Kind: [Output Only] Type of resource. Always compute#backendService
  3430. // for backend services.
  3431. Kind string `json:"kind,omitempty"`
  3432. // LoadBalancingScheme: Indicates whether the backend service will be
  3433. // used with internal or external load balancing. A backend service
  3434. // created for one type of load balancing cannot be used with the other.
  3435. // Possible values are INTERNAL and EXTERNAL.
  3436. //
  3437. // Possible values:
  3438. // "EXTERNAL"
  3439. // "INTERNAL"
  3440. // "INTERNAL_SELF_MANAGED"
  3441. // "INVALID_LOAD_BALANCING_SCHEME"
  3442. LoadBalancingScheme string `json:"loadBalancingScheme,omitempty"`
  3443. // Name: Name of the resource. Provided by the client when the resource
  3444. // is created. The name must be 1-63 characters long, and comply with
  3445. // RFC1035. Specifically, the name must be 1-63 characters long and
  3446. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  3447. // the first character must be a lowercase letter, and all following
  3448. // characters must be a dash, lowercase letter, or digit, except the
  3449. // last character, which cannot be a dash.
  3450. Name string `json:"name,omitempty"`
  3451. // Port: Deprecated in favor of portName. The TCP port to connect on the
  3452. // backend. The default value is 80.
  3453. //
  3454. // This cannot be used for internal load balancing.
  3455. Port int64 `json:"port,omitempty"`
  3456. // PortName: Name of backend port. The same name should appear in the
  3457. // instance groups referenced by this service. Required when the load
  3458. // balancing scheme is EXTERNAL.
  3459. //
  3460. // When the load balancing scheme is INTERNAL, this field is not used.
  3461. PortName string `json:"portName,omitempty"`
  3462. // Protocol: The protocol this BackendService uses to communicate with
  3463. // backends.
  3464. //
  3465. // Possible values are HTTP, HTTPS, TCP, and SSL. The default is
  3466. // HTTP.
  3467. //
  3468. // For internal load balancing, the possible values are TCP and UDP, and
  3469. // the default is TCP.
  3470. //
  3471. // Possible values:
  3472. // "HTTP"
  3473. // "HTTP2"
  3474. // "HTTPS"
  3475. // "SSL"
  3476. // "TCP"
  3477. // "UDP"
  3478. Protocol string `json:"protocol,omitempty"`
  3479. // Region: [Output Only] URL of the region where the regional backend
  3480. // service resides. This field is not applicable to global backend
  3481. // services. You must specify this field as part of the HTTP request
  3482. // URL. It is not settable as a field in the request body.
  3483. Region string `json:"region,omitempty"`
  3484. // SecurityPolicy: [Output Only] The resource URL for the security
  3485. // policy associated with this backend service.
  3486. SecurityPolicy string `json:"securityPolicy,omitempty"`
  3487. // SelfLink: [Output Only] Server-defined URL for the resource.
  3488. SelfLink string `json:"selfLink,omitempty"`
  3489. // SessionAffinity: Type of session affinity to use. The default is
  3490. // NONE.
  3491. //
  3492. // When the load balancing scheme is EXTERNAL, can be NONE, CLIENT_IP,
  3493. // or GENERATED_COOKIE.
  3494. //
  3495. // When the load balancing scheme is INTERNAL, can be NONE, CLIENT_IP,
  3496. // CLIENT_IP_PROTO, or CLIENT_IP_PORT_PROTO.
  3497. //
  3498. // When the protocol is UDP, this field is not used.
  3499. //
  3500. // Possible values:
  3501. // "CLIENT_IP"
  3502. // "CLIENT_IP_PORT_PROTO"
  3503. // "CLIENT_IP_PROTO"
  3504. // "GENERATED_COOKIE"
  3505. // "NONE"
  3506. SessionAffinity string `json:"sessionAffinity,omitempty"`
  3507. // TimeoutSec: How many seconds to wait for the backend before
  3508. // considering it a failed request. Default is 30 seconds.
  3509. TimeoutSec int64 `json:"timeoutSec,omitempty"`
  3510. // ServerResponse contains the HTTP response code and headers from the
  3511. // server.
  3512. googleapi.ServerResponse `json:"-"`
  3513. // ForceSendFields is a list of field names (e.g.
  3514. // "AffinityCookieTtlSec") to unconditionally include in API requests.
  3515. // By default, fields with empty values are omitted from API requests.
  3516. // However, any non-pointer, non-interface field appearing in
  3517. // ForceSendFields will be sent to the server regardless of whether the
  3518. // field is empty or not. This may be used to include empty fields in
  3519. // Patch requests.
  3520. ForceSendFields []string `json:"-"`
  3521. // NullFields is a list of field names (e.g. "AffinityCookieTtlSec") to
  3522. // include in API requests with the JSON null value. By default, fields
  3523. // with empty values are omitted from API requests. However, any field
  3524. // with an empty value appearing in NullFields will be sent to the
  3525. // server as null. It is an error if a field in this list has a
  3526. // non-empty value. This may be used to include null fields in Patch
  3527. // requests.
  3528. NullFields []string `json:"-"`
  3529. }
  3530. func (s *BackendService) MarshalJSON() ([]byte, error) {
  3531. type NoMethod BackendService
  3532. raw := NoMethod(*s)
  3533. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3534. }
  3535. // BackendServiceAggregatedList: Contains a list of
  3536. // BackendServicesScopedList.
  3537. type BackendServiceAggregatedList struct {
  3538. // Id: [Output Only] Unique identifier for the resource; defined by the
  3539. // server.
  3540. Id string `json:"id,omitempty"`
  3541. // Items: A list of BackendServicesScopedList resources.
  3542. Items map[string]BackendServicesScopedList `json:"items,omitempty"`
  3543. // Kind: Type of resource.
  3544. Kind string `json:"kind,omitempty"`
  3545. // NextPageToken: [Output Only] This token allows you to get the next
  3546. // page of results for list requests. If the number of results is larger
  3547. // than maxResults, use the nextPageToken as a value for the query
  3548. // parameter pageToken in the next list request. Subsequent list
  3549. // requests will have their own nextPageToken to continue paging through
  3550. // the results.
  3551. NextPageToken string `json:"nextPageToken,omitempty"`
  3552. // SelfLink: [Output Only] Server-defined URL for this resource.
  3553. SelfLink string `json:"selfLink,omitempty"`
  3554. // Warning: [Output Only] Informational warning message.
  3555. Warning *BackendServiceAggregatedListWarning `json:"warning,omitempty"`
  3556. // ServerResponse contains the HTTP response code and headers from the
  3557. // server.
  3558. googleapi.ServerResponse `json:"-"`
  3559. // ForceSendFields is a list of field names (e.g. "Id") to
  3560. // unconditionally include in API requests. By default, fields with
  3561. // empty values are omitted from API requests. However, any non-pointer,
  3562. // non-interface field appearing in ForceSendFields will be sent to the
  3563. // server regardless of whether the field is empty or not. This may be
  3564. // used to include empty fields in Patch requests.
  3565. ForceSendFields []string `json:"-"`
  3566. // NullFields is a list of field names (e.g. "Id") to include in API
  3567. // requests with the JSON null value. By default, fields with empty
  3568. // values are omitted from API requests. However, any field with an
  3569. // empty value appearing in NullFields will be sent to the server as
  3570. // null. It is an error if a field in this list has a non-empty value.
  3571. // This may be used to include null fields in Patch requests.
  3572. NullFields []string `json:"-"`
  3573. }
  3574. func (s *BackendServiceAggregatedList) MarshalJSON() ([]byte, error) {
  3575. type NoMethod BackendServiceAggregatedList
  3576. raw := NoMethod(*s)
  3577. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3578. }
  3579. // BackendServiceAggregatedListWarning: [Output Only] Informational
  3580. // warning message.
  3581. type BackendServiceAggregatedListWarning struct {
  3582. // Code: [Output Only] A warning code, if applicable. For example,
  3583. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  3584. // the response.
  3585. //
  3586. // Possible values:
  3587. // "CLEANUP_FAILED"
  3588. // "DEPRECATED_RESOURCE_USED"
  3589. // "DEPRECATED_TYPE_USED"
  3590. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  3591. // "EXPERIMENTAL_TYPE_USED"
  3592. // "EXTERNAL_API_WARNING"
  3593. // "FIELD_VALUE_OVERRIDEN"
  3594. // "INJECTED_KERNELS_DEPRECATED"
  3595. // "MISSING_TYPE_DEPENDENCY"
  3596. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  3597. // "NEXT_HOP_CANNOT_IP_FORWARD"
  3598. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  3599. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  3600. // "NEXT_HOP_NOT_RUNNING"
  3601. // "NOT_CRITICAL_ERROR"
  3602. // "NO_RESULTS_ON_PAGE"
  3603. // "REQUIRED_TOS_AGREEMENT"
  3604. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  3605. // "RESOURCE_NOT_DELETED"
  3606. // "SCHEMA_VALIDATION_IGNORED"
  3607. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  3608. // "UNDECLARED_PROPERTIES"
  3609. // "UNREACHABLE"
  3610. Code string `json:"code,omitempty"`
  3611. // Data: [Output Only] Metadata about this warning in key: value format.
  3612. // For example:
  3613. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  3614. Data []*BackendServiceAggregatedListWarningData `json:"data,omitempty"`
  3615. // Message: [Output Only] A human-readable description of the warning
  3616. // code.
  3617. Message string `json:"message,omitempty"`
  3618. // ForceSendFields is a list of field names (e.g. "Code") to
  3619. // unconditionally include in API requests. By default, fields with
  3620. // empty values are omitted from API requests. However, any non-pointer,
  3621. // non-interface field appearing in ForceSendFields will be sent to the
  3622. // server regardless of whether the field is empty or not. This may be
  3623. // used to include empty fields in Patch requests.
  3624. ForceSendFields []string `json:"-"`
  3625. // NullFields is a list of field names (e.g. "Code") to include in API
  3626. // requests with the JSON null value. By default, fields with empty
  3627. // values are omitted from API requests. However, any field with an
  3628. // empty value appearing in NullFields will be sent to the server as
  3629. // null. It is an error if a field in this list has a non-empty value.
  3630. // This may be used to include null fields in Patch requests.
  3631. NullFields []string `json:"-"`
  3632. }
  3633. func (s *BackendServiceAggregatedListWarning) MarshalJSON() ([]byte, error) {
  3634. type NoMethod BackendServiceAggregatedListWarning
  3635. raw := NoMethod(*s)
  3636. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3637. }
  3638. type BackendServiceAggregatedListWarningData struct {
  3639. // Key: [Output Only] A key that provides more detail on the warning
  3640. // being returned. For example, for warnings where there are no results
  3641. // in a list request for a particular zone, this key might be scope and
  3642. // the key value might be the zone name. Other examples might be a key
  3643. // indicating a deprecated resource and a suggested replacement, or a
  3644. // warning about invalid network settings (for example, if an instance
  3645. // attempts to perform IP forwarding but is not enabled for IP
  3646. // forwarding).
  3647. Key string `json:"key,omitempty"`
  3648. // Value: [Output Only] A warning data value corresponding to the key.
  3649. Value string `json:"value,omitempty"`
  3650. // ForceSendFields is a list of field names (e.g. "Key") to
  3651. // unconditionally include in API requests. By default, fields with
  3652. // empty values are omitted from API requests. However, any non-pointer,
  3653. // non-interface field appearing in ForceSendFields will be sent to the
  3654. // server regardless of whether the field is empty or not. This may be
  3655. // used to include empty fields in Patch requests.
  3656. ForceSendFields []string `json:"-"`
  3657. // NullFields is a list of field names (e.g. "Key") to include in API
  3658. // requests with the JSON null value. By default, fields with empty
  3659. // values are omitted from API requests. However, any field with an
  3660. // empty value appearing in NullFields will be sent to the server as
  3661. // null. It is an error if a field in this list has a non-empty value.
  3662. // This may be used to include null fields in Patch requests.
  3663. NullFields []string `json:"-"`
  3664. }
  3665. func (s *BackendServiceAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  3666. type NoMethod BackendServiceAggregatedListWarningData
  3667. raw := NoMethod(*s)
  3668. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3669. }
  3670. // BackendServiceAppEngineBackend: Configuration of a App Engine
  3671. // backend.
  3672. type BackendServiceAppEngineBackend struct {
  3673. // AppEngineService: Optional. App Engine app service name.
  3674. AppEngineService string `json:"appEngineService,omitempty"`
  3675. // TargetProject: Required. Project ID of the project hosting the app.
  3676. // This is the project ID of this project. Reference to another project
  3677. // is not allowed.
  3678. TargetProject string `json:"targetProject,omitempty"`
  3679. // Version: Optional. Version of App Engine app service. When empty, App
  3680. // Engine will do its normal traffic split.
  3681. Version string `json:"version,omitempty"`
  3682. // ForceSendFields is a list of field names (e.g. "AppEngineService") to
  3683. // unconditionally include in API requests. By default, fields with
  3684. // empty values are omitted from API requests. However, any non-pointer,
  3685. // non-interface field appearing in ForceSendFields will be sent to the
  3686. // server regardless of whether the field is empty or not. This may be
  3687. // used to include empty fields in Patch requests.
  3688. ForceSendFields []string `json:"-"`
  3689. // NullFields is a list of field names (e.g. "AppEngineService") to
  3690. // include in API requests with the JSON null value. By default, fields
  3691. // with empty values are omitted from API requests. However, any field
  3692. // with an empty value appearing in NullFields will be sent to the
  3693. // server as null. It is an error if a field in this list has a
  3694. // non-empty value. This may be used to include null fields in Patch
  3695. // requests.
  3696. NullFields []string `json:"-"`
  3697. }
  3698. func (s *BackendServiceAppEngineBackend) MarshalJSON() ([]byte, error) {
  3699. type NoMethod BackendServiceAppEngineBackend
  3700. raw := NoMethod(*s)
  3701. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3702. }
  3703. // BackendServiceCdnPolicy: Message containing Cloud CDN configuration
  3704. // for a backend service.
  3705. type BackendServiceCdnPolicy struct {
  3706. // CacheKeyPolicy: The CacheKeyPolicy for this CdnPolicy.
  3707. CacheKeyPolicy *CacheKeyPolicy `json:"cacheKeyPolicy,omitempty"`
  3708. // SignedUrlCacheMaxAgeSec: Number of seconds up to which the response
  3709. // to a signed URL request will be cached in the CDN. After this time
  3710. // period, the Signed URL will be revalidated before being served.
  3711. // Defaults to 1hr (3600s). If this field is set, Cloud CDN will
  3712. // internally act as though all responses from this backend had a
  3713. // ?Cache-Control: public, max-age=[TTL]? header, regardless of any
  3714. // existing Cache-Control header. The actual headers served in responses
  3715. // will not be altered.
  3716. SignedUrlCacheMaxAgeSec int64 `json:"signedUrlCacheMaxAgeSec,omitempty,string"`
  3717. // SignedUrlKeyNames: [Output Only] Names of the keys currently
  3718. // configured for Cloud CDN Signed URL on this backend service.
  3719. SignedUrlKeyNames []string `json:"signedUrlKeyNames,omitempty"`
  3720. // ForceSendFields is a list of field names (e.g. "CacheKeyPolicy") to
  3721. // unconditionally include in API requests. By default, fields with
  3722. // empty values are omitted from API requests. However, any non-pointer,
  3723. // non-interface field appearing in ForceSendFields will be sent to the
  3724. // server regardless of whether the field is empty or not. This may be
  3725. // used to include empty fields in Patch requests.
  3726. ForceSendFields []string `json:"-"`
  3727. // NullFields is a list of field names (e.g. "CacheKeyPolicy") to
  3728. // include in API requests with the JSON null value. By default, fields
  3729. // with empty values are omitted from API requests. However, any field
  3730. // with an empty value appearing in NullFields will be sent to the
  3731. // server as null. It is an error if a field in this list has a
  3732. // non-empty value. This may be used to include null fields in Patch
  3733. // requests.
  3734. NullFields []string `json:"-"`
  3735. }
  3736. func (s *BackendServiceCdnPolicy) MarshalJSON() ([]byte, error) {
  3737. type NoMethod BackendServiceCdnPolicy
  3738. raw := NoMethod(*s)
  3739. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3740. }
  3741. // BackendServiceCloudFunctionBackend: Configuration of a Cloud Function
  3742. // backend.
  3743. type BackendServiceCloudFunctionBackend struct {
  3744. // FunctionName: Required. A cloud function name. Special value ?*?
  3745. // represents all cloud functions in the project.
  3746. FunctionName string `json:"functionName,omitempty"`
  3747. // TargetProject: Required. Project ID of the project hosting the cloud
  3748. // function.
  3749. TargetProject string `json:"targetProject,omitempty"`
  3750. // ForceSendFields is a list of field names (e.g. "FunctionName") to
  3751. // unconditionally include in API requests. By default, fields with
  3752. // empty values are omitted from API requests. However, any non-pointer,
  3753. // non-interface field appearing in ForceSendFields will be sent to the
  3754. // server regardless of whether the field is empty or not. This may be
  3755. // used to include empty fields in Patch requests.
  3756. ForceSendFields []string `json:"-"`
  3757. // NullFields is a list of field names (e.g. "FunctionName") to include
  3758. // in API requests with the JSON null value. By default, fields with
  3759. // empty values are omitted from API requests. However, any field with
  3760. // an empty value appearing in NullFields will be sent to the server as
  3761. // null. It is an error if a field in this list has a non-empty value.
  3762. // This may be used to include null fields in Patch requests.
  3763. NullFields []string `json:"-"`
  3764. }
  3765. func (s *BackendServiceCloudFunctionBackend) MarshalJSON() ([]byte, error) {
  3766. type NoMethod BackendServiceCloudFunctionBackend
  3767. raw := NoMethod(*s)
  3768. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3769. }
  3770. type BackendServiceFailoverPolicy struct {
  3771. // DisableConnectionDrainOnFailover: On failover or failback, this field
  3772. // indicates whether connection drain will be honored. Setting this to
  3773. // true has the following effect: connections to the old active pool are
  3774. // not drained. Connections to the new active pool use the timeout of 10
  3775. // min (currently fixed). Setting to false has the following effect:
  3776. // both old and new connections will have a drain timeout of 10
  3777. // min.
  3778. //
  3779. // This can be set to true only if the protocol is TCP.
  3780. //
  3781. // The default is false.
  3782. DisableConnectionDrainOnFailover bool `json:"disableConnectionDrainOnFailover,omitempty"`
  3783. // DropTrafficIfUnhealthy: This option is used only when no healthy VMs
  3784. // are detected in the primary and backup instance groups. When set to
  3785. // true, traffic is dropped. When set to false, new connections are sent
  3786. // across all VMs in the primary group.
  3787. //
  3788. // The default is false.
  3789. DropTrafficIfUnhealthy bool `json:"dropTrafficIfUnhealthy,omitempty"`
  3790. // FailoverRatio: The value of the field must be in [0, 1]. If the ratio
  3791. // of the healthy VMs in the primary backend is at or below this number,
  3792. // traffic arriving at the load-balanced IP will be directed to the
  3793. // failover backend.
  3794. //
  3795. // In case where 'failoverRatio' is not set or all the VMs in the backup
  3796. // backend are unhealthy, the traffic will be directed back to the
  3797. // primary backend in the "force" mode, where traffic will be spread to
  3798. // the healthy VMs with the best effort, or to all VMs when no VM is
  3799. // healthy.
  3800. //
  3801. // This field is only used with l4 load balancing.
  3802. FailoverRatio float64 `json:"failoverRatio,omitempty"`
  3803. // ForceSendFields is a list of field names (e.g.
  3804. // "DisableConnectionDrainOnFailover") to unconditionally include in API
  3805. // requests. By default, fields with empty values are omitted from API
  3806. // requests. However, any non-pointer, non-interface field appearing in
  3807. // ForceSendFields will be sent to the server regardless of whether the
  3808. // field is empty or not. This may be used to include empty fields in
  3809. // Patch requests.
  3810. ForceSendFields []string `json:"-"`
  3811. // NullFields is a list of field names (e.g.
  3812. // "DisableConnectionDrainOnFailover") to include in API requests with
  3813. // the JSON null value. By default, fields with empty values are omitted
  3814. // from API requests. However, any field with an empty value appearing
  3815. // in NullFields will be sent to the server as null. It is an error if a
  3816. // field in this list has a non-empty value. This may be used to include
  3817. // null fields in Patch requests.
  3818. NullFields []string `json:"-"`
  3819. }
  3820. func (s *BackendServiceFailoverPolicy) MarshalJSON() ([]byte, error) {
  3821. type NoMethod BackendServiceFailoverPolicy
  3822. raw := NoMethod(*s)
  3823. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3824. }
  3825. func (s *BackendServiceFailoverPolicy) UnmarshalJSON(data []byte) error {
  3826. type NoMethod BackendServiceFailoverPolicy
  3827. var s1 struct {
  3828. FailoverRatio gensupport.JSONFloat64 `json:"failoverRatio"`
  3829. *NoMethod
  3830. }
  3831. s1.NoMethod = (*NoMethod)(s)
  3832. if err := json.Unmarshal(data, &s1); err != nil {
  3833. return err
  3834. }
  3835. s.FailoverRatio = float64(s1.FailoverRatio)
  3836. return nil
  3837. }
  3838. type BackendServiceGroupHealth struct {
  3839. HealthStatus []*HealthStatus `json:"healthStatus,omitempty"`
  3840. // Kind: [Output Only] Type of resource. Always
  3841. // compute#backendServiceGroupHealth for the health of backend services.
  3842. Kind string `json:"kind,omitempty"`
  3843. // ServerResponse contains the HTTP response code and headers from the
  3844. // server.
  3845. googleapi.ServerResponse `json:"-"`
  3846. // ForceSendFields is a list of field names (e.g. "HealthStatus") to
  3847. // unconditionally include in API requests. By default, fields with
  3848. // empty values are omitted from API requests. However, any non-pointer,
  3849. // non-interface field appearing in ForceSendFields will be sent to the
  3850. // server regardless of whether the field is empty or not. This may be
  3851. // used to include empty fields in Patch requests.
  3852. ForceSendFields []string `json:"-"`
  3853. // NullFields is a list of field names (e.g. "HealthStatus") to include
  3854. // in API requests with the JSON null value. By default, fields with
  3855. // empty values are omitted from API requests. However, any field with
  3856. // an empty value appearing in NullFields will be sent to the server as
  3857. // null. It is an error if a field in this list has a non-empty value.
  3858. // This may be used to include null fields in Patch requests.
  3859. NullFields []string `json:"-"`
  3860. }
  3861. func (s *BackendServiceGroupHealth) MarshalJSON() ([]byte, error) {
  3862. type NoMethod BackendServiceGroupHealth
  3863. raw := NoMethod(*s)
  3864. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3865. }
  3866. // BackendServiceIAP: Identity-Aware Proxy
  3867. type BackendServiceIAP struct {
  3868. Enabled bool `json:"enabled,omitempty"`
  3869. Oauth2ClientId string `json:"oauth2ClientId,omitempty"`
  3870. // Oauth2ClientInfo: [Input Only] OAuth client info required to generate
  3871. // client id to be used for IAP.
  3872. Oauth2ClientInfo *BackendServiceIAPOAuth2ClientInfo `json:"oauth2ClientInfo,omitempty"`
  3873. Oauth2ClientSecret string `json:"oauth2ClientSecret,omitempty"`
  3874. // Oauth2ClientSecretSha256: [Output Only] SHA256 hash value for the
  3875. // field oauth2_client_secret above.
  3876. Oauth2ClientSecretSha256 string `json:"oauth2ClientSecretSha256,omitempty"`
  3877. // ForceSendFields is a list of field names (e.g. "Enabled") to
  3878. // unconditionally include in API requests. By default, fields with
  3879. // empty values are omitted from API requests. However, any non-pointer,
  3880. // non-interface field appearing in ForceSendFields will be sent to the
  3881. // server regardless of whether the field is empty or not. This may be
  3882. // used to include empty fields in Patch requests.
  3883. ForceSendFields []string `json:"-"`
  3884. // NullFields is a list of field names (e.g. "Enabled") to include in
  3885. // API requests with the JSON null value. By default, fields with empty
  3886. // values are omitted from API requests. However, any field with an
  3887. // empty value appearing in NullFields will be sent to the server as
  3888. // null. It is an error if a field in this list has a non-empty value.
  3889. // This may be used to include null fields in Patch requests.
  3890. NullFields []string `json:"-"`
  3891. }
  3892. func (s *BackendServiceIAP) MarshalJSON() ([]byte, error) {
  3893. type NoMethod BackendServiceIAP
  3894. raw := NoMethod(*s)
  3895. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3896. }
  3897. type BackendServiceIAPOAuth2ClientInfo struct {
  3898. // ApplicationName: Application name to be used in OAuth consent screen.
  3899. ApplicationName string `json:"applicationName,omitempty"`
  3900. // ClientName: Name of the client to be generated. Optional - If not
  3901. // provided, the name will be autogenerated by the backend.
  3902. ClientName string `json:"clientName,omitempty"`
  3903. // DeveloperEmailAddress: Developer's information to be used in OAuth
  3904. // consent screen.
  3905. DeveloperEmailAddress string `json:"developerEmailAddress,omitempty"`
  3906. // ForceSendFields is a list of field names (e.g. "ApplicationName") to
  3907. // unconditionally include in API requests. By default, fields with
  3908. // empty values are omitted from API requests. However, any non-pointer,
  3909. // non-interface field appearing in ForceSendFields will be sent to the
  3910. // server regardless of whether the field is empty or not. This may be
  3911. // used to include empty fields in Patch requests.
  3912. ForceSendFields []string `json:"-"`
  3913. // NullFields is a list of field names (e.g. "ApplicationName") to
  3914. // include in API requests with the JSON null value. By default, fields
  3915. // with empty values are omitted from API requests. However, any field
  3916. // with an empty value appearing in NullFields will be sent to the
  3917. // server as null. It is an error if a field in this list has a
  3918. // non-empty value. This may be used to include null fields in Patch
  3919. // requests.
  3920. NullFields []string `json:"-"`
  3921. }
  3922. func (s *BackendServiceIAPOAuth2ClientInfo) MarshalJSON() ([]byte, error) {
  3923. type NoMethod BackendServiceIAPOAuth2ClientInfo
  3924. raw := NoMethod(*s)
  3925. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3926. }
  3927. // BackendServiceList: Contains a list of BackendService resources.
  3928. type BackendServiceList struct {
  3929. // Id: [Output Only] Unique identifier for the resource; defined by the
  3930. // server.
  3931. Id string `json:"id,omitempty"`
  3932. // Items: A list of BackendService resources.
  3933. Items []*BackendService `json:"items,omitempty"`
  3934. // Kind: [Output Only] Type of resource. Always
  3935. // compute#backendServiceList for lists of backend services.
  3936. Kind string `json:"kind,omitempty"`
  3937. // NextPageToken: [Output Only] This token allows you to get the next
  3938. // page of results for list requests. If the number of results is larger
  3939. // than maxResults, use the nextPageToken as a value for the query
  3940. // parameter pageToken in the next list request. Subsequent list
  3941. // requests will have their own nextPageToken to continue paging through
  3942. // the results.
  3943. NextPageToken string `json:"nextPageToken,omitempty"`
  3944. // SelfLink: [Output Only] Server-defined URL for this resource.
  3945. SelfLink string `json:"selfLink,omitempty"`
  3946. // Warning: [Output Only] Informational warning message.
  3947. Warning *BackendServiceListWarning `json:"warning,omitempty"`
  3948. // ServerResponse contains the HTTP response code and headers from the
  3949. // server.
  3950. googleapi.ServerResponse `json:"-"`
  3951. // ForceSendFields is a list of field names (e.g. "Id") to
  3952. // unconditionally include in API requests. By default, fields with
  3953. // empty values are omitted from API requests. However, any non-pointer,
  3954. // non-interface field appearing in ForceSendFields will be sent to the
  3955. // server regardless of whether the field is empty or not. This may be
  3956. // used to include empty fields in Patch requests.
  3957. ForceSendFields []string `json:"-"`
  3958. // NullFields is a list of field names (e.g. "Id") to include in API
  3959. // requests with the JSON null value. By default, fields with empty
  3960. // values are omitted from API requests. However, any field with an
  3961. // empty value appearing in NullFields will be sent to the server as
  3962. // null. It is an error if a field in this list has a non-empty value.
  3963. // This may be used to include null fields in Patch requests.
  3964. NullFields []string `json:"-"`
  3965. }
  3966. func (s *BackendServiceList) MarshalJSON() ([]byte, error) {
  3967. type NoMethod BackendServiceList
  3968. raw := NoMethod(*s)
  3969. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3970. }
  3971. // BackendServiceListWarning: [Output Only] Informational warning
  3972. // message.
  3973. type BackendServiceListWarning struct {
  3974. // Code: [Output Only] A warning code, if applicable. For example,
  3975. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  3976. // the response.
  3977. //
  3978. // Possible values:
  3979. // "CLEANUP_FAILED"
  3980. // "DEPRECATED_RESOURCE_USED"
  3981. // "DEPRECATED_TYPE_USED"
  3982. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  3983. // "EXPERIMENTAL_TYPE_USED"
  3984. // "EXTERNAL_API_WARNING"
  3985. // "FIELD_VALUE_OVERRIDEN"
  3986. // "INJECTED_KERNELS_DEPRECATED"
  3987. // "MISSING_TYPE_DEPENDENCY"
  3988. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  3989. // "NEXT_HOP_CANNOT_IP_FORWARD"
  3990. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  3991. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  3992. // "NEXT_HOP_NOT_RUNNING"
  3993. // "NOT_CRITICAL_ERROR"
  3994. // "NO_RESULTS_ON_PAGE"
  3995. // "REQUIRED_TOS_AGREEMENT"
  3996. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  3997. // "RESOURCE_NOT_DELETED"
  3998. // "SCHEMA_VALIDATION_IGNORED"
  3999. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  4000. // "UNDECLARED_PROPERTIES"
  4001. // "UNREACHABLE"
  4002. Code string `json:"code,omitempty"`
  4003. // Data: [Output Only] Metadata about this warning in key: value format.
  4004. // For example:
  4005. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  4006. Data []*BackendServiceListWarningData `json:"data,omitempty"`
  4007. // Message: [Output Only] A human-readable description of the warning
  4008. // code.
  4009. Message string `json:"message,omitempty"`
  4010. // ForceSendFields is a list of field names (e.g. "Code") to
  4011. // unconditionally include in API requests. By default, fields with
  4012. // empty values are omitted from API requests. However, any non-pointer,
  4013. // non-interface field appearing in ForceSendFields will be sent to the
  4014. // server regardless of whether the field is empty or not. This may be
  4015. // used to include empty fields in Patch requests.
  4016. ForceSendFields []string `json:"-"`
  4017. // NullFields is a list of field names (e.g. "Code") to include in API
  4018. // requests with the JSON null value. By default, fields with empty
  4019. // values are omitted from API requests. However, any field with an
  4020. // empty value appearing in NullFields will be sent to the server as
  4021. // null. It is an error if a field in this list has a non-empty value.
  4022. // This may be used to include null fields in Patch requests.
  4023. NullFields []string `json:"-"`
  4024. }
  4025. func (s *BackendServiceListWarning) MarshalJSON() ([]byte, error) {
  4026. type NoMethod BackendServiceListWarning
  4027. raw := NoMethod(*s)
  4028. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4029. }
  4030. type BackendServiceListWarningData struct {
  4031. // Key: [Output Only] A key that provides more detail on the warning
  4032. // being returned. For example, for warnings where there are no results
  4033. // in a list request for a particular zone, this key might be scope and
  4034. // the key value might be the zone name. Other examples might be a key
  4035. // indicating a deprecated resource and a suggested replacement, or a
  4036. // warning about invalid network settings (for example, if an instance
  4037. // attempts to perform IP forwarding but is not enabled for IP
  4038. // forwarding).
  4039. Key string `json:"key,omitempty"`
  4040. // Value: [Output Only] A warning data value corresponding to the key.
  4041. Value string `json:"value,omitempty"`
  4042. // ForceSendFields is a list of field names (e.g. "Key") to
  4043. // unconditionally include in API requests. By default, fields with
  4044. // empty values are omitted from API requests. However, any non-pointer,
  4045. // non-interface field appearing in ForceSendFields will be sent to the
  4046. // server regardless of whether the field is empty or not. This may be
  4047. // used to include empty fields in Patch requests.
  4048. ForceSendFields []string `json:"-"`
  4049. // NullFields is a list of field names (e.g. "Key") to include in API
  4050. // requests with the JSON null value. By default, fields with empty
  4051. // values are omitted from API requests. However, any field with an
  4052. // empty value appearing in NullFields will be sent to the server as
  4053. // null. It is an error if a field in this list has a non-empty value.
  4054. // This may be used to include null fields in Patch requests.
  4055. NullFields []string `json:"-"`
  4056. }
  4057. func (s *BackendServiceListWarningData) MarshalJSON() ([]byte, error) {
  4058. type NoMethod BackendServiceListWarningData
  4059. raw := NoMethod(*s)
  4060. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4061. }
  4062. type BackendServiceReference struct {
  4063. BackendService string `json:"backendService,omitempty"`
  4064. // ForceSendFields is a list of field names (e.g. "BackendService") to
  4065. // unconditionally include in API requests. By default, fields with
  4066. // empty values are omitted from API requests. However, any non-pointer,
  4067. // non-interface field appearing in ForceSendFields will be sent to the
  4068. // server regardless of whether the field is empty or not. This may be
  4069. // used to include empty fields in Patch requests.
  4070. ForceSendFields []string `json:"-"`
  4071. // NullFields is a list of field names (e.g. "BackendService") to
  4072. // include in API requests with the JSON null value. By default, fields
  4073. // with empty values are omitted from API requests. However, any field
  4074. // with an empty value appearing in NullFields will be sent to the
  4075. // server as null. It is an error if a field in this list has a
  4076. // non-empty value. This may be used to include null fields in Patch
  4077. // requests.
  4078. NullFields []string `json:"-"`
  4079. }
  4080. func (s *BackendServiceReference) MarshalJSON() ([]byte, error) {
  4081. type NoMethod BackendServiceReference
  4082. raw := NoMethod(*s)
  4083. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4084. }
  4085. type BackendServicesScopedList struct {
  4086. // BackendServices: A list of BackendServices contained in this scope.
  4087. BackendServices []*BackendService `json:"backendServices,omitempty"`
  4088. // Warning: Informational warning which replaces the list of backend
  4089. // services when the list is empty.
  4090. Warning *BackendServicesScopedListWarning `json:"warning,omitempty"`
  4091. // ForceSendFields is a list of field names (e.g. "BackendServices") to
  4092. // unconditionally include in API requests. By default, fields with
  4093. // empty values are omitted from API requests. However, any non-pointer,
  4094. // non-interface field appearing in ForceSendFields will be sent to the
  4095. // server regardless of whether the field is empty or not. This may be
  4096. // used to include empty fields in Patch requests.
  4097. ForceSendFields []string `json:"-"`
  4098. // NullFields is a list of field names (e.g. "BackendServices") to
  4099. // include in API requests with the JSON null value. By default, fields
  4100. // with empty values are omitted from API requests. However, any field
  4101. // with an empty value appearing in NullFields will be sent to the
  4102. // server as null. It is an error if a field in this list has a
  4103. // non-empty value. This may be used to include null fields in Patch
  4104. // requests.
  4105. NullFields []string `json:"-"`
  4106. }
  4107. func (s *BackendServicesScopedList) MarshalJSON() ([]byte, error) {
  4108. type NoMethod BackendServicesScopedList
  4109. raw := NoMethod(*s)
  4110. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4111. }
  4112. // BackendServicesScopedListWarning: Informational warning which
  4113. // replaces the list of backend services when the list is empty.
  4114. type BackendServicesScopedListWarning struct {
  4115. // Code: [Output Only] A warning code, if applicable. For example,
  4116. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  4117. // the response.
  4118. //
  4119. // Possible values:
  4120. // "CLEANUP_FAILED"
  4121. // "DEPRECATED_RESOURCE_USED"
  4122. // "DEPRECATED_TYPE_USED"
  4123. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  4124. // "EXPERIMENTAL_TYPE_USED"
  4125. // "EXTERNAL_API_WARNING"
  4126. // "FIELD_VALUE_OVERRIDEN"
  4127. // "INJECTED_KERNELS_DEPRECATED"
  4128. // "MISSING_TYPE_DEPENDENCY"
  4129. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  4130. // "NEXT_HOP_CANNOT_IP_FORWARD"
  4131. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  4132. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  4133. // "NEXT_HOP_NOT_RUNNING"
  4134. // "NOT_CRITICAL_ERROR"
  4135. // "NO_RESULTS_ON_PAGE"
  4136. // "REQUIRED_TOS_AGREEMENT"
  4137. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  4138. // "RESOURCE_NOT_DELETED"
  4139. // "SCHEMA_VALIDATION_IGNORED"
  4140. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  4141. // "UNDECLARED_PROPERTIES"
  4142. // "UNREACHABLE"
  4143. Code string `json:"code,omitempty"`
  4144. // Data: [Output Only] Metadata about this warning in key: value format.
  4145. // For example:
  4146. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  4147. Data []*BackendServicesScopedListWarningData `json:"data,omitempty"`
  4148. // Message: [Output Only] A human-readable description of the warning
  4149. // code.
  4150. Message string `json:"message,omitempty"`
  4151. // ForceSendFields is a list of field names (e.g. "Code") to
  4152. // unconditionally include in API requests. By default, fields with
  4153. // empty values are omitted from API requests. However, any non-pointer,
  4154. // non-interface field appearing in ForceSendFields will be sent to the
  4155. // server regardless of whether the field is empty or not. This may be
  4156. // used to include empty fields in Patch requests.
  4157. ForceSendFields []string `json:"-"`
  4158. // NullFields is a list of field names (e.g. "Code") to include in API
  4159. // requests with the JSON null value. By default, fields with empty
  4160. // values are omitted from API requests. However, any field with an
  4161. // empty value appearing in NullFields will be sent to the server as
  4162. // null. It is an error if a field in this list has a non-empty value.
  4163. // This may be used to include null fields in Patch requests.
  4164. NullFields []string `json:"-"`
  4165. }
  4166. func (s *BackendServicesScopedListWarning) MarshalJSON() ([]byte, error) {
  4167. type NoMethod BackendServicesScopedListWarning
  4168. raw := NoMethod(*s)
  4169. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4170. }
  4171. type BackendServicesScopedListWarningData struct {
  4172. // Key: [Output Only] A key that provides more detail on the warning
  4173. // being returned. For example, for warnings where there are no results
  4174. // in a list request for a particular zone, this key might be scope and
  4175. // the key value might be the zone name. Other examples might be a key
  4176. // indicating a deprecated resource and a suggested replacement, or a
  4177. // warning about invalid network settings (for example, if an instance
  4178. // attempts to perform IP forwarding but is not enabled for IP
  4179. // forwarding).
  4180. Key string `json:"key,omitempty"`
  4181. // Value: [Output Only] A warning data value corresponding to the key.
  4182. Value string `json:"value,omitempty"`
  4183. // ForceSendFields is a list of field names (e.g. "Key") to
  4184. // unconditionally include in API requests. By default, fields with
  4185. // empty values are omitted from API requests. However, any non-pointer,
  4186. // non-interface field appearing in ForceSendFields will be sent to the
  4187. // server regardless of whether the field is empty or not. This may be
  4188. // used to include empty fields in Patch requests.
  4189. ForceSendFields []string `json:"-"`
  4190. // NullFields is a list of field names (e.g. "Key") to include in API
  4191. // requests with the JSON null value. By default, fields with empty
  4192. // values are omitted from API requests. However, any field with an
  4193. // empty value appearing in NullFields will be sent to the server as
  4194. // null. It is an error if a field in this list has a non-empty value.
  4195. // This may be used to include null fields in Patch requests.
  4196. NullFields []string `json:"-"`
  4197. }
  4198. func (s *BackendServicesScopedListWarningData) MarshalJSON() ([]byte, error) {
  4199. type NoMethod BackendServicesScopedListWarningData
  4200. raw := NoMethod(*s)
  4201. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4202. }
  4203. // Binding: Associates `members` with a `role`.
  4204. type Binding struct {
  4205. // Condition: The condition that is associated with this binding. NOTE:
  4206. // an unsatisfied condition will not allow user access via current
  4207. // binding. Different bindings, including their conditions, are examined
  4208. // independently. This field is only visible as GOOGLE_INTERNAL or
  4209. // CONDITION_TRUSTED_TESTER.
  4210. Condition *Expr `json:"condition,omitempty"`
  4211. // Members: Specifies the identities requesting access for a Cloud
  4212. // Platform resource. `members` can have the following values:
  4213. //
  4214. // * `allUsers`: A special identifier that represents anyone who is on
  4215. // the internet; with or without a Google account.
  4216. //
  4217. // * `allAuthenticatedUsers`: A special identifier that represents
  4218. // anyone who is authenticated with a Google account or a service
  4219. // account.
  4220. //
  4221. // * `user:{emailid}`: An email address that represents a specific
  4222. // Google account. For example, `alice@gmail.com` .
  4223. //
  4224. //
  4225. //
  4226. // * `serviceAccount:{emailid}`: An email address that represents a
  4227. // service account. For example,
  4228. // `my-other-app@appspot.gserviceaccount.com`.
  4229. //
  4230. // * `group:{emailid}`: An email address that represents a Google group.
  4231. // For example, `admins@example.com`.
  4232. //
  4233. //
  4234. //
  4235. // * `domain:{domain}`: A Google Apps domain name that represents all
  4236. // the users of that domain. For example, `google.com` or `example.com`.
  4237. Members []string `json:"members,omitempty"`
  4238. // Role: Role that is assigned to `members`. For example,
  4239. // `roles/viewer`, `roles/editor`, or `roles/owner`.
  4240. Role string `json:"role,omitempty"`
  4241. // ForceSendFields is a list of field names (e.g. "Condition") 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. "Condition") to include in
  4249. // API requests with the JSON null value. By default, fields with empty
  4250. // values are omitted from API requests. However, any field with an
  4251. // 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 *Binding) MarshalJSON() ([]byte, error) {
  4257. type NoMethod Binding
  4258. raw := NoMethod(*s)
  4259. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4260. }
  4261. type CacheInvalidationRule struct {
  4262. // Host: If set, this invalidation rule will only apply to requests with
  4263. // a Host header matching host.
  4264. Host string `json:"host,omitempty"`
  4265. Path string `json:"path,omitempty"`
  4266. // ForceSendFields is a list of field names (e.g. "Host") to
  4267. // unconditionally include in API requests. By default, fields with
  4268. // empty values are omitted from API requests. However, any non-pointer,
  4269. // non-interface field appearing in ForceSendFields will be sent to the
  4270. // server regardless of whether the field is empty or not. This may be
  4271. // used to include empty fields in Patch requests.
  4272. ForceSendFields []string `json:"-"`
  4273. // NullFields is a list of field names (e.g. "Host") to include in API
  4274. // requests with the JSON null value. By default, fields with empty
  4275. // values are omitted from API requests. However, any field with an
  4276. // empty value appearing in NullFields will be sent to the server as
  4277. // null. It is an error if a field in this list has a non-empty value.
  4278. // This may be used to include null fields in Patch requests.
  4279. NullFields []string `json:"-"`
  4280. }
  4281. func (s *CacheInvalidationRule) MarshalJSON() ([]byte, error) {
  4282. type NoMethod CacheInvalidationRule
  4283. raw := NoMethod(*s)
  4284. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4285. }
  4286. // CacheKeyPolicy: Message containing what to include in the cache key
  4287. // for a request for Cloud CDN.
  4288. type CacheKeyPolicy struct {
  4289. // IncludeHost: If true, requests to different hosts will be cached
  4290. // separately.
  4291. IncludeHost bool `json:"includeHost,omitempty"`
  4292. // IncludeProtocol: If true, http and https requests will be cached
  4293. // separately.
  4294. IncludeProtocol bool `json:"includeProtocol,omitempty"`
  4295. // IncludeQueryString: If true, include query string parameters in the
  4296. // cache key according to query_string_whitelist and
  4297. // query_string_blacklist. If neither is set, the entire query string
  4298. // will be included. If false, the query string will be excluded from
  4299. // the cache key entirely.
  4300. IncludeQueryString bool `json:"includeQueryString,omitempty"`
  4301. // QueryStringBlacklist: Names of query string parameters to exclude in
  4302. // cache keys. All other parameters will be included. Either specify
  4303. // query_string_whitelist or query_string_blacklist, not both. '&' and
  4304. // '=' will be percent encoded and not treated as delimiters.
  4305. QueryStringBlacklist []string `json:"queryStringBlacklist,omitempty"`
  4306. // QueryStringWhitelist: Names of query string parameters to include in
  4307. // cache keys. All other parameters will be excluded. Either specify
  4308. // query_string_whitelist or query_string_blacklist, not both. '&' and
  4309. // '=' will be percent encoded and not treated as delimiters.
  4310. QueryStringWhitelist []string `json:"queryStringWhitelist,omitempty"`
  4311. // ForceSendFields is a list of field names (e.g. "IncludeHost") to
  4312. // unconditionally include in API requests. By default, fields with
  4313. // empty values are omitted from API requests. However, any non-pointer,
  4314. // non-interface field appearing in ForceSendFields will be sent to the
  4315. // server regardless of whether the field is empty or not. This may be
  4316. // used to include empty fields in Patch requests.
  4317. ForceSendFields []string `json:"-"`
  4318. // NullFields is a list of field names (e.g. "IncludeHost") to include
  4319. // in API requests with the JSON null value. By default, fields with
  4320. // empty values are omitted from API requests. However, any field with
  4321. // an empty value appearing in NullFields will be sent to the server as
  4322. // null. It is an error if a field in this list has a non-empty value.
  4323. // This may be used to include null fields in Patch requests.
  4324. NullFields []string `json:"-"`
  4325. }
  4326. func (s *CacheKeyPolicy) MarshalJSON() ([]byte, error) {
  4327. type NoMethod CacheKeyPolicy
  4328. raw := NoMethod(*s)
  4329. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4330. }
  4331. // Commitment: Represents a Commitment resource. Creating a Commitment
  4332. // resource means that you are purchasing a committed use contract with
  4333. // an explicit start and end time. You can create commitments based on
  4334. // vCPUs and memory usage and receive discounted rates. For full
  4335. // details, read Signing Up for Committed Use Discounts.
  4336. //
  4337. // Committed use discounts are subject to Google Cloud Platform's
  4338. // Service Specific Terms. By purchasing a committed use discount, you
  4339. // agree to these terms. Committed use discounts will not renew, so you
  4340. // must purchase a new commitment to continue receiving discounts. (==
  4341. // resource_for beta.commitments ==) (== resource_for v1.commitments ==)
  4342. type Commitment struct {
  4343. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  4344. // format.
  4345. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  4346. // Description: An optional description of this resource. Provide this
  4347. // property when you create the resource.
  4348. Description string `json:"description,omitempty"`
  4349. // EndTimestamp: [Output Only] Commitment end time in RFC3339 text
  4350. // format.
  4351. EndTimestamp string `json:"endTimestamp,omitempty"`
  4352. // Id: [Output Only] The unique identifier for the resource. This
  4353. // identifier is defined by the server.
  4354. Id uint64 `json:"id,omitempty,string"`
  4355. // Kind: [Output Only] Type of the resource. Always compute#commitment
  4356. // for commitments.
  4357. Kind string `json:"kind,omitempty"`
  4358. // Name: Name of the resource. Provided by the client when the resource
  4359. // is created. The name must be 1-63 characters long, and comply with
  4360. // RFC1035. Specifically, the name must be 1-63 characters long and
  4361. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  4362. // the first character must be a lowercase letter, and all following
  4363. // characters must be a dash, lowercase letter, or digit, except the
  4364. // last character, which cannot be a dash.
  4365. Name string `json:"name,omitempty"`
  4366. // Plan: The plan for this commitment, which determines duration and
  4367. // discount rate. The currently supported plans are TWELVE_MONTH (1
  4368. // year), and THIRTY_SIX_MONTH (3 years).
  4369. //
  4370. // Possible values:
  4371. // "INVALID"
  4372. // "THIRTY_SIX_MONTH"
  4373. // "TWELVE_MONTH"
  4374. Plan string `json:"plan,omitempty"`
  4375. // Region: [Output Only] URL of the region where this commitment may be
  4376. // used.
  4377. Region string `json:"region,omitempty"`
  4378. // Resources: A list of commitment amounts for particular resources.
  4379. // Note that VCPU and MEMORY resource commitments must occur together.
  4380. Resources []*ResourceCommitment `json:"resources,omitempty"`
  4381. // SelfLink: [Output Only] Server-defined URL for the resource.
  4382. SelfLink string `json:"selfLink,omitempty"`
  4383. // StartTimestamp: [Output Only] Commitment start time in RFC3339 text
  4384. // format.
  4385. StartTimestamp string `json:"startTimestamp,omitempty"`
  4386. // Status: [Output Only] Status of the commitment with regards to
  4387. // eventual expiration (each commitment has an end date defined). One of
  4388. // the following values: NOT_YET_ACTIVE, ACTIVE, EXPIRED.
  4389. //
  4390. // Possible values:
  4391. // "ACTIVE"
  4392. // "CREATING"
  4393. // "EXPIRED"
  4394. // "NOT_YET_ACTIVE"
  4395. Status string `json:"status,omitempty"`
  4396. // StatusMessage: [Output Only] An optional, human-readable explanation
  4397. // of the status.
  4398. StatusMessage string `json:"statusMessage,omitempty"`
  4399. // Type: The type of commitment, which affects the discount rate and the
  4400. // eligible resources. Type MEMORY_OPTIMIZED specifies a commitment that
  4401. // will only apply to memory optimized machines.
  4402. //
  4403. // Possible values:
  4404. // "GENERAL_PURPOSE"
  4405. // "MEMORY_OPTIMIZED"
  4406. // "TYPE_UNSPECIFIED"
  4407. Type string `json:"type,omitempty"`
  4408. // ServerResponse contains the HTTP response code and headers from the
  4409. // server.
  4410. googleapi.ServerResponse `json:"-"`
  4411. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  4412. // to unconditionally include in API requests. By default, fields with
  4413. // empty values are omitted from API requests. However, any non-pointer,
  4414. // non-interface field appearing in ForceSendFields will be sent to the
  4415. // server regardless of whether the field is empty or not. This may be
  4416. // used to include empty fields in Patch requests.
  4417. ForceSendFields []string `json:"-"`
  4418. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  4419. // include in API requests with the JSON null value. By default, fields
  4420. // with empty values are omitted from API requests. However, any field
  4421. // with an empty value appearing in NullFields will be sent to the
  4422. // server as null. It is an error if a field in this list has a
  4423. // non-empty value. This may be used to include null fields in Patch
  4424. // requests.
  4425. NullFields []string `json:"-"`
  4426. }
  4427. func (s *Commitment) MarshalJSON() ([]byte, error) {
  4428. type NoMethod Commitment
  4429. raw := NoMethod(*s)
  4430. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4431. }
  4432. type CommitmentAggregatedList struct {
  4433. // Id: [Output Only] Unique identifier for the resource; defined by the
  4434. // server.
  4435. Id string `json:"id,omitempty"`
  4436. // Items: A list of CommitmentsScopedList resources.
  4437. Items map[string]CommitmentsScopedList `json:"items,omitempty"`
  4438. // Kind: [Output Only] Type of resource. Always
  4439. // compute#commitmentAggregatedList for aggregated lists of commitments.
  4440. Kind string `json:"kind,omitempty"`
  4441. // NextPageToken: [Output Only] This token allows you to get the next
  4442. // page of results for list requests. If the number of results is larger
  4443. // than maxResults, use the nextPageToken as a value for the query
  4444. // parameter pageToken in the next list request. Subsequent list
  4445. // requests will have their own nextPageToken to continue paging through
  4446. // the results.
  4447. NextPageToken string `json:"nextPageToken,omitempty"`
  4448. // SelfLink: [Output Only] Server-defined URL for this resource.
  4449. SelfLink string `json:"selfLink,omitempty"`
  4450. // Warning: [Output Only] Informational warning message.
  4451. Warning *CommitmentAggregatedListWarning `json:"warning,omitempty"`
  4452. // ServerResponse contains the HTTP response code and headers from the
  4453. // server.
  4454. googleapi.ServerResponse `json:"-"`
  4455. // ForceSendFields is a list of field names (e.g. "Id") to
  4456. // unconditionally include in API requests. By default, fields with
  4457. // empty values are omitted from API requests. However, any non-pointer,
  4458. // non-interface field appearing in ForceSendFields will be sent to the
  4459. // server regardless of whether the field is empty or not. This may be
  4460. // used to include empty fields in Patch requests.
  4461. ForceSendFields []string `json:"-"`
  4462. // NullFields is a list of field names (e.g. "Id") to include in API
  4463. // requests with the JSON null value. By default, fields with empty
  4464. // values are omitted from API requests. However, any field with an
  4465. // empty value appearing in NullFields will be sent to the server as
  4466. // null. It is an error if a field in this list has a non-empty value.
  4467. // This may be used to include null fields in Patch requests.
  4468. NullFields []string `json:"-"`
  4469. }
  4470. func (s *CommitmentAggregatedList) MarshalJSON() ([]byte, error) {
  4471. type NoMethod CommitmentAggregatedList
  4472. raw := NoMethod(*s)
  4473. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4474. }
  4475. // CommitmentAggregatedListWarning: [Output Only] Informational warning
  4476. // message.
  4477. type CommitmentAggregatedListWarning struct {
  4478. // Code: [Output Only] A warning code, if applicable. For example,
  4479. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  4480. // the response.
  4481. //
  4482. // Possible values:
  4483. // "CLEANUP_FAILED"
  4484. // "DEPRECATED_RESOURCE_USED"
  4485. // "DEPRECATED_TYPE_USED"
  4486. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  4487. // "EXPERIMENTAL_TYPE_USED"
  4488. // "EXTERNAL_API_WARNING"
  4489. // "FIELD_VALUE_OVERRIDEN"
  4490. // "INJECTED_KERNELS_DEPRECATED"
  4491. // "MISSING_TYPE_DEPENDENCY"
  4492. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  4493. // "NEXT_HOP_CANNOT_IP_FORWARD"
  4494. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  4495. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  4496. // "NEXT_HOP_NOT_RUNNING"
  4497. // "NOT_CRITICAL_ERROR"
  4498. // "NO_RESULTS_ON_PAGE"
  4499. // "REQUIRED_TOS_AGREEMENT"
  4500. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  4501. // "RESOURCE_NOT_DELETED"
  4502. // "SCHEMA_VALIDATION_IGNORED"
  4503. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  4504. // "UNDECLARED_PROPERTIES"
  4505. // "UNREACHABLE"
  4506. Code string `json:"code,omitempty"`
  4507. // Data: [Output Only] Metadata about this warning in key: value format.
  4508. // For example:
  4509. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  4510. Data []*CommitmentAggregatedListWarningData `json:"data,omitempty"`
  4511. // Message: [Output Only] A human-readable description of the warning
  4512. // code.
  4513. Message string `json:"message,omitempty"`
  4514. // ForceSendFields is a list of field names (e.g. "Code") to
  4515. // unconditionally include in API requests. By default, fields with
  4516. // empty values are omitted from API requests. However, any non-pointer,
  4517. // non-interface field appearing in ForceSendFields will be sent to the
  4518. // server regardless of whether the field is empty or not. This may be
  4519. // used to include empty fields in Patch requests.
  4520. ForceSendFields []string `json:"-"`
  4521. // NullFields is a list of field names (e.g. "Code") to include in API
  4522. // requests with the JSON null value. By default, fields with empty
  4523. // values are omitted from API requests. However, any field with an
  4524. // empty value appearing in NullFields will be sent to the server as
  4525. // null. It is an error if a field in this list has a non-empty value.
  4526. // This may be used to include null fields in Patch requests.
  4527. NullFields []string `json:"-"`
  4528. }
  4529. func (s *CommitmentAggregatedListWarning) MarshalJSON() ([]byte, error) {
  4530. type NoMethod CommitmentAggregatedListWarning
  4531. raw := NoMethod(*s)
  4532. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4533. }
  4534. type CommitmentAggregatedListWarningData struct {
  4535. // Key: [Output Only] A key that provides more detail on the warning
  4536. // being returned. For example, for warnings where there are no results
  4537. // in a list request for a particular zone, this key might be scope and
  4538. // the key value might be the zone name. Other examples might be a key
  4539. // indicating a deprecated resource and a suggested replacement, or a
  4540. // warning about invalid network settings (for example, if an instance
  4541. // attempts to perform IP forwarding but is not enabled for IP
  4542. // forwarding).
  4543. Key string `json:"key,omitempty"`
  4544. // Value: [Output Only] A warning data value corresponding to the key.
  4545. Value string `json:"value,omitempty"`
  4546. // ForceSendFields is a list of field names (e.g. "Key") to
  4547. // unconditionally include in API requests. By default, fields with
  4548. // empty values are omitted from API requests. However, any non-pointer,
  4549. // non-interface field appearing in ForceSendFields will be sent to the
  4550. // server regardless of whether the field is empty or not. This may be
  4551. // used to include empty fields in Patch requests.
  4552. ForceSendFields []string `json:"-"`
  4553. // NullFields is a list of field names (e.g. "Key") to include in API
  4554. // requests with the JSON null value. By default, fields with empty
  4555. // values are omitted from API requests. However, any field with an
  4556. // empty value appearing in NullFields will be sent to the server as
  4557. // null. It is an error if a field in this list has a non-empty value.
  4558. // This may be used to include null fields in Patch requests.
  4559. NullFields []string `json:"-"`
  4560. }
  4561. func (s *CommitmentAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  4562. type NoMethod CommitmentAggregatedListWarningData
  4563. raw := NoMethod(*s)
  4564. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4565. }
  4566. // CommitmentList: Contains a list of Commitment resources.
  4567. type CommitmentList struct {
  4568. // Id: [Output Only] Unique identifier for the resource; defined by the
  4569. // server.
  4570. Id string `json:"id,omitempty"`
  4571. // Items: A list of Commitment resources.
  4572. Items []*Commitment `json:"items,omitempty"`
  4573. // Kind: [Output Only] Type of resource. Always compute#commitmentList
  4574. // for lists of commitments.
  4575. Kind string `json:"kind,omitempty"`
  4576. // NextPageToken: [Output Only] This token allows you to get the next
  4577. // page of results for list requests. If the number of results is larger
  4578. // than maxResults, use the nextPageToken as a value for the query
  4579. // parameter pageToken in the next list request. Subsequent list
  4580. // requests will have their own nextPageToken to continue paging through
  4581. // the results.
  4582. NextPageToken string `json:"nextPageToken,omitempty"`
  4583. // SelfLink: [Output Only] Server-defined URL for this resource.
  4584. SelfLink string `json:"selfLink,omitempty"`
  4585. // Warning: [Output Only] Informational warning message.
  4586. Warning *CommitmentListWarning `json:"warning,omitempty"`
  4587. // ServerResponse contains the HTTP response code and headers from the
  4588. // server.
  4589. googleapi.ServerResponse `json:"-"`
  4590. // ForceSendFields is a list of field names (e.g. "Id") 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. "Id") 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 *CommitmentList) MarshalJSON() ([]byte, error) {
  4606. type NoMethod CommitmentList
  4607. raw := NoMethod(*s)
  4608. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4609. }
  4610. // CommitmentListWarning: [Output Only] Informational warning message.
  4611. type CommitmentListWarning struct {
  4612. // Code: [Output Only] A warning code, if applicable. For example,
  4613. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  4614. // the response.
  4615. //
  4616. // Possible values:
  4617. // "CLEANUP_FAILED"
  4618. // "DEPRECATED_RESOURCE_USED"
  4619. // "DEPRECATED_TYPE_USED"
  4620. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  4621. // "EXPERIMENTAL_TYPE_USED"
  4622. // "EXTERNAL_API_WARNING"
  4623. // "FIELD_VALUE_OVERRIDEN"
  4624. // "INJECTED_KERNELS_DEPRECATED"
  4625. // "MISSING_TYPE_DEPENDENCY"
  4626. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  4627. // "NEXT_HOP_CANNOT_IP_FORWARD"
  4628. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  4629. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  4630. // "NEXT_HOP_NOT_RUNNING"
  4631. // "NOT_CRITICAL_ERROR"
  4632. // "NO_RESULTS_ON_PAGE"
  4633. // "REQUIRED_TOS_AGREEMENT"
  4634. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  4635. // "RESOURCE_NOT_DELETED"
  4636. // "SCHEMA_VALIDATION_IGNORED"
  4637. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  4638. // "UNDECLARED_PROPERTIES"
  4639. // "UNREACHABLE"
  4640. Code string `json:"code,omitempty"`
  4641. // Data: [Output Only] Metadata about this warning in key: value format.
  4642. // For example:
  4643. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  4644. Data []*CommitmentListWarningData `json:"data,omitempty"`
  4645. // Message: [Output Only] A human-readable description of the warning
  4646. // code.
  4647. Message string `json:"message,omitempty"`
  4648. // ForceSendFields is a list of field names (e.g. "Code") to
  4649. // unconditionally include in API requests. By default, fields with
  4650. // empty values are omitted from API requests. However, any non-pointer,
  4651. // non-interface field appearing in ForceSendFields will be sent to the
  4652. // server regardless of whether the field is empty or not. This may be
  4653. // used to include empty fields in Patch requests.
  4654. ForceSendFields []string `json:"-"`
  4655. // NullFields is a list of field names (e.g. "Code") to include in API
  4656. // requests with the JSON null value. By default, fields with empty
  4657. // values are omitted from API requests. However, any field with an
  4658. // empty value appearing in NullFields will be sent to the server as
  4659. // null. It is an error if a field in this list has a non-empty value.
  4660. // This may be used to include null fields in Patch requests.
  4661. NullFields []string `json:"-"`
  4662. }
  4663. func (s *CommitmentListWarning) MarshalJSON() ([]byte, error) {
  4664. type NoMethod CommitmentListWarning
  4665. raw := NoMethod(*s)
  4666. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4667. }
  4668. type CommitmentListWarningData struct {
  4669. // Key: [Output Only] A key that provides more detail on the warning
  4670. // being returned. For example, for warnings where there are no results
  4671. // in a list request for a particular zone, this key might be scope and
  4672. // the key value might be the zone name. Other examples might be a key
  4673. // indicating a deprecated resource and a suggested replacement, or a
  4674. // warning about invalid network settings (for example, if an instance
  4675. // attempts to perform IP forwarding but is not enabled for IP
  4676. // forwarding).
  4677. Key string `json:"key,omitempty"`
  4678. // Value: [Output Only] A warning data value corresponding to the key.
  4679. Value string `json:"value,omitempty"`
  4680. // ForceSendFields is a list of field names (e.g. "Key") to
  4681. // unconditionally include in API requests. By default, fields with
  4682. // empty values are omitted from API requests. However, any non-pointer,
  4683. // non-interface field appearing in ForceSendFields will be sent to the
  4684. // server regardless of whether the field is empty or not. This may be
  4685. // used to include empty fields in Patch requests.
  4686. ForceSendFields []string `json:"-"`
  4687. // NullFields is a list of field names (e.g. "Key") to include in API
  4688. // requests with the JSON null value. By default, fields with empty
  4689. // values are omitted from API requests. However, any field with an
  4690. // empty value appearing in NullFields will be sent to the server as
  4691. // null. It is an error if a field in this list has a non-empty value.
  4692. // This may be used to include null fields in Patch requests.
  4693. NullFields []string `json:"-"`
  4694. }
  4695. func (s *CommitmentListWarningData) MarshalJSON() ([]byte, error) {
  4696. type NoMethod CommitmentListWarningData
  4697. raw := NoMethod(*s)
  4698. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4699. }
  4700. type CommitmentsScopedList struct {
  4701. // Commitments: [Output Only] A list of commitments contained in this
  4702. // scope.
  4703. Commitments []*Commitment `json:"commitments,omitempty"`
  4704. // Warning: [Output Only] Informational warning which replaces the list
  4705. // of commitments when the list is empty.
  4706. Warning *CommitmentsScopedListWarning `json:"warning,omitempty"`
  4707. // ForceSendFields is a list of field names (e.g. "Commitments") to
  4708. // unconditionally include in API requests. By default, fields with
  4709. // empty values are omitted from API requests. However, any non-pointer,
  4710. // non-interface field appearing in ForceSendFields will be sent to the
  4711. // server regardless of whether the field is empty or not. This may be
  4712. // used to include empty fields in Patch requests.
  4713. ForceSendFields []string `json:"-"`
  4714. // NullFields is a list of field names (e.g. "Commitments") to include
  4715. // in API requests with the JSON null value. By default, fields with
  4716. // empty values are omitted from API requests. However, any field with
  4717. // an empty value appearing in NullFields will be sent to the server as
  4718. // null. It is an error if a field in this list has a non-empty value.
  4719. // This may be used to include null fields in Patch requests.
  4720. NullFields []string `json:"-"`
  4721. }
  4722. func (s *CommitmentsScopedList) MarshalJSON() ([]byte, error) {
  4723. type NoMethod CommitmentsScopedList
  4724. raw := NoMethod(*s)
  4725. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4726. }
  4727. // CommitmentsScopedListWarning: [Output Only] Informational warning
  4728. // which replaces the list of commitments when the list is empty.
  4729. type CommitmentsScopedListWarning struct {
  4730. // Code: [Output Only] A warning code, if applicable. For example,
  4731. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  4732. // the response.
  4733. //
  4734. // Possible values:
  4735. // "CLEANUP_FAILED"
  4736. // "DEPRECATED_RESOURCE_USED"
  4737. // "DEPRECATED_TYPE_USED"
  4738. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  4739. // "EXPERIMENTAL_TYPE_USED"
  4740. // "EXTERNAL_API_WARNING"
  4741. // "FIELD_VALUE_OVERRIDEN"
  4742. // "INJECTED_KERNELS_DEPRECATED"
  4743. // "MISSING_TYPE_DEPENDENCY"
  4744. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  4745. // "NEXT_HOP_CANNOT_IP_FORWARD"
  4746. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  4747. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  4748. // "NEXT_HOP_NOT_RUNNING"
  4749. // "NOT_CRITICAL_ERROR"
  4750. // "NO_RESULTS_ON_PAGE"
  4751. // "REQUIRED_TOS_AGREEMENT"
  4752. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  4753. // "RESOURCE_NOT_DELETED"
  4754. // "SCHEMA_VALIDATION_IGNORED"
  4755. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  4756. // "UNDECLARED_PROPERTIES"
  4757. // "UNREACHABLE"
  4758. Code string `json:"code,omitempty"`
  4759. // Data: [Output Only] Metadata about this warning in key: value format.
  4760. // For example:
  4761. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  4762. Data []*CommitmentsScopedListWarningData `json:"data,omitempty"`
  4763. // Message: [Output Only] A human-readable description of the warning
  4764. // code.
  4765. Message string `json:"message,omitempty"`
  4766. // ForceSendFields is a list of field names (e.g. "Code") to
  4767. // unconditionally include in API requests. By default, fields with
  4768. // empty values are omitted from API requests. However, any non-pointer,
  4769. // non-interface field appearing in ForceSendFields will be sent to the
  4770. // server regardless of whether the field is empty or not. This may be
  4771. // used to include empty fields in Patch requests.
  4772. ForceSendFields []string `json:"-"`
  4773. // NullFields is a list of field names (e.g. "Code") to include in API
  4774. // requests with the JSON null value. By default, fields with empty
  4775. // values are omitted from API requests. However, any field with an
  4776. // empty value appearing in NullFields will be sent to the server as
  4777. // null. It is an error if a field in this list has a non-empty value.
  4778. // This may be used to include null fields in Patch requests.
  4779. NullFields []string `json:"-"`
  4780. }
  4781. func (s *CommitmentsScopedListWarning) MarshalJSON() ([]byte, error) {
  4782. type NoMethod CommitmentsScopedListWarning
  4783. raw := NoMethod(*s)
  4784. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4785. }
  4786. type CommitmentsScopedListWarningData struct {
  4787. // Key: [Output Only] A key that provides more detail on the warning
  4788. // being returned. For example, for warnings where there are no results
  4789. // in a list request for a particular zone, this key might be scope and
  4790. // the key value might be the zone name. Other examples might be a key
  4791. // indicating a deprecated resource and a suggested replacement, or a
  4792. // warning about invalid network settings (for example, if an instance
  4793. // attempts to perform IP forwarding but is not enabled for IP
  4794. // forwarding).
  4795. Key string `json:"key,omitempty"`
  4796. // Value: [Output Only] A warning data value corresponding to the key.
  4797. Value string `json:"value,omitempty"`
  4798. // ForceSendFields is a list of field names (e.g. "Key") to
  4799. // unconditionally include in API requests. By default, fields with
  4800. // empty values are omitted from API requests. However, any non-pointer,
  4801. // non-interface field appearing in ForceSendFields will be sent to the
  4802. // server regardless of whether the field is empty or not. This may be
  4803. // used to include empty fields in Patch requests.
  4804. ForceSendFields []string `json:"-"`
  4805. // NullFields is a list of field names (e.g. "Key") to include in API
  4806. // requests with the JSON null value. By default, fields with empty
  4807. // values are omitted from API requests. However, any field with an
  4808. // empty value appearing in NullFields will be sent to the server as
  4809. // null. It is an error if a field in this list has a non-empty value.
  4810. // This may be used to include null fields in Patch requests.
  4811. NullFields []string `json:"-"`
  4812. }
  4813. func (s *CommitmentsScopedListWarningData) MarshalJSON() ([]byte, error) {
  4814. type NoMethod CommitmentsScopedListWarningData
  4815. raw := NoMethod(*s)
  4816. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4817. }
  4818. // Condition: A condition to be met.
  4819. type Condition struct {
  4820. // Iam: Trusted attributes supplied by the IAM system.
  4821. //
  4822. // Possible values:
  4823. // "APPROVER"
  4824. // "ATTRIBUTION"
  4825. // "AUTHORITY"
  4826. // "CREDENTIALS_TYPE"
  4827. // "JUSTIFICATION_TYPE"
  4828. // "NO_ATTR"
  4829. // "SECURITY_REALM"
  4830. Iam string `json:"iam,omitempty"`
  4831. // Op: An operator to apply the subject with.
  4832. //
  4833. // Possible values:
  4834. // "DISCHARGED"
  4835. // "EQUALS"
  4836. // "IN"
  4837. // "NOT_EQUALS"
  4838. // "NOT_IN"
  4839. // "NO_OP"
  4840. Op string `json:"op,omitempty"`
  4841. // Svc: Trusted attributes discharged by the service.
  4842. Svc string `json:"svc,omitempty"`
  4843. // Sys: Trusted attributes supplied by any service that owns resources
  4844. // and uses the IAM system for access control.
  4845. //
  4846. // Possible values:
  4847. // "IP"
  4848. // "NAME"
  4849. // "NO_ATTR"
  4850. // "REGION"
  4851. // "SERVICE"
  4852. Sys string `json:"sys,omitempty"`
  4853. // Value: DEPRECATED. Use 'values' instead.
  4854. Value string `json:"value,omitempty"`
  4855. // Values: The objects of the condition. This is mutually exclusive with
  4856. // 'value'.
  4857. Values []string `json:"values,omitempty"`
  4858. // ForceSendFields is a list of field names (e.g. "Iam") to
  4859. // unconditionally include in API requests. By default, fields with
  4860. // empty values are omitted from API requests. However, any non-pointer,
  4861. // non-interface field appearing in ForceSendFields will be sent to the
  4862. // server regardless of whether the field is empty or not. This may be
  4863. // used to include empty fields in Patch requests.
  4864. ForceSendFields []string `json:"-"`
  4865. // NullFields is a list of field names (e.g. "Iam") to include in API
  4866. // requests with the JSON null value. By default, fields with empty
  4867. // values are omitted from API requests. However, any field with an
  4868. // empty value appearing in NullFields will be sent to the server as
  4869. // null. It is an error if a field in this list has a non-empty value.
  4870. // This may be used to include null fields in Patch requests.
  4871. NullFields []string `json:"-"`
  4872. }
  4873. func (s *Condition) MarshalJSON() ([]byte, error) {
  4874. type NoMethod Condition
  4875. raw := NoMethod(*s)
  4876. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4877. }
  4878. // ConnectionDraining: Message containing connection draining
  4879. // configuration.
  4880. type ConnectionDraining struct {
  4881. // DrainingTimeoutSec: Time for which instance will be drained (not
  4882. // accept new connections, but still work to finish started).
  4883. DrainingTimeoutSec int64 `json:"drainingTimeoutSec,omitempty"`
  4884. // ForceSendFields is a list of field names (e.g. "DrainingTimeoutSec")
  4885. // to unconditionally include in API requests. By default, fields with
  4886. // empty values are omitted from API requests. However, any non-pointer,
  4887. // non-interface field appearing in ForceSendFields will be sent to the
  4888. // server regardless of whether the field is empty or not. This may be
  4889. // used to include empty fields in Patch requests.
  4890. ForceSendFields []string `json:"-"`
  4891. // NullFields is a list of field names (e.g. "DrainingTimeoutSec") to
  4892. // include in API requests with the JSON null value. By default, fields
  4893. // with empty values are omitted from API requests. However, any field
  4894. // with an empty value appearing in NullFields will be sent to the
  4895. // server as null. It is an error if a field in this list has a
  4896. // non-empty value. This may be used to include null fields in Patch
  4897. // requests.
  4898. NullFields []string `json:"-"`
  4899. }
  4900. func (s *ConnectionDraining) MarshalJSON() ([]byte, error) {
  4901. type NoMethod ConnectionDraining
  4902. raw := NoMethod(*s)
  4903. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4904. }
  4905. // CustomerEncryptionKey: Represents a customer-supplied encryption key
  4906. type CustomerEncryptionKey struct {
  4907. // KmsKeyName: The name of the encryption key that is stored in Google
  4908. // Cloud KMS.
  4909. KmsKeyName string `json:"kmsKeyName,omitempty"`
  4910. // RawKey: Specifies a 256-bit customer-supplied encryption key, encoded
  4911. // in RFC 4648 base64 to either encrypt or decrypt this resource.
  4912. RawKey string `json:"rawKey,omitempty"`
  4913. // RsaEncryptedKey: Specifies an RFC 4648 base64 encoded, RSA-wrapped
  4914. // 2048-bit customer-supplied encryption key to either encrypt or
  4915. // decrypt this resource.
  4916. //
  4917. // The key must meet the following requirements before you can provide
  4918. // it to Compute Engine:
  4919. // - The key is wrapped using a RSA public key certificate provided by
  4920. // Google.
  4921. // - After being wrapped, the key must be encoded in RFC 4648 base64
  4922. // encoding. Gets the RSA public key certificate provided by Google
  4923. // at:
  4924. // https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingre
  4925. // ss.pem
  4926. RsaEncryptedKey string `json:"rsaEncryptedKey,omitempty"`
  4927. // Sha256: [Output only] The RFC 4648 base64 encoded SHA-256 hash of the
  4928. // customer-supplied encryption key that protects this resource.
  4929. Sha256 string `json:"sha256,omitempty"`
  4930. // ForceSendFields is a list of field names (e.g. "KmsKeyName") to
  4931. // unconditionally include in API requests. By default, fields with
  4932. // empty values are omitted from API requests. However, any non-pointer,
  4933. // non-interface field appearing in ForceSendFields will be sent to the
  4934. // server regardless of whether the field is empty or not. This may be
  4935. // used to include empty fields in Patch requests.
  4936. ForceSendFields []string `json:"-"`
  4937. // NullFields is a list of field names (e.g. "KmsKeyName") to include in
  4938. // API requests with the JSON null value. By default, fields with empty
  4939. // values are omitted from API requests. However, any field with an
  4940. // empty value appearing in NullFields will be sent to the server as
  4941. // null. It is an error if a field in this list has a non-empty value.
  4942. // This may be used to include null fields in Patch requests.
  4943. NullFields []string `json:"-"`
  4944. }
  4945. func (s *CustomerEncryptionKey) MarshalJSON() ([]byte, error) {
  4946. type NoMethod CustomerEncryptionKey
  4947. raw := NoMethod(*s)
  4948. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4949. }
  4950. type CustomerEncryptionKeyProtectedDisk struct {
  4951. // DiskEncryptionKey: Decrypts data associated with the disk with a
  4952. // customer-supplied encryption key.
  4953. DiskEncryptionKey *CustomerEncryptionKey `json:"diskEncryptionKey,omitempty"`
  4954. // Source: Specifies a valid partial or full URL to an existing
  4955. // Persistent Disk resource. This field is only applicable for
  4956. // persistent disks.
  4957. Source string `json:"source,omitempty"`
  4958. // ForceSendFields is a list of field names (e.g. "DiskEncryptionKey")
  4959. // to unconditionally include in API requests. By default, fields with
  4960. // empty values are omitted from API requests. However, any non-pointer,
  4961. // non-interface field appearing in ForceSendFields will be sent to the
  4962. // server regardless of whether the field is empty or not. This may be
  4963. // used to include empty fields in Patch requests.
  4964. ForceSendFields []string `json:"-"`
  4965. // NullFields is a list of field names (e.g. "DiskEncryptionKey") to
  4966. // include in API requests with the JSON null value. By default, fields
  4967. // with empty values are omitted from API requests. However, any field
  4968. // with an empty value appearing in NullFields will be sent to the
  4969. // server as null. It is an error if a field in this list has a
  4970. // non-empty value. This may be used to include null fields in Patch
  4971. // requests.
  4972. NullFields []string `json:"-"`
  4973. }
  4974. func (s *CustomerEncryptionKeyProtectedDisk) MarshalJSON() ([]byte, error) {
  4975. type NoMethod CustomerEncryptionKeyProtectedDisk
  4976. raw := NoMethod(*s)
  4977. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4978. }
  4979. // DeprecationStatus: Deprecation status for a public resource.
  4980. type DeprecationStatus struct {
  4981. // Deleted: An optional RFC3339 timestamp on or after which the state of
  4982. // this resource is intended to change to DELETED. This is only
  4983. // informational and the status will not change unless the client
  4984. // explicitly changes it.
  4985. Deleted string `json:"deleted,omitempty"`
  4986. // Deprecated: An optional RFC3339 timestamp on or after which the state
  4987. // of this resource is intended to change to DEPRECATED. This is only
  4988. // informational and the status will not change unless the client
  4989. // explicitly changes it.
  4990. Deprecated string `json:"deprecated,omitempty"`
  4991. // Obsolete: An optional RFC3339 timestamp on or after which the state
  4992. // of this resource is intended to change to OBSOLETE. This is only
  4993. // informational and the status will not change unless the client
  4994. // explicitly changes it.
  4995. Obsolete string `json:"obsolete,omitempty"`
  4996. // Replacement: The URL of the suggested replacement for a deprecated
  4997. // resource. The suggested replacement resource must be the same kind of
  4998. // resource as the deprecated resource.
  4999. Replacement string `json:"replacement,omitempty"`
  5000. // State: The deprecation state of this resource. This can be
  5001. // DEPRECATED, OBSOLETE, or DELETED. Operations which create a new
  5002. // resource using a DEPRECATED resource will return successfully, but
  5003. // with a warning indicating the deprecated resource and recommending
  5004. // its replacement. Operations which use OBSOLETE or DELETED resources
  5005. // will be rejected and result in an error.
  5006. //
  5007. // Possible values:
  5008. // "DELETED"
  5009. // "DEPRECATED"
  5010. // "OBSOLETE"
  5011. State string `json:"state,omitempty"`
  5012. // ForceSendFields is a list of field names (e.g. "Deleted") to
  5013. // unconditionally include in API requests. By default, fields with
  5014. // empty values are omitted from API requests. However, any non-pointer,
  5015. // non-interface field appearing in ForceSendFields will be sent to the
  5016. // server regardless of whether the field is empty or not. This may be
  5017. // used to include empty fields in Patch requests.
  5018. ForceSendFields []string `json:"-"`
  5019. // NullFields is a list of field names (e.g. "Deleted") to include in
  5020. // API requests with the JSON null value. By default, fields with empty
  5021. // values are omitted from API requests. However, any field with an
  5022. // empty value appearing in NullFields will be sent to the server as
  5023. // null. It is an error if a field in this list has a non-empty value.
  5024. // This may be used to include null fields in Patch requests.
  5025. NullFields []string `json:"-"`
  5026. }
  5027. func (s *DeprecationStatus) MarshalJSON() ([]byte, error) {
  5028. type NoMethod DeprecationStatus
  5029. raw := NoMethod(*s)
  5030. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5031. }
  5032. // Disk: A Disk resource. (== resource_for beta.disks ==) (==
  5033. // resource_for v1.disks ==)
  5034. type Disk struct {
  5035. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  5036. // format.
  5037. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  5038. // Description: An optional description of this resource. Provide this
  5039. // property when you create the resource.
  5040. Description string `json:"description,omitempty"`
  5041. // DiskEncryptionKey: Encrypts the disk using a customer-supplied
  5042. // encryption key.
  5043. //
  5044. // After you encrypt a disk with a customer-supplied key, you must
  5045. // provide the same key if you use the disk later (e.g. to create a disk
  5046. // snapshot or an image, or to attach the disk to a virtual
  5047. // machine).
  5048. //
  5049. // Customer-supplied encryption keys do not protect access to metadata
  5050. // of the disk.
  5051. //
  5052. // If you do not provide an encryption key when creating the disk, then
  5053. // the disk will be encrypted using an automatically generated key and
  5054. // you do not need to provide a key to use the disk later.
  5055. DiskEncryptionKey *CustomerEncryptionKey `json:"diskEncryptionKey,omitempty"`
  5056. // GuestOsFeatures: A list of features to enable on the guest operating
  5057. // system. Applicable only for bootable images. Read Enabling guest
  5058. // operating system features to see a list of available options.
  5059. GuestOsFeatures []*GuestOsFeature `json:"guestOsFeatures,omitempty"`
  5060. // Id: [Output Only] The unique identifier for the resource. This
  5061. // identifier is defined by the server.
  5062. Id uint64 `json:"id,omitempty,string"`
  5063. // Kind: [Output Only] Type of the resource. Always compute#disk for
  5064. // disks.
  5065. Kind string `json:"kind,omitempty"`
  5066. // LabelFingerprint: A fingerprint for the labels being applied to this
  5067. // disk, which is essentially a hash of the labels set used for
  5068. // optimistic locking. The fingerprint is initially generated by Compute
  5069. // Engine and changes after every request to modify or update labels.
  5070. // You must always provide an up-to-date fingerprint hash in order to
  5071. // update or change labels.
  5072. //
  5073. // To see the latest fingerprint, make a get() request to retrieve a
  5074. // disk.
  5075. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  5076. // Labels: Labels to apply to this disk. These can be later modified by
  5077. // the setLabels method.
  5078. Labels map[string]string `json:"labels,omitempty"`
  5079. // LastAttachTimestamp: [Output Only] Last attach timestamp in RFC3339
  5080. // text format.
  5081. LastAttachTimestamp string `json:"lastAttachTimestamp,omitempty"`
  5082. // LastDetachTimestamp: [Output Only] Last detach timestamp in RFC3339
  5083. // text format.
  5084. LastDetachTimestamp string `json:"lastDetachTimestamp,omitempty"`
  5085. // LicenseCodes: Integer license codes indicating which licenses are
  5086. // attached to this disk.
  5087. LicenseCodes googleapi.Int64s `json:"licenseCodes,omitempty"`
  5088. // Licenses: Any applicable publicly visible licenses.
  5089. Licenses []string `json:"licenses,omitempty"`
  5090. // Name: Name of the resource. Provided by the client when the resource
  5091. // is created. The name must be 1-63 characters long, and comply with
  5092. // RFC1035. Specifically, the name must be 1-63 characters long and
  5093. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  5094. // the first character must be a lowercase letter, and all following
  5095. // characters must be a dash, lowercase letter, or digit, except the
  5096. // last character, which cannot be a dash.
  5097. Name string `json:"name,omitempty"`
  5098. // Options: Internal use only.
  5099. Options string `json:"options,omitempty"`
  5100. // PhysicalBlockSizeBytes: Physical block size of the persistent disk,
  5101. // in bytes. If not present in a request, a default value is used.
  5102. // Initially only 4096 is supported, but other powers of two may be
  5103. // added. If an unsupported value is requested, the error message will
  5104. // list the supported values, but even a supported value may be allowed
  5105. // for only some projects.
  5106. PhysicalBlockSizeBytes int64 `json:"physicalBlockSizeBytes,omitempty,string"`
  5107. // Region: [Output Only] URL of the region where the disk resides. Only
  5108. // applicable for regional resources. You must specify this field as
  5109. // part of the HTTP request URL. It is not settable as a field in the
  5110. // request body.
  5111. Region string `json:"region,omitempty"`
  5112. // ReplicaZones: URLs of the zones where the disk should be replicated
  5113. // to. Only applicable for regional resources.
  5114. ReplicaZones []string `json:"replicaZones,omitempty"`
  5115. // ResourcePolicies: Resource policies applied to this disk for
  5116. // automatic snapshot creations.
  5117. ResourcePolicies []string `json:"resourcePolicies,omitempty"`
  5118. // SelfLink: [Output Only] Server-defined fully-qualified URL for this
  5119. // resource.
  5120. SelfLink string `json:"selfLink,omitempty"`
  5121. // SizeGb: Size of the persistent disk, specified in GB. You can specify
  5122. // this field when creating a persistent disk using the sourceImage or
  5123. // sourceSnapshot parameter, or specify it alone to create an empty
  5124. // persistent disk.
  5125. //
  5126. // If you specify this field along with sourceImage or sourceSnapshot,
  5127. // the value of sizeGb must not be less than the size of the sourceImage
  5128. // or the size of the snapshot. Acceptable values are 1 to 65536,
  5129. // inclusive.
  5130. SizeGb int64 `json:"sizeGb,omitempty,string"`
  5131. // SourceImage: The source image used to create this disk. If the source
  5132. // image is deleted, this field will not be set.
  5133. //
  5134. // To create a disk with one of the public operating system images,
  5135. // specify the image by its family name. For example, specify
  5136. // family/debian-8 to use the latest Debian 8
  5137. // image:
  5138. // projects/debian-cloud/global/images/family/debian-8
  5139. //
  5140. //
  5141. // Alternati
  5142. // vely, use a specific version of a public operating system
  5143. // image:
  5144. // projects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD
  5145. //
  5146. //
  5147. //
  5148. // To create a disk with a custom image that you created, specify the
  5149. // image name in the following
  5150. // format:
  5151. // global/images/my-custom-image
  5152. //
  5153. //
  5154. // You can also specify a custom image by its image family, which
  5155. // returns the latest version of the image in that family. Replace the
  5156. // image name with
  5157. // family/family-name:
  5158. // global/images/family/my-image-family
  5159. SourceImage string `json:"sourceImage,omitempty"`
  5160. // SourceImageEncryptionKey: The customer-supplied encryption key of the
  5161. // source image. Required if the source image is protected by a
  5162. // customer-supplied encryption key.
  5163. SourceImageEncryptionKey *CustomerEncryptionKey `json:"sourceImageEncryptionKey,omitempty"`
  5164. // SourceImageId: [Output Only] The ID value of the image used to create
  5165. // this disk. This value identifies the exact image that was used to
  5166. // create this persistent disk. For example, if you created the
  5167. // persistent disk from an image that was later deleted and recreated
  5168. // under the same name, the source image ID would identify the exact
  5169. // version of the image that was used.
  5170. SourceImageId string `json:"sourceImageId,omitempty"`
  5171. // SourceSnapshot: The source snapshot used to create this disk. You can
  5172. // provide this as a partial or full URL to the resource. For example,
  5173. // the following are valid values:
  5174. // -
  5175. // https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot
  5176. // - projects/project/global/snapshots/snapshot
  5177. // - global/snapshots/snapshot
  5178. SourceSnapshot string `json:"sourceSnapshot,omitempty"`
  5179. // SourceSnapshotEncryptionKey: The customer-supplied encryption key of
  5180. // the source snapshot. Required if the source snapshot is protected by
  5181. // a customer-supplied encryption key.
  5182. SourceSnapshotEncryptionKey *CustomerEncryptionKey `json:"sourceSnapshotEncryptionKey,omitempty"`
  5183. // SourceSnapshotId: [Output Only] The unique ID of the snapshot used to
  5184. // create this disk. This value identifies the exact snapshot that was
  5185. // used to create this persistent disk. For example, if you created the
  5186. // persistent disk from a snapshot that was later deleted and recreated
  5187. // under the same name, the source snapshot ID would identify the exact
  5188. // version of the snapshot that was used.
  5189. SourceSnapshotId string `json:"sourceSnapshotId,omitempty"`
  5190. // Status: [Output Only] The status of disk creation.
  5191. //
  5192. // Possible values:
  5193. // "CREATING"
  5194. // "FAILED"
  5195. // "READY"
  5196. // "RESTORING"
  5197. Status string `json:"status,omitempty"`
  5198. // StorageType: [Deprecated] Storage type of the persistent disk.
  5199. //
  5200. // Possible values:
  5201. // "HDD"
  5202. // "SSD"
  5203. StorageType string `json:"storageType,omitempty"`
  5204. // Type: URL of the disk type resource describing which disk type to use
  5205. // to create the disk. Provide this when creating the disk. For example:
  5206. // project/zones/zone/diskTypes/pd-standard or pd-ssd
  5207. Type string `json:"type,omitempty"`
  5208. // Users: [Output Only] Links to the users of the disk (attached
  5209. // instances) in form: project/zones/zone/instances/instance
  5210. Users []string `json:"users,omitempty"`
  5211. // Zone: [Output Only] URL of the zone where the disk resides. You must
  5212. // specify this field as part of the HTTP request URL. It is not
  5213. // settable as a field in the request body.
  5214. Zone string `json:"zone,omitempty"`
  5215. // ServerResponse contains the HTTP response code and headers from the
  5216. // server.
  5217. googleapi.ServerResponse `json:"-"`
  5218. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  5219. // to unconditionally include in API requests. By default, fields with
  5220. // empty values are omitted from API requests. However, any non-pointer,
  5221. // non-interface field appearing in ForceSendFields will be sent to the
  5222. // server regardless of whether the field is empty or not. This may be
  5223. // used to include empty fields in Patch requests.
  5224. ForceSendFields []string `json:"-"`
  5225. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  5226. // include in API requests with the JSON null value. By default, fields
  5227. // with empty values are omitted from API requests. However, any field
  5228. // with an empty value appearing in NullFields will be sent to the
  5229. // server as null. It is an error if a field in this list has a
  5230. // non-empty value. This may be used to include null fields in Patch
  5231. // requests.
  5232. NullFields []string `json:"-"`
  5233. }
  5234. func (s *Disk) MarshalJSON() ([]byte, error) {
  5235. type NoMethod Disk
  5236. raw := NoMethod(*s)
  5237. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5238. }
  5239. type DiskAggregatedList struct {
  5240. // Id: [Output Only] Unique identifier for the resource; defined by the
  5241. // server.
  5242. Id string `json:"id,omitempty"`
  5243. // Items: A list of DisksScopedList resources.
  5244. Items map[string]DisksScopedList `json:"items,omitempty"`
  5245. // Kind: [Output Only] Type of resource. Always
  5246. // compute#diskAggregatedList for aggregated lists of persistent disks.
  5247. Kind string `json:"kind,omitempty"`
  5248. // NextPageToken: [Output Only] This token allows you to get the next
  5249. // page of results for list requests. If the number of results is larger
  5250. // than maxResults, use the nextPageToken as a value for the query
  5251. // parameter pageToken in the next list request. Subsequent list
  5252. // requests will have their own nextPageToken to continue paging through
  5253. // the results.
  5254. NextPageToken string `json:"nextPageToken,omitempty"`
  5255. // SelfLink: [Output Only] Server-defined URL for this resource.
  5256. SelfLink string `json:"selfLink,omitempty"`
  5257. // Warning: [Output Only] Informational warning message.
  5258. Warning *DiskAggregatedListWarning `json:"warning,omitempty"`
  5259. // ServerResponse contains the HTTP response code and headers from the
  5260. // server.
  5261. googleapi.ServerResponse `json:"-"`
  5262. // ForceSendFields is a list of field names (e.g. "Id") to
  5263. // unconditionally include in API requests. By default, fields with
  5264. // empty values are omitted from API requests. However, any non-pointer,
  5265. // non-interface field appearing in ForceSendFields will be sent to the
  5266. // server regardless of whether the field is empty or not. This may be
  5267. // used to include empty fields in Patch requests.
  5268. ForceSendFields []string `json:"-"`
  5269. // NullFields is a list of field names (e.g. "Id") to include in API
  5270. // requests with the JSON null value. By default, fields with empty
  5271. // values are omitted from API requests. However, any field with an
  5272. // empty value appearing in NullFields will be sent to the server as
  5273. // null. It is an error if a field in this list has a non-empty value.
  5274. // This may be used to include null fields in Patch requests.
  5275. NullFields []string `json:"-"`
  5276. }
  5277. func (s *DiskAggregatedList) MarshalJSON() ([]byte, error) {
  5278. type NoMethod DiskAggregatedList
  5279. raw := NoMethod(*s)
  5280. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5281. }
  5282. // DiskAggregatedListWarning: [Output Only] Informational warning
  5283. // message.
  5284. type DiskAggregatedListWarning struct {
  5285. // Code: [Output Only] A warning code, if applicable. For example,
  5286. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  5287. // the response.
  5288. //
  5289. // Possible values:
  5290. // "CLEANUP_FAILED"
  5291. // "DEPRECATED_RESOURCE_USED"
  5292. // "DEPRECATED_TYPE_USED"
  5293. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  5294. // "EXPERIMENTAL_TYPE_USED"
  5295. // "EXTERNAL_API_WARNING"
  5296. // "FIELD_VALUE_OVERRIDEN"
  5297. // "INJECTED_KERNELS_DEPRECATED"
  5298. // "MISSING_TYPE_DEPENDENCY"
  5299. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  5300. // "NEXT_HOP_CANNOT_IP_FORWARD"
  5301. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  5302. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  5303. // "NEXT_HOP_NOT_RUNNING"
  5304. // "NOT_CRITICAL_ERROR"
  5305. // "NO_RESULTS_ON_PAGE"
  5306. // "REQUIRED_TOS_AGREEMENT"
  5307. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  5308. // "RESOURCE_NOT_DELETED"
  5309. // "SCHEMA_VALIDATION_IGNORED"
  5310. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  5311. // "UNDECLARED_PROPERTIES"
  5312. // "UNREACHABLE"
  5313. Code string `json:"code,omitempty"`
  5314. // Data: [Output Only] Metadata about this warning in key: value format.
  5315. // For example:
  5316. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  5317. Data []*DiskAggregatedListWarningData `json:"data,omitempty"`
  5318. // Message: [Output Only] A human-readable description of the warning
  5319. // code.
  5320. Message string `json:"message,omitempty"`
  5321. // ForceSendFields is a list of field names (e.g. "Code") to
  5322. // unconditionally include in API requests. By default, fields with
  5323. // empty values are omitted from API requests. However, any non-pointer,
  5324. // non-interface field appearing in ForceSendFields will be sent to the
  5325. // server regardless of whether the field is empty or not. This may be
  5326. // used to include empty fields in Patch requests.
  5327. ForceSendFields []string `json:"-"`
  5328. // NullFields is a list of field names (e.g. "Code") to include in API
  5329. // requests with the JSON null value. By default, fields with empty
  5330. // values are omitted from API requests. However, any field with an
  5331. // empty value appearing in NullFields will be sent to the server as
  5332. // null. It is an error if a field in this list has a non-empty value.
  5333. // This may be used to include null fields in Patch requests.
  5334. NullFields []string `json:"-"`
  5335. }
  5336. func (s *DiskAggregatedListWarning) MarshalJSON() ([]byte, error) {
  5337. type NoMethod DiskAggregatedListWarning
  5338. raw := NoMethod(*s)
  5339. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5340. }
  5341. type DiskAggregatedListWarningData struct {
  5342. // Key: [Output Only] A key that provides more detail on the warning
  5343. // being returned. For example, for warnings where there are no results
  5344. // in a list request for a particular zone, this key might be scope and
  5345. // the key value might be the zone name. Other examples might be a key
  5346. // indicating a deprecated resource and a suggested replacement, or a
  5347. // warning about invalid network settings (for example, if an instance
  5348. // attempts to perform IP forwarding but is not enabled for IP
  5349. // forwarding).
  5350. Key string `json:"key,omitempty"`
  5351. // Value: [Output Only] A warning data value corresponding to the key.
  5352. Value string `json:"value,omitempty"`
  5353. // ForceSendFields is a list of field names (e.g. "Key") to
  5354. // 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. "Key") to include in API
  5361. // requests with the JSON null value. By default, fields with empty
  5362. // values are omitted from API requests. However, any field with an
  5363. // empty value appearing in NullFields will be sent to the server as
  5364. // null. It is an error if a field in this list has a non-empty value.
  5365. // This may be used to include null fields in Patch requests.
  5366. NullFields []string `json:"-"`
  5367. }
  5368. func (s *DiskAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  5369. type NoMethod DiskAggregatedListWarningData
  5370. raw := NoMethod(*s)
  5371. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5372. }
  5373. // DiskInstantiationConfig: A specification of the desired way to
  5374. // instantiate a disk in the instance template when its created from a
  5375. // source instance.
  5376. type DiskInstantiationConfig struct {
  5377. // AutoDelete: Specifies whether the disk will be auto-deleted when the
  5378. // instance is deleted (but not when the disk is detached from the
  5379. // instance).
  5380. AutoDelete bool `json:"autoDelete,omitempty"`
  5381. // CustomImage: The custom source image to be used to restore this disk
  5382. // when instantiating this instance template.
  5383. CustomImage string `json:"customImage,omitempty"`
  5384. // DeviceName: Specifies the device name of the disk to which the
  5385. // configurations apply to.
  5386. DeviceName string `json:"deviceName,omitempty"`
  5387. // InstantiateFrom: Specifies whether to include the disk and what image
  5388. // to use. Possible values are:
  5389. // - source-image: to use the same image that was used to create the
  5390. // source instance's corresponding disk. Applicable to the boot disk and
  5391. // additional read-write disks.
  5392. // - source-image-family: to use the same image family that was used to
  5393. // create the source instance's corresponding disk. Applicable to the
  5394. // boot disk and additional read-write disks.
  5395. // - custom-image: to use a user-provided image url for disk creation.
  5396. // Applicable to the boot disk and additional read-write disks.
  5397. // - attach-read-only: to attach a read-only disk. Applicable to
  5398. // read-only disks.
  5399. // - do-not-include: to exclude a disk from the template. Applicable to
  5400. // additional read-write disks, local SSDs, and read-only disks.
  5401. //
  5402. // Possible values:
  5403. // "ATTACH_READ_ONLY"
  5404. // "BLANK"
  5405. // "CUSTOM_IMAGE"
  5406. // "DEFAULT"
  5407. // "DO_NOT_INCLUDE"
  5408. // "SOURCE_IMAGE"
  5409. // "SOURCE_IMAGE_FAMILY"
  5410. InstantiateFrom string `json:"instantiateFrom,omitempty"`
  5411. // ForceSendFields is a list of field names (e.g. "AutoDelete") to
  5412. // unconditionally include in API requests. By default, fields with
  5413. // empty values are omitted from API requests. However, any non-pointer,
  5414. // non-interface field appearing in ForceSendFields will be sent to the
  5415. // server regardless of whether the field is empty or not. This may be
  5416. // used to include empty fields in Patch requests.
  5417. ForceSendFields []string `json:"-"`
  5418. // NullFields is a list of field names (e.g. "AutoDelete") to include in
  5419. // API requests with the JSON null value. By default, fields with empty
  5420. // values are omitted from API requests. However, any field with an
  5421. // empty value appearing in NullFields will be sent to the server as
  5422. // null. It is an error if a field in this list has a non-empty value.
  5423. // This may be used to include null fields in Patch requests.
  5424. NullFields []string `json:"-"`
  5425. }
  5426. func (s *DiskInstantiationConfig) MarshalJSON() ([]byte, error) {
  5427. type NoMethod DiskInstantiationConfig
  5428. raw := NoMethod(*s)
  5429. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5430. }
  5431. // DiskList: A list of Disk resources.
  5432. type DiskList struct {
  5433. // Id: [Output Only] Unique identifier for the resource; defined by the
  5434. // server.
  5435. Id string `json:"id,omitempty"`
  5436. // Items: A list of Disk resources.
  5437. Items []*Disk `json:"items,omitempty"`
  5438. // Kind: [Output Only] Type of resource. Always compute#diskList for
  5439. // lists of disks.
  5440. Kind string `json:"kind,omitempty"`
  5441. // NextPageToken: [Output Only] This token allows you to get the next
  5442. // page of results for list requests. If the number of results is larger
  5443. // than maxResults, use the nextPageToken as a value for the query
  5444. // parameter pageToken in the next list request. Subsequent list
  5445. // requests will have their own nextPageToken to continue paging through
  5446. // the results.
  5447. NextPageToken string `json:"nextPageToken,omitempty"`
  5448. // SelfLink: [Output Only] Server-defined URL for this resource.
  5449. SelfLink string `json:"selfLink,omitempty"`
  5450. // Warning: [Output Only] Informational warning message.
  5451. Warning *DiskListWarning `json:"warning,omitempty"`
  5452. // ServerResponse contains the HTTP response code and headers from the
  5453. // server.
  5454. googleapi.ServerResponse `json:"-"`
  5455. // ForceSendFields is a list of field names (e.g. "Id") to
  5456. // unconditionally include in API requests. By default, fields with
  5457. // empty values are omitted from API requests. However, any non-pointer,
  5458. // non-interface field appearing in ForceSendFields will be sent to the
  5459. // server regardless of whether the field is empty or not. This may be
  5460. // used to include empty fields in Patch requests.
  5461. ForceSendFields []string `json:"-"`
  5462. // NullFields is a list of field names (e.g. "Id") to include in API
  5463. // requests with the JSON null value. By default, fields with empty
  5464. // values are omitted from API requests. However, any field with an
  5465. // empty value appearing in NullFields will be sent to the server as
  5466. // null. It is an error if a field in this list has a non-empty value.
  5467. // This may be used to include null fields in Patch requests.
  5468. NullFields []string `json:"-"`
  5469. }
  5470. func (s *DiskList) MarshalJSON() ([]byte, error) {
  5471. type NoMethod DiskList
  5472. raw := NoMethod(*s)
  5473. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5474. }
  5475. // DiskListWarning: [Output Only] Informational warning message.
  5476. type DiskListWarning struct {
  5477. // Code: [Output Only] A warning code, if applicable. For example,
  5478. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  5479. // the response.
  5480. //
  5481. // Possible values:
  5482. // "CLEANUP_FAILED"
  5483. // "DEPRECATED_RESOURCE_USED"
  5484. // "DEPRECATED_TYPE_USED"
  5485. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  5486. // "EXPERIMENTAL_TYPE_USED"
  5487. // "EXTERNAL_API_WARNING"
  5488. // "FIELD_VALUE_OVERRIDEN"
  5489. // "INJECTED_KERNELS_DEPRECATED"
  5490. // "MISSING_TYPE_DEPENDENCY"
  5491. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  5492. // "NEXT_HOP_CANNOT_IP_FORWARD"
  5493. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  5494. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  5495. // "NEXT_HOP_NOT_RUNNING"
  5496. // "NOT_CRITICAL_ERROR"
  5497. // "NO_RESULTS_ON_PAGE"
  5498. // "REQUIRED_TOS_AGREEMENT"
  5499. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  5500. // "RESOURCE_NOT_DELETED"
  5501. // "SCHEMA_VALIDATION_IGNORED"
  5502. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  5503. // "UNDECLARED_PROPERTIES"
  5504. // "UNREACHABLE"
  5505. Code string `json:"code,omitempty"`
  5506. // Data: [Output Only] Metadata about this warning in key: value format.
  5507. // For example:
  5508. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  5509. Data []*DiskListWarningData `json:"data,omitempty"`
  5510. // Message: [Output Only] A human-readable description of the warning
  5511. // code.
  5512. Message string `json:"message,omitempty"`
  5513. // ForceSendFields is a list of field names (e.g. "Code") to
  5514. // unconditionally include in API requests. By default, fields with
  5515. // empty values are omitted from API requests. However, any non-pointer,
  5516. // non-interface field appearing in ForceSendFields will be sent to the
  5517. // server regardless of whether the field is empty or not. This may be
  5518. // used to include empty fields in Patch requests.
  5519. ForceSendFields []string `json:"-"`
  5520. // NullFields is a list of field names (e.g. "Code") to include in API
  5521. // requests with the JSON null value. By default, fields with empty
  5522. // values are omitted from API requests. However, any field with an
  5523. // empty value appearing in NullFields will be sent to the server as
  5524. // null. It is an error if a field in this list has a non-empty value.
  5525. // This may be used to include null fields in Patch requests.
  5526. NullFields []string `json:"-"`
  5527. }
  5528. func (s *DiskListWarning) MarshalJSON() ([]byte, error) {
  5529. type NoMethod DiskListWarning
  5530. raw := NoMethod(*s)
  5531. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5532. }
  5533. type DiskListWarningData struct {
  5534. // Key: [Output Only] A key that provides more detail on the warning
  5535. // being returned. For example, for warnings where there are no results
  5536. // in a list request for a particular zone, this key might be scope and
  5537. // the key value might be the zone name. Other examples might be a key
  5538. // indicating a deprecated resource and a suggested replacement, or a
  5539. // warning about invalid network settings (for example, if an instance
  5540. // attempts to perform IP forwarding but is not enabled for IP
  5541. // forwarding).
  5542. Key string `json:"key,omitempty"`
  5543. // Value: [Output Only] A warning data value corresponding to the key.
  5544. Value string `json:"value,omitempty"`
  5545. // ForceSendFields is a list of field names (e.g. "Key") to
  5546. // unconditionally include in API requests. By default, fields with
  5547. // empty values are omitted from API requests. However, any non-pointer,
  5548. // non-interface field appearing in ForceSendFields will be sent to the
  5549. // server regardless of whether the field is empty or not. This may be
  5550. // used to include empty fields in Patch requests.
  5551. ForceSendFields []string `json:"-"`
  5552. // NullFields is a list of field names (e.g. "Key") to include in API
  5553. // requests with the JSON null value. By default, fields with empty
  5554. // values are omitted from API requests. However, any field with an
  5555. // empty value appearing in NullFields will be sent to the server as
  5556. // null. It is an error if a field in this list has a non-empty value.
  5557. // This may be used to include null fields in Patch requests.
  5558. NullFields []string `json:"-"`
  5559. }
  5560. func (s *DiskListWarningData) MarshalJSON() ([]byte, error) {
  5561. type NoMethod DiskListWarningData
  5562. raw := NoMethod(*s)
  5563. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5564. }
  5565. type DiskMoveRequest struct {
  5566. // DestinationZone: The URL of the destination zone to move the disk.
  5567. // This can be a full or partial URL. For example, the following are all
  5568. // valid URLs to a zone:
  5569. // - https://www.googleapis.com/compute/v1/projects/project/zones/zone
  5570. //
  5571. // - projects/project/zones/zone
  5572. // - zones/zone
  5573. DestinationZone string `json:"destinationZone,omitempty"`
  5574. // TargetDisk: The URL of the target disk to move. This can be a full or
  5575. // partial URL. For example, the following are all valid URLs to a disk:
  5576. //
  5577. // -
  5578. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk
  5579. // - projects/project/zones/zone/disks/disk
  5580. // - zones/zone/disks/disk
  5581. TargetDisk string `json:"targetDisk,omitempty"`
  5582. // ForceSendFields is a list of field names (e.g. "DestinationZone") to
  5583. // unconditionally include in API requests. By default, fields with
  5584. // empty values are omitted from API requests. However, any non-pointer,
  5585. // non-interface field appearing in ForceSendFields will be sent to the
  5586. // server regardless of whether the field is empty or not. This may be
  5587. // used to include empty fields in Patch requests.
  5588. ForceSendFields []string `json:"-"`
  5589. // NullFields is a list of field names (e.g. "DestinationZone") to
  5590. // include in API requests with the JSON null value. By default, fields
  5591. // with empty values are omitted from API requests. However, any field
  5592. // with an empty value appearing in NullFields will be sent to the
  5593. // server as null. It is an error if a field in this list has a
  5594. // non-empty value. This may be used to include null fields in Patch
  5595. // requests.
  5596. NullFields []string `json:"-"`
  5597. }
  5598. func (s *DiskMoveRequest) MarshalJSON() ([]byte, error) {
  5599. type NoMethod DiskMoveRequest
  5600. raw := NoMethod(*s)
  5601. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5602. }
  5603. // DiskType: A DiskType resource. (== resource_for beta.diskTypes ==)
  5604. // (== resource_for v1.diskTypes ==)
  5605. type DiskType struct {
  5606. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  5607. // format.
  5608. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  5609. // DefaultDiskSizeGb: [Output Only] Server-defined default disk size in
  5610. // GB.
  5611. DefaultDiskSizeGb int64 `json:"defaultDiskSizeGb,omitempty,string"`
  5612. // Deprecated: [Output Only] The deprecation status associated with this
  5613. // disk type.
  5614. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  5615. // Description: [Output Only] An optional description of this resource.
  5616. Description string `json:"description,omitempty"`
  5617. // Id: [Output Only] The unique identifier for the resource. This
  5618. // identifier is defined by the server.
  5619. Id uint64 `json:"id,omitempty,string"`
  5620. // Kind: [Output Only] Type of the resource. Always compute#diskType for
  5621. // disk types.
  5622. Kind string `json:"kind,omitempty"`
  5623. // Name: [Output Only] Name of the resource.
  5624. Name string `json:"name,omitempty"`
  5625. // Region: [Output Only] URL of the region where the disk type resides.
  5626. // Only applicable for regional resources. You must specify this field
  5627. // as part of the HTTP request URL. It is not settable as a field in the
  5628. // request body.
  5629. Region string `json:"region,omitempty"`
  5630. // SelfLink: [Output Only] Server-defined URL for the resource.
  5631. SelfLink string `json:"selfLink,omitempty"`
  5632. // ValidDiskSize: [Output Only] An optional textual description of the
  5633. // valid disk size, such as "10GB-10TB".
  5634. ValidDiskSize string `json:"validDiskSize,omitempty"`
  5635. // Zone: [Output Only] URL of the zone where the disk type resides. You
  5636. // must specify this field as part of the HTTP request URL. It is not
  5637. // settable as a field in the request body.
  5638. Zone string `json:"zone,omitempty"`
  5639. // ServerResponse contains the HTTP response code and headers from the
  5640. // server.
  5641. googleapi.ServerResponse `json:"-"`
  5642. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  5643. // to unconditionally include in API requests. By default, fields with
  5644. // empty values are omitted from API requests. However, any non-pointer,
  5645. // non-interface field appearing in ForceSendFields will be sent to the
  5646. // server regardless of whether the field is empty or not. This may be
  5647. // used to include empty fields in Patch requests.
  5648. ForceSendFields []string `json:"-"`
  5649. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  5650. // include in API requests with the JSON null value. By default, fields
  5651. // with empty values are omitted from API requests. However, any field
  5652. // with an empty value appearing in NullFields will be sent to the
  5653. // server as null. It is an error if a field in this list has a
  5654. // non-empty value. This may be used to include null fields in Patch
  5655. // requests.
  5656. NullFields []string `json:"-"`
  5657. }
  5658. func (s *DiskType) MarshalJSON() ([]byte, error) {
  5659. type NoMethod DiskType
  5660. raw := NoMethod(*s)
  5661. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5662. }
  5663. type DiskTypeAggregatedList struct {
  5664. // Id: [Output Only] Unique identifier for the resource; defined by the
  5665. // server.
  5666. Id string `json:"id,omitempty"`
  5667. // Items: A list of DiskTypesScopedList resources.
  5668. Items map[string]DiskTypesScopedList `json:"items,omitempty"`
  5669. // Kind: [Output Only] Type of resource. Always
  5670. // compute#diskTypeAggregatedList.
  5671. Kind string `json:"kind,omitempty"`
  5672. // NextPageToken: [Output Only] This token allows you to get the next
  5673. // page of results for list requests. If the number of results is larger
  5674. // than maxResults, use the nextPageToken as a value for the query
  5675. // parameter pageToken in the next list request. Subsequent list
  5676. // requests will have their own nextPageToken to continue paging through
  5677. // the results.
  5678. NextPageToken string `json:"nextPageToken,omitempty"`
  5679. // SelfLink: [Output Only] Server-defined URL for this resource.
  5680. SelfLink string `json:"selfLink,omitempty"`
  5681. // Warning: [Output Only] Informational warning message.
  5682. Warning *DiskTypeAggregatedListWarning `json:"warning,omitempty"`
  5683. // ServerResponse contains the HTTP response code and headers from the
  5684. // server.
  5685. googleapi.ServerResponse `json:"-"`
  5686. // ForceSendFields is a list of field names (e.g. "Id") to
  5687. // unconditionally include in API requests. By default, fields with
  5688. // empty values are omitted from API requests. However, any non-pointer,
  5689. // non-interface field appearing in ForceSendFields will be sent to the
  5690. // server regardless of whether the field is empty or not. This may be
  5691. // used to include empty fields in Patch requests.
  5692. ForceSendFields []string `json:"-"`
  5693. // NullFields is a list of field names (e.g. "Id") to include in API
  5694. // requests with the JSON null value. By default, fields with empty
  5695. // values are omitted from API requests. However, any field with an
  5696. // empty value appearing in NullFields will be sent to the server as
  5697. // null. It is an error if a field in this list has a non-empty value.
  5698. // This may be used to include null fields in Patch requests.
  5699. NullFields []string `json:"-"`
  5700. }
  5701. func (s *DiskTypeAggregatedList) MarshalJSON() ([]byte, error) {
  5702. type NoMethod DiskTypeAggregatedList
  5703. raw := NoMethod(*s)
  5704. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5705. }
  5706. // DiskTypeAggregatedListWarning: [Output Only] Informational warning
  5707. // message.
  5708. type DiskTypeAggregatedListWarning struct {
  5709. // Code: [Output Only] A warning code, if applicable. For example,
  5710. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  5711. // the response.
  5712. //
  5713. // Possible values:
  5714. // "CLEANUP_FAILED"
  5715. // "DEPRECATED_RESOURCE_USED"
  5716. // "DEPRECATED_TYPE_USED"
  5717. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  5718. // "EXPERIMENTAL_TYPE_USED"
  5719. // "EXTERNAL_API_WARNING"
  5720. // "FIELD_VALUE_OVERRIDEN"
  5721. // "INJECTED_KERNELS_DEPRECATED"
  5722. // "MISSING_TYPE_DEPENDENCY"
  5723. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  5724. // "NEXT_HOP_CANNOT_IP_FORWARD"
  5725. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  5726. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  5727. // "NEXT_HOP_NOT_RUNNING"
  5728. // "NOT_CRITICAL_ERROR"
  5729. // "NO_RESULTS_ON_PAGE"
  5730. // "REQUIRED_TOS_AGREEMENT"
  5731. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  5732. // "RESOURCE_NOT_DELETED"
  5733. // "SCHEMA_VALIDATION_IGNORED"
  5734. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  5735. // "UNDECLARED_PROPERTIES"
  5736. // "UNREACHABLE"
  5737. Code string `json:"code,omitempty"`
  5738. // Data: [Output Only] Metadata about this warning in key: value format.
  5739. // For example:
  5740. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  5741. Data []*DiskTypeAggregatedListWarningData `json:"data,omitempty"`
  5742. // Message: [Output Only] A human-readable description of the warning
  5743. // code.
  5744. Message string `json:"message,omitempty"`
  5745. // ForceSendFields is a list of field names (e.g. "Code") to
  5746. // unconditionally include in API requests. By default, fields with
  5747. // empty values are omitted from API requests. However, any non-pointer,
  5748. // non-interface field appearing in ForceSendFields will be sent to the
  5749. // server regardless of whether the field is empty or not. This may be
  5750. // used to include empty fields in Patch requests.
  5751. ForceSendFields []string `json:"-"`
  5752. // NullFields is a list of field names (e.g. "Code") to include in API
  5753. // requests with the JSON null value. By default, fields with empty
  5754. // values are omitted from API requests. However, any field with an
  5755. // empty value appearing in NullFields will be sent to the server as
  5756. // null. It is an error if a field in this list has a non-empty value.
  5757. // This may be used to include null fields in Patch requests.
  5758. NullFields []string `json:"-"`
  5759. }
  5760. func (s *DiskTypeAggregatedListWarning) MarshalJSON() ([]byte, error) {
  5761. type NoMethod DiskTypeAggregatedListWarning
  5762. raw := NoMethod(*s)
  5763. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5764. }
  5765. type DiskTypeAggregatedListWarningData struct {
  5766. // Key: [Output Only] A key that provides more detail on the warning
  5767. // being returned. For example, for warnings where there are no results
  5768. // in a list request for a particular zone, this key might be scope and
  5769. // the key value might be the zone name. Other examples might be a key
  5770. // indicating a deprecated resource and a suggested replacement, or a
  5771. // warning about invalid network settings (for example, if an instance
  5772. // attempts to perform IP forwarding but is not enabled for IP
  5773. // forwarding).
  5774. Key string `json:"key,omitempty"`
  5775. // Value: [Output Only] A warning data value corresponding to the key.
  5776. Value string `json:"value,omitempty"`
  5777. // ForceSendFields is a list of field names (e.g. "Key") to
  5778. // unconditionally include in API requests. By default, fields with
  5779. // empty values are omitted from API requests. However, any non-pointer,
  5780. // non-interface field appearing in ForceSendFields will be sent to the
  5781. // server regardless of whether the field is empty or not. This may be
  5782. // used to include empty fields in Patch requests.
  5783. ForceSendFields []string `json:"-"`
  5784. // NullFields is a list of field names (e.g. "Key") to include in API
  5785. // requests with the JSON null value. By default, fields with empty
  5786. // values are omitted from API requests. However, any field with an
  5787. // empty value appearing in NullFields will be sent to the server as
  5788. // null. It is an error if a field in this list has a non-empty value.
  5789. // This may be used to include null fields in Patch requests.
  5790. NullFields []string `json:"-"`
  5791. }
  5792. func (s *DiskTypeAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  5793. type NoMethod DiskTypeAggregatedListWarningData
  5794. raw := NoMethod(*s)
  5795. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5796. }
  5797. // DiskTypeList: Contains a list of disk types.
  5798. type DiskTypeList struct {
  5799. // Id: [Output Only] Unique identifier for the resource; defined by the
  5800. // server.
  5801. Id string `json:"id,omitempty"`
  5802. // Items: A list of DiskType resources.
  5803. Items []*DiskType `json:"items,omitempty"`
  5804. // Kind: [Output Only] Type of resource. Always compute#diskTypeList for
  5805. // disk types.
  5806. Kind string `json:"kind,omitempty"`
  5807. // NextPageToken: [Output Only] This token allows you to get the next
  5808. // page of results for list requests. If the number of results is larger
  5809. // than maxResults, use the nextPageToken as a value for the query
  5810. // parameter pageToken in the next list request. Subsequent list
  5811. // requests will have their own nextPageToken to continue paging through
  5812. // the results.
  5813. NextPageToken string `json:"nextPageToken,omitempty"`
  5814. // SelfLink: [Output Only] Server-defined URL for this resource.
  5815. SelfLink string `json:"selfLink,omitempty"`
  5816. // Warning: [Output Only] Informational warning message.
  5817. Warning *DiskTypeListWarning `json:"warning,omitempty"`
  5818. // ServerResponse contains the HTTP response code and headers from the
  5819. // server.
  5820. googleapi.ServerResponse `json:"-"`
  5821. // ForceSendFields is a list of field names (e.g. "Id") to
  5822. // unconditionally include in API requests. By default, fields with
  5823. // empty values are omitted from API requests. However, any non-pointer,
  5824. // non-interface field appearing in ForceSendFields will be sent to the
  5825. // server regardless of whether the field is empty or not. This may be
  5826. // used to include empty fields in Patch requests.
  5827. ForceSendFields []string `json:"-"`
  5828. // NullFields is a list of field names (e.g. "Id") to include in API
  5829. // requests with the JSON null value. By default, fields with empty
  5830. // values are omitted from API requests. However, any field with an
  5831. // empty value appearing in NullFields will be sent to the server as
  5832. // null. It is an error if a field in this list has a non-empty value.
  5833. // This may be used to include null fields in Patch requests.
  5834. NullFields []string `json:"-"`
  5835. }
  5836. func (s *DiskTypeList) MarshalJSON() ([]byte, error) {
  5837. type NoMethod DiskTypeList
  5838. raw := NoMethod(*s)
  5839. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5840. }
  5841. // DiskTypeListWarning: [Output Only] Informational warning message.
  5842. type DiskTypeListWarning struct {
  5843. // Code: [Output Only] A warning code, if applicable. For example,
  5844. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  5845. // the response.
  5846. //
  5847. // Possible values:
  5848. // "CLEANUP_FAILED"
  5849. // "DEPRECATED_RESOURCE_USED"
  5850. // "DEPRECATED_TYPE_USED"
  5851. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  5852. // "EXPERIMENTAL_TYPE_USED"
  5853. // "EXTERNAL_API_WARNING"
  5854. // "FIELD_VALUE_OVERRIDEN"
  5855. // "INJECTED_KERNELS_DEPRECATED"
  5856. // "MISSING_TYPE_DEPENDENCY"
  5857. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  5858. // "NEXT_HOP_CANNOT_IP_FORWARD"
  5859. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  5860. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  5861. // "NEXT_HOP_NOT_RUNNING"
  5862. // "NOT_CRITICAL_ERROR"
  5863. // "NO_RESULTS_ON_PAGE"
  5864. // "REQUIRED_TOS_AGREEMENT"
  5865. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  5866. // "RESOURCE_NOT_DELETED"
  5867. // "SCHEMA_VALIDATION_IGNORED"
  5868. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  5869. // "UNDECLARED_PROPERTIES"
  5870. // "UNREACHABLE"
  5871. Code string `json:"code,omitempty"`
  5872. // Data: [Output Only] Metadata about this warning in key: value format.
  5873. // For example:
  5874. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  5875. Data []*DiskTypeListWarningData `json:"data,omitempty"`
  5876. // Message: [Output Only] A human-readable description of the warning
  5877. // code.
  5878. Message string `json:"message,omitempty"`
  5879. // ForceSendFields is a list of field names (e.g. "Code") to
  5880. // unconditionally include in API requests. By default, fields with
  5881. // empty values are omitted from API requests. However, any non-pointer,
  5882. // non-interface field appearing in ForceSendFields will be sent to the
  5883. // server regardless of whether the field is empty or not. This may be
  5884. // used to include empty fields in Patch requests.
  5885. ForceSendFields []string `json:"-"`
  5886. // NullFields is a list of field names (e.g. "Code") to include in API
  5887. // requests with the JSON null value. By default, fields with empty
  5888. // values are omitted from API requests. However, any field with an
  5889. // empty value appearing in NullFields will be sent to the server as
  5890. // null. It is an error if a field in this list has a non-empty value.
  5891. // This may be used to include null fields in Patch requests.
  5892. NullFields []string `json:"-"`
  5893. }
  5894. func (s *DiskTypeListWarning) MarshalJSON() ([]byte, error) {
  5895. type NoMethod DiskTypeListWarning
  5896. raw := NoMethod(*s)
  5897. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5898. }
  5899. type DiskTypeListWarningData struct {
  5900. // Key: [Output Only] A key that provides more detail on the warning
  5901. // being returned. For example, for warnings where there are no results
  5902. // in a list request for a particular zone, this key might be scope and
  5903. // the key value might be the zone name. Other examples might be a key
  5904. // indicating a deprecated resource and a suggested replacement, or a
  5905. // warning about invalid network settings (for example, if an instance
  5906. // attempts to perform IP forwarding but is not enabled for IP
  5907. // forwarding).
  5908. Key string `json:"key,omitempty"`
  5909. // Value: [Output Only] A warning data value corresponding to the key.
  5910. Value string `json:"value,omitempty"`
  5911. // ForceSendFields is a list of field names (e.g. "Key") to
  5912. // unconditionally include in API requests. By default, fields with
  5913. // empty values are omitted from API requests. However, any non-pointer,
  5914. // non-interface field appearing in ForceSendFields will be sent to the
  5915. // server regardless of whether the field is empty or not. This may be
  5916. // used to include empty fields in Patch requests.
  5917. ForceSendFields []string `json:"-"`
  5918. // NullFields is a list of field names (e.g. "Key") to include in API
  5919. // requests with the JSON null value. By default, fields with empty
  5920. // values are omitted from API requests. However, any field with an
  5921. // empty value appearing in NullFields will be sent to the server as
  5922. // null. It is an error if a field in this list has a non-empty value.
  5923. // This may be used to include null fields in Patch requests.
  5924. NullFields []string `json:"-"`
  5925. }
  5926. func (s *DiskTypeListWarningData) MarshalJSON() ([]byte, error) {
  5927. type NoMethod DiskTypeListWarningData
  5928. raw := NoMethod(*s)
  5929. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5930. }
  5931. type DiskTypesScopedList struct {
  5932. // DiskTypes: [Output Only] A list of disk types contained in this
  5933. // scope.
  5934. DiskTypes []*DiskType `json:"diskTypes,omitempty"`
  5935. // Warning: [Output Only] Informational warning which replaces the list
  5936. // of disk types when the list is empty.
  5937. Warning *DiskTypesScopedListWarning `json:"warning,omitempty"`
  5938. // ForceSendFields is a list of field names (e.g. "DiskTypes") to
  5939. // unconditionally include in API requests. By default, fields with
  5940. // empty values are omitted from API requests. However, any non-pointer,
  5941. // non-interface field appearing in ForceSendFields will be sent to the
  5942. // server regardless of whether the field is empty or not. This may be
  5943. // used to include empty fields in Patch requests.
  5944. ForceSendFields []string `json:"-"`
  5945. // NullFields is a list of field names (e.g. "DiskTypes") to include in
  5946. // API requests with the JSON null value. By default, fields with empty
  5947. // values are omitted from API requests. However, any field with an
  5948. // empty value appearing in NullFields will be sent to the server as
  5949. // null. It is an error if a field in this list has a non-empty value.
  5950. // This may be used to include null fields in Patch requests.
  5951. NullFields []string `json:"-"`
  5952. }
  5953. func (s *DiskTypesScopedList) MarshalJSON() ([]byte, error) {
  5954. type NoMethod DiskTypesScopedList
  5955. raw := NoMethod(*s)
  5956. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5957. }
  5958. // DiskTypesScopedListWarning: [Output Only] Informational warning which
  5959. // replaces the list of disk types when the list is empty.
  5960. type DiskTypesScopedListWarning struct {
  5961. // Code: [Output Only] A warning code, if applicable. For example,
  5962. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  5963. // the response.
  5964. //
  5965. // Possible values:
  5966. // "CLEANUP_FAILED"
  5967. // "DEPRECATED_RESOURCE_USED"
  5968. // "DEPRECATED_TYPE_USED"
  5969. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  5970. // "EXPERIMENTAL_TYPE_USED"
  5971. // "EXTERNAL_API_WARNING"
  5972. // "FIELD_VALUE_OVERRIDEN"
  5973. // "INJECTED_KERNELS_DEPRECATED"
  5974. // "MISSING_TYPE_DEPENDENCY"
  5975. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  5976. // "NEXT_HOP_CANNOT_IP_FORWARD"
  5977. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  5978. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  5979. // "NEXT_HOP_NOT_RUNNING"
  5980. // "NOT_CRITICAL_ERROR"
  5981. // "NO_RESULTS_ON_PAGE"
  5982. // "REQUIRED_TOS_AGREEMENT"
  5983. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  5984. // "RESOURCE_NOT_DELETED"
  5985. // "SCHEMA_VALIDATION_IGNORED"
  5986. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  5987. // "UNDECLARED_PROPERTIES"
  5988. // "UNREACHABLE"
  5989. Code string `json:"code,omitempty"`
  5990. // Data: [Output Only] Metadata about this warning in key: value format.
  5991. // For example:
  5992. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  5993. Data []*DiskTypesScopedListWarningData `json:"data,omitempty"`
  5994. // Message: [Output Only] A human-readable description of the warning
  5995. // code.
  5996. Message string `json:"message,omitempty"`
  5997. // ForceSendFields is a list of field names (e.g. "Code") to
  5998. // unconditionally include in API requests. By default, fields with
  5999. // empty values are omitted from API requests. However, any non-pointer,
  6000. // non-interface field appearing in ForceSendFields will be sent to the
  6001. // server regardless of whether the field is empty or not. This may be
  6002. // used to include empty fields in Patch requests.
  6003. ForceSendFields []string `json:"-"`
  6004. // NullFields is a list of field names (e.g. "Code") to include in API
  6005. // requests with the JSON null value. By default, fields with empty
  6006. // values are omitted from API requests. However, any field with an
  6007. // empty value appearing in NullFields will be sent to the server as
  6008. // null. It is an error if a field in this list has a non-empty value.
  6009. // This may be used to include null fields in Patch requests.
  6010. NullFields []string `json:"-"`
  6011. }
  6012. func (s *DiskTypesScopedListWarning) MarshalJSON() ([]byte, error) {
  6013. type NoMethod DiskTypesScopedListWarning
  6014. raw := NoMethod(*s)
  6015. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6016. }
  6017. type DiskTypesScopedListWarningData struct {
  6018. // Key: [Output Only] A key that provides more detail on the warning
  6019. // being returned. For example, for warnings where there are no results
  6020. // in a list request for a particular zone, this key might be scope and
  6021. // the key value might be the zone name. Other examples might be a key
  6022. // indicating a deprecated resource and a suggested replacement, or a
  6023. // warning about invalid network settings (for example, if an instance
  6024. // attempts to perform IP forwarding but is not enabled for IP
  6025. // forwarding).
  6026. Key string `json:"key,omitempty"`
  6027. // Value: [Output Only] A warning data value corresponding to the key.
  6028. Value string `json:"value,omitempty"`
  6029. // ForceSendFields is a list of field names (e.g. "Key") to
  6030. // unconditionally include in API requests. By default, fields with
  6031. // empty values are omitted from API requests. However, any non-pointer,
  6032. // non-interface field appearing in ForceSendFields will be sent to the
  6033. // server regardless of whether the field is empty or not. This may be
  6034. // used to include empty fields in Patch requests.
  6035. ForceSendFields []string `json:"-"`
  6036. // NullFields is a list of field names (e.g. "Key") to include in API
  6037. // requests with the JSON null value. By default, fields with empty
  6038. // values are omitted from API requests. However, any field with an
  6039. // empty value appearing in NullFields will be sent to the server as
  6040. // null. It is an error if a field in this list has a non-empty value.
  6041. // This may be used to include null fields in Patch requests.
  6042. NullFields []string `json:"-"`
  6043. }
  6044. func (s *DiskTypesScopedListWarningData) MarshalJSON() ([]byte, error) {
  6045. type NoMethod DiskTypesScopedListWarningData
  6046. raw := NoMethod(*s)
  6047. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6048. }
  6049. type DisksAddResourcePoliciesRequest struct {
  6050. // ResourcePolicies: Resource policies to be added to this disk.
  6051. ResourcePolicies []string `json:"resourcePolicies,omitempty"`
  6052. // ForceSendFields is a list of field names (e.g. "ResourcePolicies") to
  6053. // unconditionally include in API requests. By default, fields with
  6054. // empty values are omitted from API requests. However, any non-pointer,
  6055. // non-interface field appearing in ForceSendFields will be sent to the
  6056. // server regardless of whether the field is empty or not. This may be
  6057. // used to include empty fields in Patch requests.
  6058. ForceSendFields []string `json:"-"`
  6059. // NullFields is a list of field names (e.g. "ResourcePolicies") to
  6060. // include in API requests with the JSON null value. By default, fields
  6061. // with empty values are omitted from API requests. However, any field
  6062. // with an empty value appearing in NullFields will be sent to the
  6063. // server as null. It is an error if a field in this list has a
  6064. // non-empty value. This may be used to include null fields in Patch
  6065. // requests.
  6066. NullFields []string `json:"-"`
  6067. }
  6068. func (s *DisksAddResourcePoliciesRequest) MarshalJSON() ([]byte, error) {
  6069. type NoMethod DisksAddResourcePoliciesRequest
  6070. raw := NoMethod(*s)
  6071. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6072. }
  6073. type DisksRemoveResourcePoliciesRequest struct {
  6074. // ResourcePolicies: Resource policies to be removed from this disk.
  6075. ResourcePolicies []string `json:"resourcePolicies,omitempty"`
  6076. // ForceSendFields is a list of field names (e.g. "ResourcePolicies") to
  6077. // unconditionally include in API requests. By default, fields with
  6078. // empty values are omitted from API requests. However, any non-pointer,
  6079. // non-interface field appearing in ForceSendFields will be sent to the
  6080. // server regardless of whether the field is empty or not. This may be
  6081. // used to include empty fields in Patch requests.
  6082. ForceSendFields []string `json:"-"`
  6083. // NullFields is a list of field names (e.g. "ResourcePolicies") to
  6084. // include in API requests with the JSON null value. By default, fields
  6085. // with empty values are omitted from API requests. However, any field
  6086. // with an empty value appearing in NullFields will be sent to the
  6087. // server as null. It is an error if a field in this list has a
  6088. // non-empty value. This may be used to include null fields in Patch
  6089. // requests.
  6090. NullFields []string `json:"-"`
  6091. }
  6092. func (s *DisksRemoveResourcePoliciesRequest) MarshalJSON() ([]byte, error) {
  6093. type NoMethod DisksRemoveResourcePoliciesRequest
  6094. raw := NoMethod(*s)
  6095. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6096. }
  6097. type DisksResizeRequest struct {
  6098. // SizeGb: The new size of the persistent disk, which is specified in
  6099. // GB.
  6100. SizeGb int64 `json:"sizeGb,omitempty,string"`
  6101. // ForceSendFields is a list of field names (e.g. "SizeGb") to
  6102. // unconditionally include in API requests. By default, fields with
  6103. // empty values are omitted from API requests. However, any non-pointer,
  6104. // non-interface field appearing in ForceSendFields will be sent to the
  6105. // server regardless of whether the field is empty or not. This may be
  6106. // used to include empty fields in Patch requests.
  6107. ForceSendFields []string `json:"-"`
  6108. // NullFields is a list of field names (e.g. "SizeGb") to include in API
  6109. // requests with the JSON null value. By default, fields with empty
  6110. // values are omitted from API requests. However, any field with an
  6111. // empty value appearing in NullFields will be sent to the server as
  6112. // null. It is an error if a field in this list has a non-empty value.
  6113. // This may be used to include null fields in Patch requests.
  6114. NullFields []string `json:"-"`
  6115. }
  6116. func (s *DisksResizeRequest) MarshalJSON() ([]byte, error) {
  6117. type NoMethod DisksResizeRequest
  6118. raw := NoMethod(*s)
  6119. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6120. }
  6121. type DisksScopedList struct {
  6122. // Disks: [Output Only] A list of disks contained in this scope.
  6123. Disks []*Disk `json:"disks,omitempty"`
  6124. // Warning: [Output Only] Informational warning which replaces the list
  6125. // of disks when the list is empty.
  6126. Warning *DisksScopedListWarning `json:"warning,omitempty"`
  6127. // ForceSendFields is a list of field names (e.g. "Disks") to
  6128. // unconditionally include in API requests. By default, fields with
  6129. // empty values are omitted from API requests. However, any non-pointer,
  6130. // non-interface field appearing in ForceSendFields will be sent to the
  6131. // server regardless of whether the field is empty or not. This may be
  6132. // used to include empty fields in Patch requests.
  6133. ForceSendFields []string `json:"-"`
  6134. // NullFields is a list of field names (e.g. "Disks") to include in API
  6135. // requests with the JSON null value. By default, fields with empty
  6136. // values are omitted from API requests. However, any field with an
  6137. // empty value appearing in NullFields will be sent to the server as
  6138. // null. It is an error if a field in this list has a non-empty value.
  6139. // This may be used to include null fields in Patch requests.
  6140. NullFields []string `json:"-"`
  6141. }
  6142. func (s *DisksScopedList) MarshalJSON() ([]byte, error) {
  6143. type NoMethod DisksScopedList
  6144. raw := NoMethod(*s)
  6145. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6146. }
  6147. // DisksScopedListWarning: [Output Only] Informational warning which
  6148. // replaces the list of disks when the list is empty.
  6149. type DisksScopedListWarning struct {
  6150. // Code: [Output Only] A warning code, if applicable. For example,
  6151. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  6152. // the response.
  6153. //
  6154. // Possible values:
  6155. // "CLEANUP_FAILED"
  6156. // "DEPRECATED_RESOURCE_USED"
  6157. // "DEPRECATED_TYPE_USED"
  6158. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  6159. // "EXPERIMENTAL_TYPE_USED"
  6160. // "EXTERNAL_API_WARNING"
  6161. // "FIELD_VALUE_OVERRIDEN"
  6162. // "INJECTED_KERNELS_DEPRECATED"
  6163. // "MISSING_TYPE_DEPENDENCY"
  6164. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  6165. // "NEXT_HOP_CANNOT_IP_FORWARD"
  6166. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  6167. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  6168. // "NEXT_HOP_NOT_RUNNING"
  6169. // "NOT_CRITICAL_ERROR"
  6170. // "NO_RESULTS_ON_PAGE"
  6171. // "REQUIRED_TOS_AGREEMENT"
  6172. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  6173. // "RESOURCE_NOT_DELETED"
  6174. // "SCHEMA_VALIDATION_IGNORED"
  6175. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  6176. // "UNDECLARED_PROPERTIES"
  6177. // "UNREACHABLE"
  6178. Code string `json:"code,omitempty"`
  6179. // Data: [Output Only] Metadata about this warning in key: value format.
  6180. // For example:
  6181. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  6182. Data []*DisksScopedListWarningData `json:"data,omitempty"`
  6183. // Message: [Output Only] A human-readable description of the warning
  6184. // code.
  6185. Message string `json:"message,omitempty"`
  6186. // ForceSendFields is a list of field names (e.g. "Code") to
  6187. // unconditionally include in API requests. By default, fields with
  6188. // empty values are omitted from API requests. However, any non-pointer,
  6189. // non-interface field appearing in ForceSendFields will be sent to the
  6190. // server regardless of whether the field is empty or not. This may be
  6191. // used to include empty fields in Patch requests.
  6192. ForceSendFields []string `json:"-"`
  6193. // NullFields is a list of field names (e.g. "Code") to include in API
  6194. // requests with the JSON null value. By default, fields with empty
  6195. // values are omitted from API requests. However, any field with an
  6196. // empty value appearing in NullFields will be sent to the server as
  6197. // null. It is an error if a field in this list has a non-empty value.
  6198. // This may be used to include null fields in Patch requests.
  6199. NullFields []string `json:"-"`
  6200. }
  6201. func (s *DisksScopedListWarning) MarshalJSON() ([]byte, error) {
  6202. type NoMethod DisksScopedListWarning
  6203. raw := NoMethod(*s)
  6204. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6205. }
  6206. type DisksScopedListWarningData struct {
  6207. // Key: [Output Only] A key that provides more detail on the warning
  6208. // being returned. For example, for warnings where there are no results
  6209. // in a list request for a particular zone, this key might be scope and
  6210. // the key value might be the zone name. Other examples might be a key
  6211. // indicating a deprecated resource and a suggested replacement, or a
  6212. // warning about invalid network settings (for example, if an instance
  6213. // attempts to perform IP forwarding but is not enabled for IP
  6214. // forwarding).
  6215. Key string `json:"key,omitempty"`
  6216. // Value: [Output Only] A warning data value corresponding to the key.
  6217. Value string `json:"value,omitempty"`
  6218. // ForceSendFields is a list of field names (e.g. "Key") to
  6219. // unconditionally include in API requests. By default, fields with
  6220. // empty values are omitted from API requests. However, any non-pointer,
  6221. // non-interface field appearing in ForceSendFields will be sent to the
  6222. // server regardless of whether the field is empty or not. This may be
  6223. // used to include empty fields in Patch requests.
  6224. ForceSendFields []string `json:"-"`
  6225. // NullFields is a list of field names (e.g. "Key") to include in API
  6226. // requests with the JSON null value. By default, fields with empty
  6227. // values are omitted from API requests. However, any field with an
  6228. // empty value appearing in NullFields will be sent to the server as
  6229. // null. It is an error if a field in this list has a non-empty value.
  6230. // This may be used to include null fields in Patch requests.
  6231. NullFields []string `json:"-"`
  6232. }
  6233. func (s *DisksScopedListWarningData) MarshalJSON() ([]byte, error) {
  6234. type NoMethod DisksScopedListWarningData
  6235. raw := NoMethod(*s)
  6236. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6237. }
  6238. type DistributionPolicy struct {
  6239. Zones []*DistributionPolicyZoneConfiguration `json:"zones,omitempty"`
  6240. // ForceSendFields is a list of field names (e.g. "Zones") to
  6241. // unconditionally include in API requests. By default, fields with
  6242. // empty values are omitted from API requests. However, any non-pointer,
  6243. // non-interface field appearing in ForceSendFields will be sent to the
  6244. // server regardless of whether the field is empty or not. This may be
  6245. // used to include empty fields in Patch requests.
  6246. ForceSendFields []string `json:"-"`
  6247. // NullFields is a list of field names (e.g. "Zones") to include in API
  6248. // requests with the JSON null value. By default, fields with empty
  6249. // values are omitted from API requests. However, any field with an
  6250. // empty value appearing in NullFields will be sent to the server as
  6251. // null. It is an error if a field in this list has a non-empty value.
  6252. // This may be used to include null fields in Patch requests.
  6253. NullFields []string `json:"-"`
  6254. }
  6255. func (s *DistributionPolicy) MarshalJSON() ([]byte, error) {
  6256. type NoMethod DistributionPolicy
  6257. raw := NoMethod(*s)
  6258. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6259. }
  6260. type DistributionPolicyZoneConfiguration struct {
  6261. // Zone: URL of the zone where managed instance group is spawning
  6262. // instances (for regional resources). Zone has to belong to the region
  6263. // where managed instance group is located.
  6264. Zone string `json:"zone,omitempty"`
  6265. // ForceSendFields is a list of field names (e.g. "Zone") to
  6266. // unconditionally include in API requests. By default, fields with
  6267. // empty values are omitted from API requests. However, any non-pointer,
  6268. // non-interface field appearing in ForceSendFields will be sent to the
  6269. // server regardless of whether the field is empty or not. This may be
  6270. // used to include empty fields in Patch requests.
  6271. ForceSendFields []string `json:"-"`
  6272. // NullFields is a list of field names (e.g. "Zone") to include in API
  6273. // requests with the JSON null value. By default, fields with empty
  6274. // values are omitted from API requests. However, any field with an
  6275. // empty value appearing in NullFields will be sent to the server as
  6276. // null. It is an error if a field in this list has a non-empty value.
  6277. // This may be used to include null fields in Patch requests.
  6278. NullFields []string `json:"-"`
  6279. }
  6280. func (s *DistributionPolicyZoneConfiguration) MarshalJSON() ([]byte, error) {
  6281. type NoMethod DistributionPolicyZoneConfiguration
  6282. raw := NoMethod(*s)
  6283. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6284. }
  6285. // Expr: Represents an expression text. Example:
  6286. //
  6287. // title: "User account presence" description: "Determines whether the
  6288. // request has a user account" expression: "size(request.user) > 0"
  6289. type Expr struct {
  6290. // Description: An optional description of the expression. This is a
  6291. // longer text which describes the expression, e.g. when hovered over it
  6292. // in a UI.
  6293. Description string `json:"description,omitempty"`
  6294. // Expression: Textual representation of an expression in Common
  6295. // Expression Language syntax.
  6296. //
  6297. // The application context of the containing message determines which
  6298. // well-known feature set of CEL is supported.
  6299. Expression string `json:"expression,omitempty"`
  6300. // Location: An optional string indicating the location of the
  6301. // expression for error reporting, e.g. a file name and a position in
  6302. // the file.
  6303. Location string `json:"location,omitempty"`
  6304. // Title: An optional title for the expression, i.e. a short string
  6305. // describing its purpose. This can be used e.g. in UIs which allow to
  6306. // enter the expression.
  6307. Title string `json:"title,omitempty"`
  6308. // ForceSendFields is a list of field names (e.g. "Description") to
  6309. // unconditionally include in API requests. By default, fields with
  6310. // empty values are omitted from API requests. However, any non-pointer,
  6311. // non-interface field appearing in ForceSendFields will be sent to the
  6312. // server regardless of whether the field is empty or not. This may be
  6313. // used to include empty fields in Patch requests.
  6314. ForceSendFields []string `json:"-"`
  6315. // NullFields is a list of field names (e.g. "Description") to include
  6316. // in API requests with the JSON null value. By default, fields with
  6317. // empty values are omitted from API requests. However, any field with
  6318. // an empty value appearing in NullFields will be sent to the server as
  6319. // null. It is an error if a field in this list has a non-empty value.
  6320. // This may be used to include null fields in Patch requests.
  6321. NullFields []string `json:"-"`
  6322. }
  6323. func (s *Expr) MarshalJSON() ([]byte, error) {
  6324. type NoMethod Expr
  6325. raw := NoMethod(*s)
  6326. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6327. }
  6328. // Firewall: Represents a Firewall resource.
  6329. type Firewall struct {
  6330. // Allowed: The list of ALLOW rules specified by this firewall. Each
  6331. // rule specifies a protocol and port-range tuple that describes a
  6332. // permitted connection.
  6333. Allowed []*FirewallAllowed `json:"allowed,omitempty"`
  6334. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  6335. // format.
  6336. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  6337. // Denied: The list of DENY rules specified by this firewall. Each rule
  6338. // specifies a protocol and port-range tuple that describes a denied
  6339. // connection.
  6340. Denied []*FirewallDenied `json:"denied,omitempty"`
  6341. // Description: An optional description of this resource. Provide this
  6342. // property when you create the resource.
  6343. Description string `json:"description,omitempty"`
  6344. // DestinationRanges: If destination ranges are specified, the firewall
  6345. // will apply only to traffic that has destination IP address in these
  6346. // ranges. These ranges must be expressed in CIDR format. Only IPv4 is
  6347. // supported.
  6348. DestinationRanges []string `json:"destinationRanges,omitempty"`
  6349. // Direction: Direction of traffic to which this firewall applies;
  6350. // default is INGRESS. Note: For INGRESS traffic, it is NOT supported to
  6351. // specify destinationRanges; For EGRESS traffic, it is NOT supported to
  6352. // specify sourceRanges OR sourceTags.
  6353. //
  6354. // Possible values:
  6355. // "EGRESS"
  6356. // "INGRESS"
  6357. Direction string `json:"direction,omitempty"`
  6358. // Disabled: Denotes whether the firewall rule is disabled, i.e not
  6359. // applied to the network it is associated with. When set to true, the
  6360. // firewall rule is not enforced and the network behaves as if it did
  6361. // not exist. If this is unspecified, the firewall rule will be enabled.
  6362. Disabled bool `json:"disabled,omitempty"`
  6363. // EnableLogging: This field denotes whether to enable logging for a
  6364. // particular firewall rule. If logging is enabled, logs will be
  6365. // exported to Stackdriver.
  6366. EnableLogging bool `json:"enableLogging,omitempty"`
  6367. // Id: [Output Only] The unique identifier for the resource. This
  6368. // identifier is defined by the server.
  6369. Id uint64 `json:"id,omitempty,string"`
  6370. // Kind: [Output Only] Type of the resource. Always compute#firewall for
  6371. // firewall rules.
  6372. Kind string `json:"kind,omitempty"`
  6373. // Name: Name of the resource; provided by the client when the resource
  6374. // is created. The name must be 1-63 characters long, and comply with
  6375. // RFC1035. Specifically, the name must be 1-63 characters long and
  6376. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  6377. // the first character must be a lowercase letter, and all following
  6378. // characters must be a dash, lowercase letter, or digit, except the
  6379. // last character, which cannot be a dash.
  6380. Name string `json:"name,omitempty"`
  6381. // Network: URL of the network resource for this firewall rule. If not
  6382. // specified when creating a firewall rule, the default network is
  6383. // used:
  6384. // global/networks/default
  6385. // If you choose to specify this property, you can specify the network
  6386. // as a full or partial URL. For example, the following are all valid
  6387. // URLs:
  6388. // -
  6389. // https://www.googleapis.com/compute/v1/projects/myproject/global/networks/my-network
  6390. // - projects/myproject/global/networks/my-network
  6391. // - global/networks/default
  6392. Network string `json:"network,omitempty"`
  6393. // Priority: Priority for this rule. This is an integer between 0 and
  6394. // 65535, both inclusive. When not specified, the value assumed is 1000.
  6395. // Relative priorities determine precedence of conflicting rules. Lower
  6396. // value of priority implies higher precedence (eg, a rule with priority
  6397. // 0 has higher precedence than a rule with priority 1). DENY rules take
  6398. // precedence over ALLOW rules having equal priority.
  6399. Priority int64 `json:"priority,omitempty"`
  6400. // SelfLink: [Output Only] Server-defined URL for the resource.
  6401. SelfLink string `json:"selfLink,omitempty"`
  6402. // SourceRanges: If source ranges are specified, the firewall will apply
  6403. // only to traffic that has source IP address in these ranges. These
  6404. // ranges must be expressed in CIDR format. One or both of sourceRanges
  6405. // and sourceTags may be set. If both properties are set, the firewall
  6406. // will apply to traffic that has source IP address within sourceRanges
  6407. // OR the source IP that belongs to a tag listed in the sourceTags
  6408. // property. The connection does not need to match both properties for
  6409. // the firewall to apply. Only IPv4 is supported.
  6410. SourceRanges []string `json:"sourceRanges,omitempty"`
  6411. // SourceServiceAccounts: If source service accounts are specified, the
  6412. // firewall will apply only to traffic originating from an instance with
  6413. // a service account in this list. Source service accounts cannot be
  6414. // used to control traffic to an instance's external IP address because
  6415. // service accounts are associated with an instance, not an IP address.
  6416. // sourceRanges can be set at the same time as sourceServiceAccounts. If
  6417. // both are set, the firewall will apply to traffic that has source IP
  6418. // address within sourceRanges OR the source IP belongs to an instance
  6419. // with service account listed in sourceServiceAccount. The connection
  6420. // does not need to match both properties for the firewall to apply.
  6421. // sourceServiceAccounts cannot be used at the same time as sourceTags
  6422. // or targetTags.
  6423. SourceServiceAccounts []string `json:"sourceServiceAccounts,omitempty"`
  6424. // SourceTags: If source tags are specified, the firewall rule applies
  6425. // only to traffic with source IPs that match the primary network
  6426. // interfaces of VM instances that have the tag and are in the same VPC
  6427. // network. Source tags cannot be used to control traffic to an
  6428. // instance's external IP address, it only applies to traffic between
  6429. // instances in the same virtual network. Because tags are associated
  6430. // with instances, not IP addresses. One or both of sourceRanges and
  6431. // sourceTags may be set. If both properties are set, the firewall will
  6432. // apply to traffic that has source IP address within sourceRanges OR
  6433. // the source IP that belongs to a tag listed in the sourceTags
  6434. // property. The connection does not need to match both properties for
  6435. // the firewall to apply.
  6436. SourceTags []string `json:"sourceTags,omitempty"`
  6437. // TargetServiceAccounts: A list of service accounts indicating sets of
  6438. // instances located in the network that may make network connections as
  6439. // specified in allowed[]. targetServiceAccounts cannot be used at the
  6440. // same time as targetTags or sourceTags. If neither
  6441. // targetServiceAccounts nor targetTags are specified, the firewall rule
  6442. // applies to all instances on the specified network.
  6443. TargetServiceAccounts []string `json:"targetServiceAccounts,omitempty"`
  6444. // TargetTags: A list of tags that controls which instances the firewall
  6445. // rule applies to. If targetTags are specified, then the firewall rule
  6446. // applies only to instances in the VPC network that have one of those
  6447. // tags. If no targetTags are specified, the firewall rule applies to
  6448. // all instances on the specified network.
  6449. TargetTags []string `json:"targetTags,omitempty"`
  6450. // ServerResponse contains the HTTP response code and headers from the
  6451. // server.
  6452. googleapi.ServerResponse `json:"-"`
  6453. // ForceSendFields is a list of field names (e.g. "Allowed") to
  6454. // unconditionally include in API requests. By default, fields with
  6455. // empty values are omitted from API requests. However, any non-pointer,
  6456. // non-interface field appearing in ForceSendFields will be sent to the
  6457. // server regardless of whether the field is empty or not. This may be
  6458. // used to include empty fields in Patch requests.
  6459. ForceSendFields []string `json:"-"`
  6460. // NullFields is a list of field names (e.g. "Allowed") to include in
  6461. // API requests with the JSON null value. By default, fields with empty
  6462. // values are omitted from API requests. However, any field with an
  6463. // empty value appearing in NullFields will be sent to the server as
  6464. // null. It is an error if a field in this list has a non-empty value.
  6465. // This may be used to include null fields in Patch requests.
  6466. NullFields []string `json:"-"`
  6467. }
  6468. func (s *Firewall) MarshalJSON() ([]byte, error) {
  6469. type NoMethod Firewall
  6470. raw := NoMethod(*s)
  6471. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6472. }
  6473. type FirewallAllowed struct {
  6474. // IPProtocol: The IP protocol to which this rule applies. The protocol
  6475. // type is required when creating a firewall rule. This value can either
  6476. // be one of the following well known protocol strings (tcp, udp, icmp,
  6477. // esp, ah, ipip, sctp), or the IP protocol number.
  6478. IPProtocol string `json:"IPProtocol,omitempty"`
  6479. // Ports: An optional list of ports to which this rule applies. This
  6480. // field is only applicable for UDP or TCP protocol. Each entry must be
  6481. // either an integer or a range. If not specified, this rule applies to
  6482. // connections through any port.
  6483. //
  6484. // Example inputs include: ["22"], ["80","443"], and ["12345-12349"].
  6485. Ports []string `json:"ports,omitempty"`
  6486. // ForceSendFields is a list of field names (e.g. "IPProtocol") to
  6487. // unconditionally include in API requests. By default, fields with
  6488. // empty values are omitted from API requests. However, any non-pointer,
  6489. // non-interface field appearing in ForceSendFields will be sent to the
  6490. // server regardless of whether the field is empty or not. This may be
  6491. // used to include empty fields in Patch requests.
  6492. ForceSendFields []string `json:"-"`
  6493. // NullFields is a list of field names (e.g. "IPProtocol") to include in
  6494. // API requests with the JSON null value. By default, fields with empty
  6495. // values are omitted from API requests. However, any field with an
  6496. // empty value appearing in NullFields will be sent to the server as
  6497. // null. It is an error if a field in this list has a non-empty value.
  6498. // This may be used to include null fields in Patch requests.
  6499. NullFields []string `json:"-"`
  6500. }
  6501. func (s *FirewallAllowed) MarshalJSON() ([]byte, error) {
  6502. type NoMethod FirewallAllowed
  6503. raw := NoMethod(*s)
  6504. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6505. }
  6506. type FirewallDenied struct {
  6507. // IPProtocol: The IP protocol to which this rule applies. The protocol
  6508. // type is required when creating a firewall rule. This value can either
  6509. // be one of the following well known protocol strings (tcp, udp, icmp,
  6510. // esp, ah, ipip, sctp), or the IP protocol number.
  6511. IPProtocol string `json:"IPProtocol,omitempty"`
  6512. // Ports: An optional list of ports to which this rule applies. This
  6513. // field is only applicable for UDP or TCP protocol. Each entry must be
  6514. // either an integer or a range. If not specified, this rule applies to
  6515. // connections through any port.
  6516. //
  6517. // Example inputs include: ["22"], ["80","443"], and ["12345-12349"].
  6518. Ports []string `json:"ports,omitempty"`
  6519. // ForceSendFields is a list of field names (e.g. "IPProtocol") to
  6520. // unconditionally include in API requests. By default, fields with
  6521. // empty values are omitted from API requests. However, any non-pointer,
  6522. // non-interface field appearing in ForceSendFields will be sent to the
  6523. // server regardless of whether the field is empty or not. This may be
  6524. // used to include empty fields in Patch requests.
  6525. ForceSendFields []string `json:"-"`
  6526. // NullFields is a list of field names (e.g. "IPProtocol") to include in
  6527. // API requests with the JSON null value. By default, fields with empty
  6528. // values are omitted from API requests. However, any field with an
  6529. // empty value appearing in NullFields will be sent to the server as
  6530. // null. It is an error if a field in this list has a non-empty value.
  6531. // This may be used to include null fields in Patch requests.
  6532. NullFields []string `json:"-"`
  6533. }
  6534. func (s *FirewallDenied) MarshalJSON() ([]byte, error) {
  6535. type NoMethod FirewallDenied
  6536. raw := NoMethod(*s)
  6537. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6538. }
  6539. // FirewallList: Contains a list of firewalls.
  6540. type FirewallList struct {
  6541. // Id: [Output Only] Unique identifier for the resource; defined by the
  6542. // server.
  6543. Id string `json:"id,omitempty"`
  6544. // Items: A list of Firewall resources.
  6545. Items []*Firewall `json:"items,omitempty"`
  6546. // Kind: [Output Only] Type of resource. Always compute#firewallList for
  6547. // lists of firewalls.
  6548. Kind string `json:"kind,omitempty"`
  6549. // NextPageToken: [Output Only] This token allows you to get the next
  6550. // page of results for list requests. If the number of results is larger
  6551. // than maxResults, use the nextPageToken as a value for the query
  6552. // parameter pageToken in the next list request. Subsequent list
  6553. // requests will have their own nextPageToken to continue paging through
  6554. // the results.
  6555. NextPageToken string `json:"nextPageToken,omitempty"`
  6556. // SelfLink: [Output Only] Server-defined URL for this resource.
  6557. SelfLink string `json:"selfLink,omitempty"`
  6558. // Warning: [Output Only] Informational warning message.
  6559. Warning *FirewallListWarning `json:"warning,omitempty"`
  6560. // ServerResponse contains the HTTP response code and headers from the
  6561. // server.
  6562. googleapi.ServerResponse `json:"-"`
  6563. // ForceSendFields is a list of field names (e.g. "Id") to
  6564. // unconditionally include in API requests. By default, fields with
  6565. // empty values are omitted from API requests. However, any non-pointer,
  6566. // non-interface field appearing in ForceSendFields will be sent to the
  6567. // server regardless of whether the field is empty or not. This may be
  6568. // used to include empty fields in Patch requests.
  6569. ForceSendFields []string `json:"-"`
  6570. // NullFields is a list of field names (e.g. "Id") to include in API
  6571. // requests with the JSON null value. By default, fields with empty
  6572. // values are omitted from API requests. However, any field with an
  6573. // empty value appearing in NullFields will be sent to the server as
  6574. // null. It is an error if a field in this list has a non-empty value.
  6575. // This may be used to include null fields in Patch requests.
  6576. NullFields []string `json:"-"`
  6577. }
  6578. func (s *FirewallList) MarshalJSON() ([]byte, error) {
  6579. type NoMethod FirewallList
  6580. raw := NoMethod(*s)
  6581. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6582. }
  6583. // FirewallListWarning: [Output Only] Informational warning message.
  6584. type FirewallListWarning struct {
  6585. // Code: [Output Only] A warning code, if applicable. For example,
  6586. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  6587. // the response.
  6588. //
  6589. // Possible values:
  6590. // "CLEANUP_FAILED"
  6591. // "DEPRECATED_RESOURCE_USED"
  6592. // "DEPRECATED_TYPE_USED"
  6593. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  6594. // "EXPERIMENTAL_TYPE_USED"
  6595. // "EXTERNAL_API_WARNING"
  6596. // "FIELD_VALUE_OVERRIDEN"
  6597. // "INJECTED_KERNELS_DEPRECATED"
  6598. // "MISSING_TYPE_DEPENDENCY"
  6599. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  6600. // "NEXT_HOP_CANNOT_IP_FORWARD"
  6601. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  6602. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  6603. // "NEXT_HOP_NOT_RUNNING"
  6604. // "NOT_CRITICAL_ERROR"
  6605. // "NO_RESULTS_ON_PAGE"
  6606. // "REQUIRED_TOS_AGREEMENT"
  6607. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  6608. // "RESOURCE_NOT_DELETED"
  6609. // "SCHEMA_VALIDATION_IGNORED"
  6610. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  6611. // "UNDECLARED_PROPERTIES"
  6612. // "UNREACHABLE"
  6613. Code string `json:"code,omitempty"`
  6614. // Data: [Output Only] Metadata about this warning in key: value format.
  6615. // For example:
  6616. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  6617. Data []*FirewallListWarningData `json:"data,omitempty"`
  6618. // Message: [Output Only] A human-readable description of the warning
  6619. // code.
  6620. Message string `json:"message,omitempty"`
  6621. // ForceSendFields is a list of field names (e.g. "Code") to
  6622. // unconditionally include in API requests. By default, fields with
  6623. // empty values are omitted from API requests. However, any non-pointer,
  6624. // non-interface field appearing in ForceSendFields will be sent to the
  6625. // server regardless of whether the field is empty or not. This may be
  6626. // used to include empty fields in Patch requests.
  6627. ForceSendFields []string `json:"-"`
  6628. // NullFields is a list of field names (e.g. "Code") to include in API
  6629. // requests with the JSON null value. By default, fields with empty
  6630. // values are omitted from API requests. However, any field with an
  6631. // empty value appearing in NullFields will be sent to the server as
  6632. // null. It is an error if a field in this list has a non-empty value.
  6633. // This may be used to include null fields in Patch requests.
  6634. NullFields []string `json:"-"`
  6635. }
  6636. func (s *FirewallListWarning) MarshalJSON() ([]byte, error) {
  6637. type NoMethod FirewallListWarning
  6638. raw := NoMethod(*s)
  6639. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6640. }
  6641. type FirewallListWarningData struct {
  6642. // Key: [Output Only] A key that provides more detail on the warning
  6643. // being returned. For example, for warnings where there are no results
  6644. // in a list request for a particular zone, this key might be scope and
  6645. // the key value might be the zone name. Other examples might be a key
  6646. // indicating a deprecated resource and a suggested replacement, or a
  6647. // warning about invalid network settings (for example, if an instance
  6648. // attempts to perform IP forwarding but is not enabled for IP
  6649. // forwarding).
  6650. Key string `json:"key,omitempty"`
  6651. // Value: [Output Only] A warning data value corresponding to the key.
  6652. Value string `json:"value,omitempty"`
  6653. // ForceSendFields is a list of field names (e.g. "Key") to
  6654. // unconditionally include in API requests. By default, fields with
  6655. // empty values are omitted from API requests. However, any non-pointer,
  6656. // non-interface field appearing in ForceSendFields will be sent to the
  6657. // server regardless of whether the field is empty or not. This may be
  6658. // used to include empty fields in Patch requests.
  6659. ForceSendFields []string `json:"-"`
  6660. // NullFields is a list of field names (e.g. "Key") to include in API
  6661. // requests with the JSON null value. By default, fields with empty
  6662. // values are omitted from API requests. However, any field with an
  6663. // empty value appearing in NullFields will be sent to the server as
  6664. // null. It is an error if a field in this list has a non-empty value.
  6665. // This may be used to include null fields in Patch requests.
  6666. NullFields []string `json:"-"`
  6667. }
  6668. func (s *FirewallListWarningData) MarshalJSON() ([]byte, error) {
  6669. type NoMethod FirewallListWarningData
  6670. raw := NoMethod(*s)
  6671. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6672. }
  6673. // FixedOrPercent: Encapsulates numeric value that can be either
  6674. // absolute or relative.
  6675. type FixedOrPercent struct {
  6676. // Calculated: [Output Only] Absolute value of VM instances calculated
  6677. // based on the specific mode.
  6678. //
  6679. //
  6680. // - If the value is fixed, then the caculated value is equal to the
  6681. // fixed value.
  6682. // - If the value is a percent, then the calculated value is percent/100
  6683. // * targetSize. For example, the calculated value of a 80% of a managed
  6684. // instance group with 150 instances would be (80/100 * 150) = 120 VM
  6685. // instances. If there is a remainder, the number is rounded up.
  6686. Calculated int64 `json:"calculated,omitempty"`
  6687. // Fixed: Specifies a fixed number of VM instances. This must be a
  6688. // positive integer.
  6689. Fixed int64 `json:"fixed,omitempty"`
  6690. // Percent: Specifies a percentage of instances between 0 to 100%,
  6691. // inclusive. For example, specify 80 for 80%.
  6692. Percent int64 `json:"percent,omitempty"`
  6693. // ForceSendFields is a list of field names (e.g. "Calculated") to
  6694. // unconditionally include in API requests. By default, fields with
  6695. // empty values are omitted from API requests. However, any non-pointer,
  6696. // non-interface field appearing in ForceSendFields will be sent to the
  6697. // server regardless of whether the field is empty or not. This may be
  6698. // used to include empty fields in Patch requests.
  6699. ForceSendFields []string `json:"-"`
  6700. // NullFields is a list of field names (e.g. "Calculated") to include in
  6701. // API requests with the JSON null value. By default, fields with empty
  6702. // values are omitted from API requests. However, any field with an
  6703. // empty value appearing in NullFields will be sent to the server as
  6704. // null. It is an error if a field in this list has a non-empty value.
  6705. // This may be used to include null fields in Patch requests.
  6706. NullFields []string `json:"-"`
  6707. }
  6708. func (s *FixedOrPercent) MarshalJSON() ([]byte, error) {
  6709. type NoMethod FixedOrPercent
  6710. raw := NoMethod(*s)
  6711. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6712. }
  6713. // ForwardingRule: A ForwardingRule resource. A ForwardingRule resource
  6714. // specifies which pool of target virtual machines to forward a packet
  6715. // to if it matches the given [IPAddress, IPProtocol, ports] tuple. (==
  6716. // resource_for beta.forwardingRules ==) (== resource_for
  6717. // v1.forwardingRules ==) (== resource_for beta.globalForwardingRules
  6718. // ==) (== resource_for v1.globalForwardingRules ==) (== resource_for
  6719. // beta.regionForwardingRules ==) (== resource_for
  6720. // v1.regionForwardingRules ==)
  6721. type ForwardingRule struct {
  6722. // IPAddress: The IP address that this forwarding rule is serving on
  6723. // behalf of.
  6724. //
  6725. // Addresses are restricted based on the forwarding rule's load
  6726. // balancing scheme (EXTERNAL or INTERNAL) and scope (global or
  6727. // regional).
  6728. //
  6729. // When the load balancing scheme is EXTERNAL, for global forwarding
  6730. // rules, the address must be a global IP, and for regional forwarding
  6731. // rules, the address must live in the same region as the forwarding
  6732. // rule. If this field is empty, an ephemeral IPv4 address from the same
  6733. // scope (global or regional) will be assigned. A regional forwarding
  6734. // rule supports IPv4 only. A global forwarding rule supports either
  6735. // IPv4 or IPv6.
  6736. //
  6737. // When the load balancing scheme is INTERNAL, this can only be an RFC
  6738. // 1918 IP address belonging to the network/subnet configured for the
  6739. // forwarding rule. By default, if this field is empty, an ephemeral
  6740. // internal IP address will be automatically allocated from the IP range
  6741. // of the subnet or network configured for this forwarding rule.
  6742. //
  6743. // An address can be specified either by a literal IP address or a URL
  6744. // reference to an existing Address resource. The following examples are
  6745. // all valid:
  6746. // - 100.1.2.3
  6747. // -
  6748. // https://www.googleapis.com/compute/v1/projects/project/regions/region/addresses/address
  6749. // - projects/project/regions/region/addresses/address
  6750. // - regions/region/addresses/address
  6751. // - global/addresses/address
  6752. // - address
  6753. IPAddress string `json:"IPAddress,omitempty"`
  6754. // IPProtocol: The IP protocol to which this rule applies. Valid options
  6755. // are TCP, UDP, ESP, AH, SCTP or ICMP.
  6756. //
  6757. // When the load balancing scheme is INTERNAL, only TCP and UDP are
  6758. // valid.
  6759. //
  6760. // Possible values:
  6761. // "AH"
  6762. // "ESP"
  6763. // "ICMP"
  6764. // "SCTP"
  6765. // "TCP"
  6766. // "UDP"
  6767. IPProtocol string `json:"IPProtocol,omitempty"`
  6768. // AllPorts: This field is used along with the backend_service field for
  6769. // internal load balancing or with the target field for internal
  6770. // TargetInstance. This field cannot be used with port or portRange
  6771. // fields.
  6772. //
  6773. // When the load balancing scheme is INTERNAL and protocol is TCP/UDP,
  6774. // specify this field to allow packets addressed to any ports will be
  6775. // forwarded to the backends configured with this forwarding rule.
  6776. AllPorts bool `json:"allPorts,omitempty"`
  6777. // BackendService: This field is not used for external load
  6778. // balancing.
  6779. //
  6780. // For internal load balancing, this field identifies the BackendService
  6781. // resource to receive the matched traffic.
  6782. BackendService string `json:"backendService,omitempty"`
  6783. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  6784. // format.
  6785. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  6786. // Description: An optional description of this resource. Provide this
  6787. // property when you create the resource.
  6788. Description string `json:"description,omitempty"`
  6789. // Fingerprint: Fingerprint of this resource. A hash of the contents
  6790. // stored in this object. This field is used in optimistic locking. This
  6791. // field will be ignored when inserting a ForwardingRule. Include the
  6792. // fingerprint in patch request to ensure that you do not overwrite
  6793. // changes that were applied from another concurrent request.
  6794. //
  6795. // To see the latest fingerprint, make a get() request to retrieve a
  6796. // ForwardingRule.
  6797. Fingerprint string `json:"fingerprint,omitempty"`
  6798. // Id: [Output Only] The unique identifier for the resource. This
  6799. // identifier is defined by the server.
  6800. Id uint64 `json:"id,omitempty,string"`
  6801. // IpVersion: The IP Version that will be used by this forwarding rule.
  6802. // Valid options are IPV4 or IPV6. This can only be specified for a
  6803. // global forwarding rule.
  6804. //
  6805. // Possible values:
  6806. // "IPV4"
  6807. // "IPV6"
  6808. // "UNSPECIFIED_VERSION"
  6809. IpVersion string `json:"ipVersion,omitempty"`
  6810. // Kind: [Output Only] Type of the resource. Always
  6811. // compute#forwardingRule for Forwarding Rule resources.
  6812. Kind string `json:"kind,omitempty"`
  6813. // LabelFingerprint: A fingerprint for the labels being applied to this
  6814. // resource, which is essentially a hash of the labels set used for
  6815. // optimistic locking. The fingerprint is initially generated by Compute
  6816. // Engine and changes after every request to modify or update labels.
  6817. // You must always provide an up-to-date fingerprint hash in order to
  6818. // update or change labels.
  6819. //
  6820. // To see the latest fingerprint, make a get() request to retrieve a
  6821. // ForwardingRule.
  6822. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  6823. // Labels: Labels to apply to this resource. These can be later modified
  6824. // by the setLabels method. Each label key/value pair must comply with
  6825. // RFC1035. Label values may be empty.
  6826. Labels map[string]string `json:"labels,omitempty"`
  6827. // LoadBalancingScheme: This signifies what the ForwardingRule will be
  6828. // used for and can only take the following values: INTERNAL, EXTERNAL
  6829. // The value of INTERNAL means that this will be used for Internal
  6830. // Network Load Balancing (TCP, UDP). The value of EXTERNAL means that
  6831. // this will be used for External Load Balancing (HTTP(S) LB, External
  6832. // TCP/UDP LB, SSL Proxy)
  6833. //
  6834. // Possible values:
  6835. // "EXTERNAL"
  6836. // "INTERNAL"
  6837. // "INTERNAL_SELF_MANAGED"
  6838. // "INVALID"
  6839. LoadBalancingScheme string `json:"loadBalancingScheme,omitempty"`
  6840. // Name: Name of the resource; provided by the client when the resource
  6841. // is created. The name must be 1-63 characters long, and comply with
  6842. // RFC1035. Specifically, the name must be 1-63 characters long and
  6843. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  6844. // the first character must be a lowercase letter, and all following
  6845. // characters must be a dash, lowercase letter, or digit, except the
  6846. // last character, which cannot be a dash.
  6847. Name string `json:"name,omitempty"`
  6848. // Network: This field is not used for external load balancing.
  6849. //
  6850. // For internal load balancing, this field identifies the network that
  6851. // the load balanced IP should belong to for this Forwarding Rule. If
  6852. // this field is not specified, the default network will be used.
  6853. Network string `json:"network,omitempty"`
  6854. // NetworkTier: This signifies the networking tier used for configuring
  6855. // this load balancer and can only take the following values: PREMIUM ,
  6856. // STANDARD.
  6857. //
  6858. // For regional ForwardingRule, the valid values are PREMIUM and
  6859. // STANDARD. For GlobalForwardingRule, the valid value is PREMIUM.
  6860. //
  6861. // If this field is not specified, it is assumed to be PREMIUM. If
  6862. // IPAddress is specified, this value must be equal to the networkTier
  6863. // of the Address.
  6864. //
  6865. // Possible values:
  6866. // "PREMIUM"
  6867. // "SELECT"
  6868. // "STANDARD"
  6869. NetworkTier string `json:"networkTier,omitempty"`
  6870. // PortRange: This field is used along with the target field for
  6871. // TargetHttpProxy, TargetHttpsProxy, TargetSslProxy, TargetTcpProxy,
  6872. // TargetVpnGateway, TargetPool, TargetInstance.
  6873. //
  6874. // Applicable only when IPProtocol is TCP, UDP, or SCTP, only packets
  6875. // addressed to ports in the specified range will be forwarded to
  6876. // target. Forwarding rules with the same [IPAddress, IPProtocol] pair
  6877. // must have disjoint port ranges.
  6878. //
  6879. // Some types of forwarding target have constraints on the acceptable
  6880. // ports:
  6881. // - TargetHttpProxy: 80, 8080
  6882. // - TargetHttpsProxy: 443
  6883. // - TargetTcpProxy: 25, 43, 110, 143, 195, 443, 465, 587, 700, 993,
  6884. // 995, 1688, 1883, 5222
  6885. // - TargetSslProxy: 25, 43, 110, 143, 195, 443, 465, 587, 700, 993,
  6886. // 995, 1688, 1883, 5222
  6887. // - TargetVpnGateway: 500, 4500
  6888. PortRange string `json:"portRange,omitempty"`
  6889. // Ports: This field is used along with the backend_service field for
  6890. // internal load balancing.
  6891. //
  6892. // When the load balancing scheme is INTERNAL, a single port or a comma
  6893. // separated list of ports can be configured. Only packets addressed to
  6894. // these ports will be forwarded to the backends configured with this
  6895. // forwarding rule.
  6896. //
  6897. // You may specify a maximum of up to 5 ports.
  6898. Ports []string `json:"ports,omitempty"`
  6899. // Region: [Output Only] URL of the region where the regional forwarding
  6900. // rule resides. This field is not applicable to global forwarding
  6901. // rules. You must specify this field as part of the HTTP request URL.
  6902. // It is not settable as a field in the request body.
  6903. Region string `json:"region,omitempty"`
  6904. // SelfLink: [Output Only] Server-defined URL for the resource.
  6905. SelfLink string `json:"selfLink,omitempty"`
  6906. // ServiceLabel: An optional prefix to the service name for this
  6907. // Forwarding Rule. If specified, will be the first label of the fully
  6908. // qualified service name.
  6909. //
  6910. // The label must be 1-63 characters long, and comply with RFC1035.
  6911. // Specifically, the label must be 1-63 characters long and match the
  6912. // regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first
  6913. // character must be a lowercase letter, and all following characters
  6914. // must be a dash, lowercase letter, or digit, except the last
  6915. // character, which cannot be a dash.
  6916. //
  6917. // This field is only used for internal load balancing.
  6918. ServiceLabel string `json:"serviceLabel,omitempty"`
  6919. // ServiceName: [Output Only] The internal fully qualified service name
  6920. // for this Forwarding Rule.
  6921. //
  6922. // This field is only used for internal load balancing.
  6923. ServiceName string `json:"serviceName,omitempty"`
  6924. // Subnetwork: This field is not used for external load balancing.
  6925. //
  6926. // For internal load balancing, this field identifies the subnetwork
  6927. // that the load balanced IP should belong to for this Forwarding
  6928. // Rule.
  6929. //
  6930. // If the network specified is in auto subnet mode, this field is
  6931. // optional. However, if the network is in custom subnet mode, a
  6932. // subnetwork must be specified.
  6933. Subnetwork string `json:"subnetwork,omitempty"`
  6934. // Target: The URL of the target resource to receive the matched
  6935. // traffic. For regional forwarding rules, this target must live in the
  6936. // same region as the forwarding rule. For global forwarding rules, this
  6937. // target must be a global load balancing resource. The forwarded
  6938. // traffic must be of a type appropriate to the target object.
  6939. Target string `json:"target,omitempty"`
  6940. // ServerResponse contains the HTTP response code and headers from the
  6941. // server.
  6942. googleapi.ServerResponse `json:"-"`
  6943. // ForceSendFields is a list of field names (e.g. "IPAddress") to
  6944. // unconditionally include in API requests. By default, fields with
  6945. // empty values are omitted from API requests. However, any non-pointer,
  6946. // non-interface field appearing in ForceSendFields will be sent to the
  6947. // server regardless of whether the field is empty or not. This may be
  6948. // used to include empty fields in Patch requests.
  6949. ForceSendFields []string `json:"-"`
  6950. // NullFields is a list of field names (e.g. "IPAddress") to include in
  6951. // API requests with the JSON null value. By default, fields with empty
  6952. // values are omitted from API requests. However, any field with an
  6953. // empty value appearing in NullFields will be sent to the server as
  6954. // null. It is an error if a field in this list has a non-empty value.
  6955. // This may be used to include null fields in Patch requests.
  6956. NullFields []string `json:"-"`
  6957. }
  6958. func (s *ForwardingRule) MarshalJSON() ([]byte, error) {
  6959. type NoMethod ForwardingRule
  6960. raw := NoMethod(*s)
  6961. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6962. }
  6963. type ForwardingRuleAggregatedList struct {
  6964. // Id: [Output Only] Unique identifier for the resource; defined by the
  6965. // server.
  6966. Id string `json:"id,omitempty"`
  6967. // Items: A list of ForwardingRulesScopedList resources.
  6968. Items map[string]ForwardingRulesScopedList `json:"items,omitempty"`
  6969. // Kind: [Output Only] Type of resource. Always
  6970. // compute#forwardingRuleAggregatedList for lists of forwarding rules.
  6971. Kind string `json:"kind,omitempty"`
  6972. // NextPageToken: [Output Only] This token allows you to get the next
  6973. // page of results for list requests. If the number of results is larger
  6974. // than maxResults, use the nextPageToken as a value for the query
  6975. // parameter pageToken in the next list request. Subsequent list
  6976. // requests will have their own nextPageToken to continue paging through
  6977. // the results.
  6978. NextPageToken string `json:"nextPageToken,omitempty"`
  6979. // SelfLink: [Output Only] Server-defined URL for this resource.
  6980. SelfLink string `json:"selfLink,omitempty"`
  6981. // Warning: [Output Only] Informational warning message.
  6982. Warning *ForwardingRuleAggregatedListWarning `json:"warning,omitempty"`
  6983. // ServerResponse contains the HTTP response code and headers from the
  6984. // server.
  6985. googleapi.ServerResponse `json:"-"`
  6986. // ForceSendFields is a list of field names (e.g. "Id") to
  6987. // unconditionally include in API requests. By default, fields with
  6988. // empty values are omitted from API requests. However, any non-pointer,
  6989. // non-interface field appearing in ForceSendFields will be sent to the
  6990. // server regardless of whether the field is empty or not. This may be
  6991. // used to include empty fields in Patch requests.
  6992. ForceSendFields []string `json:"-"`
  6993. // NullFields is a list of field names (e.g. "Id") to include in API
  6994. // requests with the JSON null value. By default, fields with empty
  6995. // values are omitted from API requests. However, any field with an
  6996. // empty value appearing in NullFields will be sent to the server as
  6997. // null. It is an error if a field in this list has a non-empty value.
  6998. // This may be used to include null fields in Patch requests.
  6999. NullFields []string `json:"-"`
  7000. }
  7001. func (s *ForwardingRuleAggregatedList) MarshalJSON() ([]byte, error) {
  7002. type NoMethod ForwardingRuleAggregatedList
  7003. raw := NoMethod(*s)
  7004. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7005. }
  7006. // ForwardingRuleAggregatedListWarning: [Output Only] Informational
  7007. // warning message.
  7008. type ForwardingRuleAggregatedListWarning struct {
  7009. // Code: [Output Only] A warning code, if applicable. For example,
  7010. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  7011. // the response.
  7012. //
  7013. // Possible values:
  7014. // "CLEANUP_FAILED"
  7015. // "DEPRECATED_RESOURCE_USED"
  7016. // "DEPRECATED_TYPE_USED"
  7017. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  7018. // "EXPERIMENTAL_TYPE_USED"
  7019. // "EXTERNAL_API_WARNING"
  7020. // "FIELD_VALUE_OVERRIDEN"
  7021. // "INJECTED_KERNELS_DEPRECATED"
  7022. // "MISSING_TYPE_DEPENDENCY"
  7023. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  7024. // "NEXT_HOP_CANNOT_IP_FORWARD"
  7025. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  7026. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  7027. // "NEXT_HOP_NOT_RUNNING"
  7028. // "NOT_CRITICAL_ERROR"
  7029. // "NO_RESULTS_ON_PAGE"
  7030. // "REQUIRED_TOS_AGREEMENT"
  7031. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  7032. // "RESOURCE_NOT_DELETED"
  7033. // "SCHEMA_VALIDATION_IGNORED"
  7034. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  7035. // "UNDECLARED_PROPERTIES"
  7036. // "UNREACHABLE"
  7037. Code string `json:"code,omitempty"`
  7038. // Data: [Output Only] Metadata about this warning in key: value format.
  7039. // For example:
  7040. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  7041. Data []*ForwardingRuleAggregatedListWarningData `json:"data,omitempty"`
  7042. // Message: [Output Only] A human-readable description of the warning
  7043. // code.
  7044. Message string `json:"message,omitempty"`
  7045. // ForceSendFields is a list of field names (e.g. "Code") to
  7046. // unconditionally include in API requests. By default, fields with
  7047. // empty values are omitted from API requests. However, any non-pointer,
  7048. // non-interface field appearing in ForceSendFields will be sent to the
  7049. // server regardless of whether the field is empty or not. This may be
  7050. // used to include empty fields in Patch requests.
  7051. ForceSendFields []string `json:"-"`
  7052. // NullFields is a list of field names (e.g. "Code") to include in API
  7053. // requests with the JSON null value. By default, fields with empty
  7054. // values are omitted from API requests. However, any field with an
  7055. // empty value appearing in NullFields will be sent to the server as
  7056. // null. It is an error if a field in this list has a non-empty value.
  7057. // This may be used to include null fields in Patch requests.
  7058. NullFields []string `json:"-"`
  7059. }
  7060. func (s *ForwardingRuleAggregatedListWarning) MarshalJSON() ([]byte, error) {
  7061. type NoMethod ForwardingRuleAggregatedListWarning
  7062. raw := NoMethod(*s)
  7063. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7064. }
  7065. type ForwardingRuleAggregatedListWarningData struct {
  7066. // Key: [Output Only] A key that provides more detail on the warning
  7067. // being returned. For example, for warnings where there are no results
  7068. // in a list request for a particular zone, this key might be scope and
  7069. // the key value might be the zone name. Other examples might be a key
  7070. // indicating a deprecated resource and a suggested replacement, or a
  7071. // warning about invalid network settings (for example, if an instance
  7072. // attempts to perform IP forwarding but is not enabled for IP
  7073. // forwarding).
  7074. Key string `json:"key,omitempty"`
  7075. // Value: [Output Only] A warning data value corresponding to the key.
  7076. Value string `json:"value,omitempty"`
  7077. // ForceSendFields is a list of field names (e.g. "Key") to
  7078. // unconditionally include in API requests. By default, fields with
  7079. // empty values are omitted from API requests. However, any non-pointer,
  7080. // non-interface field appearing in ForceSendFields will be sent to the
  7081. // server regardless of whether the field is empty or not. This may be
  7082. // used to include empty fields in Patch requests.
  7083. ForceSendFields []string `json:"-"`
  7084. // NullFields is a list of field names (e.g. "Key") to include in API
  7085. // requests with the JSON null value. By default, fields with empty
  7086. // values are omitted from API requests. However, any field with an
  7087. // empty value appearing in NullFields will be sent to the server as
  7088. // null. It is an error if a field in this list has a non-empty value.
  7089. // This may be used to include null fields in Patch requests.
  7090. NullFields []string `json:"-"`
  7091. }
  7092. func (s *ForwardingRuleAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  7093. type NoMethod ForwardingRuleAggregatedListWarningData
  7094. raw := NoMethod(*s)
  7095. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7096. }
  7097. // ForwardingRuleList: Contains a list of ForwardingRule resources.
  7098. type ForwardingRuleList struct {
  7099. // Id: [Output Only] Unique identifier for the resource; defined by the
  7100. // server.
  7101. Id string `json:"id,omitempty"`
  7102. // Items: A list of ForwardingRule resources.
  7103. Items []*ForwardingRule `json:"items,omitempty"`
  7104. // Kind: Type of resource.
  7105. Kind string `json:"kind,omitempty"`
  7106. // NextPageToken: [Output Only] This token allows you to get the next
  7107. // page of results for list requests. If the number of results is larger
  7108. // than maxResults, use the nextPageToken as a value for the query
  7109. // parameter pageToken in the next list request. Subsequent list
  7110. // requests will have their own nextPageToken to continue paging through
  7111. // the results.
  7112. NextPageToken string `json:"nextPageToken,omitempty"`
  7113. // SelfLink: [Output Only] Server-defined URL for this resource.
  7114. SelfLink string `json:"selfLink,omitempty"`
  7115. // Warning: [Output Only] Informational warning message.
  7116. Warning *ForwardingRuleListWarning `json:"warning,omitempty"`
  7117. // ServerResponse contains the HTTP response code and headers from the
  7118. // server.
  7119. googleapi.ServerResponse `json:"-"`
  7120. // ForceSendFields is a list of field names (e.g. "Id") to
  7121. // unconditionally include in API requests. By default, fields with
  7122. // empty values are omitted from API requests. However, any non-pointer,
  7123. // non-interface field appearing in ForceSendFields will be sent to the
  7124. // server regardless of whether the field is empty or not. This may be
  7125. // used to include empty fields in Patch requests.
  7126. ForceSendFields []string `json:"-"`
  7127. // NullFields is a list of field names (e.g. "Id") to include in API
  7128. // requests with the JSON null value. By default, fields with empty
  7129. // values are omitted from API requests. However, any field with an
  7130. // empty value appearing in NullFields will be sent to the server as
  7131. // null. It is an error if a field in this list has a non-empty value.
  7132. // This may be used to include null fields in Patch requests.
  7133. NullFields []string `json:"-"`
  7134. }
  7135. func (s *ForwardingRuleList) MarshalJSON() ([]byte, error) {
  7136. type NoMethod ForwardingRuleList
  7137. raw := NoMethod(*s)
  7138. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7139. }
  7140. // ForwardingRuleListWarning: [Output Only] Informational warning
  7141. // message.
  7142. type ForwardingRuleListWarning struct {
  7143. // Code: [Output Only] A warning code, if applicable. For example,
  7144. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  7145. // the response.
  7146. //
  7147. // Possible values:
  7148. // "CLEANUP_FAILED"
  7149. // "DEPRECATED_RESOURCE_USED"
  7150. // "DEPRECATED_TYPE_USED"
  7151. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  7152. // "EXPERIMENTAL_TYPE_USED"
  7153. // "EXTERNAL_API_WARNING"
  7154. // "FIELD_VALUE_OVERRIDEN"
  7155. // "INJECTED_KERNELS_DEPRECATED"
  7156. // "MISSING_TYPE_DEPENDENCY"
  7157. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  7158. // "NEXT_HOP_CANNOT_IP_FORWARD"
  7159. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  7160. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  7161. // "NEXT_HOP_NOT_RUNNING"
  7162. // "NOT_CRITICAL_ERROR"
  7163. // "NO_RESULTS_ON_PAGE"
  7164. // "REQUIRED_TOS_AGREEMENT"
  7165. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  7166. // "RESOURCE_NOT_DELETED"
  7167. // "SCHEMA_VALIDATION_IGNORED"
  7168. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  7169. // "UNDECLARED_PROPERTIES"
  7170. // "UNREACHABLE"
  7171. Code string `json:"code,omitempty"`
  7172. // Data: [Output Only] Metadata about this warning in key: value format.
  7173. // For example:
  7174. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  7175. Data []*ForwardingRuleListWarningData `json:"data,omitempty"`
  7176. // Message: [Output Only] A human-readable description of the warning
  7177. // code.
  7178. Message string `json:"message,omitempty"`
  7179. // ForceSendFields is a list of field names (e.g. "Code") to
  7180. // unconditionally include in API requests. By default, fields with
  7181. // empty values are omitted from API requests. However, any non-pointer,
  7182. // non-interface field appearing in ForceSendFields will be sent to the
  7183. // server regardless of whether the field is empty or not. This may be
  7184. // used to include empty fields in Patch requests.
  7185. ForceSendFields []string `json:"-"`
  7186. // NullFields is a list of field names (e.g. "Code") to include in API
  7187. // requests with the JSON null value. By default, fields with empty
  7188. // values are omitted from API requests. However, any field with an
  7189. // empty value appearing in NullFields will be sent to the server as
  7190. // null. It is an error if a field in this list has a non-empty value.
  7191. // This may be used to include null fields in Patch requests.
  7192. NullFields []string `json:"-"`
  7193. }
  7194. func (s *ForwardingRuleListWarning) MarshalJSON() ([]byte, error) {
  7195. type NoMethod ForwardingRuleListWarning
  7196. raw := NoMethod(*s)
  7197. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7198. }
  7199. type ForwardingRuleListWarningData struct {
  7200. // Key: [Output Only] A key that provides more detail on the warning
  7201. // being returned. For example, for warnings where there are no results
  7202. // in a list request for a particular zone, this key might be scope and
  7203. // the key value might be the zone name. Other examples might be a key
  7204. // indicating a deprecated resource and a suggested replacement, or a
  7205. // warning about invalid network settings (for example, if an instance
  7206. // attempts to perform IP forwarding but is not enabled for IP
  7207. // forwarding).
  7208. Key string `json:"key,omitempty"`
  7209. // Value: [Output Only] A warning data value corresponding to the key.
  7210. Value string `json:"value,omitempty"`
  7211. // ForceSendFields is a list of field names (e.g. "Key") to
  7212. // unconditionally include in API requests. By default, fields with
  7213. // empty values are omitted from API requests. However, any non-pointer,
  7214. // non-interface field appearing in ForceSendFields will be sent to the
  7215. // server regardless of whether the field is empty or not. This may be
  7216. // used to include empty fields in Patch requests.
  7217. ForceSendFields []string `json:"-"`
  7218. // NullFields is a list of field names (e.g. "Key") to include in API
  7219. // requests with the JSON null value. By default, fields with empty
  7220. // values are omitted from API requests. However, any field with an
  7221. // empty value appearing in NullFields will be sent to the server as
  7222. // null. It is an error if a field in this list has a non-empty value.
  7223. // This may be used to include null fields in Patch requests.
  7224. NullFields []string `json:"-"`
  7225. }
  7226. func (s *ForwardingRuleListWarningData) MarshalJSON() ([]byte, error) {
  7227. type NoMethod ForwardingRuleListWarningData
  7228. raw := NoMethod(*s)
  7229. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7230. }
  7231. type ForwardingRuleReference struct {
  7232. ForwardingRule string `json:"forwardingRule,omitempty"`
  7233. // ForceSendFields is a list of field names (e.g. "ForwardingRule") to
  7234. // unconditionally include in API requests. By default, fields with
  7235. // empty values are omitted from API requests. However, any non-pointer,
  7236. // non-interface field appearing in ForceSendFields will be sent to the
  7237. // server regardless of whether the field is empty or not. This may be
  7238. // used to include empty fields in Patch requests.
  7239. ForceSendFields []string `json:"-"`
  7240. // NullFields is a list of field names (e.g. "ForwardingRule") to
  7241. // include in API requests with the JSON null value. By default, fields
  7242. // with empty values are omitted from API requests. However, any field
  7243. // with an empty value appearing in NullFields will be sent to the
  7244. // server as null. It is an error if a field in this list has a
  7245. // non-empty value. This may be used to include null fields in Patch
  7246. // requests.
  7247. NullFields []string `json:"-"`
  7248. }
  7249. func (s *ForwardingRuleReference) MarshalJSON() ([]byte, error) {
  7250. type NoMethod ForwardingRuleReference
  7251. raw := NoMethod(*s)
  7252. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7253. }
  7254. type ForwardingRulesScopedList struct {
  7255. // ForwardingRules: A list of forwarding rules contained in this scope.
  7256. ForwardingRules []*ForwardingRule `json:"forwardingRules,omitempty"`
  7257. // Warning: Informational warning which replaces the list of forwarding
  7258. // rules when the list is empty.
  7259. Warning *ForwardingRulesScopedListWarning `json:"warning,omitempty"`
  7260. // ForceSendFields is a list of field names (e.g. "ForwardingRules") to
  7261. // unconditionally include in API requests. By default, fields with
  7262. // empty values are omitted from API requests. However, any non-pointer,
  7263. // non-interface field appearing in ForceSendFields will be sent to the
  7264. // server regardless of whether the field is empty or not. This may be
  7265. // used to include empty fields in Patch requests.
  7266. ForceSendFields []string `json:"-"`
  7267. // NullFields is a list of field names (e.g. "ForwardingRules") to
  7268. // include in API requests with the JSON null value. By default, fields
  7269. // with empty values are omitted from API requests. However, any field
  7270. // with an empty value appearing in NullFields will be sent to the
  7271. // server as null. It is an error if a field in this list has a
  7272. // non-empty value. This may be used to include null fields in Patch
  7273. // requests.
  7274. NullFields []string `json:"-"`
  7275. }
  7276. func (s *ForwardingRulesScopedList) MarshalJSON() ([]byte, error) {
  7277. type NoMethod ForwardingRulesScopedList
  7278. raw := NoMethod(*s)
  7279. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7280. }
  7281. // ForwardingRulesScopedListWarning: Informational warning which
  7282. // replaces the list of forwarding rules when the list is empty.
  7283. type ForwardingRulesScopedListWarning struct {
  7284. // Code: [Output Only] A warning code, if applicable. For example,
  7285. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  7286. // the response.
  7287. //
  7288. // Possible values:
  7289. // "CLEANUP_FAILED"
  7290. // "DEPRECATED_RESOURCE_USED"
  7291. // "DEPRECATED_TYPE_USED"
  7292. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  7293. // "EXPERIMENTAL_TYPE_USED"
  7294. // "EXTERNAL_API_WARNING"
  7295. // "FIELD_VALUE_OVERRIDEN"
  7296. // "INJECTED_KERNELS_DEPRECATED"
  7297. // "MISSING_TYPE_DEPENDENCY"
  7298. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  7299. // "NEXT_HOP_CANNOT_IP_FORWARD"
  7300. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  7301. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  7302. // "NEXT_HOP_NOT_RUNNING"
  7303. // "NOT_CRITICAL_ERROR"
  7304. // "NO_RESULTS_ON_PAGE"
  7305. // "REQUIRED_TOS_AGREEMENT"
  7306. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  7307. // "RESOURCE_NOT_DELETED"
  7308. // "SCHEMA_VALIDATION_IGNORED"
  7309. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  7310. // "UNDECLARED_PROPERTIES"
  7311. // "UNREACHABLE"
  7312. Code string `json:"code,omitempty"`
  7313. // Data: [Output Only] Metadata about this warning in key: value format.
  7314. // For example:
  7315. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  7316. Data []*ForwardingRulesScopedListWarningData `json:"data,omitempty"`
  7317. // Message: [Output Only] A human-readable description of the warning
  7318. // code.
  7319. Message string `json:"message,omitempty"`
  7320. // ForceSendFields is a list of field names (e.g. "Code") to
  7321. // unconditionally include in API requests. By default, fields with
  7322. // empty values are omitted from API requests. However, any non-pointer,
  7323. // non-interface field appearing in ForceSendFields will be sent to the
  7324. // server regardless of whether the field is empty or not. This may be
  7325. // used to include empty fields in Patch requests.
  7326. ForceSendFields []string `json:"-"`
  7327. // NullFields is a list of field names (e.g. "Code") to include in API
  7328. // requests with the JSON null value. By default, fields with empty
  7329. // values are omitted from API requests. However, any field with an
  7330. // empty value appearing in NullFields will be sent to the server as
  7331. // null. It is an error if a field in this list has a non-empty value.
  7332. // This may be used to include null fields in Patch requests.
  7333. NullFields []string `json:"-"`
  7334. }
  7335. func (s *ForwardingRulesScopedListWarning) MarshalJSON() ([]byte, error) {
  7336. type NoMethod ForwardingRulesScopedListWarning
  7337. raw := NoMethod(*s)
  7338. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7339. }
  7340. type ForwardingRulesScopedListWarningData struct {
  7341. // Key: [Output Only] A key that provides more detail on the warning
  7342. // being returned. For example, for warnings where there are no results
  7343. // in a list request for a particular zone, this key might be scope and
  7344. // the key value might be the zone name. Other examples might be a key
  7345. // indicating a deprecated resource and a suggested replacement, or a
  7346. // warning about invalid network settings (for example, if an instance
  7347. // attempts to perform IP forwarding but is not enabled for IP
  7348. // forwarding).
  7349. Key string `json:"key,omitempty"`
  7350. // Value: [Output Only] A warning data value corresponding to the key.
  7351. Value string `json:"value,omitempty"`
  7352. // ForceSendFields is a list of field names (e.g. "Key") to
  7353. // unconditionally include in API requests. By default, fields with
  7354. // empty values are omitted from API requests. However, any non-pointer,
  7355. // non-interface field appearing in ForceSendFields will be sent to the
  7356. // server regardless of whether the field is empty or not. This may be
  7357. // used to include empty fields in Patch requests.
  7358. ForceSendFields []string `json:"-"`
  7359. // NullFields is a list of field names (e.g. "Key") to include in API
  7360. // requests with the JSON null value. By default, fields with empty
  7361. // values are omitted from API requests. However, any field with an
  7362. // empty value appearing in NullFields will be sent to the server as
  7363. // null. It is an error if a field in this list has a non-empty value.
  7364. // This may be used to include null fields in Patch requests.
  7365. NullFields []string `json:"-"`
  7366. }
  7367. func (s *ForwardingRulesScopedListWarningData) MarshalJSON() ([]byte, error) {
  7368. type NoMethod ForwardingRulesScopedListWarningData
  7369. raw := NoMethod(*s)
  7370. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7371. }
  7372. type GlobalSetLabelsRequest struct {
  7373. // LabelFingerprint: The fingerprint of the previous set of labels for
  7374. // this resource, used to detect conflicts. The fingerprint is initially
  7375. // generated by Compute Engine and changes after every request to modify
  7376. // or update labels. You must always provide an up-to-date fingerprint
  7377. // hash when updating or changing labels. Make a get() request to the
  7378. // resource to get the latest fingerprint.
  7379. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  7380. // Labels: A list of labels to apply for this resource. Each label key &
  7381. // value must comply with RFC1035. Specifically, the name must be 1-63
  7382. // characters long and match the regular expression
  7383. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  7384. // a lowercase letter, and all following characters must be a dash,
  7385. // lowercase letter, or digit, except the last character, which cannot
  7386. // be a dash. For example, "webserver-frontend": "images". A label value
  7387. // can also be empty (e.g. "my-label": "").
  7388. Labels map[string]string `json:"labels,omitempty"`
  7389. // ForceSendFields is a list of field names (e.g. "LabelFingerprint") to
  7390. // unconditionally include in API requests. By default, fields with
  7391. // empty values are omitted from API requests. However, any non-pointer,
  7392. // non-interface field appearing in ForceSendFields will be sent to the
  7393. // server regardless of whether the field is empty or not. This may be
  7394. // used to include empty fields in Patch requests.
  7395. ForceSendFields []string `json:"-"`
  7396. // NullFields is a list of field names (e.g. "LabelFingerprint") to
  7397. // include in API requests with the JSON null value. By default, fields
  7398. // with empty values are omitted from API requests. However, any field
  7399. // with an empty value appearing in NullFields will be sent to the
  7400. // server as null. It is an error if a field in this list has a
  7401. // non-empty value. This may be used to include null fields in Patch
  7402. // requests.
  7403. NullFields []string `json:"-"`
  7404. }
  7405. func (s *GlobalSetLabelsRequest) MarshalJSON() ([]byte, error) {
  7406. type NoMethod GlobalSetLabelsRequest
  7407. raw := NoMethod(*s)
  7408. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7409. }
  7410. type GlobalSetPolicyRequest struct {
  7411. // Bindings: Flatten Policy to create a backwacd compatible wire-format.
  7412. // Deprecated. Use 'policy' to specify bindings.
  7413. Bindings []*Binding `json:"bindings,omitempty"`
  7414. // Etag: Flatten Policy to create a backward compatible wire-format.
  7415. // Deprecated. Use 'policy' to specify the etag.
  7416. Etag string `json:"etag,omitempty"`
  7417. // Policy: REQUIRED: The complete policy to be applied to the
  7418. // 'resource'. The size of the policy is limited to a few 10s of KB. An
  7419. // empty policy is in general a valid policy but certain services (like
  7420. // Projects) might reject them.
  7421. Policy *Policy `json:"policy,omitempty"`
  7422. // ForceSendFields is a list of field names (e.g. "Bindings") to
  7423. // unconditionally include in API requests. By default, fields with
  7424. // empty values are omitted from API requests. However, any non-pointer,
  7425. // non-interface field appearing in ForceSendFields will be sent to the
  7426. // server regardless of whether the field is empty or not. This may be
  7427. // used to include empty fields in Patch requests.
  7428. ForceSendFields []string `json:"-"`
  7429. // NullFields is a list of field names (e.g. "Bindings") to include in
  7430. // API requests with the JSON null value. By default, fields with empty
  7431. // values are omitted from API requests. However, any field with an
  7432. // empty value appearing in NullFields will be sent to the server as
  7433. // null. It is an error if a field in this list has a non-empty value.
  7434. // This may be used to include null fields in Patch requests.
  7435. NullFields []string `json:"-"`
  7436. }
  7437. func (s *GlobalSetPolicyRequest) MarshalJSON() ([]byte, error) {
  7438. type NoMethod GlobalSetPolicyRequest
  7439. raw := NoMethod(*s)
  7440. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7441. }
  7442. // GuestAttributes: A guest attributes entry.
  7443. type GuestAttributes struct {
  7444. // Kind: [Output Only] Type of the resource. Always
  7445. // compute#guestAttributes for guest attributes entry.
  7446. Kind string `json:"kind,omitempty"`
  7447. // SelfLink: [Output Only] Server-defined URL for this resource.
  7448. SelfLink string `json:"selfLink,omitempty"`
  7449. // VariableKey: The key to search for.
  7450. VariableKey string `json:"variableKey,omitempty"`
  7451. // VariableValue: [Output Only] The value found for the requested key.
  7452. VariableValue string `json:"variableValue,omitempty"`
  7453. // ServerResponse contains the HTTP response code and headers from the
  7454. // server.
  7455. googleapi.ServerResponse `json:"-"`
  7456. // ForceSendFields is a list of field names (e.g. "Kind") to
  7457. // unconditionally include in API requests. By default, fields with
  7458. // empty values are omitted from API requests. However, any non-pointer,
  7459. // non-interface field appearing in ForceSendFields will be sent to the
  7460. // server regardless of whether the field is empty or not. This may be
  7461. // used to include empty fields in Patch requests.
  7462. ForceSendFields []string `json:"-"`
  7463. // NullFields is a list of field names (e.g. "Kind") to include in API
  7464. // requests with the JSON null value. By default, fields with empty
  7465. // values are omitted from API requests. However, any field with an
  7466. // empty value appearing in NullFields will be sent to the server as
  7467. // null. It is an error if a field in this list has a non-empty value.
  7468. // This may be used to include null fields in Patch requests.
  7469. NullFields []string `json:"-"`
  7470. }
  7471. func (s *GuestAttributes) MarshalJSON() ([]byte, error) {
  7472. type NoMethod GuestAttributes
  7473. raw := NoMethod(*s)
  7474. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7475. }
  7476. // GuestOsFeature: Guest OS features.
  7477. type GuestOsFeature struct {
  7478. // Type: The ID of a supported feature. Read Enabling guest operating
  7479. // system features to see a list of available options.
  7480. //
  7481. // Possible values:
  7482. // "FEATURE_TYPE_UNSPECIFIED"
  7483. // "MULTI_IP_SUBNET"
  7484. // "SECURE_BOOT"
  7485. // "UEFI_COMPATIBLE"
  7486. // "VIRTIO_SCSI_MULTIQUEUE"
  7487. // "WINDOWS"
  7488. Type string `json:"type,omitempty"`
  7489. // ForceSendFields is a list of field names (e.g. "Type") to
  7490. // unconditionally include in API requests. By default, fields with
  7491. // empty values are omitted from API requests. However, any non-pointer,
  7492. // non-interface field appearing in ForceSendFields will be sent to the
  7493. // server regardless of whether the field is empty or not. This may be
  7494. // used to include empty fields in Patch requests.
  7495. ForceSendFields []string `json:"-"`
  7496. // NullFields is a list of field names (e.g. "Type") to include in API
  7497. // requests with the JSON null value. By default, fields with empty
  7498. // values are omitted from API requests. However, any field with an
  7499. // empty value appearing in NullFields will be sent to the server as
  7500. // null. It is an error if a field in this list has a non-empty value.
  7501. // This may be used to include null fields in Patch requests.
  7502. NullFields []string `json:"-"`
  7503. }
  7504. func (s *GuestOsFeature) MarshalJSON() ([]byte, error) {
  7505. type NoMethod GuestOsFeature
  7506. raw := NoMethod(*s)
  7507. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7508. }
  7509. type HTTP2HealthCheck struct {
  7510. // Host: The value of the host header in the HTTP/2 health check
  7511. // request. If left empty (default value), the IP on behalf of which
  7512. // this health check is performed will be used.
  7513. Host string `json:"host,omitempty"`
  7514. // Port: The TCP port number for the health check request. The default
  7515. // value is 443. Valid values are 1 through 65535.
  7516. Port int64 `json:"port,omitempty"`
  7517. // PortName: Port name as defined in InstanceGroup#NamedPort#name. If
  7518. // both port and port_name are defined, port takes precedence.
  7519. PortName string `json:"portName,omitempty"`
  7520. // PortSpecification: Specifies how port is selected for health
  7521. // checking, can be one of following values:
  7522. // USE_FIXED_PORT: The port number in
  7523. // port
  7524. // is used for health checking.
  7525. // USE_NAMED_PORT: The
  7526. // portName
  7527. // is used for health checking.
  7528. // USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for
  7529. // each network endpoint is used for health checking. For other
  7530. // backends, the port or named port specified in the Backend Service is
  7531. // used for health checking.
  7532. //
  7533. //
  7534. // If not specified, HTTP2 health check follows behavior specified
  7535. // in
  7536. // port
  7537. // and
  7538. // portName
  7539. // fields.
  7540. //
  7541. // Possible values:
  7542. // "USE_FIXED_PORT"
  7543. // "USE_NAMED_PORT"
  7544. // "USE_SERVING_PORT"
  7545. PortSpecification string `json:"portSpecification,omitempty"`
  7546. // ProxyHeader: Specifies the type of proxy header to append before
  7547. // sending data to the backend, either NONE or PROXY_V1. The default is
  7548. // NONE.
  7549. //
  7550. // Possible values:
  7551. // "NONE"
  7552. // "PROXY_V1"
  7553. ProxyHeader string `json:"proxyHeader,omitempty"`
  7554. // RequestPath: The request path of the HTTP/2 health check request. The
  7555. // default value is /.
  7556. RequestPath string `json:"requestPath,omitempty"`
  7557. // Response: The string to match anywhere in the first 1024 bytes of the
  7558. // response body. If left empty (the default value), the status code
  7559. // determines health. The response data can only be ASCII.
  7560. Response string `json:"response,omitempty"`
  7561. // ForceSendFields is a list of field names (e.g. "Host") to
  7562. // unconditionally include in API requests. By default, fields with
  7563. // empty values are omitted from API requests. However, any non-pointer,
  7564. // non-interface field appearing in ForceSendFields will be sent to the
  7565. // server regardless of whether the field is empty or not. This may be
  7566. // used to include empty fields in Patch requests.
  7567. ForceSendFields []string `json:"-"`
  7568. // NullFields is a list of field names (e.g. "Host") to include in API
  7569. // requests with the JSON null value. By default, fields with empty
  7570. // values are omitted from API requests. However, any field with an
  7571. // empty value appearing in NullFields will be sent to the server as
  7572. // null. It is an error if a field in this list has a non-empty value.
  7573. // This may be used to include null fields in Patch requests.
  7574. NullFields []string `json:"-"`
  7575. }
  7576. func (s *HTTP2HealthCheck) MarshalJSON() ([]byte, error) {
  7577. type NoMethod HTTP2HealthCheck
  7578. raw := NoMethod(*s)
  7579. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7580. }
  7581. type HTTPHealthCheck struct {
  7582. // Host: The value of the host header in the HTTP health check request.
  7583. // If left empty (default value), the IP on behalf of which this health
  7584. // check is performed will be used.
  7585. Host string `json:"host,omitempty"`
  7586. // Port: The TCP port number for the health check request. The default
  7587. // value is 80. Valid values are 1 through 65535.
  7588. Port int64 `json:"port,omitempty"`
  7589. // PortName: Port name as defined in InstanceGroup#NamedPort#name. If
  7590. // both port and port_name are defined, port takes precedence.
  7591. PortName string `json:"portName,omitempty"`
  7592. // PortSpecification: Specifies how port is selected for health
  7593. // checking, can be one of following values:
  7594. // USE_FIXED_PORT: The port number in
  7595. // port
  7596. // is used for health checking.
  7597. // USE_NAMED_PORT: The
  7598. // portName
  7599. // is used for health checking.
  7600. // USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for
  7601. // each network endpoint is used for health checking. For other
  7602. // backends, the port or named port specified in the Backend Service is
  7603. // used for health checking.
  7604. //
  7605. //
  7606. // If not specified, HTTP health check follows behavior specified
  7607. // in
  7608. // port
  7609. // and
  7610. // portName
  7611. // fields.
  7612. //
  7613. // Possible values:
  7614. // "USE_FIXED_PORT"
  7615. // "USE_NAMED_PORT"
  7616. // "USE_SERVING_PORT"
  7617. PortSpecification string `json:"portSpecification,omitempty"`
  7618. // ProxyHeader: Specifies the type of proxy header to append before
  7619. // sending data to the backend, either NONE or PROXY_V1. The default is
  7620. // NONE.
  7621. //
  7622. // Possible values:
  7623. // "NONE"
  7624. // "PROXY_V1"
  7625. ProxyHeader string `json:"proxyHeader,omitempty"`
  7626. // RequestPath: The request path of the HTTP health check request. The
  7627. // default value is /.
  7628. RequestPath string `json:"requestPath,omitempty"`
  7629. // Response: The string to match anywhere in the first 1024 bytes of the
  7630. // response body. If left empty (the default value), the status code
  7631. // determines health. The response data can only be ASCII.
  7632. Response string `json:"response,omitempty"`
  7633. // ForceSendFields is a list of field names (e.g. "Host") to
  7634. // unconditionally include in API requests. By default, fields with
  7635. // empty values are omitted from API requests. However, any non-pointer,
  7636. // non-interface field appearing in ForceSendFields will be sent to the
  7637. // server regardless of whether the field is empty or not. This may be
  7638. // used to include empty fields in Patch requests.
  7639. ForceSendFields []string `json:"-"`
  7640. // NullFields is a list of field names (e.g. "Host") to include in API
  7641. // requests with the JSON null value. By default, fields with empty
  7642. // values are omitted from API requests. However, any field with an
  7643. // empty value appearing in NullFields will be sent to the server as
  7644. // null. It is an error if a field in this list has a non-empty value.
  7645. // This may be used to include null fields in Patch requests.
  7646. NullFields []string `json:"-"`
  7647. }
  7648. func (s *HTTPHealthCheck) MarshalJSON() ([]byte, error) {
  7649. type NoMethod HTTPHealthCheck
  7650. raw := NoMethod(*s)
  7651. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7652. }
  7653. type HTTPSHealthCheck struct {
  7654. // Host: The value of the host header in the HTTPS health check request.
  7655. // If left empty (default value), the IP on behalf of which this health
  7656. // check is performed will be used.
  7657. Host string `json:"host,omitempty"`
  7658. // Port: The TCP port number for the health check request. The default
  7659. // value is 443. Valid values are 1 through 65535.
  7660. Port int64 `json:"port,omitempty"`
  7661. // PortName: Port name as defined in InstanceGroup#NamedPort#name. If
  7662. // both port and port_name are defined, port takes precedence.
  7663. PortName string `json:"portName,omitempty"`
  7664. // PortSpecification: Specifies how port is selected for health
  7665. // checking, can be one of following values:
  7666. // USE_FIXED_PORT: The port number in
  7667. // port
  7668. // is used for health checking.
  7669. // USE_NAMED_PORT: The
  7670. // portName
  7671. // is used for health checking.
  7672. // USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for
  7673. // each network endpoint is used for health checking. For other
  7674. // backends, the port or named port specified in the Backend Service is
  7675. // used for health checking.
  7676. //
  7677. //
  7678. // If not specified, HTTPS health check follows behavior specified
  7679. // in
  7680. // port
  7681. // and
  7682. // portName
  7683. // fields.
  7684. //
  7685. // Possible values:
  7686. // "USE_FIXED_PORT"
  7687. // "USE_NAMED_PORT"
  7688. // "USE_SERVING_PORT"
  7689. PortSpecification string `json:"portSpecification,omitempty"`
  7690. // ProxyHeader: Specifies the type of proxy header to append before
  7691. // sending data to the backend, either NONE or PROXY_V1. The default is
  7692. // NONE.
  7693. //
  7694. // Possible values:
  7695. // "NONE"
  7696. // "PROXY_V1"
  7697. ProxyHeader string `json:"proxyHeader,omitempty"`
  7698. // RequestPath: The request path of the HTTPS health check request. The
  7699. // default value is /.
  7700. RequestPath string `json:"requestPath,omitempty"`
  7701. // Response: The string to match anywhere in the first 1024 bytes of the
  7702. // response body. If left empty (the default value), the status code
  7703. // determines health. The response data can only be ASCII.
  7704. Response string `json:"response,omitempty"`
  7705. // ForceSendFields is a list of field names (e.g. "Host") to
  7706. // unconditionally include in API requests. By default, fields with
  7707. // empty values are omitted from API requests. However, any non-pointer,
  7708. // non-interface field appearing in ForceSendFields will be sent to the
  7709. // server regardless of whether the field is empty or not. This may be
  7710. // used to include empty fields in Patch requests.
  7711. ForceSendFields []string `json:"-"`
  7712. // NullFields is a list of field names (e.g. "Host") to include in API
  7713. // requests with the JSON null value. By default, fields with empty
  7714. // values are omitted from API requests. However, any field with an
  7715. // empty value appearing in NullFields will be sent to the server as
  7716. // null. It is an error if a field in this list has a non-empty value.
  7717. // This may be used to include null fields in Patch requests.
  7718. NullFields []string `json:"-"`
  7719. }
  7720. func (s *HTTPSHealthCheck) MarshalJSON() ([]byte, error) {
  7721. type NoMethod HTTPSHealthCheck
  7722. raw := NoMethod(*s)
  7723. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7724. }
  7725. // HealthCheck: An HealthCheck resource. This resource defines a
  7726. // template for how individual virtual machines should be checked for
  7727. // health, via one of the supported protocols.
  7728. type HealthCheck struct {
  7729. // CheckIntervalSec: How often (in seconds) to send a health check. The
  7730. // default value is 5 seconds.
  7731. CheckIntervalSec int64 `json:"checkIntervalSec,omitempty"`
  7732. // CreationTimestamp: [Output Only] Creation timestamp in 3339 text
  7733. // format.
  7734. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  7735. // Description: An optional description of this resource. Provide this
  7736. // property when you create the resource.
  7737. Description string `json:"description,omitempty"`
  7738. // HealthyThreshold: A so-far unhealthy instance will be marked healthy
  7739. // after this many consecutive successes. The default value is 2.
  7740. HealthyThreshold int64 `json:"healthyThreshold,omitempty"`
  7741. Http2HealthCheck *HTTP2HealthCheck `json:"http2HealthCheck,omitempty"`
  7742. HttpHealthCheck *HTTPHealthCheck `json:"httpHealthCheck,omitempty"`
  7743. HttpsHealthCheck *HTTPSHealthCheck `json:"httpsHealthCheck,omitempty"`
  7744. // Id: [Output Only] The unique identifier for the resource. This
  7745. // identifier is defined by the server.
  7746. Id uint64 `json:"id,omitempty,string"`
  7747. // Kind: Type of the resource.
  7748. Kind string `json:"kind,omitempty"`
  7749. // Name: Name of the resource. Provided by the client when the resource
  7750. // is created. The name must be 1-63 characters long, and comply with
  7751. // RFC1035. Specifically, the name must be 1-63 characters long and
  7752. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  7753. // the first character must be a lowercase letter, and all following
  7754. // characters must be a dash, lowercase letter, or digit, except the
  7755. // last character, which cannot be a dash.
  7756. Name string `json:"name,omitempty"`
  7757. // Region: [Output Only] Region where the health check resides. Not
  7758. // applicable to global health checks.
  7759. Region string `json:"region,omitempty"`
  7760. // SelfLink: [Output Only] Server-defined URL for the resource.
  7761. SelfLink string `json:"selfLink,omitempty"`
  7762. SslHealthCheck *SSLHealthCheck `json:"sslHealthCheck,omitempty"`
  7763. TcpHealthCheck *TCPHealthCheck `json:"tcpHealthCheck,omitempty"`
  7764. // TimeoutSec: How long (in seconds) to wait before claiming failure.
  7765. // The default value is 5 seconds. It is invalid for timeoutSec to have
  7766. // greater value than checkIntervalSec.
  7767. TimeoutSec int64 `json:"timeoutSec,omitempty"`
  7768. // Type: Specifies the type of the healthCheck, either TCP, SSL, HTTP or
  7769. // HTTPS. If not specified, the default is TCP. Exactly one of the
  7770. // protocol-specific health check field must be specified, which must
  7771. // match type field.
  7772. //
  7773. // Possible values:
  7774. // "HTTP"
  7775. // "HTTP2"
  7776. // "HTTPS"
  7777. // "INVALID"
  7778. // "SSL"
  7779. // "TCP"
  7780. // "UDP"
  7781. Type string `json:"type,omitempty"`
  7782. UdpHealthCheck *UDPHealthCheck `json:"udpHealthCheck,omitempty"`
  7783. // UnhealthyThreshold: A so-far healthy instance will be marked
  7784. // unhealthy after this many consecutive failures. The default value is
  7785. // 2.
  7786. UnhealthyThreshold int64 `json:"unhealthyThreshold,omitempty"`
  7787. // ServerResponse contains the HTTP response code and headers from the
  7788. // server.
  7789. googleapi.ServerResponse `json:"-"`
  7790. // ForceSendFields is a list of field names (e.g. "CheckIntervalSec") to
  7791. // unconditionally include in API requests. By default, fields with
  7792. // empty values are omitted from API requests. However, any non-pointer,
  7793. // non-interface field appearing in ForceSendFields will be sent to the
  7794. // server regardless of whether the field is empty or not. This may be
  7795. // used to include empty fields in Patch requests.
  7796. ForceSendFields []string `json:"-"`
  7797. // NullFields is a list of field names (e.g. "CheckIntervalSec") to
  7798. // include in API requests with the JSON null value. By default, fields
  7799. // with empty values are omitted from API requests. However, any field
  7800. // with an empty value appearing in NullFields will be sent to the
  7801. // server as null. It is an error if a field in this list has a
  7802. // non-empty value. This may be used to include null fields in Patch
  7803. // requests.
  7804. NullFields []string `json:"-"`
  7805. }
  7806. func (s *HealthCheck) MarshalJSON() ([]byte, error) {
  7807. type NoMethod HealthCheck
  7808. raw := NoMethod(*s)
  7809. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7810. }
  7811. // HealthCheckList: Contains a list of HealthCheck resources.
  7812. type HealthCheckList struct {
  7813. // Id: [Output Only] Unique identifier for the resource; defined by the
  7814. // server.
  7815. Id string `json:"id,omitempty"`
  7816. // Items: A list of HealthCheck resources.
  7817. Items []*HealthCheck `json:"items,omitempty"`
  7818. // Kind: Type of resource.
  7819. Kind string `json:"kind,omitempty"`
  7820. // NextPageToken: [Output Only] This token allows you to get the next
  7821. // page of results for list requests. If the number of results is larger
  7822. // than maxResults, use the nextPageToken as a value for the query
  7823. // parameter pageToken in the next list request. Subsequent list
  7824. // requests will have their own nextPageToken to continue paging through
  7825. // the results.
  7826. NextPageToken string `json:"nextPageToken,omitempty"`
  7827. // SelfLink: [Output Only] Server-defined URL for this resource.
  7828. SelfLink string `json:"selfLink,omitempty"`
  7829. // Warning: [Output Only] Informational warning message.
  7830. Warning *HealthCheckListWarning `json:"warning,omitempty"`
  7831. // ServerResponse contains the HTTP response code and headers from the
  7832. // server.
  7833. googleapi.ServerResponse `json:"-"`
  7834. // ForceSendFields is a list of field names (e.g. "Id") to
  7835. // unconditionally include in API requests. By default, fields with
  7836. // empty values are omitted from API requests. However, any non-pointer,
  7837. // non-interface field appearing in ForceSendFields will be sent to the
  7838. // server regardless of whether the field is empty or not. This may be
  7839. // used to include empty fields in Patch requests.
  7840. ForceSendFields []string `json:"-"`
  7841. // NullFields is a list of field names (e.g. "Id") to include in API
  7842. // requests with the JSON null value. By default, fields with empty
  7843. // values are omitted from API requests. However, any field with an
  7844. // empty value appearing in NullFields will be sent to the server as
  7845. // null. It is an error if a field in this list has a non-empty value.
  7846. // This may be used to include null fields in Patch requests.
  7847. NullFields []string `json:"-"`
  7848. }
  7849. func (s *HealthCheckList) MarshalJSON() ([]byte, error) {
  7850. type NoMethod HealthCheckList
  7851. raw := NoMethod(*s)
  7852. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7853. }
  7854. // HealthCheckListWarning: [Output Only] Informational warning message.
  7855. type HealthCheckListWarning struct {
  7856. // Code: [Output Only] A warning code, if applicable. For example,
  7857. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  7858. // the response.
  7859. //
  7860. // Possible values:
  7861. // "CLEANUP_FAILED"
  7862. // "DEPRECATED_RESOURCE_USED"
  7863. // "DEPRECATED_TYPE_USED"
  7864. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  7865. // "EXPERIMENTAL_TYPE_USED"
  7866. // "EXTERNAL_API_WARNING"
  7867. // "FIELD_VALUE_OVERRIDEN"
  7868. // "INJECTED_KERNELS_DEPRECATED"
  7869. // "MISSING_TYPE_DEPENDENCY"
  7870. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  7871. // "NEXT_HOP_CANNOT_IP_FORWARD"
  7872. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  7873. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  7874. // "NEXT_HOP_NOT_RUNNING"
  7875. // "NOT_CRITICAL_ERROR"
  7876. // "NO_RESULTS_ON_PAGE"
  7877. // "REQUIRED_TOS_AGREEMENT"
  7878. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  7879. // "RESOURCE_NOT_DELETED"
  7880. // "SCHEMA_VALIDATION_IGNORED"
  7881. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  7882. // "UNDECLARED_PROPERTIES"
  7883. // "UNREACHABLE"
  7884. Code string `json:"code,omitempty"`
  7885. // Data: [Output Only] Metadata about this warning in key: value format.
  7886. // For example:
  7887. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  7888. Data []*HealthCheckListWarningData `json:"data,omitempty"`
  7889. // Message: [Output Only] A human-readable description of the warning
  7890. // code.
  7891. Message string `json:"message,omitempty"`
  7892. // ForceSendFields is a list of field names (e.g. "Code") to
  7893. // unconditionally include in API requests. By default, fields with
  7894. // empty values are omitted from API requests. However, any non-pointer,
  7895. // non-interface field appearing in ForceSendFields will be sent to the
  7896. // server regardless of whether the field is empty or not. This may be
  7897. // used to include empty fields in Patch requests.
  7898. ForceSendFields []string `json:"-"`
  7899. // NullFields is a list of field names (e.g. "Code") to include in API
  7900. // requests with the JSON null value. By default, fields with empty
  7901. // values are omitted from API requests. However, any field with an
  7902. // empty value appearing in NullFields will be sent to the server as
  7903. // null. It is an error if a field in this list has a non-empty value.
  7904. // This may be used to include null fields in Patch requests.
  7905. NullFields []string `json:"-"`
  7906. }
  7907. func (s *HealthCheckListWarning) MarshalJSON() ([]byte, error) {
  7908. type NoMethod HealthCheckListWarning
  7909. raw := NoMethod(*s)
  7910. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7911. }
  7912. type HealthCheckListWarningData struct {
  7913. // Key: [Output Only] A key that provides more detail on the warning
  7914. // being returned. For example, for warnings where there are no results
  7915. // in a list request for a particular zone, this key might be scope and
  7916. // the key value might be the zone name. Other examples might be a key
  7917. // indicating a deprecated resource and a suggested replacement, or a
  7918. // warning about invalid network settings (for example, if an instance
  7919. // attempts to perform IP forwarding but is not enabled for IP
  7920. // forwarding).
  7921. Key string `json:"key,omitempty"`
  7922. // Value: [Output Only] A warning data value corresponding to the key.
  7923. Value string `json:"value,omitempty"`
  7924. // ForceSendFields is a list of field names (e.g. "Key") to
  7925. // unconditionally include in API requests. By default, fields with
  7926. // empty values are omitted from API requests. However, any non-pointer,
  7927. // non-interface field appearing in ForceSendFields will be sent to the
  7928. // server regardless of whether the field is empty or not. This may be
  7929. // used to include empty fields in Patch requests.
  7930. ForceSendFields []string `json:"-"`
  7931. // NullFields is a list of field names (e.g. "Key") to include in API
  7932. // requests with the JSON null value. By default, fields with empty
  7933. // values are omitted from API requests. However, any field with an
  7934. // empty value appearing in NullFields will be sent to the server as
  7935. // null. It is an error if a field in this list has a non-empty value.
  7936. // This may be used to include null fields in Patch requests.
  7937. NullFields []string `json:"-"`
  7938. }
  7939. func (s *HealthCheckListWarningData) MarshalJSON() ([]byte, error) {
  7940. type NoMethod HealthCheckListWarningData
  7941. raw := NoMethod(*s)
  7942. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7943. }
  7944. // HealthCheckReference: A full or valid partial URL to a health check.
  7945. // For example, the following are valid URLs:
  7946. // -
  7947. // https://www.googleapis.com/compute/beta/projects/project-id/global/httpHealthChecks/health-check
  7948. // - projects/project-id/global/httpHealthChecks/health-check
  7949. // - global/httpHealthChecks/health-check
  7950. type HealthCheckReference struct {
  7951. HealthCheck string `json:"healthCheck,omitempty"`
  7952. // ForceSendFields is a list of field names (e.g. "HealthCheck") to
  7953. // unconditionally include in API requests. By default, fields with
  7954. // empty values are omitted from API requests. However, any non-pointer,
  7955. // non-interface field appearing in ForceSendFields will be sent to the
  7956. // server regardless of whether the field is empty or not. This may be
  7957. // used to include empty fields in Patch requests.
  7958. ForceSendFields []string `json:"-"`
  7959. // NullFields is a list of field names (e.g. "HealthCheck") to include
  7960. // in API requests with the JSON null value. By default, fields with
  7961. // empty values are omitted from API requests. However, any field with
  7962. // an empty value appearing in NullFields will be sent to the server as
  7963. // null. It is an error if a field in this list has a non-empty value.
  7964. // This may be used to include null fields in Patch requests.
  7965. NullFields []string `json:"-"`
  7966. }
  7967. func (s *HealthCheckReference) MarshalJSON() ([]byte, error) {
  7968. type NoMethod HealthCheckReference
  7969. raw := NoMethod(*s)
  7970. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7971. }
  7972. type HealthChecksAggregatedList struct {
  7973. // Id: [Output Only] Unique identifier for the resource; defined by the
  7974. // server.
  7975. Id string `json:"id,omitempty"`
  7976. // Items: A list of HealthChecksScopedList resources.
  7977. Items map[string]HealthChecksScopedList `json:"items,omitempty"`
  7978. // Kind: Type of resource.
  7979. Kind string `json:"kind,omitempty"`
  7980. // NextPageToken: [Output Only] This token allows you to get the next
  7981. // page of results for list requests. If the number of results is larger
  7982. // than maxResults, use the nextPageToken as a value for the query
  7983. // parameter pageToken in the next list request. Subsequent list
  7984. // requests will have their own nextPageToken to continue paging through
  7985. // the results.
  7986. NextPageToken string `json:"nextPageToken,omitempty"`
  7987. // SelfLink: [Output Only] Server-defined URL for this resource.
  7988. SelfLink string `json:"selfLink,omitempty"`
  7989. // Warning: [Output Only] Informational warning message.
  7990. Warning *HealthChecksAggregatedListWarning `json:"warning,omitempty"`
  7991. // ServerResponse contains the HTTP response code and headers from the
  7992. // server.
  7993. googleapi.ServerResponse `json:"-"`
  7994. // ForceSendFields is a list of field names (e.g. "Id") to
  7995. // unconditionally include in API requests. By default, fields with
  7996. // empty values are omitted from API requests. However, any non-pointer,
  7997. // non-interface field appearing in ForceSendFields will be sent to the
  7998. // server regardless of whether the field is empty or not. This may be
  7999. // used to include empty fields in Patch requests.
  8000. ForceSendFields []string `json:"-"`
  8001. // NullFields is a list of field names (e.g. "Id") to include in API
  8002. // requests with the JSON null value. By default, fields with empty
  8003. // values are omitted from API requests. However, any field with an
  8004. // empty value appearing in NullFields will be sent to the server as
  8005. // null. It is an error if a field in this list has a non-empty value.
  8006. // This may be used to include null fields in Patch requests.
  8007. NullFields []string `json:"-"`
  8008. }
  8009. func (s *HealthChecksAggregatedList) MarshalJSON() ([]byte, error) {
  8010. type NoMethod HealthChecksAggregatedList
  8011. raw := NoMethod(*s)
  8012. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8013. }
  8014. // HealthChecksAggregatedListWarning: [Output Only] Informational
  8015. // warning message.
  8016. type HealthChecksAggregatedListWarning struct {
  8017. // Code: [Output Only] A warning code, if applicable. For example,
  8018. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  8019. // the response.
  8020. //
  8021. // Possible values:
  8022. // "CLEANUP_FAILED"
  8023. // "DEPRECATED_RESOURCE_USED"
  8024. // "DEPRECATED_TYPE_USED"
  8025. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  8026. // "EXPERIMENTAL_TYPE_USED"
  8027. // "EXTERNAL_API_WARNING"
  8028. // "FIELD_VALUE_OVERRIDEN"
  8029. // "INJECTED_KERNELS_DEPRECATED"
  8030. // "MISSING_TYPE_DEPENDENCY"
  8031. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  8032. // "NEXT_HOP_CANNOT_IP_FORWARD"
  8033. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  8034. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  8035. // "NEXT_HOP_NOT_RUNNING"
  8036. // "NOT_CRITICAL_ERROR"
  8037. // "NO_RESULTS_ON_PAGE"
  8038. // "REQUIRED_TOS_AGREEMENT"
  8039. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  8040. // "RESOURCE_NOT_DELETED"
  8041. // "SCHEMA_VALIDATION_IGNORED"
  8042. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  8043. // "UNDECLARED_PROPERTIES"
  8044. // "UNREACHABLE"
  8045. Code string `json:"code,omitempty"`
  8046. // Data: [Output Only] Metadata about this warning in key: value format.
  8047. // For example:
  8048. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  8049. Data []*HealthChecksAggregatedListWarningData `json:"data,omitempty"`
  8050. // Message: [Output Only] A human-readable description of the warning
  8051. // code.
  8052. Message string `json:"message,omitempty"`
  8053. // ForceSendFields is a list of field names (e.g. "Code") to
  8054. // unconditionally include in API requests. By default, fields with
  8055. // empty values are omitted from API requests. However, any non-pointer,
  8056. // non-interface field appearing in ForceSendFields will be sent to the
  8057. // server regardless of whether the field is empty or not. This may be
  8058. // used to include empty fields in Patch requests.
  8059. ForceSendFields []string `json:"-"`
  8060. // NullFields is a list of field names (e.g. "Code") to include in API
  8061. // requests with the JSON null value. By default, fields with empty
  8062. // values are omitted from API requests. However, any field with an
  8063. // empty value appearing in NullFields will be sent to the server as
  8064. // null. It is an error if a field in this list has a non-empty value.
  8065. // This may be used to include null fields in Patch requests.
  8066. NullFields []string `json:"-"`
  8067. }
  8068. func (s *HealthChecksAggregatedListWarning) MarshalJSON() ([]byte, error) {
  8069. type NoMethod HealthChecksAggregatedListWarning
  8070. raw := NoMethod(*s)
  8071. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8072. }
  8073. type HealthChecksAggregatedListWarningData struct {
  8074. // Key: [Output Only] A key that provides more detail on the warning
  8075. // being returned. For example, for warnings where there are no results
  8076. // in a list request for a particular zone, this key might be scope and
  8077. // the key value might be the zone name. Other examples might be a key
  8078. // indicating a deprecated resource and a suggested replacement, or a
  8079. // warning about invalid network settings (for example, if an instance
  8080. // attempts to perform IP forwarding but is not enabled for IP
  8081. // forwarding).
  8082. Key string `json:"key,omitempty"`
  8083. // Value: [Output Only] A warning data value corresponding to the key.
  8084. Value string `json:"value,omitempty"`
  8085. // ForceSendFields is a list of field names (e.g. "Key") to
  8086. // unconditionally include in API requests. By default, fields with
  8087. // empty values are omitted from API requests. However, any non-pointer,
  8088. // non-interface field appearing in ForceSendFields will be sent to the
  8089. // server regardless of whether the field is empty or not. This may be
  8090. // used to include empty fields in Patch requests.
  8091. ForceSendFields []string `json:"-"`
  8092. // NullFields is a list of field names (e.g. "Key") to include in API
  8093. // requests with the JSON null value. By default, fields with empty
  8094. // values are omitted from API requests. However, any field with an
  8095. // empty value appearing in NullFields will be sent to the server as
  8096. // null. It is an error if a field in this list has a non-empty value.
  8097. // This may be used to include null fields in Patch requests.
  8098. NullFields []string `json:"-"`
  8099. }
  8100. func (s *HealthChecksAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  8101. type NoMethod HealthChecksAggregatedListWarningData
  8102. raw := NoMethod(*s)
  8103. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8104. }
  8105. type HealthChecksScopedList struct {
  8106. // HealthChecks: A list of HealthChecks contained in this scope.
  8107. HealthChecks []*HealthCheck `json:"healthChecks,omitempty"`
  8108. // Warning: Informational warning which replaces the list of backend
  8109. // services when the list is empty.
  8110. Warning *HealthChecksScopedListWarning `json:"warning,omitempty"`
  8111. // ForceSendFields is a list of field names (e.g. "HealthChecks") to
  8112. // unconditionally include in API requests. By default, fields with
  8113. // empty values are omitted from API requests. However, any non-pointer,
  8114. // non-interface field appearing in ForceSendFields will be sent to the
  8115. // server regardless of whether the field is empty or not. This may be
  8116. // used to include empty fields in Patch requests.
  8117. ForceSendFields []string `json:"-"`
  8118. // NullFields is a list of field names (e.g. "HealthChecks") to include
  8119. // in API requests with the JSON null value. By default, fields with
  8120. // empty values are omitted from API requests. However, any field with
  8121. // an empty value appearing in NullFields will be sent to the server as
  8122. // null. It is an error if a field in this list has a non-empty value.
  8123. // This may be used to include null fields in Patch requests.
  8124. NullFields []string `json:"-"`
  8125. }
  8126. func (s *HealthChecksScopedList) MarshalJSON() ([]byte, error) {
  8127. type NoMethod HealthChecksScopedList
  8128. raw := NoMethod(*s)
  8129. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8130. }
  8131. // HealthChecksScopedListWarning: Informational warning which replaces
  8132. // the list of backend services when the list is empty.
  8133. type HealthChecksScopedListWarning struct {
  8134. // Code: [Output Only] A warning code, if applicable. For example,
  8135. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  8136. // the response.
  8137. //
  8138. // Possible values:
  8139. // "CLEANUP_FAILED"
  8140. // "DEPRECATED_RESOURCE_USED"
  8141. // "DEPRECATED_TYPE_USED"
  8142. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  8143. // "EXPERIMENTAL_TYPE_USED"
  8144. // "EXTERNAL_API_WARNING"
  8145. // "FIELD_VALUE_OVERRIDEN"
  8146. // "INJECTED_KERNELS_DEPRECATED"
  8147. // "MISSING_TYPE_DEPENDENCY"
  8148. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  8149. // "NEXT_HOP_CANNOT_IP_FORWARD"
  8150. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  8151. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  8152. // "NEXT_HOP_NOT_RUNNING"
  8153. // "NOT_CRITICAL_ERROR"
  8154. // "NO_RESULTS_ON_PAGE"
  8155. // "REQUIRED_TOS_AGREEMENT"
  8156. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  8157. // "RESOURCE_NOT_DELETED"
  8158. // "SCHEMA_VALIDATION_IGNORED"
  8159. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  8160. // "UNDECLARED_PROPERTIES"
  8161. // "UNREACHABLE"
  8162. Code string `json:"code,omitempty"`
  8163. // Data: [Output Only] Metadata about this warning in key: value format.
  8164. // For example:
  8165. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  8166. Data []*HealthChecksScopedListWarningData `json:"data,omitempty"`
  8167. // Message: [Output Only] A human-readable description of the warning
  8168. // code.
  8169. Message string `json:"message,omitempty"`
  8170. // ForceSendFields is a list of field names (e.g. "Code") to
  8171. // unconditionally include in API requests. By default, fields with
  8172. // empty values are omitted from API requests. However, any non-pointer,
  8173. // non-interface field appearing in ForceSendFields will be sent to the
  8174. // server regardless of whether the field is empty or not. This may be
  8175. // used to include empty fields in Patch requests.
  8176. ForceSendFields []string `json:"-"`
  8177. // NullFields is a list of field names (e.g. "Code") to include in API
  8178. // requests with the JSON null value. By default, fields with empty
  8179. // values are omitted from API requests. However, any field with an
  8180. // empty value appearing in NullFields will be sent to the server as
  8181. // null. It is an error if a field in this list has a non-empty value.
  8182. // This may be used to include null fields in Patch requests.
  8183. NullFields []string `json:"-"`
  8184. }
  8185. func (s *HealthChecksScopedListWarning) MarshalJSON() ([]byte, error) {
  8186. type NoMethod HealthChecksScopedListWarning
  8187. raw := NoMethod(*s)
  8188. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8189. }
  8190. type HealthChecksScopedListWarningData struct {
  8191. // Key: [Output Only] A key that provides more detail on the warning
  8192. // being returned. For example, for warnings where there are no results
  8193. // in a list request for a particular zone, this key might be scope and
  8194. // the key value might be the zone name. Other examples might be a key
  8195. // indicating a deprecated resource and a suggested replacement, or a
  8196. // warning about invalid network settings (for example, if an instance
  8197. // attempts to perform IP forwarding but is not enabled for IP
  8198. // forwarding).
  8199. Key string `json:"key,omitempty"`
  8200. // Value: [Output Only] A warning data value corresponding to the key.
  8201. Value string `json:"value,omitempty"`
  8202. // ForceSendFields is a list of field names (e.g. "Key") to
  8203. // unconditionally include in API requests. By default, fields with
  8204. // empty values are omitted from API requests. However, any non-pointer,
  8205. // non-interface field appearing in ForceSendFields will be sent to the
  8206. // server regardless of whether the field is empty or not. This may be
  8207. // used to include empty fields in Patch requests.
  8208. ForceSendFields []string `json:"-"`
  8209. // NullFields is a list of field names (e.g. "Key") to include in API
  8210. // requests with the JSON null value. By default, fields with empty
  8211. // values are omitted from API requests. However, any field with an
  8212. // empty value appearing in NullFields will be sent to the server as
  8213. // null. It is an error if a field in this list has a non-empty value.
  8214. // This may be used to include null fields in Patch requests.
  8215. NullFields []string `json:"-"`
  8216. }
  8217. func (s *HealthChecksScopedListWarningData) MarshalJSON() ([]byte, error) {
  8218. type NoMethod HealthChecksScopedListWarningData
  8219. raw := NoMethod(*s)
  8220. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8221. }
  8222. type HealthStatus struct {
  8223. // HealthState: Health state of the instance.
  8224. //
  8225. // Possible values:
  8226. // "HEALTHY"
  8227. // "UNHEALTHY"
  8228. HealthState string `json:"healthState,omitempty"`
  8229. // Instance: URL of the instance resource.
  8230. Instance string `json:"instance,omitempty"`
  8231. // IpAddress: The IP address represented by this resource.
  8232. IpAddress string `json:"ipAddress,omitempty"`
  8233. // Port: The port on the instance.
  8234. Port int64 `json:"port,omitempty"`
  8235. // ForceSendFields is a list of field names (e.g. "HealthState") to
  8236. // unconditionally include in API requests. By default, fields with
  8237. // empty values are omitted from API requests. However, any non-pointer,
  8238. // non-interface field appearing in ForceSendFields will be sent to the
  8239. // server regardless of whether the field is empty or not. This may be
  8240. // used to include empty fields in Patch requests.
  8241. ForceSendFields []string `json:"-"`
  8242. // NullFields is a list of field names (e.g. "HealthState") to include
  8243. // in API requests with the JSON null value. By default, fields with
  8244. // empty values are omitted from API requests. However, any field with
  8245. // an empty value appearing in NullFields will be sent to the server as
  8246. // null. It is an error if a field in this list has a non-empty value.
  8247. // This may be used to include null fields in Patch requests.
  8248. NullFields []string `json:"-"`
  8249. }
  8250. func (s *HealthStatus) MarshalJSON() ([]byte, error) {
  8251. type NoMethod HealthStatus
  8252. raw := NoMethod(*s)
  8253. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8254. }
  8255. type HealthStatusForNetworkEndpoint struct {
  8256. // BackendService: URL of the backend service associated with the health
  8257. // state of the network endpoint.
  8258. BackendService *BackendServiceReference `json:"backendService,omitempty"`
  8259. // ForwardingRule: URL of the forwarding rule associated with the health
  8260. // state of the network endpoint.
  8261. ForwardingRule *ForwardingRuleReference `json:"forwardingRule,omitempty"`
  8262. // HealthCheck: URL of the health check associated with the health state
  8263. // of the network endpoint.
  8264. HealthCheck *HealthCheckReference `json:"healthCheck,omitempty"`
  8265. // HealthState: Health state of the network endpoint determined based on
  8266. // the health checks configured.
  8267. //
  8268. // Possible values:
  8269. // "DRAINING"
  8270. // "HEALTHY"
  8271. // "UNHEALTHY"
  8272. // "UNKNOWN"
  8273. HealthState string `json:"healthState,omitempty"`
  8274. // ForceSendFields is a list of field names (e.g. "BackendService") to
  8275. // unconditionally include in API requests. By default, fields with
  8276. // empty values are omitted from API requests. However, any non-pointer,
  8277. // non-interface field appearing in ForceSendFields will be sent to the
  8278. // server regardless of whether the field is empty or not. This may be
  8279. // used to include empty fields in Patch requests.
  8280. ForceSendFields []string `json:"-"`
  8281. // NullFields is a list of field names (e.g. "BackendService") to
  8282. // include in API requests with the JSON null value. By default, fields
  8283. // with empty values are omitted from API requests. However, any field
  8284. // with an empty value appearing in NullFields will be sent to the
  8285. // server as null. It is an error if a field in this list has a
  8286. // non-empty value. This may be used to include null fields in Patch
  8287. // requests.
  8288. NullFields []string `json:"-"`
  8289. }
  8290. func (s *HealthStatusForNetworkEndpoint) MarshalJSON() ([]byte, error) {
  8291. type NoMethod HealthStatusForNetworkEndpoint
  8292. raw := NoMethod(*s)
  8293. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8294. }
  8295. type Host struct {
  8296. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  8297. // format.
  8298. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  8299. // Description: [Output Only] An optional textual description of the
  8300. // resource.
  8301. Description string `json:"description,omitempty"`
  8302. // HostType: Full or partial URL of the host type resource to use for
  8303. // this host, in the format: zones/zone/hostTypes/host-type. This is
  8304. // provided by the client when the host is created. For example, the
  8305. // following is a valid partial url to a predefined host
  8306. // type:
  8307. // zones/us-central1-b/hostTypes/n1-host-64-416
  8308. HostType string `json:"hostType,omitempty"`
  8309. // Id: [Output Only] The unique identifier for the resource. This
  8310. // identifier is defined by the server.
  8311. Id uint64 `json:"id,omitempty,string"`
  8312. // Instances: A list of resource URLs to the virtual machine instances
  8313. // in this host. They must live in zones contained in the same region as
  8314. // this host.
  8315. Instances []string `json:"instances,omitempty"`
  8316. // Kind: [Output Only] The type of the resource. Always compute#host for
  8317. // host.
  8318. Kind string `json:"kind,omitempty"`
  8319. // LabelFingerprint: A fingerprint for this request, which is
  8320. // essentially a hash of the metadata's contents and used for optimistic
  8321. // locking. The fingerprint is initially generated by Compute Engine and
  8322. // changes after every request to modify or update metadata. You must
  8323. // always provide an up-to-date fingerprint hash in order to update or
  8324. // change metadata.
  8325. //
  8326. // To see the latest fingerprint, make get() request to the host.
  8327. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  8328. // Labels: Labels to apply to this host.
  8329. Labels map[string]string `json:"labels,omitempty"`
  8330. // Name: The name of the resource, provided by the client when initially
  8331. // creating the resource. The resource name must be 1-63 characters
  8332. // long, and comply with RFC1035. Specifically, the name must be 1-63
  8333. // characters long and match the regular expression
  8334. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  8335. // a lowercase letter, and all following characters must be a dash,
  8336. // lowercase letter, or digit, except the last character, which cannot
  8337. // be a dash.
  8338. Name string `json:"name,omitempty"`
  8339. // SelfLink: [Output Only] Server-defined URL for the resource.
  8340. SelfLink string `json:"selfLink,omitempty"`
  8341. // Status: [Output Only] The status of the host. One of the following
  8342. // values: CREATING, READY, REPAIR, and DELETING.
  8343. //
  8344. // Possible values:
  8345. // "CREATING"
  8346. // "DELETING"
  8347. // "INVALID"
  8348. // "READY"
  8349. // "REPAIR"
  8350. Status string `json:"status,omitempty"`
  8351. // StatusMessage: [Output Only] An optional, human-readable explanation
  8352. // of the status.
  8353. StatusMessage string `json:"statusMessage,omitempty"`
  8354. // Zone: [Output Only] The name of the zone where the host resides, such
  8355. // as us-central1-a.
  8356. Zone string `json:"zone,omitempty"`
  8357. // ServerResponse contains the HTTP response code and headers from the
  8358. // server.
  8359. googleapi.ServerResponse `json:"-"`
  8360. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  8361. // to unconditionally include in API requests. By default, fields with
  8362. // empty values are omitted from API requests. However, any non-pointer,
  8363. // non-interface field appearing in ForceSendFields will be sent to the
  8364. // server regardless of whether the field is empty or not. This may be
  8365. // used to include empty fields in Patch requests.
  8366. ForceSendFields []string `json:"-"`
  8367. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  8368. // include in API requests with the JSON null value. By default, fields
  8369. // with empty values are omitted from API requests. However, any field
  8370. // with an empty value appearing in NullFields will be sent to the
  8371. // server as null. It is an error if a field in this list has a
  8372. // non-empty value. This may be used to include null fields in Patch
  8373. // requests.
  8374. NullFields []string `json:"-"`
  8375. }
  8376. func (s *Host) MarshalJSON() ([]byte, error) {
  8377. type NoMethod Host
  8378. raw := NoMethod(*s)
  8379. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8380. }
  8381. type HostAggregatedList struct {
  8382. // Id: [Output Only] Unique identifier for the resource; defined by the
  8383. // server.
  8384. Id string `json:"id,omitempty"`
  8385. // Items: A list of HostsScopedList resources.
  8386. Items map[string]HostsScopedList `json:"items,omitempty"`
  8387. // Kind: [Output Only] Type of resource. Always
  8388. // compute#hostAggregatedList for aggregated lists of hosts.
  8389. Kind string `json:"kind,omitempty"`
  8390. // NextPageToken: [Output Only] This token allows you to get the next
  8391. // page of results for list requests. If the number of results is larger
  8392. // than maxResults, use the nextPageToken as a value for the query
  8393. // parameter pageToken in the next list request. Subsequent list
  8394. // requests will have their own nextPageToken to continue paging through
  8395. // the results.
  8396. NextPageToken string `json:"nextPageToken,omitempty"`
  8397. // SelfLink: [Output Only] Server-defined URL for this resource.
  8398. SelfLink string `json:"selfLink,omitempty"`
  8399. // Warning: [Output Only] Informational warning message.
  8400. Warning *HostAggregatedListWarning `json:"warning,omitempty"`
  8401. // ServerResponse contains the HTTP response code and headers from the
  8402. // server.
  8403. googleapi.ServerResponse `json:"-"`
  8404. // ForceSendFields is a list of field names (e.g. "Id") to
  8405. // unconditionally include in API requests. By default, fields with
  8406. // empty values are omitted from API requests. However, any non-pointer,
  8407. // non-interface field appearing in ForceSendFields will be sent to the
  8408. // server regardless of whether the field is empty or not. This may be
  8409. // used to include empty fields in Patch requests.
  8410. ForceSendFields []string `json:"-"`
  8411. // NullFields is a list of field names (e.g. "Id") to include in API
  8412. // requests with the JSON null value. By default, fields with empty
  8413. // values are omitted from API requests. However, any field with an
  8414. // empty value appearing in NullFields will be sent to the server as
  8415. // null. It is an error if a field in this list has a non-empty value.
  8416. // This may be used to include null fields in Patch requests.
  8417. NullFields []string `json:"-"`
  8418. }
  8419. func (s *HostAggregatedList) MarshalJSON() ([]byte, error) {
  8420. type NoMethod HostAggregatedList
  8421. raw := NoMethod(*s)
  8422. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8423. }
  8424. // HostAggregatedListWarning: [Output Only] Informational warning
  8425. // message.
  8426. type HostAggregatedListWarning struct {
  8427. // Code: [Output Only] A warning code, if applicable. For example,
  8428. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  8429. // the response.
  8430. //
  8431. // Possible values:
  8432. // "CLEANUP_FAILED"
  8433. // "DEPRECATED_RESOURCE_USED"
  8434. // "DEPRECATED_TYPE_USED"
  8435. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  8436. // "EXPERIMENTAL_TYPE_USED"
  8437. // "EXTERNAL_API_WARNING"
  8438. // "FIELD_VALUE_OVERRIDEN"
  8439. // "INJECTED_KERNELS_DEPRECATED"
  8440. // "MISSING_TYPE_DEPENDENCY"
  8441. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  8442. // "NEXT_HOP_CANNOT_IP_FORWARD"
  8443. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  8444. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  8445. // "NEXT_HOP_NOT_RUNNING"
  8446. // "NOT_CRITICAL_ERROR"
  8447. // "NO_RESULTS_ON_PAGE"
  8448. // "REQUIRED_TOS_AGREEMENT"
  8449. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  8450. // "RESOURCE_NOT_DELETED"
  8451. // "SCHEMA_VALIDATION_IGNORED"
  8452. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  8453. // "UNDECLARED_PROPERTIES"
  8454. // "UNREACHABLE"
  8455. Code string `json:"code,omitempty"`
  8456. // Data: [Output Only] Metadata about this warning in key: value format.
  8457. // For example:
  8458. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  8459. Data []*HostAggregatedListWarningData `json:"data,omitempty"`
  8460. // Message: [Output Only] A human-readable description of the warning
  8461. // code.
  8462. Message string `json:"message,omitempty"`
  8463. // ForceSendFields is a list of field names (e.g. "Code") to
  8464. // unconditionally include in API requests. By default, fields with
  8465. // empty values are omitted from API requests. However, any non-pointer,
  8466. // non-interface field appearing in ForceSendFields will be sent to the
  8467. // server regardless of whether the field is empty or not. This may be
  8468. // used to include empty fields in Patch requests.
  8469. ForceSendFields []string `json:"-"`
  8470. // NullFields is a list of field names (e.g. "Code") to include in API
  8471. // requests with the JSON null value. By default, fields with empty
  8472. // values are omitted from API requests. However, any field with an
  8473. // empty value appearing in NullFields will be sent to the server as
  8474. // null. It is an error if a field in this list has a non-empty value.
  8475. // This may be used to include null fields in Patch requests.
  8476. NullFields []string `json:"-"`
  8477. }
  8478. func (s *HostAggregatedListWarning) MarshalJSON() ([]byte, error) {
  8479. type NoMethod HostAggregatedListWarning
  8480. raw := NoMethod(*s)
  8481. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8482. }
  8483. type HostAggregatedListWarningData struct {
  8484. // Key: [Output Only] A key that provides more detail on the warning
  8485. // being returned. For example, for warnings where there are no results
  8486. // in a list request for a particular zone, this key might be scope and
  8487. // the key value might be the zone name. Other examples might be a key
  8488. // indicating a deprecated resource and a suggested replacement, or a
  8489. // warning about invalid network settings (for example, if an instance
  8490. // attempts to perform IP forwarding but is not enabled for IP
  8491. // forwarding).
  8492. Key string `json:"key,omitempty"`
  8493. // Value: [Output Only] A warning data value corresponding to the key.
  8494. Value string `json:"value,omitempty"`
  8495. // ForceSendFields is a list of field names (e.g. "Key") to
  8496. // unconditionally include in API requests. By default, fields with
  8497. // empty values are omitted from API requests. However, any non-pointer,
  8498. // non-interface field appearing in ForceSendFields will be sent to the
  8499. // server regardless of whether the field is empty or not. This may be
  8500. // used to include empty fields in Patch requests.
  8501. ForceSendFields []string `json:"-"`
  8502. // NullFields is a list of field names (e.g. "Key") to include in API
  8503. // requests with the JSON null value. By default, fields with empty
  8504. // values are omitted from API requests. However, any field with an
  8505. // empty value appearing in NullFields will be sent to the server as
  8506. // null. It is an error if a field in this list has a non-empty value.
  8507. // This may be used to include null fields in Patch requests.
  8508. NullFields []string `json:"-"`
  8509. }
  8510. func (s *HostAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  8511. type NoMethod HostAggregatedListWarningData
  8512. raw := NoMethod(*s)
  8513. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8514. }
  8515. // HostList: Contains a list of hosts.
  8516. type HostList struct {
  8517. // Id: [Output Only] Unique identifier for the resource; defined by the
  8518. // server.
  8519. Id string `json:"id,omitempty"`
  8520. // Items: A list of Host resources.
  8521. Items []*Host `json:"items,omitempty"`
  8522. // Kind: [Output Only] Type of resource. Always compute#hostList for
  8523. // lists of hosts.
  8524. Kind string `json:"kind,omitempty"`
  8525. // NextPageToken: [Output Only] This token allows you to get the next
  8526. // page of results for list requests. If the number of results is larger
  8527. // than maxResults, use the nextPageToken as a value for the query
  8528. // parameter pageToken in the next list request. Subsequent list
  8529. // requests will have their own nextPageToken to continue paging through
  8530. // the results.
  8531. NextPageToken string `json:"nextPageToken,omitempty"`
  8532. // SelfLink: [Output Only] Server-defined URL for this resource.
  8533. SelfLink string `json:"selfLink,omitempty"`
  8534. // Warning: [Output Only] Informational warning message.
  8535. Warning *HostListWarning `json:"warning,omitempty"`
  8536. // ServerResponse contains the HTTP response code and headers from the
  8537. // server.
  8538. googleapi.ServerResponse `json:"-"`
  8539. // ForceSendFields is a list of field names (e.g. "Id") to
  8540. // unconditionally include in API requests. By default, fields with
  8541. // empty values are omitted from API requests. However, any non-pointer,
  8542. // non-interface field appearing in ForceSendFields will be sent to the
  8543. // server regardless of whether the field is empty or not. This may be
  8544. // used to include empty fields in Patch requests.
  8545. ForceSendFields []string `json:"-"`
  8546. // NullFields is a list of field names (e.g. "Id") to include in API
  8547. // requests with the JSON null value. By default, fields with empty
  8548. // values are omitted from API requests. However, any field with an
  8549. // empty value appearing in NullFields will be sent to the server as
  8550. // null. It is an error if a field in this list has a non-empty value.
  8551. // This may be used to include null fields in Patch requests.
  8552. NullFields []string `json:"-"`
  8553. }
  8554. func (s *HostList) MarshalJSON() ([]byte, error) {
  8555. type NoMethod HostList
  8556. raw := NoMethod(*s)
  8557. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8558. }
  8559. // HostListWarning: [Output Only] Informational warning message.
  8560. type HostListWarning struct {
  8561. // Code: [Output Only] A warning code, if applicable. For example,
  8562. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  8563. // the response.
  8564. //
  8565. // Possible values:
  8566. // "CLEANUP_FAILED"
  8567. // "DEPRECATED_RESOURCE_USED"
  8568. // "DEPRECATED_TYPE_USED"
  8569. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  8570. // "EXPERIMENTAL_TYPE_USED"
  8571. // "EXTERNAL_API_WARNING"
  8572. // "FIELD_VALUE_OVERRIDEN"
  8573. // "INJECTED_KERNELS_DEPRECATED"
  8574. // "MISSING_TYPE_DEPENDENCY"
  8575. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  8576. // "NEXT_HOP_CANNOT_IP_FORWARD"
  8577. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  8578. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  8579. // "NEXT_HOP_NOT_RUNNING"
  8580. // "NOT_CRITICAL_ERROR"
  8581. // "NO_RESULTS_ON_PAGE"
  8582. // "REQUIRED_TOS_AGREEMENT"
  8583. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  8584. // "RESOURCE_NOT_DELETED"
  8585. // "SCHEMA_VALIDATION_IGNORED"
  8586. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  8587. // "UNDECLARED_PROPERTIES"
  8588. // "UNREACHABLE"
  8589. Code string `json:"code,omitempty"`
  8590. // Data: [Output Only] Metadata about this warning in key: value format.
  8591. // For example:
  8592. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  8593. Data []*HostListWarningData `json:"data,omitempty"`
  8594. // Message: [Output Only] A human-readable description of the warning
  8595. // code.
  8596. Message string `json:"message,omitempty"`
  8597. // ForceSendFields is a list of field names (e.g. "Code") to
  8598. // unconditionally include in API requests. By default, fields with
  8599. // empty values are omitted from API requests. However, any non-pointer,
  8600. // non-interface field appearing in ForceSendFields will be sent to the
  8601. // server regardless of whether the field is empty or not. This may be
  8602. // used to include empty fields in Patch requests.
  8603. ForceSendFields []string `json:"-"`
  8604. // NullFields is a list of field names (e.g. "Code") to include in API
  8605. // requests with the JSON null value. By default, fields with empty
  8606. // values are omitted from API requests. However, any field with an
  8607. // empty value appearing in NullFields will be sent to the server as
  8608. // null. It is an error if a field in this list has a non-empty value.
  8609. // This may be used to include null fields in Patch requests.
  8610. NullFields []string `json:"-"`
  8611. }
  8612. func (s *HostListWarning) MarshalJSON() ([]byte, error) {
  8613. type NoMethod HostListWarning
  8614. raw := NoMethod(*s)
  8615. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8616. }
  8617. type HostListWarningData struct {
  8618. // Key: [Output Only] A key that provides more detail on the warning
  8619. // being returned. For example, for warnings where there are no results
  8620. // in a list request for a particular zone, this key might be scope and
  8621. // the key value might be the zone name. Other examples might be a key
  8622. // indicating a deprecated resource and a suggested replacement, or a
  8623. // warning about invalid network settings (for example, if an instance
  8624. // attempts to perform IP forwarding but is not enabled for IP
  8625. // forwarding).
  8626. Key string `json:"key,omitempty"`
  8627. // Value: [Output Only] A warning data value corresponding to the key.
  8628. Value string `json:"value,omitempty"`
  8629. // ForceSendFields is a list of field names (e.g. "Key") to
  8630. // unconditionally include in API requests. By default, fields with
  8631. // empty values are omitted from API requests. However, any non-pointer,
  8632. // non-interface field appearing in ForceSendFields will be sent to the
  8633. // server regardless of whether the field is empty or not. This may be
  8634. // used to include empty fields in Patch requests.
  8635. ForceSendFields []string `json:"-"`
  8636. // NullFields is a list of field names (e.g. "Key") to include in API
  8637. // requests with the JSON null value. By default, fields with empty
  8638. // values are omitted from API requests. However, any field with an
  8639. // empty value appearing in NullFields will be sent to the server as
  8640. // null. It is an error if a field in this list has a non-empty value.
  8641. // This may be used to include null fields in Patch requests.
  8642. NullFields []string `json:"-"`
  8643. }
  8644. func (s *HostListWarningData) MarshalJSON() ([]byte, error) {
  8645. type NoMethod HostListWarningData
  8646. raw := NoMethod(*s)
  8647. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8648. }
  8649. // HostRule: UrlMaps A host-matching rule for a URL. If matched, will
  8650. // use the named PathMatcher to select the BackendService.
  8651. type HostRule struct {
  8652. // Description: An optional description of this resource. Provide this
  8653. // property when you create the resource.
  8654. Description string `json:"description,omitempty"`
  8655. // Hosts: The list of host patterns to match. They must be valid
  8656. // hostnames, except * will match any string of ([a-z0-9-.]*). In that
  8657. // case, * must be the first character and must be followed in the
  8658. // pattern by either - or ..
  8659. Hosts []string `json:"hosts,omitempty"`
  8660. // PathMatcher: The name of the PathMatcher to use to match the path
  8661. // portion of the URL if the hostRule matches the URL's host portion.
  8662. PathMatcher string `json:"pathMatcher,omitempty"`
  8663. // ForceSendFields is a list of field names (e.g. "Description") to
  8664. // unconditionally include in API requests. By default, fields with
  8665. // empty values are omitted from API requests. However, any non-pointer,
  8666. // non-interface field appearing in ForceSendFields will be sent to the
  8667. // server regardless of whether the field is empty or not. This may be
  8668. // used to include empty fields in Patch requests.
  8669. ForceSendFields []string `json:"-"`
  8670. // NullFields is a list of field names (e.g. "Description") to include
  8671. // in API requests with the JSON null value. By default, fields with
  8672. // empty values are omitted from API requests. However, any field with
  8673. // an empty value appearing in NullFields will be sent to the server as
  8674. // null. It is an error if a field in this list has a non-empty value.
  8675. // This may be used to include null fields in Patch requests.
  8676. NullFields []string `json:"-"`
  8677. }
  8678. func (s *HostRule) MarshalJSON() ([]byte, error) {
  8679. type NoMethod HostRule
  8680. raw := NoMethod(*s)
  8681. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8682. }
  8683. // HostType: A Host Type resource.
  8684. type HostType struct {
  8685. // CpuPlatform: [Output Only] The CPU platform used by this host type.
  8686. CpuPlatform string `json:"cpuPlatform,omitempty"`
  8687. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  8688. // format.
  8689. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  8690. // Deprecated: [Output Only] The deprecation status associated with this
  8691. // host type.
  8692. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  8693. // Description: [Output Only] An optional textual description of the
  8694. // resource.
  8695. Description string `json:"description,omitempty"`
  8696. // GuestCpus: [Output Only] The number of virtual CPUs that are
  8697. // available to the host type.
  8698. GuestCpus int64 `json:"guestCpus,omitempty"`
  8699. // Id: [Output Only] The unique identifier for the resource. This
  8700. // identifier is defined by the server.
  8701. Id uint64 `json:"id,omitempty,string"`
  8702. // Kind: [Output Only] The type of the resource. Always compute#hostType
  8703. // for host types.
  8704. Kind string `json:"kind,omitempty"`
  8705. // LocalSsdGb: [Output Only] Local SSD available to the host type,
  8706. // defined in GB.
  8707. LocalSsdGb int64 `json:"localSsdGb,omitempty"`
  8708. // MemoryMb: [Output Only] The amount of physical memory available to
  8709. // the host type, defined in MB.
  8710. MemoryMb int64 `json:"memoryMb,omitempty"`
  8711. // Name: [Output Only] Name of the resource.
  8712. Name string `json:"name,omitempty"`
  8713. // SelfLink: [Output Only] Server-defined URL for the resource.
  8714. SelfLink string `json:"selfLink,omitempty"`
  8715. // Zone: [Output Only] The name of the zone where the host type resides,
  8716. // such as us-central1-a.
  8717. Zone string `json:"zone,omitempty"`
  8718. // ServerResponse contains the HTTP response code and headers from the
  8719. // server.
  8720. googleapi.ServerResponse `json:"-"`
  8721. // ForceSendFields is a list of field names (e.g. "CpuPlatform") to
  8722. // unconditionally include in API requests. By default, fields with
  8723. // empty values are omitted from API requests. However, any non-pointer,
  8724. // non-interface field appearing in ForceSendFields will be sent to the
  8725. // server regardless of whether the field is empty or not. This may be
  8726. // used to include empty fields in Patch requests.
  8727. ForceSendFields []string `json:"-"`
  8728. // NullFields is a list of field names (e.g. "CpuPlatform") to include
  8729. // in API requests with the JSON null value. By default, fields with
  8730. // empty values are omitted from API requests. However, any field with
  8731. // an empty value appearing in NullFields will be sent to the server as
  8732. // null. It is an error if a field in this list has a non-empty value.
  8733. // This may be used to include null fields in Patch requests.
  8734. NullFields []string `json:"-"`
  8735. }
  8736. func (s *HostType) MarshalJSON() ([]byte, error) {
  8737. type NoMethod HostType
  8738. raw := NoMethod(*s)
  8739. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8740. }
  8741. type HostTypeAggregatedList struct {
  8742. // Id: [Output Only] Unique identifier for the resource; defined by the
  8743. // server.
  8744. Id string `json:"id,omitempty"`
  8745. // Items: A list of HostTypesScopedList resources.
  8746. Items map[string]HostTypesScopedList `json:"items,omitempty"`
  8747. // Kind: [Output Only] Type of resource.Always
  8748. // compute#hostTypeAggregatedList for aggregated lists of host types.
  8749. Kind string `json:"kind,omitempty"`
  8750. // NextPageToken: [Output Only] This token allows you to get the next
  8751. // page of results for list requests. If the number of results is larger
  8752. // than maxResults, use the nextPageToken as a value for the query
  8753. // parameter pageToken in the next list request. Subsequent list
  8754. // requests will have their own nextPageToken to continue paging through
  8755. // the results.
  8756. NextPageToken string `json:"nextPageToken,omitempty"`
  8757. // SelfLink: [Output Only] Server-defined URL for this resource.
  8758. SelfLink string `json:"selfLink,omitempty"`
  8759. // Warning: [Output Only] Informational warning message.
  8760. Warning *HostTypeAggregatedListWarning `json:"warning,omitempty"`
  8761. // ServerResponse contains the HTTP response code and headers from the
  8762. // server.
  8763. googleapi.ServerResponse `json:"-"`
  8764. // ForceSendFields is a list of field names (e.g. "Id") to
  8765. // unconditionally include in API requests. By default, fields with
  8766. // empty values are omitted from API requests. However, any non-pointer,
  8767. // non-interface field appearing in ForceSendFields will be sent to the
  8768. // server regardless of whether the field is empty or not. This may be
  8769. // used to include empty fields in Patch requests.
  8770. ForceSendFields []string `json:"-"`
  8771. // NullFields is a list of field names (e.g. "Id") to include in API
  8772. // requests with the JSON null value. By default, fields with empty
  8773. // values are omitted from API requests. However, any field with an
  8774. // empty value appearing in NullFields will be sent to the server as
  8775. // null. It is an error if a field in this list has a non-empty value.
  8776. // This may be used to include null fields in Patch requests.
  8777. NullFields []string `json:"-"`
  8778. }
  8779. func (s *HostTypeAggregatedList) MarshalJSON() ([]byte, error) {
  8780. type NoMethod HostTypeAggregatedList
  8781. raw := NoMethod(*s)
  8782. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8783. }
  8784. // HostTypeAggregatedListWarning: [Output Only] Informational warning
  8785. // message.
  8786. type HostTypeAggregatedListWarning struct {
  8787. // Code: [Output Only] A warning code, if applicable. For example,
  8788. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  8789. // the response.
  8790. //
  8791. // Possible values:
  8792. // "CLEANUP_FAILED"
  8793. // "DEPRECATED_RESOURCE_USED"
  8794. // "DEPRECATED_TYPE_USED"
  8795. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  8796. // "EXPERIMENTAL_TYPE_USED"
  8797. // "EXTERNAL_API_WARNING"
  8798. // "FIELD_VALUE_OVERRIDEN"
  8799. // "INJECTED_KERNELS_DEPRECATED"
  8800. // "MISSING_TYPE_DEPENDENCY"
  8801. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  8802. // "NEXT_HOP_CANNOT_IP_FORWARD"
  8803. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  8804. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  8805. // "NEXT_HOP_NOT_RUNNING"
  8806. // "NOT_CRITICAL_ERROR"
  8807. // "NO_RESULTS_ON_PAGE"
  8808. // "REQUIRED_TOS_AGREEMENT"
  8809. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  8810. // "RESOURCE_NOT_DELETED"
  8811. // "SCHEMA_VALIDATION_IGNORED"
  8812. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  8813. // "UNDECLARED_PROPERTIES"
  8814. // "UNREACHABLE"
  8815. Code string `json:"code,omitempty"`
  8816. // Data: [Output Only] Metadata about this warning in key: value format.
  8817. // For example:
  8818. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  8819. Data []*HostTypeAggregatedListWarningData `json:"data,omitempty"`
  8820. // Message: [Output Only] A human-readable description of the warning
  8821. // code.
  8822. Message string `json:"message,omitempty"`
  8823. // ForceSendFields is a list of field names (e.g. "Code") to
  8824. // unconditionally include in API requests. By default, fields with
  8825. // empty values are omitted from API requests. However, any non-pointer,
  8826. // non-interface field appearing in ForceSendFields will be sent to the
  8827. // server regardless of whether the field is empty or not. This may be
  8828. // used to include empty fields in Patch requests.
  8829. ForceSendFields []string `json:"-"`
  8830. // NullFields is a list of field names (e.g. "Code") to include in API
  8831. // requests with the JSON null value. By default, fields with empty
  8832. // values are omitted from API requests. However, any field with an
  8833. // empty value appearing in NullFields will be sent to the server as
  8834. // null. It is an error if a field in this list has a non-empty value.
  8835. // This may be used to include null fields in Patch requests.
  8836. NullFields []string `json:"-"`
  8837. }
  8838. func (s *HostTypeAggregatedListWarning) MarshalJSON() ([]byte, error) {
  8839. type NoMethod HostTypeAggregatedListWarning
  8840. raw := NoMethod(*s)
  8841. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8842. }
  8843. type HostTypeAggregatedListWarningData struct {
  8844. // Key: [Output Only] A key that provides more detail on the warning
  8845. // being returned. For example, for warnings where there are no results
  8846. // in a list request for a particular zone, this key might be scope and
  8847. // the key value might be the zone name. Other examples might be a key
  8848. // indicating a deprecated resource and a suggested replacement, or a
  8849. // warning about invalid network settings (for example, if an instance
  8850. // attempts to perform IP forwarding but is not enabled for IP
  8851. // forwarding).
  8852. Key string `json:"key,omitempty"`
  8853. // Value: [Output Only] A warning data value corresponding to the key.
  8854. Value string `json:"value,omitempty"`
  8855. // ForceSendFields is a list of field names (e.g. "Key") to
  8856. // unconditionally include in API requests. By default, fields with
  8857. // empty values are omitted from API requests. However, any non-pointer,
  8858. // non-interface field appearing in ForceSendFields will be sent to the
  8859. // server regardless of whether the field is empty or not. This may be
  8860. // used to include empty fields in Patch requests.
  8861. ForceSendFields []string `json:"-"`
  8862. // NullFields is a list of field names (e.g. "Key") to include in API
  8863. // requests with the JSON null value. By default, fields with empty
  8864. // values are omitted from API requests. However, any field with an
  8865. // empty value appearing in NullFields will be sent to the server as
  8866. // null. It is an error if a field in this list has a non-empty value.
  8867. // This may be used to include null fields in Patch requests.
  8868. NullFields []string `json:"-"`
  8869. }
  8870. func (s *HostTypeAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  8871. type NoMethod HostTypeAggregatedListWarningData
  8872. raw := NoMethod(*s)
  8873. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8874. }
  8875. // HostTypeList: Contains a list of host types.
  8876. type HostTypeList struct {
  8877. // Id: [Output Only] Unique identifier for the resource; defined by the
  8878. // server.
  8879. Id string `json:"id,omitempty"`
  8880. // Items: A list of HostType resources.
  8881. Items []*HostType `json:"items,omitempty"`
  8882. // Kind: [Output Only] Type of resource.Always compute#hostTypeList for
  8883. // lists of host types.
  8884. Kind string `json:"kind,omitempty"`
  8885. // NextPageToken: [Output Only] This token allows you to get the next
  8886. // page of results for list requests. If the number of results is larger
  8887. // than maxResults, use the nextPageToken as a value for the query
  8888. // parameter pageToken in the next list request. Subsequent list
  8889. // requests will have their own nextPageToken to continue paging through
  8890. // the results.
  8891. NextPageToken string `json:"nextPageToken,omitempty"`
  8892. // SelfLink: [Output Only] Server-defined URL for this resource.
  8893. SelfLink string `json:"selfLink,omitempty"`
  8894. // Warning: [Output Only] Informational warning message.
  8895. Warning *HostTypeListWarning `json:"warning,omitempty"`
  8896. // ServerResponse contains the HTTP response code and headers from the
  8897. // server.
  8898. googleapi.ServerResponse `json:"-"`
  8899. // ForceSendFields is a list of field names (e.g. "Id") to
  8900. // unconditionally include in API requests. By default, fields with
  8901. // empty values are omitted from API requests. However, any non-pointer,
  8902. // non-interface field appearing in ForceSendFields will be sent to the
  8903. // server regardless of whether the field is empty or not. This may be
  8904. // used to include empty fields in Patch requests.
  8905. ForceSendFields []string `json:"-"`
  8906. // NullFields is a list of field names (e.g. "Id") to include in API
  8907. // requests with the JSON null value. By default, fields with empty
  8908. // values are omitted from API requests. However, any field with an
  8909. // empty value appearing in NullFields will be sent to the server as
  8910. // null. It is an error if a field in this list has a non-empty value.
  8911. // This may be used to include null fields in Patch requests.
  8912. NullFields []string `json:"-"`
  8913. }
  8914. func (s *HostTypeList) MarshalJSON() ([]byte, error) {
  8915. type NoMethod HostTypeList
  8916. raw := NoMethod(*s)
  8917. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8918. }
  8919. // HostTypeListWarning: [Output Only] Informational warning message.
  8920. type HostTypeListWarning struct {
  8921. // Code: [Output Only] A warning code, if applicable. For example,
  8922. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  8923. // the response.
  8924. //
  8925. // Possible values:
  8926. // "CLEANUP_FAILED"
  8927. // "DEPRECATED_RESOURCE_USED"
  8928. // "DEPRECATED_TYPE_USED"
  8929. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  8930. // "EXPERIMENTAL_TYPE_USED"
  8931. // "EXTERNAL_API_WARNING"
  8932. // "FIELD_VALUE_OVERRIDEN"
  8933. // "INJECTED_KERNELS_DEPRECATED"
  8934. // "MISSING_TYPE_DEPENDENCY"
  8935. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  8936. // "NEXT_HOP_CANNOT_IP_FORWARD"
  8937. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  8938. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  8939. // "NEXT_HOP_NOT_RUNNING"
  8940. // "NOT_CRITICAL_ERROR"
  8941. // "NO_RESULTS_ON_PAGE"
  8942. // "REQUIRED_TOS_AGREEMENT"
  8943. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  8944. // "RESOURCE_NOT_DELETED"
  8945. // "SCHEMA_VALIDATION_IGNORED"
  8946. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  8947. // "UNDECLARED_PROPERTIES"
  8948. // "UNREACHABLE"
  8949. Code string `json:"code,omitempty"`
  8950. // Data: [Output Only] Metadata about this warning in key: value format.
  8951. // For example:
  8952. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  8953. Data []*HostTypeListWarningData `json:"data,omitempty"`
  8954. // Message: [Output Only] A human-readable description of the warning
  8955. // code.
  8956. Message string `json:"message,omitempty"`
  8957. // ForceSendFields is a list of field names (e.g. "Code") to
  8958. // unconditionally include in API requests. By default, fields with
  8959. // empty values are omitted from API requests. However, any non-pointer,
  8960. // non-interface field appearing in ForceSendFields will be sent to the
  8961. // server regardless of whether the field is empty or not. This may be
  8962. // used to include empty fields in Patch requests.
  8963. ForceSendFields []string `json:"-"`
  8964. // NullFields is a list of field names (e.g. "Code") to include in API
  8965. // requests with the JSON null value. By default, fields with empty
  8966. // values are omitted from API requests. However, any field with an
  8967. // empty value appearing in NullFields will be sent to the server as
  8968. // null. It is an error if a field in this list has a non-empty value.
  8969. // This may be used to include null fields in Patch requests.
  8970. NullFields []string `json:"-"`
  8971. }
  8972. func (s *HostTypeListWarning) MarshalJSON() ([]byte, error) {
  8973. type NoMethod HostTypeListWarning
  8974. raw := NoMethod(*s)
  8975. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8976. }
  8977. type HostTypeListWarningData struct {
  8978. // Key: [Output Only] A key that provides more detail on the warning
  8979. // being returned. For example, for warnings where there are no results
  8980. // in a list request for a particular zone, this key might be scope and
  8981. // the key value might be the zone name. Other examples might be a key
  8982. // indicating a deprecated resource and a suggested replacement, or a
  8983. // warning about invalid network settings (for example, if an instance
  8984. // attempts to perform IP forwarding but is not enabled for IP
  8985. // forwarding).
  8986. Key string `json:"key,omitempty"`
  8987. // Value: [Output Only] A warning data value corresponding to the key.
  8988. Value string `json:"value,omitempty"`
  8989. // ForceSendFields is a list of field names (e.g. "Key") to
  8990. // unconditionally include in API requests. By default, fields with
  8991. // empty values are omitted from API requests. However, any non-pointer,
  8992. // non-interface field appearing in ForceSendFields will be sent to the
  8993. // server regardless of whether the field is empty or not. This may be
  8994. // used to include empty fields in Patch requests.
  8995. ForceSendFields []string `json:"-"`
  8996. // NullFields is a list of field names (e.g. "Key") to include in API
  8997. // requests with the JSON null value. By default, fields with empty
  8998. // values are omitted from API requests. However, any field with an
  8999. // empty value appearing in NullFields will be sent to the server as
  9000. // null. It is an error if a field in this list has a non-empty value.
  9001. // This may be used to include null fields in Patch requests.
  9002. NullFields []string `json:"-"`
  9003. }
  9004. func (s *HostTypeListWarningData) MarshalJSON() ([]byte, error) {
  9005. type NoMethod HostTypeListWarningData
  9006. raw := NoMethod(*s)
  9007. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9008. }
  9009. type HostTypesScopedList struct {
  9010. // HostTypes: [Output Only] A list of host types contained in this
  9011. // scope.
  9012. HostTypes []*HostType `json:"hostTypes,omitempty"`
  9013. // Warning: [Output Only] An informational warning that appears when the
  9014. // host types list is empty.
  9015. Warning *HostTypesScopedListWarning `json:"warning,omitempty"`
  9016. // ForceSendFields is a list of field names (e.g. "HostTypes") to
  9017. // unconditionally include in API requests. By default, fields with
  9018. // empty values are omitted from API requests. However, any non-pointer,
  9019. // non-interface field appearing in ForceSendFields will be sent to the
  9020. // server regardless of whether the field is empty or not. This may be
  9021. // used to include empty fields in Patch requests.
  9022. ForceSendFields []string `json:"-"`
  9023. // NullFields is a list of field names (e.g. "HostTypes") to include in
  9024. // API requests with the JSON null value. By default, fields with empty
  9025. // values are omitted from API requests. However, any field with an
  9026. // empty value appearing in NullFields will be sent to the server as
  9027. // null. It is an error if a field in this list has a non-empty value.
  9028. // This may be used to include null fields in Patch requests.
  9029. NullFields []string `json:"-"`
  9030. }
  9031. func (s *HostTypesScopedList) MarshalJSON() ([]byte, error) {
  9032. type NoMethod HostTypesScopedList
  9033. raw := NoMethod(*s)
  9034. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9035. }
  9036. // HostTypesScopedListWarning: [Output Only] An informational warning
  9037. // that appears when the host types list is empty.
  9038. type HostTypesScopedListWarning struct {
  9039. // Code: [Output Only] A warning code, if applicable. For example,
  9040. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  9041. // the response.
  9042. //
  9043. // Possible values:
  9044. // "CLEANUP_FAILED"
  9045. // "DEPRECATED_RESOURCE_USED"
  9046. // "DEPRECATED_TYPE_USED"
  9047. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  9048. // "EXPERIMENTAL_TYPE_USED"
  9049. // "EXTERNAL_API_WARNING"
  9050. // "FIELD_VALUE_OVERRIDEN"
  9051. // "INJECTED_KERNELS_DEPRECATED"
  9052. // "MISSING_TYPE_DEPENDENCY"
  9053. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  9054. // "NEXT_HOP_CANNOT_IP_FORWARD"
  9055. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  9056. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  9057. // "NEXT_HOP_NOT_RUNNING"
  9058. // "NOT_CRITICAL_ERROR"
  9059. // "NO_RESULTS_ON_PAGE"
  9060. // "REQUIRED_TOS_AGREEMENT"
  9061. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  9062. // "RESOURCE_NOT_DELETED"
  9063. // "SCHEMA_VALIDATION_IGNORED"
  9064. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  9065. // "UNDECLARED_PROPERTIES"
  9066. // "UNREACHABLE"
  9067. Code string `json:"code,omitempty"`
  9068. // Data: [Output Only] Metadata about this warning in key: value format.
  9069. // For example:
  9070. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  9071. Data []*HostTypesScopedListWarningData `json:"data,omitempty"`
  9072. // Message: [Output Only] A human-readable description of the warning
  9073. // code.
  9074. Message string `json:"message,omitempty"`
  9075. // ForceSendFields is a list of field names (e.g. "Code") to
  9076. // unconditionally include in API requests. By default, fields with
  9077. // empty values are omitted from API requests. However, any non-pointer,
  9078. // non-interface field appearing in ForceSendFields will be sent to the
  9079. // server regardless of whether the field is empty or not. This may be
  9080. // used to include empty fields in Patch requests.
  9081. ForceSendFields []string `json:"-"`
  9082. // NullFields is a list of field names (e.g. "Code") to include in API
  9083. // requests with the JSON null value. By default, fields with empty
  9084. // values are omitted from API requests. However, any field with an
  9085. // empty value appearing in NullFields will be sent to the server as
  9086. // null. It is an error if a field in this list has a non-empty value.
  9087. // This may be used to include null fields in Patch requests.
  9088. NullFields []string `json:"-"`
  9089. }
  9090. func (s *HostTypesScopedListWarning) MarshalJSON() ([]byte, error) {
  9091. type NoMethod HostTypesScopedListWarning
  9092. raw := NoMethod(*s)
  9093. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9094. }
  9095. type HostTypesScopedListWarningData struct {
  9096. // Key: [Output Only] A key that provides more detail on the warning
  9097. // being returned. For example, for warnings where there are no results
  9098. // in a list request for a particular zone, this key might be scope and
  9099. // the key value might be the zone name. Other examples might be a key
  9100. // indicating a deprecated resource and a suggested replacement, or a
  9101. // warning about invalid network settings (for example, if an instance
  9102. // attempts to perform IP forwarding but is not enabled for IP
  9103. // forwarding).
  9104. Key string `json:"key,omitempty"`
  9105. // Value: [Output Only] A warning data value corresponding to the key.
  9106. Value string `json:"value,omitempty"`
  9107. // ForceSendFields is a list of field names (e.g. "Key") to
  9108. // unconditionally include in API requests. By default, fields with
  9109. // empty values are omitted from API requests. However, any non-pointer,
  9110. // non-interface field appearing in ForceSendFields will be sent to the
  9111. // server regardless of whether the field is empty or not. This may be
  9112. // used to include empty fields in Patch requests.
  9113. ForceSendFields []string `json:"-"`
  9114. // NullFields is a list of field names (e.g. "Key") to include in API
  9115. // requests with the JSON null value. By default, fields with empty
  9116. // values are omitted from API requests. However, any field with an
  9117. // empty value appearing in NullFields will be sent to the server as
  9118. // null. It is an error if a field in this list has a non-empty value.
  9119. // This may be used to include null fields in Patch requests.
  9120. NullFields []string `json:"-"`
  9121. }
  9122. func (s *HostTypesScopedListWarningData) MarshalJSON() ([]byte, error) {
  9123. type NoMethod HostTypesScopedListWarningData
  9124. raw := NoMethod(*s)
  9125. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9126. }
  9127. type HostsScopedList struct {
  9128. // Hosts: [Output Only] A list of hosts contained in this scope.
  9129. Hosts []*Host `json:"hosts,omitempty"`
  9130. // Warning: [Output Only] An informational warning that appears when the
  9131. // host list is empty.
  9132. Warning *HostsScopedListWarning `json:"warning,omitempty"`
  9133. // ForceSendFields is a list of field names (e.g. "Hosts") to
  9134. // unconditionally include in API requests. By default, fields with
  9135. // empty values are omitted from API requests. However, any non-pointer,
  9136. // non-interface field appearing in ForceSendFields will be sent to the
  9137. // server regardless of whether the field is empty or not. This may be
  9138. // used to include empty fields in Patch requests.
  9139. ForceSendFields []string `json:"-"`
  9140. // NullFields is a list of field names (e.g. "Hosts") to include in API
  9141. // requests with the JSON null value. By default, fields with empty
  9142. // values are omitted from API requests. However, any field with an
  9143. // empty value appearing in NullFields will be sent to the server as
  9144. // null. It is an error if a field in this list has a non-empty value.
  9145. // This may be used to include null fields in Patch requests.
  9146. NullFields []string `json:"-"`
  9147. }
  9148. func (s *HostsScopedList) MarshalJSON() ([]byte, error) {
  9149. type NoMethod HostsScopedList
  9150. raw := NoMethod(*s)
  9151. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9152. }
  9153. // HostsScopedListWarning: [Output Only] An informational warning that
  9154. // appears when the host list is empty.
  9155. type HostsScopedListWarning struct {
  9156. // Code: [Output Only] A warning code, if applicable. For example,
  9157. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  9158. // the response.
  9159. //
  9160. // Possible values:
  9161. // "CLEANUP_FAILED"
  9162. // "DEPRECATED_RESOURCE_USED"
  9163. // "DEPRECATED_TYPE_USED"
  9164. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  9165. // "EXPERIMENTAL_TYPE_USED"
  9166. // "EXTERNAL_API_WARNING"
  9167. // "FIELD_VALUE_OVERRIDEN"
  9168. // "INJECTED_KERNELS_DEPRECATED"
  9169. // "MISSING_TYPE_DEPENDENCY"
  9170. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  9171. // "NEXT_HOP_CANNOT_IP_FORWARD"
  9172. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  9173. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  9174. // "NEXT_HOP_NOT_RUNNING"
  9175. // "NOT_CRITICAL_ERROR"
  9176. // "NO_RESULTS_ON_PAGE"
  9177. // "REQUIRED_TOS_AGREEMENT"
  9178. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  9179. // "RESOURCE_NOT_DELETED"
  9180. // "SCHEMA_VALIDATION_IGNORED"
  9181. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  9182. // "UNDECLARED_PROPERTIES"
  9183. // "UNREACHABLE"
  9184. Code string `json:"code,omitempty"`
  9185. // Data: [Output Only] Metadata about this warning in key: value format.
  9186. // For example:
  9187. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  9188. Data []*HostsScopedListWarningData `json:"data,omitempty"`
  9189. // Message: [Output Only] A human-readable description of the warning
  9190. // code.
  9191. Message string `json:"message,omitempty"`
  9192. // ForceSendFields is a list of field names (e.g. "Code") to
  9193. // unconditionally include in API requests. By default, fields with
  9194. // empty values are omitted from API requests. However, any non-pointer,
  9195. // non-interface field appearing in ForceSendFields will be sent to the
  9196. // server regardless of whether the field is empty or not. This may be
  9197. // used to include empty fields in Patch requests.
  9198. ForceSendFields []string `json:"-"`
  9199. // NullFields is a list of field names (e.g. "Code") to include in API
  9200. // requests with the JSON null value. By default, fields with empty
  9201. // values are omitted from API requests. However, any field with an
  9202. // empty value appearing in NullFields will be sent to the server as
  9203. // null. It is an error if a field in this list has a non-empty value.
  9204. // This may be used to include null fields in Patch requests.
  9205. NullFields []string `json:"-"`
  9206. }
  9207. func (s *HostsScopedListWarning) MarshalJSON() ([]byte, error) {
  9208. type NoMethod HostsScopedListWarning
  9209. raw := NoMethod(*s)
  9210. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9211. }
  9212. type HostsScopedListWarningData struct {
  9213. // Key: [Output Only] A key that provides more detail on the warning
  9214. // being returned. For example, for warnings where there are no results
  9215. // in a list request for a particular zone, this key might be scope and
  9216. // the key value might be the zone name. Other examples might be a key
  9217. // indicating a deprecated resource and a suggested replacement, or a
  9218. // warning about invalid network settings (for example, if an instance
  9219. // attempts to perform IP forwarding but is not enabled for IP
  9220. // forwarding).
  9221. Key string `json:"key,omitempty"`
  9222. // Value: [Output Only] A warning data value corresponding to the key.
  9223. Value string `json:"value,omitempty"`
  9224. // ForceSendFields is a list of field names (e.g. "Key") to
  9225. // unconditionally include in API requests. By default, fields with
  9226. // empty values are omitted from API requests. However, any non-pointer,
  9227. // non-interface field appearing in ForceSendFields will be sent to the
  9228. // server regardless of whether the field is empty or not. This may be
  9229. // used to include empty fields in Patch requests.
  9230. ForceSendFields []string `json:"-"`
  9231. // NullFields is a list of field names (e.g. "Key") to include in API
  9232. // requests with the JSON null value. By default, fields with empty
  9233. // values are omitted from API requests. However, any field with an
  9234. // empty value appearing in NullFields will be sent to the server as
  9235. // null. It is an error if a field in this list has a non-empty value.
  9236. // This may be used to include null fields in Patch requests.
  9237. NullFields []string `json:"-"`
  9238. }
  9239. func (s *HostsScopedListWarningData) MarshalJSON() ([]byte, error) {
  9240. type NoMethod HostsScopedListWarningData
  9241. raw := NoMethod(*s)
  9242. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9243. }
  9244. // HttpHealthCheck: An HttpHealthCheck resource. This resource defines a
  9245. // template for how individual instances should be checked for health,
  9246. // via HTTP.
  9247. type HttpHealthCheck struct {
  9248. // CheckIntervalSec: How often (in seconds) to send a health check. The
  9249. // default value is 5 seconds.
  9250. CheckIntervalSec int64 `json:"checkIntervalSec,omitempty"`
  9251. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  9252. // format.
  9253. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  9254. // Description: An optional description of this resource. Provide this
  9255. // property when you create the resource.
  9256. Description string `json:"description,omitempty"`
  9257. // HealthyThreshold: A so-far unhealthy instance will be marked healthy
  9258. // after this many consecutive successes. The default value is 2.
  9259. HealthyThreshold int64 `json:"healthyThreshold,omitempty"`
  9260. // Host: The value of the host header in the HTTP health check request.
  9261. // If left empty (default value), the public IP on behalf of which this
  9262. // health check is performed will be used.
  9263. Host string `json:"host,omitempty"`
  9264. // Id: [Output Only] The unique identifier for the resource. This
  9265. // identifier is defined by the server.
  9266. Id uint64 `json:"id,omitempty,string"`
  9267. // Kind: [Output Only] Type of the resource. Always
  9268. // compute#httpHealthCheck for HTTP health checks.
  9269. Kind string `json:"kind,omitempty"`
  9270. // Name: Name of the resource. Provided by the client when the resource
  9271. // is created. The name must be 1-63 characters long, and comply with
  9272. // RFC1035. Specifically, the name must be 1-63 characters long and
  9273. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  9274. // the first character must be a lowercase letter, and all following
  9275. // characters must be a dash, lowercase letter, or digit, except the
  9276. // last character, which cannot be a dash.
  9277. Name string `json:"name,omitempty"`
  9278. // Port: The TCP port number for the HTTP health check request. The
  9279. // default value is 80.
  9280. Port int64 `json:"port,omitempty"`
  9281. // RequestPath: The request path of the HTTP health check request. The
  9282. // default value is /.
  9283. RequestPath string `json:"requestPath,omitempty"`
  9284. // SelfLink: [Output Only] Server-defined URL for the resource.
  9285. SelfLink string `json:"selfLink,omitempty"`
  9286. // TimeoutSec: How long (in seconds) to wait before claiming failure.
  9287. // The default value is 5 seconds. It is invalid for timeoutSec to have
  9288. // greater value than checkIntervalSec.
  9289. TimeoutSec int64 `json:"timeoutSec,omitempty"`
  9290. // UnhealthyThreshold: A so-far healthy instance will be marked
  9291. // unhealthy after this many consecutive failures. The default value is
  9292. // 2.
  9293. UnhealthyThreshold int64 `json:"unhealthyThreshold,omitempty"`
  9294. // ServerResponse contains the HTTP response code and headers from the
  9295. // server.
  9296. googleapi.ServerResponse `json:"-"`
  9297. // ForceSendFields is a list of field names (e.g. "CheckIntervalSec") to
  9298. // unconditionally include in API requests. By default, fields with
  9299. // empty values are omitted from API requests. However, any non-pointer,
  9300. // non-interface field appearing in ForceSendFields will be sent to the
  9301. // server regardless of whether the field is empty or not. This may be
  9302. // used to include empty fields in Patch requests.
  9303. ForceSendFields []string `json:"-"`
  9304. // NullFields is a list of field names (e.g. "CheckIntervalSec") to
  9305. // include in API requests with the JSON null value. By default, fields
  9306. // with empty values are omitted from API requests. However, any field
  9307. // with an empty value appearing in NullFields will be sent to the
  9308. // server as null. It is an error if a field in this list has a
  9309. // non-empty value. This may be used to include null fields in Patch
  9310. // requests.
  9311. NullFields []string `json:"-"`
  9312. }
  9313. func (s *HttpHealthCheck) MarshalJSON() ([]byte, error) {
  9314. type NoMethod HttpHealthCheck
  9315. raw := NoMethod(*s)
  9316. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9317. }
  9318. // HttpHealthCheckList: Contains a list of HttpHealthCheck resources.
  9319. type HttpHealthCheckList struct {
  9320. // Id: [Output Only] Unique identifier for the resource; defined by the
  9321. // server.
  9322. Id string `json:"id,omitempty"`
  9323. // Items: A list of HttpHealthCheck resources.
  9324. Items []*HttpHealthCheck `json:"items,omitempty"`
  9325. // Kind: Type of resource.
  9326. Kind string `json:"kind,omitempty"`
  9327. // NextPageToken: [Output Only] This token allows you to get the next
  9328. // page of results for list requests. If the number of results is larger
  9329. // than maxResults, use the nextPageToken as a value for the query
  9330. // parameter pageToken in the next list request. Subsequent list
  9331. // requests will have their own nextPageToken to continue paging through
  9332. // the results.
  9333. NextPageToken string `json:"nextPageToken,omitempty"`
  9334. // SelfLink: [Output Only] Server-defined URL for this resource.
  9335. SelfLink string `json:"selfLink,omitempty"`
  9336. // Warning: [Output Only] Informational warning message.
  9337. Warning *HttpHealthCheckListWarning `json:"warning,omitempty"`
  9338. // ServerResponse contains the HTTP response code and headers from the
  9339. // server.
  9340. googleapi.ServerResponse `json:"-"`
  9341. // ForceSendFields is a list of field names (e.g. "Id") to
  9342. // unconditionally include in API requests. By default, fields with
  9343. // empty values are omitted from API requests. However, any non-pointer,
  9344. // non-interface field appearing in ForceSendFields will be sent to the
  9345. // server regardless of whether the field is empty or not. This may be
  9346. // used to include empty fields in Patch requests.
  9347. ForceSendFields []string `json:"-"`
  9348. // NullFields is a list of field names (e.g. "Id") to include in API
  9349. // requests with the JSON null value. By default, fields with empty
  9350. // values are omitted from API requests. However, any field with an
  9351. // empty value appearing in NullFields will be sent to the server as
  9352. // null. It is an error if a field in this list has a non-empty value.
  9353. // This may be used to include null fields in Patch requests.
  9354. NullFields []string `json:"-"`
  9355. }
  9356. func (s *HttpHealthCheckList) MarshalJSON() ([]byte, error) {
  9357. type NoMethod HttpHealthCheckList
  9358. raw := NoMethod(*s)
  9359. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9360. }
  9361. // HttpHealthCheckListWarning: [Output Only] Informational warning
  9362. // message.
  9363. type HttpHealthCheckListWarning struct {
  9364. // Code: [Output Only] A warning code, if applicable. For example,
  9365. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  9366. // the response.
  9367. //
  9368. // Possible values:
  9369. // "CLEANUP_FAILED"
  9370. // "DEPRECATED_RESOURCE_USED"
  9371. // "DEPRECATED_TYPE_USED"
  9372. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  9373. // "EXPERIMENTAL_TYPE_USED"
  9374. // "EXTERNAL_API_WARNING"
  9375. // "FIELD_VALUE_OVERRIDEN"
  9376. // "INJECTED_KERNELS_DEPRECATED"
  9377. // "MISSING_TYPE_DEPENDENCY"
  9378. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  9379. // "NEXT_HOP_CANNOT_IP_FORWARD"
  9380. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  9381. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  9382. // "NEXT_HOP_NOT_RUNNING"
  9383. // "NOT_CRITICAL_ERROR"
  9384. // "NO_RESULTS_ON_PAGE"
  9385. // "REQUIRED_TOS_AGREEMENT"
  9386. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  9387. // "RESOURCE_NOT_DELETED"
  9388. // "SCHEMA_VALIDATION_IGNORED"
  9389. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  9390. // "UNDECLARED_PROPERTIES"
  9391. // "UNREACHABLE"
  9392. Code string `json:"code,omitempty"`
  9393. // Data: [Output Only] Metadata about this warning in key: value format.
  9394. // For example:
  9395. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  9396. Data []*HttpHealthCheckListWarningData `json:"data,omitempty"`
  9397. // Message: [Output Only] A human-readable description of the warning
  9398. // code.
  9399. Message string `json:"message,omitempty"`
  9400. // ForceSendFields is a list of field names (e.g. "Code") to
  9401. // unconditionally include in API requests. By default, fields with
  9402. // empty values are omitted from API requests. However, any non-pointer,
  9403. // non-interface field appearing in ForceSendFields will be sent to the
  9404. // server regardless of whether the field is empty or not. This may be
  9405. // used to include empty fields in Patch requests.
  9406. ForceSendFields []string `json:"-"`
  9407. // NullFields is a list of field names (e.g. "Code") to include in API
  9408. // requests with the JSON null value. By default, fields with empty
  9409. // values are omitted from API requests. However, any field with an
  9410. // empty value appearing in NullFields will be sent to the server as
  9411. // null. It is an error if a field in this list has a non-empty value.
  9412. // This may be used to include null fields in Patch requests.
  9413. NullFields []string `json:"-"`
  9414. }
  9415. func (s *HttpHealthCheckListWarning) MarshalJSON() ([]byte, error) {
  9416. type NoMethod HttpHealthCheckListWarning
  9417. raw := NoMethod(*s)
  9418. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9419. }
  9420. type HttpHealthCheckListWarningData struct {
  9421. // Key: [Output Only] A key that provides more detail on the warning
  9422. // being returned. For example, for warnings where there are no results
  9423. // in a list request for a particular zone, this key might be scope and
  9424. // the key value might be the zone name. Other examples might be a key
  9425. // indicating a deprecated resource and a suggested replacement, or a
  9426. // warning about invalid network settings (for example, if an instance
  9427. // attempts to perform IP forwarding but is not enabled for IP
  9428. // forwarding).
  9429. Key string `json:"key,omitempty"`
  9430. // Value: [Output Only] A warning data value corresponding to the key.
  9431. Value string `json:"value,omitempty"`
  9432. // ForceSendFields is a list of field names (e.g. "Key") to
  9433. // unconditionally include in API requests. By default, fields with
  9434. // empty values are omitted from API requests. However, any non-pointer,
  9435. // non-interface field appearing in ForceSendFields will be sent to the
  9436. // server regardless of whether the field is empty or not. This may be
  9437. // used to include empty fields in Patch requests.
  9438. ForceSendFields []string `json:"-"`
  9439. // NullFields is a list of field names (e.g. "Key") to include in API
  9440. // requests with the JSON null value. By default, fields with empty
  9441. // values are omitted from API requests. However, any field with an
  9442. // empty value appearing in NullFields will be sent to the server as
  9443. // null. It is an error if a field in this list has a non-empty value.
  9444. // This may be used to include null fields in Patch requests.
  9445. NullFields []string `json:"-"`
  9446. }
  9447. func (s *HttpHealthCheckListWarningData) MarshalJSON() ([]byte, error) {
  9448. type NoMethod HttpHealthCheckListWarningData
  9449. raw := NoMethod(*s)
  9450. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9451. }
  9452. // HttpsHealthCheck: An HttpsHealthCheck resource. This resource defines
  9453. // a template for how individual instances should be checked for health,
  9454. // via HTTPS.
  9455. type HttpsHealthCheck struct {
  9456. // CheckIntervalSec: How often (in seconds) to send a health check. The
  9457. // default value is 5 seconds.
  9458. CheckIntervalSec int64 `json:"checkIntervalSec,omitempty"`
  9459. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  9460. // format.
  9461. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  9462. // Description: An optional description of this resource. Provide this
  9463. // property when you create the resource.
  9464. Description string `json:"description,omitempty"`
  9465. // HealthyThreshold: A so-far unhealthy instance will be marked healthy
  9466. // after this many consecutive successes. The default value is 2.
  9467. HealthyThreshold int64 `json:"healthyThreshold,omitempty"`
  9468. // Host: The value of the host header in the HTTPS health check request.
  9469. // If left empty (default value), the public IP on behalf of which this
  9470. // health check is performed will be used.
  9471. Host string `json:"host,omitempty"`
  9472. // Id: [Output Only] The unique identifier for the resource. This
  9473. // identifier is defined by the server.
  9474. Id uint64 `json:"id,omitempty,string"`
  9475. // Kind: Type of the resource.
  9476. Kind string `json:"kind,omitempty"`
  9477. // Name: Name of the resource. Provided by the client when the resource
  9478. // is created. The name must be 1-63 characters long, and comply with
  9479. // RFC1035. Specifically, the name must be 1-63 characters long and
  9480. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  9481. // the first character must be a lowercase letter, and all following
  9482. // characters must be a dash, lowercase letter, or digit, except the
  9483. // last character, which cannot be a dash.
  9484. Name string `json:"name,omitempty"`
  9485. // Port: The TCP port number for the HTTPS health check request. The
  9486. // default value is 443.
  9487. Port int64 `json:"port,omitempty"`
  9488. // RequestPath: The request path of the HTTPS health check request. The
  9489. // default value is "/".
  9490. RequestPath string `json:"requestPath,omitempty"`
  9491. // SelfLink: [Output Only] Server-defined URL for the resource.
  9492. SelfLink string `json:"selfLink,omitempty"`
  9493. // TimeoutSec: How long (in seconds) to wait before claiming failure.
  9494. // The default value is 5 seconds. It is invalid for timeoutSec to have
  9495. // a greater value than checkIntervalSec.
  9496. TimeoutSec int64 `json:"timeoutSec,omitempty"`
  9497. // UnhealthyThreshold: A so-far healthy instance will be marked
  9498. // unhealthy after this many consecutive failures. The default value is
  9499. // 2.
  9500. UnhealthyThreshold int64 `json:"unhealthyThreshold,omitempty"`
  9501. // ServerResponse contains the HTTP response code and headers from the
  9502. // server.
  9503. googleapi.ServerResponse `json:"-"`
  9504. // ForceSendFields is a list of field names (e.g. "CheckIntervalSec") to
  9505. // unconditionally include in API requests. By default, fields with
  9506. // empty values are omitted from API requests. However, any non-pointer,
  9507. // non-interface field appearing in ForceSendFields will be sent to the
  9508. // server regardless of whether the field is empty or not. This may be
  9509. // used to include empty fields in Patch requests.
  9510. ForceSendFields []string `json:"-"`
  9511. // NullFields is a list of field names (e.g. "CheckIntervalSec") to
  9512. // include in API requests with the JSON null value. By default, fields
  9513. // with empty values are omitted from API requests. However, any field
  9514. // with an empty value appearing in NullFields will be sent to the
  9515. // server as null. It is an error if a field in this list has a
  9516. // non-empty value. This may be used to include null fields in Patch
  9517. // requests.
  9518. NullFields []string `json:"-"`
  9519. }
  9520. func (s *HttpsHealthCheck) MarshalJSON() ([]byte, error) {
  9521. type NoMethod HttpsHealthCheck
  9522. raw := NoMethod(*s)
  9523. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9524. }
  9525. // HttpsHealthCheckList: Contains a list of HttpsHealthCheck resources.
  9526. type HttpsHealthCheckList struct {
  9527. // Id: [Output Only] Unique identifier for the resource; defined by the
  9528. // server.
  9529. Id string `json:"id,omitempty"`
  9530. // Items: A list of HttpsHealthCheck resources.
  9531. Items []*HttpsHealthCheck `json:"items,omitempty"`
  9532. // Kind: Type of resource.
  9533. Kind string `json:"kind,omitempty"`
  9534. // NextPageToken: [Output Only] This token allows you to get the next
  9535. // page of results for list requests. If the number of results is larger
  9536. // than maxResults, use the nextPageToken as a value for the query
  9537. // parameter pageToken in the next list request. Subsequent list
  9538. // requests will have their own nextPageToken to continue paging through
  9539. // the results.
  9540. NextPageToken string `json:"nextPageToken,omitempty"`
  9541. // SelfLink: [Output Only] Server-defined URL for this resource.
  9542. SelfLink string `json:"selfLink,omitempty"`
  9543. // Warning: [Output Only] Informational warning message.
  9544. Warning *HttpsHealthCheckListWarning `json:"warning,omitempty"`
  9545. // ServerResponse contains the HTTP response code and headers from the
  9546. // server.
  9547. googleapi.ServerResponse `json:"-"`
  9548. // ForceSendFields is a list of field names (e.g. "Id") to
  9549. // unconditionally include in API requests. By default, fields with
  9550. // empty values are omitted from API requests. However, any non-pointer,
  9551. // non-interface field appearing in ForceSendFields will be sent to the
  9552. // server regardless of whether the field is empty or not. This may be
  9553. // used to include empty fields in Patch requests.
  9554. ForceSendFields []string `json:"-"`
  9555. // NullFields is a list of field names (e.g. "Id") to include in API
  9556. // requests with the JSON null value. By default, fields with empty
  9557. // values are omitted from API requests. However, any field with an
  9558. // empty value appearing in NullFields will be sent to the server as
  9559. // null. It is an error if a field in this list has a non-empty value.
  9560. // This may be used to include null fields in Patch requests.
  9561. NullFields []string `json:"-"`
  9562. }
  9563. func (s *HttpsHealthCheckList) MarshalJSON() ([]byte, error) {
  9564. type NoMethod HttpsHealthCheckList
  9565. raw := NoMethod(*s)
  9566. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9567. }
  9568. // HttpsHealthCheckListWarning: [Output Only] Informational warning
  9569. // message.
  9570. type HttpsHealthCheckListWarning struct {
  9571. // Code: [Output Only] A warning code, if applicable. For example,
  9572. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  9573. // the response.
  9574. //
  9575. // Possible values:
  9576. // "CLEANUP_FAILED"
  9577. // "DEPRECATED_RESOURCE_USED"
  9578. // "DEPRECATED_TYPE_USED"
  9579. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  9580. // "EXPERIMENTAL_TYPE_USED"
  9581. // "EXTERNAL_API_WARNING"
  9582. // "FIELD_VALUE_OVERRIDEN"
  9583. // "INJECTED_KERNELS_DEPRECATED"
  9584. // "MISSING_TYPE_DEPENDENCY"
  9585. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  9586. // "NEXT_HOP_CANNOT_IP_FORWARD"
  9587. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  9588. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  9589. // "NEXT_HOP_NOT_RUNNING"
  9590. // "NOT_CRITICAL_ERROR"
  9591. // "NO_RESULTS_ON_PAGE"
  9592. // "REQUIRED_TOS_AGREEMENT"
  9593. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  9594. // "RESOURCE_NOT_DELETED"
  9595. // "SCHEMA_VALIDATION_IGNORED"
  9596. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  9597. // "UNDECLARED_PROPERTIES"
  9598. // "UNREACHABLE"
  9599. Code string `json:"code,omitempty"`
  9600. // Data: [Output Only] Metadata about this warning in key: value format.
  9601. // For example:
  9602. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  9603. Data []*HttpsHealthCheckListWarningData `json:"data,omitempty"`
  9604. // Message: [Output Only] A human-readable description of the warning
  9605. // code.
  9606. Message string `json:"message,omitempty"`
  9607. // ForceSendFields is a list of field names (e.g. "Code") to
  9608. // unconditionally include in API requests. By default, fields with
  9609. // empty values are omitted from API requests. However, any non-pointer,
  9610. // non-interface field appearing in ForceSendFields will be sent to the
  9611. // server regardless of whether the field is empty or not. This may be
  9612. // used to include empty fields in Patch requests.
  9613. ForceSendFields []string `json:"-"`
  9614. // NullFields is a list of field names (e.g. "Code") to include in API
  9615. // requests with the JSON null value. By default, fields with empty
  9616. // values are omitted from API requests. However, any field with an
  9617. // empty value appearing in NullFields will be sent to the server as
  9618. // null. It is an error if a field in this list has a non-empty value.
  9619. // This may be used to include null fields in Patch requests.
  9620. NullFields []string `json:"-"`
  9621. }
  9622. func (s *HttpsHealthCheckListWarning) MarshalJSON() ([]byte, error) {
  9623. type NoMethod HttpsHealthCheckListWarning
  9624. raw := NoMethod(*s)
  9625. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9626. }
  9627. type HttpsHealthCheckListWarningData struct {
  9628. // Key: [Output Only] A key that provides more detail on the warning
  9629. // being returned. For example, for warnings where there are no results
  9630. // in a list request for a particular zone, this key might be scope and
  9631. // the key value might be the zone name. Other examples might be a key
  9632. // indicating a deprecated resource and a suggested replacement, or a
  9633. // warning about invalid network settings (for example, if an instance
  9634. // attempts to perform IP forwarding but is not enabled for IP
  9635. // forwarding).
  9636. Key string `json:"key,omitempty"`
  9637. // Value: [Output Only] A warning data value corresponding to the key.
  9638. Value string `json:"value,omitempty"`
  9639. // ForceSendFields is a list of field names (e.g. "Key") to
  9640. // unconditionally include in API requests. By default, fields with
  9641. // empty values are omitted from API requests. However, any non-pointer,
  9642. // non-interface field appearing in ForceSendFields will be sent to the
  9643. // server regardless of whether the field is empty or not. This may be
  9644. // used to include empty fields in Patch requests.
  9645. ForceSendFields []string `json:"-"`
  9646. // NullFields is a list of field names (e.g. "Key") to include in API
  9647. // requests with the JSON null value. By default, fields with empty
  9648. // values are omitted from API requests. However, any field with an
  9649. // empty value appearing in NullFields will be sent to the server as
  9650. // null. It is an error if a field in this list has a non-empty value.
  9651. // This may be used to include null fields in Patch requests.
  9652. NullFields []string `json:"-"`
  9653. }
  9654. func (s *HttpsHealthCheckListWarningData) MarshalJSON() ([]byte, error) {
  9655. type NoMethod HttpsHealthCheckListWarningData
  9656. raw := NoMethod(*s)
  9657. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9658. }
  9659. // Image: An Image resource. (== resource_for beta.images ==) (==
  9660. // resource_for v1.images ==)
  9661. type Image struct {
  9662. // ArchiveSizeBytes: Size of the image tar.gz archive stored in Google
  9663. // Cloud Storage (in bytes).
  9664. ArchiveSizeBytes int64 `json:"archiveSizeBytes,omitempty,string"`
  9665. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  9666. // format.
  9667. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  9668. // Deprecated: The deprecation status associated with this image.
  9669. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  9670. // Description: An optional description of this resource. Provide this
  9671. // property when you create the resource.
  9672. Description string `json:"description,omitempty"`
  9673. // DiskSizeGb: Size of the image when restored onto a persistent disk
  9674. // (in GB).
  9675. DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"`
  9676. // Family: The name of the image family to which this image belongs. You
  9677. // can create disks by specifying an image family instead of a specific
  9678. // image name. The image family always returns its latest image that is
  9679. // not deprecated. The name of the image family must comply with
  9680. // RFC1035.
  9681. Family string `json:"family,omitempty"`
  9682. // GuestOsFeatures: A list of features to enable on the guest operating
  9683. // system. Applicable only for bootable images. Read Enabling guest
  9684. // operating system features to see a list of available options.
  9685. GuestOsFeatures []*GuestOsFeature `json:"guestOsFeatures,omitempty"`
  9686. // Id: [Output Only] The unique identifier for the resource. This
  9687. // identifier is defined by the server.
  9688. Id uint64 `json:"id,omitempty,string"`
  9689. // ImageEncryptionKey: Encrypts the image using a customer-supplied
  9690. // encryption key.
  9691. //
  9692. // After you encrypt an image with a customer-supplied key, you must
  9693. // provide the same key if you use the image later (e.g. to create a
  9694. // disk from the image).
  9695. //
  9696. // Customer-supplied encryption keys do not protect access to metadata
  9697. // of the disk.
  9698. //
  9699. // If you do not provide an encryption key when creating the image, then
  9700. // the disk will be encrypted using an automatically generated key and
  9701. // you do not need to provide a key to use the image later.
  9702. ImageEncryptionKey *CustomerEncryptionKey `json:"imageEncryptionKey,omitempty"`
  9703. // Kind: [Output Only] Type of the resource. Always compute#image for
  9704. // images.
  9705. Kind string `json:"kind,omitempty"`
  9706. // LabelFingerprint: A fingerprint for the labels being applied to this
  9707. // image, which is essentially a hash of the labels used for optimistic
  9708. // locking. The fingerprint is initially generated by Compute Engine and
  9709. // changes after every request to modify or update labels. You must
  9710. // always provide an up-to-date fingerprint hash in order to update or
  9711. // change labels.
  9712. //
  9713. // To see the latest fingerprint, make a get() request to retrieve an
  9714. // image.
  9715. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  9716. // Labels: Labels to apply to this image. These can be later modified by
  9717. // the setLabels method.
  9718. Labels map[string]string `json:"labels,omitempty"`
  9719. // LicenseCodes: Integer license codes indicating which licenses are
  9720. // attached to this image.
  9721. LicenseCodes googleapi.Int64s `json:"licenseCodes,omitempty"`
  9722. // Licenses: Any applicable license URI.
  9723. Licenses []string `json:"licenses,omitempty"`
  9724. // Name: Name of the resource; provided by the client when the resource
  9725. // is created. The name must be 1-63 characters long, and comply with
  9726. // RFC1035. Specifically, the name must be 1-63 characters long and
  9727. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  9728. // the first character must be a lowercase letter, and all following
  9729. // characters must be a dash, lowercase letter, or digit, except the
  9730. // last character, which cannot be a dash.
  9731. Name string `json:"name,omitempty"`
  9732. // RawDisk: The parameters of the raw disk image.
  9733. RawDisk *ImageRawDisk `json:"rawDisk,omitempty"`
  9734. // SelfLink: [Output Only] Server-defined URL for the resource.
  9735. SelfLink string `json:"selfLink,omitempty"`
  9736. // SourceDisk: URL of the source disk used to create this image. This
  9737. // can be a full or valid partial URL. You must provide either this
  9738. // property or the rawDisk.source property but not both to create an
  9739. // image. For example, the following are valid values:
  9740. // -
  9741. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk
  9742. // - projects/project/zones/zone/disks/disk
  9743. // - zones/zone/disks/disk
  9744. SourceDisk string `json:"sourceDisk,omitempty"`
  9745. // SourceDiskEncryptionKey: The customer-supplied encryption key of the
  9746. // source disk. Required if the source disk is protected by a
  9747. // customer-supplied encryption key.
  9748. SourceDiskEncryptionKey *CustomerEncryptionKey `json:"sourceDiskEncryptionKey,omitempty"`
  9749. // SourceDiskId: The ID value of the disk used to create this image.
  9750. // This value may be used to determine whether the image was taken from
  9751. // the current or a previous instance of a given disk name.
  9752. SourceDiskId string `json:"sourceDiskId,omitempty"`
  9753. // SourceImage: URL of the source image used to create this image. This
  9754. // can be a full or valid partial URL. You must provide exactly one of:
  9755. //
  9756. // - this property, or
  9757. // - the rawDisk.source property, or
  9758. // - the sourceDisk property in order to create an image.
  9759. SourceImage string `json:"sourceImage,omitempty"`
  9760. // SourceImageEncryptionKey: The customer-supplied encryption key of the
  9761. // source image. Required if the source image is protected by a
  9762. // customer-supplied encryption key.
  9763. SourceImageEncryptionKey *CustomerEncryptionKey `json:"sourceImageEncryptionKey,omitempty"`
  9764. // SourceImageId: [Output Only] The ID value of the image used to create
  9765. // this image. This value may be used to determine whether the image was
  9766. // taken from the current or a previous instance of a given image name.
  9767. SourceImageId string `json:"sourceImageId,omitempty"`
  9768. // SourceSnapshot: URL of the source snapshot used to create this image.
  9769. // This can be a full or valid partial URL. You must provide exactly one
  9770. // of:
  9771. // - this property, or
  9772. // - the sourceImage property, or
  9773. // - the rawDisk.source property, or
  9774. // - the sourceDisk property in order to create an image.
  9775. SourceSnapshot string `json:"sourceSnapshot,omitempty"`
  9776. // SourceSnapshotEncryptionKey: The customer-supplied encryption key of
  9777. // the source snapshot. Required if the source snapshot is protected by
  9778. // a customer-supplied encryption key.
  9779. SourceSnapshotEncryptionKey *CustomerEncryptionKey `json:"sourceSnapshotEncryptionKey,omitempty"`
  9780. // SourceSnapshotId: [Output Only] The ID value of the snapshot used to
  9781. // create this image. This value may be used to determine whether the
  9782. // snapshot was taken from the current or a previous instance of a given
  9783. // snapshot name.
  9784. SourceSnapshotId string `json:"sourceSnapshotId,omitempty"`
  9785. // SourceType: The type of the image used to create this disk. The
  9786. // default and only value is RAW
  9787. //
  9788. // Possible values:
  9789. // "RAW" (default)
  9790. SourceType string `json:"sourceType,omitempty"`
  9791. // Status: [Output Only] The status of the image. An image can be used
  9792. // to create other resources, such as instances, only after the image
  9793. // has been successfully created and the status is set to READY.
  9794. // Possible values are FAILED, PENDING, or READY.
  9795. //
  9796. // Possible values:
  9797. // "FAILED"
  9798. // "PENDING"
  9799. // "READY"
  9800. Status string `json:"status,omitempty"`
  9801. // ServerResponse contains the HTTP response code and headers from the
  9802. // server.
  9803. googleapi.ServerResponse `json:"-"`
  9804. // ForceSendFields is a list of field names (e.g. "ArchiveSizeBytes") to
  9805. // unconditionally include in API requests. By default, fields with
  9806. // empty values are omitted from API requests. However, any non-pointer,
  9807. // non-interface field appearing in ForceSendFields will be sent to the
  9808. // server regardless of whether the field is empty or not. This may be
  9809. // used to include empty fields in Patch requests.
  9810. ForceSendFields []string `json:"-"`
  9811. // NullFields is a list of field names (e.g. "ArchiveSizeBytes") to
  9812. // include in API requests with the JSON null value. By default, fields
  9813. // with empty values are omitted from API requests. However, any field
  9814. // with an empty value appearing in NullFields will be sent to the
  9815. // server as null. It is an error if a field in this list has a
  9816. // non-empty value. This may be used to include null fields in Patch
  9817. // requests.
  9818. NullFields []string `json:"-"`
  9819. }
  9820. func (s *Image) MarshalJSON() ([]byte, error) {
  9821. type NoMethod Image
  9822. raw := NoMethod(*s)
  9823. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9824. }
  9825. // ImageRawDisk: The parameters of the raw disk image.
  9826. type ImageRawDisk struct {
  9827. // ContainerType: The format used to encode and transmit the block
  9828. // device, which should be TAR. This is just a container and
  9829. // transmission format and not a runtime format. Provided by the client
  9830. // when the disk image is created.
  9831. //
  9832. // Possible values:
  9833. // "TAR"
  9834. ContainerType string `json:"containerType,omitempty"`
  9835. // Sha1Checksum: An optional SHA1 checksum of the disk image before
  9836. // unpackaging; provided by the client when the disk image is created.
  9837. Sha1Checksum string `json:"sha1Checksum,omitempty"`
  9838. // Source: The full Google Cloud Storage URL where the disk image is
  9839. // stored. You must provide either this property or the sourceDisk
  9840. // property but not both.
  9841. Source string `json:"source,omitempty"`
  9842. // ForceSendFields is a list of field names (e.g. "ContainerType") to
  9843. // unconditionally include in API requests. By default, fields with
  9844. // empty values are omitted from API requests. However, any non-pointer,
  9845. // non-interface field appearing in ForceSendFields will be sent to the
  9846. // server regardless of whether the field is empty or not. This may be
  9847. // used to include empty fields in Patch requests.
  9848. ForceSendFields []string `json:"-"`
  9849. // NullFields is a list of field names (e.g. "ContainerType") to include
  9850. // in API requests with the JSON null value. By default, fields with
  9851. // empty values are omitted from API requests. However, any field with
  9852. // an empty value appearing in NullFields will be sent to the server as
  9853. // null. It is an error if a field in this list has a non-empty value.
  9854. // This may be used to include null fields in Patch requests.
  9855. NullFields []string `json:"-"`
  9856. }
  9857. func (s *ImageRawDisk) MarshalJSON() ([]byte, error) {
  9858. type NoMethod ImageRawDisk
  9859. raw := NoMethod(*s)
  9860. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9861. }
  9862. // ImageList: Contains a list of images.
  9863. type ImageList struct {
  9864. // Id: [Output Only] Unique identifier for the resource; defined by the
  9865. // server.
  9866. Id string `json:"id,omitempty"`
  9867. // Items: A list of Image resources.
  9868. Items []*Image `json:"items,omitempty"`
  9869. // Kind: Type of resource.
  9870. Kind string `json:"kind,omitempty"`
  9871. // NextPageToken: [Output Only] This token allows you to get the next
  9872. // page of results for list requests. If the number of results is larger
  9873. // than maxResults, use the nextPageToken as a value for the query
  9874. // parameter pageToken in the next list request. Subsequent list
  9875. // requests will have their own nextPageToken to continue paging through
  9876. // the results.
  9877. NextPageToken string `json:"nextPageToken,omitempty"`
  9878. // SelfLink: [Output Only] Server-defined URL for this resource.
  9879. SelfLink string `json:"selfLink,omitempty"`
  9880. // Warning: [Output Only] Informational warning message.
  9881. Warning *ImageListWarning `json:"warning,omitempty"`
  9882. // ServerResponse contains the HTTP response code and headers from the
  9883. // server.
  9884. googleapi.ServerResponse `json:"-"`
  9885. // ForceSendFields is a list of field names (e.g. "Id") to
  9886. // unconditionally include in API requests. By default, fields with
  9887. // empty values are omitted from API requests. However, any non-pointer,
  9888. // non-interface field appearing in ForceSendFields will be sent to the
  9889. // server regardless of whether the field is empty or not. This may be
  9890. // used to include empty fields in Patch requests.
  9891. ForceSendFields []string `json:"-"`
  9892. // NullFields is a list of field names (e.g. "Id") to include in API
  9893. // requests with the JSON null value. By default, fields with empty
  9894. // values are omitted from API requests. However, any field with an
  9895. // empty value appearing in NullFields will be sent to the server as
  9896. // null. It is an error if a field in this list has a non-empty value.
  9897. // This may be used to include null fields in Patch requests.
  9898. NullFields []string `json:"-"`
  9899. }
  9900. func (s *ImageList) MarshalJSON() ([]byte, error) {
  9901. type NoMethod ImageList
  9902. raw := NoMethod(*s)
  9903. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9904. }
  9905. // ImageListWarning: [Output Only] Informational warning message.
  9906. type ImageListWarning struct {
  9907. // Code: [Output Only] A warning code, if applicable. For example,
  9908. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  9909. // the response.
  9910. //
  9911. // Possible values:
  9912. // "CLEANUP_FAILED"
  9913. // "DEPRECATED_RESOURCE_USED"
  9914. // "DEPRECATED_TYPE_USED"
  9915. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  9916. // "EXPERIMENTAL_TYPE_USED"
  9917. // "EXTERNAL_API_WARNING"
  9918. // "FIELD_VALUE_OVERRIDEN"
  9919. // "INJECTED_KERNELS_DEPRECATED"
  9920. // "MISSING_TYPE_DEPENDENCY"
  9921. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  9922. // "NEXT_HOP_CANNOT_IP_FORWARD"
  9923. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  9924. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  9925. // "NEXT_HOP_NOT_RUNNING"
  9926. // "NOT_CRITICAL_ERROR"
  9927. // "NO_RESULTS_ON_PAGE"
  9928. // "REQUIRED_TOS_AGREEMENT"
  9929. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  9930. // "RESOURCE_NOT_DELETED"
  9931. // "SCHEMA_VALIDATION_IGNORED"
  9932. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  9933. // "UNDECLARED_PROPERTIES"
  9934. // "UNREACHABLE"
  9935. Code string `json:"code,omitempty"`
  9936. // Data: [Output Only] Metadata about this warning in key: value format.
  9937. // For example:
  9938. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  9939. Data []*ImageListWarningData `json:"data,omitempty"`
  9940. // Message: [Output Only] A human-readable description of the warning
  9941. // code.
  9942. Message string `json:"message,omitempty"`
  9943. // ForceSendFields is a list of field names (e.g. "Code") to
  9944. // unconditionally include in API requests. By default, fields with
  9945. // empty values are omitted from API requests. However, any non-pointer,
  9946. // non-interface field appearing in ForceSendFields will be sent to the
  9947. // server regardless of whether the field is empty or not. This may be
  9948. // used to include empty fields in Patch requests.
  9949. ForceSendFields []string `json:"-"`
  9950. // NullFields is a list of field names (e.g. "Code") to include in API
  9951. // requests with the JSON null value. By default, fields with empty
  9952. // values are omitted from API requests. However, any field with an
  9953. // empty value appearing in NullFields will be sent to the server as
  9954. // null. It is an error if a field in this list has a non-empty value.
  9955. // This may be used to include null fields in Patch requests.
  9956. NullFields []string `json:"-"`
  9957. }
  9958. func (s *ImageListWarning) MarshalJSON() ([]byte, error) {
  9959. type NoMethod ImageListWarning
  9960. raw := NoMethod(*s)
  9961. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9962. }
  9963. type ImageListWarningData struct {
  9964. // Key: [Output Only] A key that provides more detail on the warning
  9965. // being returned. For example, for warnings where there are no results
  9966. // in a list request for a particular zone, this key might be scope and
  9967. // the key value might be the zone name. Other examples might be a key
  9968. // indicating a deprecated resource and a suggested replacement, or a
  9969. // warning about invalid network settings (for example, if an instance
  9970. // attempts to perform IP forwarding but is not enabled for IP
  9971. // forwarding).
  9972. Key string `json:"key,omitempty"`
  9973. // Value: [Output Only] A warning data value corresponding to the key.
  9974. Value string `json:"value,omitempty"`
  9975. // ForceSendFields is a list of field names (e.g. "Key") to
  9976. // unconditionally include in API requests. By default, fields with
  9977. // empty values are omitted from API requests. However, any non-pointer,
  9978. // non-interface field appearing in ForceSendFields will be sent to the
  9979. // server regardless of whether the field is empty or not. This may be
  9980. // used to include empty fields in Patch requests.
  9981. ForceSendFields []string `json:"-"`
  9982. // NullFields is a list of field names (e.g. "Key") to include in API
  9983. // requests with the JSON null value. By default, fields with empty
  9984. // values are omitted from API requests. However, any field with an
  9985. // empty value appearing in NullFields will be sent to the server as
  9986. // null. It is an error if a field in this list has a non-empty value.
  9987. // This may be used to include null fields in Patch requests.
  9988. NullFields []string `json:"-"`
  9989. }
  9990. func (s *ImageListWarningData) MarshalJSON() ([]byte, error) {
  9991. type NoMethod ImageListWarningData
  9992. raw := NoMethod(*s)
  9993. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9994. }
  9995. // Instance: An Instance resource. (== resource_for beta.instances ==)
  9996. // (== resource_for v1.instances ==)
  9997. type Instance struct {
  9998. // CanIpForward: Allows this instance to send and receive packets with
  9999. // non-matching destination or source IPs. This is required if you plan
  10000. // to use this instance to forward routes. For more information, see
  10001. // Enabling IP Forwarding.
  10002. CanIpForward bool `json:"canIpForward,omitempty"`
  10003. // CpuPlatform: [Output Only] The CPU platform used by this instance.
  10004. CpuPlatform string `json:"cpuPlatform,omitempty"`
  10005. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  10006. // format.
  10007. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  10008. // DeletionProtection: Whether the resource should be protected against
  10009. // deletion.
  10010. DeletionProtection bool `json:"deletionProtection,omitempty"`
  10011. // Description: An optional description of this resource. Provide this
  10012. // property when you create the resource.
  10013. Description string `json:"description,omitempty"`
  10014. // Disks: Array of disks associated with this instance. Persistent disks
  10015. // must be created before you can assign them.
  10016. Disks []*AttachedDisk `json:"disks,omitempty"`
  10017. // GuestAccelerators: A list of the type and count of accelerator cards
  10018. // attached to the instance.
  10019. GuestAccelerators []*AcceleratorConfig `json:"guestAccelerators,omitempty"`
  10020. // Host: Full or partial URL of the host resource that the instance
  10021. // should be placed on, in the format: zones/zone/hosts/host.
  10022. //
  10023. // Optional, sole-tenant Host (physical machine) that the instance will
  10024. // be placed on when it's created. The instance is guaranteed to be
  10025. // placed on the same machine as other instances with the same
  10026. // sole-tenant host.
  10027. //
  10028. // The request will be rejected if the sole-tenant host has run out of
  10029. // resources.
  10030. Host string `json:"host,omitempty"`
  10031. // Id: [Output Only] The unique identifier for the resource. This
  10032. // identifier is defined by the server.
  10033. Id uint64 `json:"id,omitempty,string"`
  10034. // InstanceEncryptionKey: Encrypts or decrypts data for an instance with
  10035. // a customer-supplied encryption key.
  10036. //
  10037. // If you are creating a new instance, this field encrypts the local SSD
  10038. // and in-memory contents of the instance using a key that you
  10039. // provide.
  10040. //
  10041. // If you are restarting an instance protected with a customer-supplied
  10042. // encryption key, you must provide the correct key in order to
  10043. // successfully restart the instance.
  10044. //
  10045. // If you do not provide an encryption key when creating the instance,
  10046. // then the local SSD and in-memory contents will be encrypted using an
  10047. // automatically generated key and you do not need to provide a key to
  10048. // start the instance later.
  10049. //
  10050. // Instance templates do not store customer-supplied encryption keys, so
  10051. // you cannot use your own keys to encrypt local SSDs and in-memory
  10052. // content in a managed instance group.
  10053. InstanceEncryptionKey *CustomerEncryptionKey `json:"instanceEncryptionKey,omitempty"`
  10054. // Kind: [Output Only] Type of the resource. Always compute#instance for
  10055. // instances.
  10056. Kind string `json:"kind,omitempty"`
  10057. // LabelFingerprint: A fingerprint for this request, which is
  10058. // essentially a hash of the label's contents and used for optimistic
  10059. // locking. The fingerprint is initially generated by Compute Engine and
  10060. // changes after every request to modify or update labels. You must
  10061. // always provide an up-to-date fingerprint hash in order to update or
  10062. // change labels.
  10063. //
  10064. // To see the latest fingerprint, make get() request to the instance.
  10065. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  10066. // Labels: Labels to apply to this instance. These can be later modified
  10067. // by the setLabels method.
  10068. Labels map[string]string `json:"labels,omitempty"`
  10069. // MachineType: Full or partial URL of the machine type resource to use
  10070. // for this instance, in the format:
  10071. // zones/zone/machineTypes/machine-type. This is provided by the client
  10072. // when the instance is created. For example, the following is a valid
  10073. // partial url to a predefined machine
  10074. // type:
  10075. // zones/us-central1-f/machineTypes/n1-standard-1
  10076. //
  10077. //
  10078. // To create a custom machine type, provide a URL to a machine type in
  10079. // the following format, where CPUS is 1 or an even number up to 32 (2,
  10080. // 4, 6, ... 24, etc), and MEMORY is the total memory for this instance.
  10081. // Memory must be a multiple of 256 MB and must be supplied in MB (e.g.
  10082. // 5 GB of memory is 5120
  10083. // MB):
  10084. // zones/zone/machineTypes/custom-CPUS-MEMORY
  10085. //
  10086. //
  10087. // For example: zones/us-central1-f/machineTypes/custom-4-5120
  10088. //
  10089. // For a full list of restrictions, read the Specifications for custom
  10090. // machine types.
  10091. MachineType string `json:"machineType,omitempty"`
  10092. // Metadata: The metadata key/value pairs assigned to this instance.
  10093. // This includes custom metadata and predefined keys.
  10094. Metadata *Metadata `json:"metadata,omitempty"`
  10095. // MinCpuPlatform: Specifies a minimum CPU platform for the VM instance.
  10096. // Applicable values are the friendly names of CPU platforms, such as
  10097. // minCpuPlatform: "Intel Haswell" or minCpuPlatform: "Intel Sandy
  10098. // Bridge".
  10099. MinCpuPlatform string `json:"minCpuPlatform,omitempty"`
  10100. // Name: The name of the resource, provided by the client when initially
  10101. // creating the resource. The resource name must be 1-63 characters
  10102. // long, and comply with RFC1035. Specifically, the name must be 1-63
  10103. // characters long and match the regular expression
  10104. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  10105. // a lowercase letter, and all following characters must be a dash,
  10106. // lowercase letter, or digit, except the last character, which cannot
  10107. // be a dash.
  10108. Name string `json:"name,omitempty"`
  10109. // NetworkInterfaces: An array of network configurations for this
  10110. // instance. These specify how interfaces are configured to interact
  10111. // with other network services, such as connecting to the internet.
  10112. // Multiple interfaces are supported per instance.
  10113. NetworkInterfaces []*NetworkInterface `json:"networkInterfaces,omitempty"`
  10114. // PreservedStateSizeGb: Total amount of preserved state for SUSPENDED
  10115. // instances. Read-only in the api.
  10116. PreservedStateSizeGb int64 `json:"preservedStateSizeGb,omitempty,string"`
  10117. // ResourcePolicies: Resource policies applied to this instance.
  10118. ResourcePolicies []string `json:"resourcePolicies,omitempty"`
  10119. // Scheduling: Sets the scheduling options for this instance.
  10120. Scheduling *Scheduling `json:"scheduling,omitempty"`
  10121. // SelfLink: [Output Only] Server-defined URL for this resource.
  10122. SelfLink string `json:"selfLink,omitempty"`
  10123. // ServiceAccounts: A list of service accounts, with their specified
  10124. // scopes, authorized for this instance. Only one service account per VM
  10125. // instance is supported.
  10126. //
  10127. // Service accounts generate access tokens that can be accessed through
  10128. // the metadata server and used to authenticate applications on the
  10129. // instance. See Service Accounts for more information.
  10130. ServiceAccounts []*ServiceAccount `json:"serviceAccounts,omitempty"`
  10131. ShieldedVmConfig *ShieldedVmConfig `json:"shieldedVmConfig,omitempty"`
  10132. ShieldedVmIntegrityPolicy *ShieldedVmIntegrityPolicy `json:"shieldedVmIntegrityPolicy,omitempty"`
  10133. // SourceMachineImage: Source machine image
  10134. SourceMachineImage string `json:"sourceMachineImage,omitempty"`
  10135. // StartRestricted: [Output Only] Whether a VM has been restricted for
  10136. // start because Compute Engine has detected suspicious activity.
  10137. StartRestricted bool `json:"startRestricted,omitempty"`
  10138. // Status: [Output Only] The status of the instance. One of the
  10139. // following values: PROVISIONING, STAGING, RUNNING, STOPPING, STOPPED,
  10140. // SUSPENDING, SUSPENDED, and TERMINATED.
  10141. //
  10142. // Possible values:
  10143. // "PROVISIONING"
  10144. // "RUNNING"
  10145. // "STAGING"
  10146. // "STOPPED"
  10147. // "STOPPING"
  10148. // "SUSPENDED"
  10149. // "SUSPENDING"
  10150. // "TERMINATED"
  10151. Status string `json:"status,omitempty"`
  10152. // StatusMessage: [Output Only] An optional, human-readable explanation
  10153. // of the status.
  10154. StatusMessage string `json:"statusMessage,omitempty"`
  10155. // Tags: A list of tags to apply to this instance. Tags are used to
  10156. // identify valid sources or targets for network firewalls and are
  10157. // specified by the client during instance creation. The tags can be
  10158. // later modified by the setTags method. Each tag within the list must
  10159. // comply with RFC1035.
  10160. Tags *Tags `json:"tags,omitempty"`
  10161. // Zone: [Output Only] URL of the zone where the instance resides. You
  10162. // must specify this field as part of the HTTP request URL. It is not
  10163. // settable as a field in the request body.
  10164. Zone string `json:"zone,omitempty"`
  10165. // ServerResponse contains the HTTP response code and headers from the
  10166. // server.
  10167. googleapi.ServerResponse `json:"-"`
  10168. // ForceSendFields is a list of field names (e.g. "CanIpForward") to
  10169. // unconditionally include in API requests. By default, fields with
  10170. // empty values are omitted from API requests. However, any non-pointer,
  10171. // non-interface field appearing in ForceSendFields will be sent to the
  10172. // server regardless of whether the field is empty or not. This may be
  10173. // used to include empty fields in Patch requests.
  10174. ForceSendFields []string `json:"-"`
  10175. // NullFields is a list of field names (e.g. "CanIpForward") to include
  10176. // in API requests with the JSON null value. By default, fields with
  10177. // empty values are omitted from API requests. However, any field with
  10178. // an empty value appearing in NullFields will be sent to the server as
  10179. // null. It is an error if a field in this list has a non-empty value.
  10180. // This may be used to include null fields in Patch requests.
  10181. NullFields []string `json:"-"`
  10182. }
  10183. func (s *Instance) MarshalJSON() ([]byte, error) {
  10184. type NoMethod Instance
  10185. raw := NoMethod(*s)
  10186. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10187. }
  10188. type InstanceAggregatedList struct {
  10189. // Id: [Output Only] Unique identifier for the resource; defined by the
  10190. // server.
  10191. Id string `json:"id,omitempty"`
  10192. // Items: A list of InstancesScopedList resources.
  10193. Items map[string]InstancesScopedList `json:"items,omitempty"`
  10194. // Kind: [Output Only] Type of resource. Always
  10195. // compute#instanceAggregatedList for aggregated lists of Instance
  10196. // resources.
  10197. Kind string `json:"kind,omitempty"`
  10198. // NextPageToken: [Output Only] This token allows you to get the next
  10199. // page of results for list requests. If the number of results is larger
  10200. // than maxResults, use the nextPageToken as a value for the query
  10201. // parameter pageToken in the next list request. Subsequent list
  10202. // requests will have their own nextPageToken to continue paging through
  10203. // the results.
  10204. NextPageToken string `json:"nextPageToken,omitempty"`
  10205. // SelfLink: [Output Only] Server-defined URL for this resource.
  10206. SelfLink string `json:"selfLink,omitempty"`
  10207. // Warning: [Output Only] Informational warning message.
  10208. Warning *InstanceAggregatedListWarning `json:"warning,omitempty"`
  10209. // ServerResponse contains the HTTP response code and headers from the
  10210. // server.
  10211. googleapi.ServerResponse `json:"-"`
  10212. // ForceSendFields is a list of field names (e.g. "Id") to
  10213. // unconditionally include in API requests. By default, fields with
  10214. // empty values are omitted from API requests. However, any non-pointer,
  10215. // non-interface field appearing in ForceSendFields will be sent to the
  10216. // server regardless of whether the field is empty or not. This may be
  10217. // used to include empty fields in Patch requests.
  10218. ForceSendFields []string `json:"-"`
  10219. // NullFields is a list of field names (e.g. "Id") to include in API
  10220. // requests with the JSON null value. By default, fields with empty
  10221. // values are omitted from API requests. However, any field with an
  10222. // empty value appearing in NullFields will be sent to the server as
  10223. // null. It is an error if a field in this list has a non-empty value.
  10224. // This may be used to include null fields in Patch requests.
  10225. NullFields []string `json:"-"`
  10226. }
  10227. func (s *InstanceAggregatedList) MarshalJSON() ([]byte, error) {
  10228. type NoMethod InstanceAggregatedList
  10229. raw := NoMethod(*s)
  10230. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10231. }
  10232. // InstanceAggregatedListWarning: [Output Only] Informational warning
  10233. // message.
  10234. type InstanceAggregatedListWarning struct {
  10235. // Code: [Output Only] A warning code, if applicable. For example,
  10236. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  10237. // the response.
  10238. //
  10239. // Possible values:
  10240. // "CLEANUP_FAILED"
  10241. // "DEPRECATED_RESOURCE_USED"
  10242. // "DEPRECATED_TYPE_USED"
  10243. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  10244. // "EXPERIMENTAL_TYPE_USED"
  10245. // "EXTERNAL_API_WARNING"
  10246. // "FIELD_VALUE_OVERRIDEN"
  10247. // "INJECTED_KERNELS_DEPRECATED"
  10248. // "MISSING_TYPE_DEPENDENCY"
  10249. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  10250. // "NEXT_HOP_CANNOT_IP_FORWARD"
  10251. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  10252. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  10253. // "NEXT_HOP_NOT_RUNNING"
  10254. // "NOT_CRITICAL_ERROR"
  10255. // "NO_RESULTS_ON_PAGE"
  10256. // "REQUIRED_TOS_AGREEMENT"
  10257. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  10258. // "RESOURCE_NOT_DELETED"
  10259. // "SCHEMA_VALIDATION_IGNORED"
  10260. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  10261. // "UNDECLARED_PROPERTIES"
  10262. // "UNREACHABLE"
  10263. Code string `json:"code,omitempty"`
  10264. // Data: [Output Only] Metadata about this warning in key: value format.
  10265. // For example:
  10266. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  10267. Data []*InstanceAggregatedListWarningData `json:"data,omitempty"`
  10268. // Message: [Output Only] A human-readable description of the warning
  10269. // code.
  10270. Message string `json:"message,omitempty"`
  10271. // ForceSendFields is a list of field names (e.g. "Code") to
  10272. // unconditionally include in API requests. By default, fields with
  10273. // empty values are omitted from API requests. However, any non-pointer,
  10274. // non-interface field appearing in ForceSendFields will be sent to the
  10275. // server regardless of whether the field is empty or not. This may be
  10276. // used to include empty fields in Patch requests.
  10277. ForceSendFields []string `json:"-"`
  10278. // NullFields is a list of field names (e.g. "Code") to include in API
  10279. // requests with the JSON null value. By default, fields with empty
  10280. // values are omitted from API requests. However, any field with an
  10281. // empty value appearing in NullFields will be sent to the server as
  10282. // null. It is an error if a field in this list has a non-empty value.
  10283. // This may be used to include null fields in Patch requests.
  10284. NullFields []string `json:"-"`
  10285. }
  10286. func (s *InstanceAggregatedListWarning) MarshalJSON() ([]byte, error) {
  10287. type NoMethod InstanceAggregatedListWarning
  10288. raw := NoMethod(*s)
  10289. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10290. }
  10291. type InstanceAggregatedListWarningData struct {
  10292. // Key: [Output Only] A key that provides more detail on the warning
  10293. // being returned. For example, for warnings where there are no results
  10294. // in a list request for a particular zone, this key might be scope and
  10295. // the key value might be the zone name. Other examples might be a key
  10296. // indicating a deprecated resource and a suggested replacement, or a
  10297. // warning about invalid network settings (for example, if an instance
  10298. // attempts to perform IP forwarding but is not enabled for IP
  10299. // forwarding).
  10300. Key string `json:"key,omitempty"`
  10301. // Value: [Output Only] A warning data value corresponding to the key.
  10302. Value string `json:"value,omitempty"`
  10303. // ForceSendFields is a list of field names (e.g. "Key") to
  10304. // unconditionally include in API requests. By default, fields with
  10305. // empty values are omitted from API requests. However, any non-pointer,
  10306. // non-interface field appearing in ForceSendFields will be sent to the
  10307. // server regardless of whether the field is empty or not. This may be
  10308. // used to include empty fields in Patch requests.
  10309. ForceSendFields []string `json:"-"`
  10310. // NullFields is a list of field names (e.g. "Key") to include in API
  10311. // requests with the JSON null value. By default, fields with empty
  10312. // values are omitted from API requests. However, any field with an
  10313. // empty value appearing in NullFields will be sent to the server as
  10314. // null. It is an error if a field in this list has a non-empty value.
  10315. // This may be used to include null fields in Patch requests.
  10316. NullFields []string `json:"-"`
  10317. }
  10318. func (s *InstanceAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  10319. type NoMethod InstanceAggregatedListWarningData
  10320. raw := NoMethod(*s)
  10321. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10322. }
  10323. // InstanceGroup: InstanceGroups (== resource_for beta.instanceGroups
  10324. // ==) (== resource_for v1.instanceGroups ==) (== resource_for
  10325. // beta.regionInstanceGroups ==) (== resource_for
  10326. // v1.regionInstanceGroups ==)
  10327. type InstanceGroup struct {
  10328. // CreationTimestamp: [Output Only] The creation timestamp for this
  10329. // instance group in RFC3339 text format.
  10330. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  10331. // Description: An optional description of this resource. Provide this
  10332. // property when you create the resource.
  10333. Description string `json:"description,omitempty"`
  10334. // Fingerprint: [Output Only] The fingerprint of the named ports. The
  10335. // system uses this fingerprint to detect conflicts when multiple users
  10336. // change the named ports concurrently.
  10337. Fingerprint string `json:"fingerprint,omitempty"`
  10338. // Id: [Output Only] A unique identifier for this instance group,
  10339. // generated by the server.
  10340. Id uint64 `json:"id,omitempty,string"`
  10341. // Kind: [Output Only] The resource type, which is always
  10342. // compute#instanceGroup for instance groups.
  10343. Kind string `json:"kind,omitempty"`
  10344. // Name: The name of the instance group. The name must be 1-63
  10345. // characters long, and comply with RFC1035.
  10346. Name string `json:"name,omitempty"`
  10347. // NamedPorts: Assigns a name to a port number. For example: {name:
  10348. // "http", port: 80}
  10349. //
  10350. // This allows the system to reference ports by the assigned name
  10351. // instead of a port number. Named ports can also contain multiple
  10352. // ports. For example: [{name: "http", port: 80},{name: "http", port:
  10353. // 8080}]
  10354. //
  10355. // Named ports apply to all instances in this instance group.
  10356. NamedPorts []*NamedPort `json:"namedPorts,omitempty"`
  10357. // Network: The URL of the network to which all instances in the
  10358. // instance group belong.
  10359. Network string `json:"network,omitempty"`
  10360. // Region: [Output Only] The URL of the region where the instance group
  10361. // is located (for regional resources).
  10362. Region string `json:"region,omitempty"`
  10363. // SelfLink: [Output Only] The URL for this instance group. The server
  10364. // generates this URL.
  10365. SelfLink string `json:"selfLink,omitempty"`
  10366. // Size: [Output Only] The total number of instances in the instance
  10367. // group.
  10368. Size int64 `json:"size,omitempty"`
  10369. // Subnetwork: [Output Only] The URL of the subnetwork to which all
  10370. // instances in the instance group belong.
  10371. Subnetwork string `json:"subnetwork,omitempty"`
  10372. // Zone: [Output Only] The URL of the zone where the instance group is
  10373. // located (for zonal resources).
  10374. Zone string `json:"zone,omitempty"`
  10375. // ServerResponse contains the HTTP response code and headers from the
  10376. // server.
  10377. googleapi.ServerResponse `json:"-"`
  10378. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  10379. // to unconditionally include in API requests. By default, fields with
  10380. // empty values are omitted from API requests. However, any non-pointer,
  10381. // non-interface field appearing in ForceSendFields will be sent to the
  10382. // server regardless of whether the field is empty or not. This may be
  10383. // used to include empty fields in Patch requests.
  10384. ForceSendFields []string `json:"-"`
  10385. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  10386. // include in API requests with the JSON null value. By default, fields
  10387. // with empty values are omitted from API requests. However, any field
  10388. // with an empty value appearing in NullFields will be sent to the
  10389. // server as null. It is an error if a field in this list has a
  10390. // non-empty value. This may be used to include null fields in Patch
  10391. // requests.
  10392. NullFields []string `json:"-"`
  10393. }
  10394. func (s *InstanceGroup) MarshalJSON() ([]byte, error) {
  10395. type NoMethod InstanceGroup
  10396. raw := NoMethod(*s)
  10397. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10398. }
  10399. type InstanceGroupAggregatedList struct {
  10400. // Id: [Output Only] Unique identifier for the resource; defined by the
  10401. // server.
  10402. Id string `json:"id,omitempty"`
  10403. // Items: A list of InstanceGroupsScopedList resources.
  10404. Items map[string]InstanceGroupsScopedList `json:"items,omitempty"`
  10405. // Kind: [Output Only] The resource type, which is always
  10406. // compute#instanceGroupAggregatedList for aggregated lists of instance
  10407. // groups.
  10408. Kind string `json:"kind,omitempty"`
  10409. // NextPageToken: [Output Only] This token allows you to get the next
  10410. // page of results for list requests. If the number of results is larger
  10411. // than maxResults, use the nextPageToken as a value for the query
  10412. // parameter pageToken in the next list request. Subsequent list
  10413. // requests will have their own nextPageToken to continue paging through
  10414. // the results.
  10415. NextPageToken string `json:"nextPageToken,omitempty"`
  10416. // SelfLink: [Output Only] Server-defined URL for this resource.
  10417. SelfLink string `json:"selfLink,omitempty"`
  10418. // Warning: [Output Only] Informational warning message.
  10419. Warning *InstanceGroupAggregatedListWarning `json:"warning,omitempty"`
  10420. // ServerResponse contains the HTTP response code and headers from the
  10421. // server.
  10422. googleapi.ServerResponse `json:"-"`
  10423. // ForceSendFields is a list of field names (e.g. "Id") to
  10424. // unconditionally include in API requests. By default, fields with
  10425. // empty values are omitted from API requests. However, any non-pointer,
  10426. // non-interface field appearing in ForceSendFields will be sent to the
  10427. // server regardless of whether the field is empty or not. This may be
  10428. // used to include empty fields in Patch requests.
  10429. ForceSendFields []string `json:"-"`
  10430. // NullFields is a list of field names (e.g. "Id") to include in API
  10431. // requests with the JSON null value. By default, fields with empty
  10432. // values are omitted from API requests. However, any field with an
  10433. // empty value appearing in NullFields will be sent to the server as
  10434. // null. It is an error if a field in this list has a non-empty value.
  10435. // This may be used to include null fields in Patch requests.
  10436. NullFields []string `json:"-"`
  10437. }
  10438. func (s *InstanceGroupAggregatedList) MarshalJSON() ([]byte, error) {
  10439. type NoMethod InstanceGroupAggregatedList
  10440. raw := NoMethod(*s)
  10441. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10442. }
  10443. // InstanceGroupAggregatedListWarning: [Output Only] Informational
  10444. // warning message.
  10445. type InstanceGroupAggregatedListWarning struct {
  10446. // Code: [Output Only] A warning code, if applicable. For example,
  10447. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  10448. // the response.
  10449. //
  10450. // Possible values:
  10451. // "CLEANUP_FAILED"
  10452. // "DEPRECATED_RESOURCE_USED"
  10453. // "DEPRECATED_TYPE_USED"
  10454. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  10455. // "EXPERIMENTAL_TYPE_USED"
  10456. // "EXTERNAL_API_WARNING"
  10457. // "FIELD_VALUE_OVERRIDEN"
  10458. // "INJECTED_KERNELS_DEPRECATED"
  10459. // "MISSING_TYPE_DEPENDENCY"
  10460. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  10461. // "NEXT_HOP_CANNOT_IP_FORWARD"
  10462. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  10463. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  10464. // "NEXT_HOP_NOT_RUNNING"
  10465. // "NOT_CRITICAL_ERROR"
  10466. // "NO_RESULTS_ON_PAGE"
  10467. // "REQUIRED_TOS_AGREEMENT"
  10468. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  10469. // "RESOURCE_NOT_DELETED"
  10470. // "SCHEMA_VALIDATION_IGNORED"
  10471. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  10472. // "UNDECLARED_PROPERTIES"
  10473. // "UNREACHABLE"
  10474. Code string `json:"code,omitempty"`
  10475. // Data: [Output Only] Metadata about this warning in key: value format.
  10476. // For example:
  10477. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  10478. Data []*InstanceGroupAggregatedListWarningData `json:"data,omitempty"`
  10479. // Message: [Output Only] A human-readable description of the warning
  10480. // code.
  10481. Message string `json:"message,omitempty"`
  10482. // ForceSendFields is a list of field names (e.g. "Code") to
  10483. // unconditionally include in API requests. By default, fields with
  10484. // empty values are omitted from API requests. However, any non-pointer,
  10485. // non-interface field appearing in ForceSendFields will be sent to the
  10486. // server regardless of whether the field is empty or not. This may be
  10487. // used to include empty fields in Patch requests.
  10488. ForceSendFields []string `json:"-"`
  10489. // NullFields is a list of field names (e.g. "Code") to include in API
  10490. // requests with the JSON null value. By default, fields with empty
  10491. // values are omitted from API requests. However, any field with an
  10492. // empty value appearing in NullFields will be sent to the server as
  10493. // null. It is an error if a field in this list has a non-empty value.
  10494. // This may be used to include null fields in Patch requests.
  10495. NullFields []string `json:"-"`
  10496. }
  10497. func (s *InstanceGroupAggregatedListWarning) MarshalJSON() ([]byte, error) {
  10498. type NoMethod InstanceGroupAggregatedListWarning
  10499. raw := NoMethod(*s)
  10500. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10501. }
  10502. type InstanceGroupAggregatedListWarningData struct {
  10503. // Key: [Output Only] A key that provides more detail on the warning
  10504. // being returned. For example, for warnings where there are no results
  10505. // in a list request for a particular zone, this key might be scope and
  10506. // the key value might be the zone name. Other examples might be a key
  10507. // indicating a deprecated resource and a suggested replacement, or a
  10508. // warning about invalid network settings (for example, if an instance
  10509. // attempts to perform IP forwarding but is not enabled for IP
  10510. // forwarding).
  10511. Key string `json:"key,omitempty"`
  10512. // Value: [Output Only] A warning data value corresponding to the key.
  10513. Value string `json:"value,omitempty"`
  10514. // ForceSendFields is a list of field names (e.g. "Key") to
  10515. // unconditionally include in API requests. By default, fields with
  10516. // empty values are omitted from API requests. However, any non-pointer,
  10517. // non-interface field appearing in ForceSendFields will be sent to the
  10518. // server regardless of whether the field is empty or not. This may be
  10519. // used to include empty fields in Patch requests.
  10520. ForceSendFields []string `json:"-"`
  10521. // NullFields is a list of field names (e.g. "Key") to include in API
  10522. // requests with the JSON null value. By default, fields with empty
  10523. // values are omitted from API requests. However, any field with an
  10524. // empty value appearing in NullFields will be sent to the server as
  10525. // null. It is an error if a field in this list has a non-empty value.
  10526. // This may be used to include null fields in Patch requests.
  10527. NullFields []string `json:"-"`
  10528. }
  10529. func (s *InstanceGroupAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  10530. type NoMethod InstanceGroupAggregatedListWarningData
  10531. raw := NoMethod(*s)
  10532. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10533. }
  10534. // InstanceGroupList: A list of InstanceGroup resources.
  10535. type InstanceGroupList struct {
  10536. // Id: [Output Only] Unique identifier for the resource; defined by the
  10537. // server.
  10538. Id string `json:"id,omitempty"`
  10539. // Items: A list of InstanceGroup resources.
  10540. Items []*InstanceGroup `json:"items,omitempty"`
  10541. // Kind: [Output Only] The resource type, which is always
  10542. // compute#instanceGroupList for instance group lists.
  10543. Kind string `json:"kind,omitempty"`
  10544. // NextPageToken: [Output Only] This token allows you to get the next
  10545. // page of results for list requests. If the number of results is larger
  10546. // than maxResults, use the nextPageToken as a value for the query
  10547. // parameter pageToken in the next list request. Subsequent list
  10548. // requests will have their own nextPageToken to continue paging through
  10549. // the results.
  10550. NextPageToken string `json:"nextPageToken,omitempty"`
  10551. // SelfLink: [Output Only] Server-defined URL for this resource.
  10552. SelfLink string `json:"selfLink,omitempty"`
  10553. // Warning: [Output Only] Informational warning message.
  10554. Warning *InstanceGroupListWarning `json:"warning,omitempty"`
  10555. // ServerResponse contains the HTTP response code and headers from the
  10556. // server.
  10557. googleapi.ServerResponse `json:"-"`
  10558. // ForceSendFields is a list of field names (e.g. "Id") to
  10559. // unconditionally include in API requests. By default, fields with
  10560. // empty values are omitted from API requests. However, any non-pointer,
  10561. // non-interface field appearing in ForceSendFields will be sent to the
  10562. // server regardless of whether the field is empty or not. This may be
  10563. // used to include empty fields in Patch requests.
  10564. ForceSendFields []string `json:"-"`
  10565. // NullFields is a list of field names (e.g. "Id") to include in API
  10566. // requests with the JSON null value. By default, fields with empty
  10567. // values are omitted from API requests. However, any field with an
  10568. // empty value appearing in NullFields will be sent to the server as
  10569. // null. It is an error if a field in this list has a non-empty value.
  10570. // This may be used to include null fields in Patch requests.
  10571. NullFields []string `json:"-"`
  10572. }
  10573. func (s *InstanceGroupList) MarshalJSON() ([]byte, error) {
  10574. type NoMethod InstanceGroupList
  10575. raw := NoMethod(*s)
  10576. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10577. }
  10578. // InstanceGroupListWarning: [Output Only] Informational warning
  10579. // message.
  10580. type InstanceGroupListWarning struct {
  10581. // Code: [Output Only] A warning code, if applicable. For example,
  10582. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  10583. // the response.
  10584. //
  10585. // Possible values:
  10586. // "CLEANUP_FAILED"
  10587. // "DEPRECATED_RESOURCE_USED"
  10588. // "DEPRECATED_TYPE_USED"
  10589. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  10590. // "EXPERIMENTAL_TYPE_USED"
  10591. // "EXTERNAL_API_WARNING"
  10592. // "FIELD_VALUE_OVERRIDEN"
  10593. // "INJECTED_KERNELS_DEPRECATED"
  10594. // "MISSING_TYPE_DEPENDENCY"
  10595. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  10596. // "NEXT_HOP_CANNOT_IP_FORWARD"
  10597. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  10598. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  10599. // "NEXT_HOP_NOT_RUNNING"
  10600. // "NOT_CRITICAL_ERROR"
  10601. // "NO_RESULTS_ON_PAGE"
  10602. // "REQUIRED_TOS_AGREEMENT"
  10603. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  10604. // "RESOURCE_NOT_DELETED"
  10605. // "SCHEMA_VALIDATION_IGNORED"
  10606. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  10607. // "UNDECLARED_PROPERTIES"
  10608. // "UNREACHABLE"
  10609. Code string `json:"code,omitempty"`
  10610. // Data: [Output Only] Metadata about this warning in key: value format.
  10611. // For example:
  10612. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  10613. Data []*InstanceGroupListWarningData `json:"data,omitempty"`
  10614. // Message: [Output Only] A human-readable description of the warning
  10615. // code.
  10616. Message string `json:"message,omitempty"`
  10617. // ForceSendFields is a list of field names (e.g. "Code") to
  10618. // unconditionally include in API requests. By default, fields with
  10619. // empty values are omitted from API requests. However, any non-pointer,
  10620. // non-interface field appearing in ForceSendFields will be sent to the
  10621. // server regardless of whether the field is empty or not. This may be
  10622. // used to include empty fields in Patch requests.
  10623. ForceSendFields []string `json:"-"`
  10624. // NullFields is a list of field names (e.g. "Code") to include in API
  10625. // requests with the JSON null value. By default, fields with empty
  10626. // values are omitted from API requests. However, any field with an
  10627. // empty value appearing in NullFields will be sent to the server as
  10628. // null. It is an error if a field in this list has a non-empty value.
  10629. // This may be used to include null fields in Patch requests.
  10630. NullFields []string `json:"-"`
  10631. }
  10632. func (s *InstanceGroupListWarning) MarshalJSON() ([]byte, error) {
  10633. type NoMethod InstanceGroupListWarning
  10634. raw := NoMethod(*s)
  10635. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10636. }
  10637. type InstanceGroupListWarningData struct {
  10638. // Key: [Output Only] A key that provides more detail on the warning
  10639. // being returned. For example, for warnings where there are no results
  10640. // in a list request for a particular zone, this key might be scope and
  10641. // the key value might be the zone name. Other examples might be a key
  10642. // indicating a deprecated resource and a suggested replacement, or a
  10643. // warning about invalid network settings (for example, if an instance
  10644. // attempts to perform IP forwarding but is not enabled for IP
  10645. // forwarding).
  10646. Key string `json:"key,omitempty"`
  10647. // Value: [Output Only] A warning data value corresponding to the key.
  10648. Value string `json:"value,omitempty"`
  10649. // ForceSendFields is a list of field names (e.g. "Key") to
  10650. // unconditionally include in API requests. By default, fields with
  10651. // empty values are omitted from API requests. However, any non-pointer,
  10652. // non-interface field appearing in ForceSendFields will be sent to the
  10653. // server regardless of whether the field is empty or not. This may be
  10654. // used to include empty fields in Patch requests.
  10655. ForceSendFields []string `json:"-"`
  10656. // NullFields is a list of field names (e.g. "Key") to include in API
  10657. // requests with the JSON null value. By default, fields with empty
  10658. // values are omitted from API requests. However, any field with an
  10659. // empty value appearing in NullFields will be sent to the server as
  10660. // null. It is an error if a field in this list has a non-empty value.
  10661. // This may be used to include null fields in Patch requests.
  10662. NullFields []string `json:"-"`
  10663. }
  10664. func (s *InstanceGroupListWarningData) MarshalJSON() ([]byte, error) {
  10665. type NoMethod InstanceGroupListWarningData
  10666. raw := NoMethod(*s)
  10667. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10668. }
  10669. // InstanceGroupManager: An Instance Group Manager resource. (==
  10670. // resource_for beta.instanceGroupManagers ==) (== resource_for
  10671. // v1.instanceGroupManagers ==) (== resource_for
  10672. // beta.regionInstanceGroupManagers ==) (== resource_for
  10673. // v1.regionInstanceGroupManagers ==)
  10674. type InstanceGroupManager struct {
  10675. Activities *InstanceGroupManagerActivities `json:"activities,omitempty"`
  10676. // AutoHealingPolicies: The autohealing policy for this managed instance
  10677. // group. You can specify only one value.
  10678. AutoHealingPolicies []*InstanceGroupManagerAutoHealingPolicy `json:"autoHealingPolicies,omitempty"`
  10679. // BaseInstanceName: The base instance name to use for instances in this
  10680. // group. The value must be 1-58 characters long. Instances are named by
  10681. // appending a hyphen and a random four-character string to the base
  10682. // instance name. The base instance name must comply with RFC1035.
  10683. BaseInstanceName string `json:"baseInstanceName,omitempty"`
  10684. // CreationTimestamp: [Output Only] The creation timestamp for this
  10685. // managed instance group in RFC3339 text format.
  10686. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  10687. // CurrentActions: [Output Only] The list of instance actions and the
  10688. // number of instances in this managed instance group that are scheduled
  10689. // for each of those actions.
  10690. CurrentActions *InstanceGroupManagerActionsSummary `json:"currentActions,omitempty"`
  10691. // Description: An optional description of this resource. Provide this
  10692. // property when you create the resource.
  10693. Description string `json:"description,omitempty"`
  10694. // DistributionPolicy: Policy valid only for regional managed instance
  10695. // groups.
  10696. DistributionPolicy *DistributionPolicy `json:"distributionPolicy,omitempty"`
  10697. // FailoverAction: The action to perform in case of zone failure. Only
  10698. // one value is supported, NO_FAILOVER. The default is NO_FAILOVER.
  10699. //
  10700. // Possible values:
  10701. // "NO_FAILOVER"
  10702. // "UNKNOWN"
  10703. FailoverAction string `json:"failoverAction,omitempty"`
  10704. // Fingerprint: Fingerprint of this resource. This field may be used in
  10705. // optimistic locking. It will be ignored when inserting an
  10706. // InstanceGroupManager. An up-to-date fingerprint must be provided in
  10707. // order to update the InstanceGroupManager.
  10708. Fingerprint string `json:"fingerprint,omitempty"`
  10709. // Id: [Output Only] A unique identifier for this resource type. The
  10710. // server generates this identifier.
  10711. Id uint64 `json:"id,omitempty,string"`
  10712. // InstanceGroup: [Output Only] The URL of the Instance Group resource.
  10713. InstanceGroup string `json:"instanceGroup,omitempty"`
  10714. // InstanceTemplate: The URL of the instance template that is specified
  10715. // for this managed instance group. The group uses this template to
  10716. // create all new instances in the managed instance group.
  10717. InstanceTemplate string `json:"instanceTemplate,omitempty"`
  10718. // Kind: [Output Only] The resource type, which is always
  10719. // compute#instanceGroupManager for managed instance groups.
  10720. Kind string `json:"kind,omitempty"`
  10721. // Name: The name of the managed instance group. The name must be 1-63
  10722. // characters long, and comply with RFC1035.
  10723. Name string `json:"name,omitempty"`
  10724. // NamedPorts: Named ports configured for the Instance Groups
  10725. // complementary to this Instance Group Manager.
  10726. NamedPorts []*NamedPort `json:"namedPorts,omitempty"`
  10727. // PendingActions: [Output Only] The list of instance actions and the
  10728. // number of instances in this managed instance group that are pending
  10729. // for each of those actions.
  10730. PendingActions *InstanceGroupManagerPendingActionsSummary `json:"pendingActions,omitempty"`
  10731. // Region: [Output Only] The URL of the region where the managed
  10732. // instance group resides (for regional resources).
  10733. Region string `json:"region,omitempty"`
  10734. // SelfLink: [Output Only] The URL for this managed instance group. The
  10735. // server defines this URL.
  10736. SelfLink string `json:"selfLink,omitempty"`
  10737. // ServiceAccount: The service account to be used as credentials for all
  10738. // operations performed by the managed instance group on instances. The
  10739. // service accounts needs all permissions required to create and delete
  10740. // instances. By default, the service account
  10741. // {projectNumber}@cloudservices.gserviceaccount.com is used.
  10742. ServiceAccount string `json:"serviceAccount,omitempty"`
  10743. // StatefulPolicy: Stateful configuration for this Instanced Group
  10744. // Manager
  10745. StatefulPolicy *StatefulPolicy `json:"statefulPolicy,omitempty"`
  10746. // TargetPools: The URLs for all TargetPool resources to which instances
  10747. // in the instanceGroup field are added. The target pools automatically
  10748. // apply to all of the instances in the managed instance group.
  10749. TargetPools []string `json:"targetPools,omitempty"`
  10750. // TargetSize: The target number of running instances for this managed
  10751. // instance group. Deleting or abandoning instances reduces this number.
  10752. // Resizing the group changes this number.
  10753. TargetSize int64 `json:"targetSize,omitempty"`
  10754. // UpdatePolicy: The update policy for this managed instance group.
  10755. UpdatePolicy *InstanceGroupManagerUpdatePolicy `json:"updatePolicy,omitempty"`
  10756. // Versions: Specifies the instance templates used by this managed
  10757. // instance group to create instances.
  10758. //
  10759. // Each version is defined by an instanceTemplate. Every template can
  10760. // appear at most once per instance group. This field overrides the
  10761. // top-level instanceTemplate field. Read more about the relationships
  10762. // between these fields. Exactly one version must leave the targetSize
  10763. // field unset. That version will be applied to all remaining instances.
  10764. // For more information, read about canary updates.
  10765. Versions []*InstanceGroupManagerVersion `json:"versions,omitempty"`
  10766. // Zone: [Output Only] The URL of the zone where the managed instance
  10767. // group is located (for zonal resources).
  10768. Zone string `json:"zone,omitempty"`
  10769. // ServerResponse contains the HTTP response code and headers from the
  10770. // server.
  10771. googleapi.ServerResponse `json:"-"`
  10772. // ForceSendFields is a list of field names (e.g. "Activities") to
  10773. // unconditionally include in API requests. By default, fields with
  10774. // empty values are omitted from API requests. However, any non-pointer,
  10775. // non-interface field appearing in ForceSendFields will be sent to the
  10776. // server regardless of whether the field is empty or not. This may be
  10777. // used to include empty fields in Patch requests.
  10778. ForceSendFields []string `json:"-"`
  10779. // NullFields is a list of field names (e.g. "Activities") to include in
  10780. // API requests with the JSON null value. By default, fields with empty
  10781. // values are omitted from API requests. However, any field with an
  10782. // empty value appearing in NullFields will be sent to the server as
  10783. // null. It is an error if a field in this list has a non-empty value.
  10784. // This may be used to include null fields in Patch requests.
  10785. NullFields []string `json:"-"`
  10786. }
  10787. func (s *InstanceGroupManager) MarshalJSON() ([]byte, error) {
  10788. type NoMethod InstanceGroupManager
  10789. raw := NoMethod(*s)
  10790. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10791. }
  10792. type InstanceGroupManagerActionsSummary struct {
  10793. // Abandoning: [Output Only] The total number of instances in the
  10794. // managed instance group that are scheduled to be abandoned. Abandoning
  10795. // an instance removes it from the managed instance group without
  10796. // deleting it.
  10797. Abandoning int64 `json:"abandoning,omitempty"`
  10798. // Creating: [Output Only] The number of instances in the managed
  10799. // instance group that are scheduled to be created or are currently
  10800. // being created. If the group fails to create any of these instances,
  10801. // it tries again until it creates the instance successfully.
  10802. //
  10803. // If you have disabled creation retries, this field will not be
  10804. // populated; instead, the creatingWithoutRetries field will be
  10805. // populated.
  10806. Creating int64 `json:"creating,omitempty"`
  10807. // CreatingWithoutRetries: [Output Only] The number of instances that
  10808. // the managed instance group will attempt to create. The group attempts
  10809. // to create each instance only once. If the group fails to create any
  10810. // of these instances, it decreases the group's targetSize value
  10811. // accordingly.
  10812. CreatingWithoutRetries int64 `json:"creatingWithoutRetries,omitempty"`
  10813. // Deleting: [Output Only] The number of instances in the managed
  10814. // instance group that are scheduled to be deleted or are currently
  10815. // being deleted.
  10816. Deleting int64 `json:"deleting,omitempty"`
  10817. // None: [Output Only] The number of instances in the managed instance
  10818. // group that are running and have no scheduled actions.
  10819. None int64 `json:"none,omitempty"`
  10820. // Recreating: [Output Only] The number of instances in the managed
  10821. // instance group that are scheduled to be recreated or are currently
  10822. // being being recreated. Recreating an instance deletes the existing
  10823. // root persistent disk and creates a new disk from the image that is
  10824. // defined in the instance template.
  10825. Recreating int64 `json:"recreating,omitempty"`
  10826. // Refreshing: [Output Only] The number of instances in the managed
  10827. // instance group that are being reconfigured with properties that do
  10828. // not require a restart or a recreate action. For example, setting or
  10829. // removing target pools for the instance.
  10830. Refreshing int64 `json:"refreshing,omitempty"`
  10831. // Restarting: [Output Only] The number of instances in the managed
  10832. // instance group that are scheduled to be restarted or are currently
  10833. // being restarted.
  10834. Restarting int64 `json:"restarting,omitempty"`
  10835. // Verifying: [Output Only] The number of instances in the managed
  10836. // instance group that are being verified. See the
  10837. // managedInstances[].currentAction property in the listManagedInstances
  10838. // method documentation.
  10839. Verifying int64 `json:"verifying,omitempty"`
  10840. // ForceSendFields is a list of field names (e.g. "Abandoning") to
  10841. // unconditionally include in API requests. By default, fields with
  10842. // empty values are omitted from API requests. However, any non-pointer,
  10843. // non-interface field appearing in ForceSendFields will be sent to the
  10844. // server regardless of whether the field is empty or not. This may be
  10845. // used to include empty fields in Patch requests.
  10846. ForceSendFields []string `json:"-"`
  10847. // NullFields is a list of field names (e.g. "Abandoning") to include in
  10848. // API requests with the JSON null value. By default, fields with empty
  10849. // values are omitted from API requests. However, any field with an
  10850. // empty value appearing in NullFields will be sent to the server as
  10851. // null. It is an error if a field in this list has a non-empty value.
  10852. // This may be used to include null fields in Patch requests.
  10853. NullFields []string `json:"-"`
  10854. }
  10855. func (s *InstanceGroupManagerActionsSummary) MarshalJSON() ([]byte, error) {
  10856. type NoMethod InstanceGroupManagerActionsSummary
  10857. raw := NoMethod(*s)
  10858. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10859. }
  10860. type InstanceGroupManagerActivities struct {
  10861. // Possible values:
  10862. // "PERMITTED"
  10863. // "PROHIBITED"
  10864. Autohealing string `json:"autohealing,omitempty"`
  10865. // Possible values:
  10866. // "PERMITTED"
  10867. // "PROHIBITED"
  10868. AutohealingHealthCheckBased string `json:"autohealingHealthCheckBased,omitempty"`
  10869. // Possible values:
  10870. // "PERMITTED"
  10871. // "PROHIBITED"
  10872. AutoscalingDown string `json:"autoscalingDown,omitempty"`
  10873. // Possible values:
  10874. // "PERMITTED"
  10875. // "PROHIBITED"
  10876. AutoscalingUp string `json:"autoscalingUp,omitempty"`
  10877. // Possible values:
  10878. // "PERMITTED"
  10879. // "PROHIBITED"
  10880. CreatingInstances string `json:"creatingInstances,omitempty"`
  10881. // Possible values:
  10882. // "PERMITTED"
  10883. // "PROHIBITED"
  10884. DeletingInstances string `json:"deletingInstances,omitempty"`
  10885. // Possible values:
  10886. // "PERMITTED"
  10887. // "PROHIBITED"
  10888. RecreatingInstances string `json:"recreatingInstances,omitempty"`
  10889. // ForceSendFields is a list of field names (e.g. "Autohealing") to
  10890. // unconditionally include in API requests. By default, fields with
  10891. // empty values are omitted from API requests. However, any non-pointer,
  10892. // non-interface field appearing in ForceSendFields will be sent to the
  10893. // server regardless of whether the field is empty or not. This may be
  10894. // used to include empty fields in Patch requests.
  10895. ForceSendFields []string `json:"-"`
  10896. // NullFields is a list of field names (e.g. "Autohealing") to include
  10897. // in API requests with the JSON null value. By default, fields with
  10898. // empty values are omitted from API requests. However, any field with
  10899. // an empty value appearing in NullFields will be sent to the server as
  10900. // null. It is an error if a field in this list has a non-empty value.
  10901. // This may be used to include null fields in Patch requests.
  10902. NullFields []string `json:"-"`
  10903. }
  10904. func (s *InstanceGroupManagerActivities) MarshalJSON() ([]byte, error) {
  10905. type NoMethod InstanceGroupManagerActivities
  10906. raw := NoMethod(*s)
  10907. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10908. }
  10909. type InstanceGroupManagerAggregatedList struct {
  10910. // Id: [Output Only] Unique identifier for the resource; defined by the
  10911. // server.
  10912. Id string `json:"id,omitempty"`
  10913. // Items: A list of InstanceGroupManagersScopedList resources.
  10914. Items map[string]InstanceGroupManagersScopedList `json:"items,omitempty"`
  10915. // Kind: [Output Only] The resource type, which is always
  10916. // compute#instanceGroupManagerAggregatedList for an aggregated list of
  10917. // managed instance groups.
  10918. Kind string `json:"kind,omitempty"`
  10919. // NextPageToken: [Output Only] This token allows you to get the next
  10920. // page of results for list requests. If the number of results is larger
  10921. // than maxResults, use the nextPageToken as a value for the query
  10922. // parameter pageToken in the next list request. Subsequent list
  10923. // requests will have their own nextPageToken to continue paging through
  10924. // the results.
  10925. NextPageToken string `json:"nextPageToken,omitempty"`
  10926. // SelfLink: [Output Only] Server-defined URL for this resource.
  10927. SelfLink string `json:"selfLink,omitempty"`
  10928. // Warning: [Output Only] Informational warning message.
  10929. Warning *InstanceGroupManagerAggregatedListWarning `json:"warning,omitempty"`
  10930. // ServerResponse contains the HTTP response code and headers from the
  10931. // server.
  10932. googleapi.ServerResponse `json:"-"`
  10933. // ForceSendFields is a list of field names (e.g. "Id") 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. "Id") to include in API
  10941. // 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 *InstanceGroupManagerAggregatedList) MarshalJSON() ([]byte, error) {
  10949. type NoMethod InstanceGroupManagerAggregatedList
  10950. raw := NoMethod(*s)
  10951. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10952. }
  10953. // InstanceGroupManagerAggregatedListWarning: [Output Only]
  10954. // Informational warning message.
  10955. type InstanceGroupManagerAggregatedListWarning struct {
  10956. // Code: [Output Only] A warning code, if applicable. For example,
  10957. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  10958. // the response.
  10959. //
  10960. // Possible values:
  10961. // "CLEANUP_FAILED"
  10962. // "DEPRECATED_RESOURCE_USED"
  10963. // "DEPRECATED_TYPE_USED"
  10964. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  10965. // "EXPERIMENTAL_TYPE_USED"
  10966. // "EXTERNAL_API_WARNING"
  10967. // "FIELD_VALUE_OVERRIDEN"
  10968. // "INJECTED_KERNELS_DEPRECATED"
  10969. // "MISSING_TYPE_DEPENDENCY"
  10970. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  10971. // "NEXT_HOP_CANNOT_IP_FORWARD"
  10972. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  10973. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  10974. // "NEXT_HOP_NOT_RUNNING"
  10975. // "NOT_CRITICAL_ERROR"
  10976. // "NO_RESULTS_ON_PAGE"
  10977. // "REQUIRED_TOS_AGREEMENT"
  10978. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  10979. // "RESOURCE_NOT_DELETED"
  10980. // "SCHEMA_VALIDATION_IGNORED"
  10981. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  10982. // "UNDECLARED_PROPERTIES"
  10983. // "UNREACHABLE"
  10984. Code string `json:"code,omitempty"`
  10985. // Data: [Output Only] Metadata about this warning in key: value format.
  10986. // For example:
  10987. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  10988. Data []*InstanceGroupManagerAggregatedListWarningData `json:"data,omitempty"`
  10989. // Message: [Output Only] A human-readable description of the warning
  10990. // code.
  10991. Message string `json:"message,omitempty"`
  10992. // ForceSendFields is a list of field names (e.g. "Code") to
  10993. // unconditionally include in API requests. By default, fields with
  10994. // empty values are omitted from API requests. However, any non-pointer,
  10995. // non-interface field appearing in ForceSendFields will be sent to the
  10996. // server regardless of whether the field is empty or not. This may be
  10997. // used to include empty fields in Patch requests.
  10998. ForceSendFields []string `json:"-"`
  10999. // NullFields is a list of field names (e.g. "Code") to include in API
  11000. // requests with the JSON null value. By default, fields with empty
  11001. // values are omitted from API requests. However, any field with an
  11002. // empty value appearing in NullFields will be sent to the server as
  11003. // null. It is an error if a field in this list has a non-empty value.
  11004. // This may be used to include null fields in Patch requests.
  11005. NullFields []string `json:"-"`
  11006. }
  11007. func (s *InstanceGroupManagerAggregatedListWarning) MarshalJSON() ([]byte, error) {
  11008. type NoMethod InstanceGroupManagerAggregatedListWarning
  11009. raw := NoMethod(*s)
  11010. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11011. }
  11012. type InstanceGroupManagerAggregatedListWarningData struct {
  11013. // Key: [Output Only] A key that provides more detail on the warning
  11014. // being returned. For example, for warnings where there are no results
  11015. // in a list request for a particular zone, this key might be scope and
  11016. // the key value might be the zone name. Other examples might be a key
  11017. // indicating a deprecated resource and a suggested replacement, or a
  11018. // warning about invalid network settings (for example, if an instance
  11019. // attempts to perform IP forwarding but is not enabled for IP
  11020. // forwarding).
  11021. Key string `json:"key,omitempty"`
  11022. // Value: [Output Only] A warning data value corresponding to the key.
  11023. Value string `json:"value,omitempty"`
  11024. // ForceSendFields is a list of field names (e.g. "Key") to
  11025. // unconditionally include in API requests. By default, fields with
  11026. // empty values are omitted from API requests. However, any non-pointer,
  11027. // non-interface field appearing in ForceSendFields will be sent to the
  11028. // server regardless of whether the field is empty or not. This may be
  11029. // used to include empty fields in Patch requests.
  11030. ForceSendFields []string `json:"-"`
  11031. // NullFields is a list of field names (e.g. "Key") to include in API
  11032. // requests with the JSON null value. By default, fields with empty
  11033. // values are omitted from API requests. However, any field with an
  11034. // empty value appearing in NullFields will be sent to the server as
  11035. // null. It is an error if a field in this list has a non-empty value.
  11036. // This may be used to include null fields in Patch requests.
  11037. NullFields []string `json:"-"`
  11038. }
  11039. func (s *InstanceGroupManagerAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  11040. type NoMethod InstanceGroupManagerAggregatedListWarningData
  11041. raw := NoMethod(*s)
  11042. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11043. }
  11044. type InstanceGroupManagerAutoHealingPolicy struct {
  11045. // HealthCheck: The URL for the health check that signals autohealing.
  11046. HealthCheck string `json:"healthCheck,omitempty"`
  11047. // InitialDelaySec: The number of seconds that the managed instance
  11048. // group waits before it applies autohealing policies to new instances
  11049. // or recently recreated instances. This initial delay allows instances
  11050. // to initialize and run their startup scripts before the instance group
  11051. // determines that they are UNHEALTHY. This prevents the managed
  11052. // instance group from recreating its instances prematurely. This value
  11053. // must be from range [0, 3600].
  11054. InitialDelaySec int64 `json:"initialDelaySec,omitempty"`
  11055. // MaxUnavailable: Maximum number of instances that can be unavailable
  11056. // when autohealing. The instance is considered available if all of the
  11057. // following conditions are satisfied: 1. Instance's status is RUNNING.
  11058. // 2. Instance's liveness health check result was observed to be HEALTHY
  11059. // at least once. By default, a percent value of 100% is used.
  11060. MaxUnavailable *FixedOrPercent `json:"maxUnavailable,omitempty"`
  11061. // Mode: Defines operating mode for this policy.
  11062. //
  11063. // Possible values:
  11064. // "OFF"
  11065. // "ON"
  11066. Mode string `json:"mode,omitempty"`
  11067. // ForceSendFields is a list of field names (e.g. "HealthCheck") to
  11068. // unconditionally include in API requests. By default, fields with
  11069. // empty values are omitted from API requests. However, any non-pointer,
  11070. // non-interface field appearing in ForceSendFields will be sent to the
  11071. // server regardless of whether the field is empty or not. This may be
  11072. // used to include empty fields in Patch requests.
  11073. ForceSendFields []string `json:"-"`
  11074. // NullFields is a list of field names (e.g. "HealthCheck") to include
  11075. // in API requests with the JSON null value. By default, fields with
  11076. // empty values are omitted from API requests. However, any field with
  11077. // an empty value appearing in NullFields will be sent to the server as
  11078. // null. It is an error if a field in this list has a non-empty value.
  11079. // This may be used to include null fields in Patch requests.
  11080. NullFields []string `json:"-"`
  11081. }
  11082. func (s *InstanceGroupManagerAutoHealingPolicy) MarshalJSON() ([]byte, error) {
  11083. type NoMethod InstanceGroupManagerAutoHealingPolicy
  11084. raw := NoMethod(*s)
  11085. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11086. }
  11087. // InstanceGroupManagerList: [Output Only] A list of managed instance
  11088. // groups.
  11089. type InstanceGroupManagerList struct {
  11090. // Id: [Output Only] Unique identifier for the resource; defined by the
  11091. // server.
  11092. Id string `json:"id,omitempty"`
  11093. // Items: A list of InstanceGroupManager resources.
  11094. Items []*InstanceGroupManager `json:"items,omitempty"`
  11095. // Kind: [Output Only] The resource type, which is always
  11096. // compute#instanceGroupManagerList for a list of managed instance
  11097. // groups.
  11098. Kind string `json:"kind,omitempty"`
  11099. // NextPageToken: [Output Only] This token allows you to get the next
  11100. // page of results for list requests. If the number of results is larger
  11101. // than maxResults, use the nextPageToken as a value for the query
  11102. // parameter pageToken in the next list request. Subsequent list
  11103. // requests will have their own nextPageToken to continue paging through
  11104. // the results.
  11105. NextPageToken string `json:"nextPageToken,omitempty"`
  11106. // SelfLink: [Output Only] Server-defined URL for this resource.
  11107. SelfLink string `json:"selfLink,omitempty"`
  11108. // Warning: [Output Only] Informational warning message.
  11109. Warning *InstanceGroupManagerListWarning `json:"warning,omitempty"`
  11110. // ServerResponse contains the HTTP response code and headers from the
  11111. // server.
  11112. googleapi.ServerResponse `json:"-"`
  11113. // ForceSendFields is a list of field names (e.g. "Id") to
  11114. // unconditionally include in API requests. By default, fields with
  11115. // empty values are omitted from API requests. However, any non-pointer,
  11116. // non-interface field appearing in ForceSendFields will be sent to the
  11117. // server regardless of whether the field is empty or not. This may be
  11118. // used to include empty fields in Patch requests.
  11119. ForceSendFields []string `json:"-"`
  11120. // NullFields is a list of field names (e.g. "Id") to include in API
  11121. // requests with the JSON null value. By default, fields with empty
  11122. // values are omitted from API requests. However, any field with an
  11123. // empty value appearing in NullFields will be sent to the server as
  11124. // null. It is an error if a field in this list has a non-empty value.
  11125. // This may be used to include null fields in Patch requests.
  11126. NullFields []string `json:"-"`
  11127. }
  11128. func (s *InstanceGroupManagerList) MarshalJSON() ([]byte, error) {
  11129. type NoMethod InstanceGroupManagerList
  11130. raw := NoMethod(*s)
  11131. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11132. }
  11133. // InstanceGroupManagerListWarning: [Output Only] Informational warning
  11134. // message.
  11135. type InstanceGroupManagerListWarning struct {
  11136. // Code: [Output Only] A warning code, if applicable. For example,
  11137. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  11138. // the response.
  11139. //
  11140. // Possible values:
  11141. // "CLEANUP_FAILED"
  11142. // "DEPRECATED_RESOURCE_USED"
  11143. // "DEPRECATED_TYPE_USED"
  11144. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  11145. // "EXPERIMENTAL_TYPE_USED"
  11146. // "EXTERNAL_API_WARNING"
  11147. // "FIELD_VALUE_OVERRIDEN"
  11148. // "INJECTED_KERNELS_DEPRECATED"
  11149. // "MISSING_TYPE_DEPENDENCY"
  11150. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  11151. // "NEXT_HOP_CANNOT_IP_FORWARD"
  11152. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  11153. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  11154. // "NEXT_HOP_NOT_RUNNING"
  11155. // "NOT_CRITICAL_ERROR"
  11156. // "NO_RESULTS_ON_PAGE"
  11157. // "REQUIRED_TOS_AGREEMENT"
  11158. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  11159. // "RESOURCE_NOT_DELETED"
  11160. // "SCHEMA_VALIDATION_IGNORED"
  11161. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  11162. // "UNDECLARED_PROPERTIES"
  11163. // "UNREACHABLE"
  11164. Code string `json:"code,omitempty"`
  11165. // Data: [Output Only] Metadata about this warning in key: value format.
  11166. // For example:
  11167. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  11168. Data []*InstanceGroupManagerListWarningData `json:"data,omitempty"`
  11169. // Message: [Output Only] A human-readable description of the warning
  11170. // code.
  11171. Message string `json:"message,omitempty"`
  11172. // ForceSendFields is a list of field names (e.g. "Code") to
  11173. // unconditionally include in API requests. By default, fields with
  11174. // empty values are omitted from API requests. However, any non-pointer,
  11175. // non-interface field appearing in ForceSendFields will be sent to the
  11176. // server regardless of whether the field is empty or not. This may be
  11177. // used to include empty fields in Patch requests.
  11178. ForceSendFields []string `json:"-"`
  11179. // NullFields is a list of field names (e.g. "Code") to include in API
  11180. // requests with the JSON null value. By default, fields with empty
  11181. // values are omitted from API requests. However, any field with an
  11182. // empty value appearing in NullFields will be sent to the server as
  11183. // null. It is an error if a field in this list has a non-empty value.
  11184. // This may be used to include null fields in Patch requests.
  11185. NullFields []string `json:"-"`
  11186. }
  11187. func (s *InstanceGroupManagerListWarning) MarshalJSON() ([]byte, error) {
  11188. type NoMethod InstanceGroupManagerListWarning
  11189. raw := NoMethod(*s)
  11190. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11191. }
  11192. type InstanceGroupManagerListWarningData struct {
  11193. // Key: [Output Only] A key that provides more detail on the warning
  11194. // being returned. For example, for warnings where there are no results
  11195. // in a list request for a particular zone, this key might be scope and
  11196. // the key value might be the zone name. Other examples might be a key
  11197. // indicating a deprecated resource and a suggested replacement, or a
  11198. // warning about invalid network settings (for example, if an instance
  11199. // attempts to perform IP forwarding but is not enabled for IP
  11200. // forwarding).
  11201. Key string `json:"key,omitempty"`
  11202. // Value: [Output Only] A warning data value corresponding to the key.
  11203. Value string `json:"value,omitempty"`
  11204. // ForceSendFields is a list of field names (e.g. "Key") to
  11205. // unconditionally include in API requests. By default, fields with
  11206. // empty values are omitted from API requests. However, any non-pointer,
  11207. // non-interface field appearing in ForceSendFields will be sent to the
  11208. // server regardless of whether the field is empty or not. This may be
  11209. // used to include empty fields in Patch requests.
  11210. ForceSendFields []string `json:"-"`
  11211. // NullFields is a list of field names (e.g. "Key") to include in API
  11212. // requests with the JSON null value. By default, fields with empty
  11213. // values are omitted from API requests. However, any field with an
  11214. // empty value appearing in NullFields will be sent to the server as
  11215. // null. It is an error if a field in this list has a non-empty value.
  11216. // This may be used to include null fields in Patch requests.
  11217. NullFields []string `json:"-"`
  11218. }
  11219. func (s *InstanceGroupManagerListWarningData) MarshalJSON() ([]byte, error) {
  11220. type NoMethod InstanceGroupManagerListWarningData
  11221. raw := NoMethod(*s)
  11222. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11223. }
  11224. type InstanceGroupManagerPendingActionsSummary struct {
  11225. // Creating: [Output Only] The number of instances in the managed
  11226. // instance group that are pending to be created.
  11227. Creating int64 `json:"creating,omitempty"`
  11228. // Deleting: [Output Only] The number of instances in the managed
  11229. // instance group that are pending to be deleted.
  11230. Deleting int64 `json:"deleting,omitempty"`
  11231. // Recreating: [Output Only] The number of instances in the managed
  11232. // instance group that are pending to be recreated.
  11233. Recreating int64 `json:"recreating,omitempty"`
  11234. // Restarting: [Output Only] The number of instances in the managed
  11235. // instance group that are pending to be restarted.
  11236. Restarting int64 `json:"restarting,omitempty"`
  11237. // ForceSendFields is a list of field names (e.g. "Creating") to
  11238. // unconditionally include in API requests. By default, fields with
  11239. // empty values are omitted from API requests. However, any non-pointer,
  11240. // non-interface field appearing in ForceSendFields will be sent to the
  11241. // server regardless of whether the field is empty or not. This may be
  11242. // used to include empty fields in Patch requests.
  11243. ForceSendFields []string `json:"-"`
  11244. // NullFields is a list of field names (e.g. "Creating") to include in
  11245. // API requests with the JSON null value. By default, fields with empty
  11246. // values are omitted from API requests. However, any field with an
  11247. // empty value appearing in NullFields will be sent to the server as
  11248. // null. It is an error if a field in this list has a non-empty value.
  11249. // This may be used to include null fields in Patch requests.
  11250. NullFields []string `json:"-"`
  11251. }
  11252. func (s *InstanceGroupManagerPendingActionsSummary) MarshalJSON() ([]byte, error) {
  11253. type NoMethod InstanceGroupManagerPendingActionsSummary
  11254. raw := NoMethod(*s)
  11255. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11256. }
  11257. type InstanceGroupManagerUpdatePolicy struct {
  11258. // Possible values:
  11259. // "NONE"
  11260. // "PROACTIVE"
  11261. // "UNSPECIFIED_TYPE"
  11262. InstanceRedistributionType string `json:"instanceRedistributionType,omitempty"`
  11263. // MaxSurge: The maximum number of instances that can be created above
  11264. // the specified targetSize during the update process. By default, a
  11265. // fixed value of 1 is used. This value can be either a fixed number or
  11266. // a percentage if the instance group has 10 or more instances. If you
  11267. // set a percentage, the number of instances will be rounded up if
  11268. // necessary.
  11269. //
  11270. // At least one of either maxSurge or maxUnavailable must be greater
  11271. // than 0. Learn more about maxSurge.
  11272. MaxSurge *FixedOrPercent `json:"maxSurge,omitempty"`
  11273. // MaxUnavailable: The maximum number of instances that can be
  11274. // unavailable during the update process. An instance is considered
  11275. // available if all of the following conditions are satisfied:
  11276. //
  11277. //
  11278. // - The instance's status is RUNNING.
  11279. // - If there is a health check on the instance group, the instance's
  11280. // liveness health check result must be HEALTHY at least once. If there
  11281. // is no health check on the group, then the instance only needs to have
  11282. // a status of RUNNING to be considered available. By default, a fixed
  11283. // value of 1 is used. This value can be either a fixed number or a
  11284. // percentage if the instance group has 10 or more instances. If you set
  11285. // a percentage, the number of instances will be rounded up if
  11286. // necessary.
  11287. //
  11288. // At least one of either maxSurge or maxUnavailable must be greater
  11289. // than 0. Learn more about maxUnavailable.
  11290. MaxUnavailable *FixedOrPercent `json:"maxUnavailable,omitempty"`
  11291. // MinReadySec: Minimum number of seconds to wait for after a newly
  11292. // created instance becomes available. This value must be from range [0,
  11293. // 3600].
  11294. MinReadySec int64 `json:"minReadySec,omitempty"`
  11295. // MinimalAction: Minimal action to be taken on an instance. You can
  11296. // specify either RESTART to restart existing instances or REPLACE to
  11297. // delete and create new instances from the target template. If you
  11298. // specify a code>RESTART, the Updater will attempt to perform that
  11299. // action only. However, if the Updater determines that the minimal
  11300. // action you specify is not enough to perform the update, it might
  11301. // perform a more disruptive action.
  11302. //
  11303. // Possible values:
  11304. // "NONE"
  11305. // "REFRESH"
  11306. // "REPLACE"
  11307. // "RESTART"
  11308. MinimalAction string `json:"minimalAction,omitempty"`
  11309. // Possible values:
  11310. // "OPPORTUNISTIC"
  11311. // "PROACTIVE"
  11312. Type string `json:"type,omitempty"`
  11313. // ForceSendFields is a list of field names (e.g.
  11314. // "InstanceRedistributionType") to unconditionally include in API
  11315. // requests. By default, fields with empty values are omitted from API
  11316. // requests. However, any non-pointer, non-interface field appearing in
  11317. // ForceSendFields will be sent to the server regardless of whether the
  11318. // field is empty or not. This may be used to include empty fields in
  11319. // Patch requests.
  11320. ForceSendFields []string `json:"-"`
  11321. // NullFields is a list of field names (e.g.
  11322. // "InstanceRedistributionType") to include in API requests with the
  11323. // JSON null value. By default, fields with empty values are omitted
  11324. // from API requests. However, any field with an empty value appearing
  11325. // in NullFields will be sent to the server as null. It is an error if a
  11326. // field in this list has a non-empty value. This may be used to include
  11327. // null fields in Patch requests.
  11328. NullFields []string `json:"-"`
  11329. }
  11330. func (s *InstanceGroupManagerUpdatePolicy) MarshalJSON() ([]byte, error) {
  11331. type NoMethod InstanceGroupManagerUpdatePolicy
  11332. raw := NoMethod(*s)
  11333. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11334. }
  11335. type InstanceGroupManagerVersion struct {
  11336. InstanceTemplate string `json:"instanceTemplate,omitempty"`
  11337. // Name: Name of the version. Unique among all versions in the scope of
  11338. // this managed instance group.
  11339. Name string `json:"name,omitempty"`
  11340. // Tag: Tag describing the version. Used to trigger rollout of a target
  11341. // version even if instance_template remains unchanged. Deprecated in
  11342. // favor of 'name'.
  11343. Tag string `json:"tag,omitempty"`
  11344. // TargetSize: Specifies the intended number of instances to be created
  11345. // from the instanceTemplate. The final number of instances created from
  11346. // the template will be equal to:
  11347. // - If expressed as a fixed number, the minimum of either
  11348. // targetSize.fixed or instanceGroupManager.targetSize is used.
  11349. // - if expressed as a percent, the targetSize would be
  11350. // (targetSize.percent/100 * InstanceGroupManager.targetSize) If there
  11351. // is a remainder, the number is rounded up. If unset, this version
  11352. // will update any remaining instances not updated by another version.
  11353. // Read Starting a canary update for more information.
  11354. TargetSize *FixedOrPercent `json:"targetSize,omitempty"`
  11355. // ForceSendFields is a list of field names (e.g. "InstanceTemplate") to
  11356. // unconditionally include in API requests. By default, fields with
  11357. // empty values are omitted from API requests. However, any non-pointer,
  11358. // non-interface field appearing in ForceSendFields will be sent to the
  11359. // server regardless of whether the field is empty or not. This may be
  11360. // used to include empty fields in Patch requests.
  11361. ForceSendFields []string `json:"-"`
  11362. // NullFields is a list of field names (e.g. "InstanceTemplate") to
  11363. // include in API requests with the JSON null value. By default, fields
  11364. // with empty values are omitted from API requests. However, any field
  11365. // with an empty value appearing in NullFields will be sent to the
  11366. // server as null. It is an error if a field in this list has a
  11367. // non-empty value. This may be used to include null fields in Patch
  11368. // requests.
  11369. NullFields []string `json:"-"`
  11370. }
  11371. func (s *InstanceGroupManagerVersion) MarshalJSON() ([]byte, error) {
  11372. type NoMethod InstanceGroupManagerVersion
  11373. raw := NoMethod(*s)
  11374. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11375. }
  11376. type InstanceGroupManagersAbandonInstancesRequest struct {
  11377. // Instances: The URLs of one or more instances to abandon. This can be
  11378. // a full URL or a partial URL, such as
  11379. // zones/[ZONE]/instances/[INSTANCE_NAME].
  11380. Instances []string `json:"instances,omitempty"`
  11381. // ForceSendFields is a list of field names (e.g. "Instances") to
  11382. // unconditionally include in API requests. By default, fields with
  11383. // empty values are omitted from API requests. However, any non-pointer,
  11384. // non-interface field appearing in ForceSendFields will be sent to the
  11385. // server regardless of whether the field is empty or not. This may be
  11386. // used to include empty fields in Patch requests.
  11387. ForceSendFields []string `json:"-"`
  11388. // NullFields is a list of field names (e.g. "Instances") to include in
  11389. // API requests with the JSON null value. By default, fields with empty
  11390. // values are omitted from API requests. However, any field with an
  11391. // empty value appearing in NullFields will be sent to the server as
  11392. // null. It is an error if a field in this list has a non-empty value.
  11393. // This may be used to include null fields in Patch requests.
  11394. NullFields []string `json:"-"`
  11395. }
  11396. func (s *InstanceGroupManagersAbandonInstancesRequest) MarshalJSON() ([]byte, error) {
  11397. type NoMethod InstanceGroupManagersAbandonInstancesRequest
  11398. raw := NoMethod(*s)
  11399. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11400. }
  11401. // InstanceGroupManagersApplyUpdatesRequest:
  11402. // InstanceGroupManagers.applyUpdatesToInstances
  11403. type InstanceGroupManagersApplyUpdatesRequest struct {
  11404. // Instances: The list of URLs of one or more instances for which we
  11405. // want to apply updates on this managed instance group. This can be a
  11406. // full URL or a partial URL, such as
  11407. // zones/[ZONE]/instances/[INSTANCE_NAME].
  11408. Instances []string `json:"instances,omitempty"`
  11409. // MaximalAction: The maximal action that should be perfomed on the
  11410. // instances. By default REPLACE.
  11411. //
  11412. // Possible values:
  11413. // "NONE"
  11414. // "REFRESH"
  11415. // "REPLACE"
  11416. // "RESTART"
  11417. MaximalAction string `json:"maximalAction,omitempty"`
  11418. // MinimalAction: The minimal action that should be perfomed on the
  11419. // instances. By default NONE.
  11420. //
  11421. // Possible values:
  11422. // "NONE"
  11423. // "REFRESH"
  11424. // "REPLACE"
  11425. // "RESTART"
  11426. MinimalAction string `json:"minimalAction,omitempty"`
  11427. // ForceSendFields is a list of field names (e.g. "Instances") to
  11428. // unconditionally include in API requests. By default, fields with
  11429. // empty values are omitted from API requests. However, any non-pointer,
  11430. // non-interface field appearing in ForceSendFields will be sent to the
  11431. // server regardless of whether the field is empty or not. This may be
  11432. // used to include empty fields in Patch requests.
  11433. ForceSendFields []string `json:"-"`
  11434. // NullFields is a list of field names (e.g. "Instances") to include in
  11435. // API requests with the JSON null value. By default, fields with empty
  11436. // values are omitted from API requests. However, any field with an
  11437. // empty value appearing in NullFields will be sent to the server as
  11438. // null. It is an error if a field in this list has a non-empty value.
  11439. // This may be used to include null fields in Patch requests.
  11440. NullFields []string `json:"-"`
  11441. }
  11442. func (s *InstanceGroupManagersApplyUpdatesRequest) MarshalJSON() ([]byte, error) {
  11443. type NoMethod InstanceGroupManagersApplyUpdatesRequest
  11444. raw := NoMethod(*s)
  11445. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11446. }
  11447. type InstanceGroupManagersDeleteInstancesRequest struct {
  11448. // Instances: The URLs of one or more instances to delete. This can be a
  11449. // full URL or a partial URL, such as
  11450. // zones/[ZONE]/instances/[INSTANCE_NAME].
  11451. Instances []string `json:"instances,omitempty"`
  11452. // ForceSendFields is a list of field names (e.g. "Instances") to
  11453. // unconditionally include in API requests. By default, fields with
  11454. // empty values are omitted from API requests. However, any non-pointer,
  11455. // non-interface field appearing in ForceSendFields will be sent to the
  11456. // server regardless of whether the field is empty or not. This may be
  11457. // used to include empty fields in Patch requests.
  11458. ForceSendFields []string `json:"-"`
  11459. // NullFields is a list of field names (e.g. "Instances") to include in
  11460. // API requests with the JSON null value. By default, fields with empty
  11461. // values are omitted from API requests. However, any field with an
  11462. // empty value appearing in NullFields will be sent to the server as
  11463. // null. It is an error if a field in this list has a non-empty value.
  11464. // This may be used to include null fields in Patch requests.
  11465. NullFields []string `json:"-"`
  11466. }
  11467. func (s *InstanceGroupManagersDeleteInstancesRequest) MarshalJSON() ([]byte, error) {
  11468. type NoMethod InstanceGroupManagersDeleteInstancesRequest
  11469. raw := NoMethod(*s)
  11470. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11471. }
  11472. // InstanceGroupManagersDeletePerInstanceConfigsReq:
  11473. // InstanceGroupManagers.deletePerInstanceConfigs
  11474. type InstanceGroupManagersDeletePerInstanceConfigsReq struct {
  11475. // Instances: The list of instances for which we want to delete
  11476. // per-instance configs on this managed instance group.
  11477. Instances []string `json:"instances,omitempty"`
  11478. // ForceSendFields is a list of field names (e.g. "Instances") to
  11479. // unconditionally include in API requests. By default, fields with
  11480. // empty values are omitted from API requests. However, any non-pointer,
  11481. // non-interface field appearing in ForceSendFields will be sent to the
  11482. // server regardless of whether the field is empty or not. This may be
  11483. // used to include empty fields in Patch requests.
  11484. ForceSendFields []string `json:"-"`
  11485. // NullFields is a list of field names (e.g. "Instances") to include in
  11486. // API requests with the JSON null value. By default, fields with empty
  11487. // values are omitted from API requests. However, any field with an
  11488. // empty value appearing in NullFields will be sent to the server as
  11489. // null. It is an error if a field in this list has a non-empty value.
  11490. // This may be used to include null fields in Patch requests.
  11491. NullFields []string `json:"-"`
  11492. }
  11493. func (s *InstanceGroupManagersDeletePerInstanceConfigsReq) MarshalJSON() ([]byte, error) {
  11494. type NoMethod InstanceGroupManagersDeletePerInstanceConfigsReq
  11495. raw := NoMethod(*s)
  11496. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11497. }
  11498. type InstanceGroupManagersListManagedInstancesResponse struct {
  11499. // ManagedInstances: [Output Only] The list of instances in the managed
  11500. // instance group.
  11501. ManagedInstances []*ManagedInstance `json:"managedInstances,omitempty"`
  11502. // NextPageToken: [Output Only] This token allows you to get the next
  11503. // page of results for list requests. If the number of results is larger
  11504. // than maxResults, use the nextPageToken as a value for the query
  11505. // parameter pageToken in the next list request. Subsequent list
  11506. // requests will have their own nextPageToken to continue paging through
  11507. // the results.
  11508. NextPageToken string `json:"nextPageToken,omitempty"`
  11509. // ServerResponse contains the HTTP response code and headers from the
  11510. // server.
  11511. googleapi.ServerResponse `json:"-"`
  11512. // ForceSendFields is a list of field names (e.g. "ManagedInstances") to
  11513. // unconditionally include in API requests. By default, fields with
  11514. // empty values are omitted from API requests. However, any non-pointer,
  11515. // non-interface field appearing in ForceSendFields will be sent to the
  11516. // server regardless of whether the field is empty or not. This may be
  11517. // used to include empty fields in Patch requests.
  11518. ForceSendFields []string `json:"-"`
  11519. // NullFields is a list of field names (e.g. "ManagedInstances") to
  11520. // include in API requests with the JSON null value. By default, fields
  11521. // with empty values are omitted from API requests. However, any field
  11522. // with an empty value appearing in NullFields will be sent to the
  11523. // server as null. It is an error if a field in this list has a
  11524. // non-empty value. This may be used to include null fields in Patch
  11525. // requests.
  11526. NullFields []string `json:"-"`
  11527. }
  11528. func (s *InstanceGroupManagersListManagedInstancesResponse) MarshalJSON() ([]byte, error) {
  11529. type NoMethod InstanceGroupManagersListManagedInstancesResponse
  11530. raw := NoMethod(*s)
  11531. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11532. }
  11533. type InstanceGroupManagersListPerInstanceConfigsResp struct {
  11534. // Items: [Output Only] The list of PerInstanceConfig.
  11535. Items []*PerInstanceConfig `json:"items,omitempty"`
  11536. // NextPageToken: [Output Only] This token allows you to get the next
  11537. // page of results for list requests. If the number of results is larger
  11538. // than maxResults, use the nextPageToken as a value for the query
  11539. // parameter pageToken in the next list request. Subsequent list
  11540. // requests will have their own nextPageToken to continue paging through
  11541. // the results.
  11542. NextPageToken string `json:"nextPageToken,omitempty"`
  11543. // Warning: [Output Only] Informational warning message.
  11544. Warning *InstanceGroupManagersListPerInstanceConfigsRespWarning `json:"warning,omitempty"`
  11545. // ServerResponse contains the HTTP response code and headers from the
  11546. // server.
  11547. googleapi.ServerResponse `json:"-"`
  11548. // ForceSendFields is a list of field names (e.g. "Items") to
  11549. // unconditionally include in API requests. By default, fields with
  11550. // empty values are omitted from API requests. However, any non-pointer,
  11551. // non-interface field appearing in ForceSendFields will be sent to the
  11552. // server regardless of whether the field is empty or not. This may be
  11553. // used to include empty fields in Patch requests.
  11554. ForceSendFields []string `json:"-"`
  11555. // NullFields is a list of field names (e.g. "Items") to include in API
  11556. // requests with the JSON null value. By default, fields with empty
  11557. // values are omitted from API requests. However, any field with an
  11558. // empty value appearing in NullFields will be sent to the server as
  11559. // null. It is an error if a field in this list has a non-empty value.
  11560. // This may be used to include null fields in Patch requests.
  11561. NullFields []string `json:"-"`
  11562. }
  11563. func (s *InstanceGroupManagersListPerInstanceConfigsResp) MarshalJSON() ([]byte, error) {
  11564. type NoMethod InstanceGroupManagersListPerInstanceConfigsResp
  11565. raw := NoMethod(*s)
  11566. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11567. }
  11568. // InstanceGroupManagersListPerInstanceConfigsRespWarning: [Output Only]
  11569. // Informational warning message.
  11570. type InstanceGroupManagersListPerInstanceConfigsRespWarning struct {
  11571. // Code: [Output Only] A warning code, if applicable. For example,
  11572. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  11573. // the response.
  11574. //
  11575. // Possible values:
  11576. // "CLEANUP_FAILED"
  11577. // "DEPRECATED_RESOURCE_USED"
  11578. // "DEPRECATED_TYPE_USED"
  11579. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  11580. // "EXPERIMENTAL_TYPE_USED"
  11581. // "EXTERNAL_API_WARNING"
  11582. // "FIELD_VALUE_OVERRIDEN"
  11583. // "INJECTED_KERNELS_DEPRECATED"
  11584. // "MISSING_TYPE_DEPENDENCY"
  11585. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  11586. // "NEXT_HOP_CANNOT_IP_FORWARD"
  11587. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  11588. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  11589. // "NEXT_HOP_NOT_RUNNING"
  11590. // "NOT_CRITICAL_ERROR"
  11591. // "NO_RESULTS_ON_PAGE"
  11592. // "REQUIRED_TOS_AGREEMENT"
  11593. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  11594. // "RESOURCE_NOT_DELETED"
  11595. // "SCHEMA_VALIDATION_IGNORED"
  11596. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  11597. // "UNDECLARED_PROPERTIES"
  11598. // "UNREACHABLE"
  11599. Code string `json:"code,omitempty"`
  11600. // Data: [Output Only] Metadata about this warning in key: value format.
  11601. // For example:
  11602. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  11603. Data []*InstanceGroupManagersListPerInstanceConfigsRespWarningData `json:"data,omitempty"`
  11604. // Message: [Output Only] A human-readable description of the warning
  11605. // code.
  11606. Message string `json:"message,omitempty"`
  11607. // ForceSendFields is a list of field names (e.g. "Code") to
  11608. // unconditionally include in API requests. By default, fields with
  11609. // empty values are omitted from API requests. However, any non-pointer,
  11610. // non-interface field appearing in ForceSendFields will be sent to the
  11611. // server regardless of whether the field is empty or not. This may be
  11612. // used to include empty fields in Patch requests.
  11613. ForceSendFields []string `json:"-"`
  11614. // NullFields is a list of field names (e.g. "Code") to include in API
  11615. // requests with the JSON null value. By default, fields with empty
  11616. // values are omitted from API requests. However, any field with an
  11617. // empty value appearing in NullFields will be sent to the server as
  11618. // null. It is an error if a field in this list has a non-empty value.
  11619. // This may be used to include null fields in Patch requests.
  11620. NullFields []string `json:"-"`
  11621. }
  11622. func (s *InstanceGroupManagersListPerInstanceConfigsRespWarning) MarshalJSON() ([]byte, error) {
  11623. type NoMethod InstanceGroupManagersListPerInstanceConfigsRespWarning
  11624. raw := NoMethod(*s)
  11625. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11626. }
  11627. type InstanceGroupManagersListPerInstanceConfigsRespWarningData struct {
  11628. // Key: [Output Only] A key that provides more detail on the warning
  11629. // being returned. For example, for warnings where there are no results
  11630. // in a list request for a particular zone, this key might be scope and
  11631. // the key value might be the zone name. Other examples might be a key
  11632. // indicating a deprecated resource and a suggested replacement, or a
  11633. // warning about invalid network settings (for example, if an instance
  11634. // attempts to perform IP forwarding but is not enabled for IP
  11635. // forwarding).
  11636. Key string `json:"key,omitempty"`
  11637. // Value: [Output Only] A warning data value corresponding to the key.
  11638. Value string `json:"value,omitempty"`
  11639. // ForceSendFields is a list of field names (e.g. "Key") to
  11640. // unconditionally include in API requests. By default, fields with
  11641. // empty values are omitted from API requests. However, any non-pointer,
  11642. // non-interface field appearing in ForceSendFields will be sent to the
  11643. // server regardless of whether the field is empty or not. This may be
  11644. // used to include empty fields in Patch requests.
  11645. ForceSendFields []string `json:"-"`
  11646. // NullFields is a list of field names (e.g. "Key") to include in API
  11647. // requests with the JSON null value. By default, fields with empty
  11648. // values are omitted from API requests. However, any field with an
  11649. // empty value appearing in NullFields will be sent to the server as
  11650. // null. It is an error if a field in this list has a non-empty value.
  11651. // This may be used to include null fields in Patch requests.
  11652. NullFields []string `json:"-"`
  11653. }
  11654. func (s *InstanceGroupManagersListPerInstanceConfigsRespWarningData) MarshalJSON() ([]byte, error) {
  11655. type NoMethod InstanceGroupManagersListPerInstanceConfigsRespWarningData
  11656. raw := NoMethod(*s)
  11657. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11658. }
  11659. type InstanceGroupManagersRecreateInstancesRequest struct {
  11660. // Instances: The URLs of one or more instances to recreate. This can be
  11661. // a full URL or a partial URL, such as
  11662. // zones/[ZONE]/instances/[INSTANCE_NAME].
  11663. Instances []string `json:"instances,omitempty"`
  11664. // ForceSendFields is a list of field names (e.g. "Instances") to
  11665. // unconditionally include in API requests. By default, fields with
  11666. // empty values are omitted from API requests. However, any non-pointer,
  11667. // non-interface field appearing in ForceSendFields will be sent to the
  11668. // server regardless of whether the field is empty or not. This may be
  11669. // used to include empty fields in Patch requests.
  11670. ForceSendFields []string `json:"-"`
  11671. // NullFields is a list of field names (e.g. "Instances") to include in
  11672. // API requests with the JSON null value. By default, fields with empty
  11673. // values are omitted from API requests. However, any field with an
  11674. // empty value appearing in NullFields will be sent to the server as
  11675. // null. It is an error if a field in this list has a non-empty value.
  11676. // This may be used to include null fields in Patch requests.
  11677. NullFields []string `json:"-"`
  11678. }
  11679. func (s *InstanceGroupManagersRecreateInstancesRequest) MarshalJSON() ([]byte, error) {
  11680. type NoMethod InstanceGroupManagersRecreateInstancesRequest
  11681. raw := NoMethod(*s)
  11682. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11683. }
  11684. type InstanceGroupManagersResizeAdvancedRequest struct {
  11685. // NoCreationRetries: If this flag is true, the managed instance group
  11686. // attempts to create all instances initiated by this resize request
  11687. // only once. If there is an error during creation, the managed instance
  11688. // group does not retry create this instance, and we will decrease the
  11689. // targetSize of the request instead. If the flag is false, the group
  11690. // attemps to recreate each instance continuously until it
  11691. // succeeds.
  11692. //
  11693. // This flag matters only in the first attempt of creation of an
  11694. // instance. After an instance is successfully created while this flag
  11695. // is enabled, the instance behaves the same way as all the other
  11696. // instances created with a regular resize request. In particular, if a
  11697. // running instance dies unexpectedly at a later time and needs to be
  11698. // recreated, this mode does not affect the recreation behavior in that
  11699. // scenario.
  11700. //
  11701. // This flag is applicable only to the current resize request. It does
  11702. // not influence other resize requests in any way.
  11703. //
  11704. // You can see which instances is being creating in which mode by
  11705. // calling the get or listManagedInstances API.
  11706. NoCreationRetries bool `json:"noCreationRetries,omitempty"`
  11707. // TargetSize: The number of running instances that the managed instance
  11708. // group should maintain at any given time. The group automatically adds
  11709. // or removes instances to maintain the number of instances specified by
  11710. // this parameter.
  11711. TargetSize int64 `json:"targetSize,omitempty"`
  11712. // ForceSendFields is a list of field names (e.g. "NoCreationRetries")
  11713. // to unconditionally include in API requests. By default, fields with
  11714. // empty values are omitted from API requests. However, any non-pointer,
  11715. // non-interface field appearing in ForceSendFields will be sent to the
  11716. // server regardless of whether the field is empty or not. This may be
  11717. // used to include empty fields in Patch requests.
  11718. ForceSendFields []string `json:"-"`
  11719. // NullFields is a list of field names (e.g. "NoCreationRetries") to
  11720. // include in API requests with the JSON null value. By default, fields
  11721. // with empty values are omitted from API requests. However, any field
  11722. // with an empty value appearing in NullFields will be sent to the
  11723. // server as null. It is an error if a field in this list has a
  11724. // non-empty value. This may be used to include null fields in Patch
  11725. // requests.
  11726. NullFields []string `json:"-"`
  11727. }
  11728. func (s *InstanceGroupManagersResizeAdvancedRequest) MarshalJSON() ([]byte, error) {
  11729. type NoMethod InstanceGroupManagersResizeAdvancedRequest
  11730. raw := NoMethod(*s)
  11731. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11732. }
  11733. type InstanceGroupManagersScopedList struct {
  11734. // InstanceGroupManagers: [Output Only] The list of managed instance
  11735. // groups that are contained in the specified project and zone.
  11736. InstanceGroupManagers []*InstanceGroupManager `json:"instanceGroupManagers,omitempty"`
  11737. // Warning: [Output Only] The warning that replaces the list of managed
  11738. // instance groups when the list is empty.
  11739. Warning *InstanceGroupManagersScopedListWarning `json:"warning,omitempty"`
  11740. // ForceSendFields is a list of field names (e.g.
  11741. // "InstanceGroupManagers") to unconditionally include in API requests.
  11742. // By default, fields with empty values are omitted from API requests.
  11743. // However, any non-pointer, non-interface field appearing in
  11744. // ForceSendFields will be sent to the server regardless of whether the
  11745. // field is empty or not. This may be used to include empty fields in
  11746. // Patch requests.
  11747. ForceSendFields []string `json:"-"`
  11748. // NullFields is a list of field names (e.g. "InstanceGroupManagers") to
  11749. // include in API requests with the JSON null value. By default, fields
  11750. // with empty values are omitted from API requests. However, any field
  11751. // with an empty value appearing in NullFields will be sent to the
  11752. // server as null. It is an error if a field in this list has a
  11753. // non-empty value. This may be used to include null fields in Patch
  11754. // requests.
  11755. NullFields []string `json:"-"`
  11756. }
  11757. func (s *InstanceGroupManagersScopedList) MarshalJSON() ([]byte, error) {
  11758. type NoMethod InstanceGroupManagersScopedList
  11759. raw := NoMethod(*s)
  11760. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11761. }
  11762. // InstanceGroupManagersScopedListWarning: [Output Only] The warning
  11763. // that replaces the list of managed instance groups when the list is
  11764. // empty.
  11765. type InstanceGroupManagersScopedListWarning struct {
  11766. // Code: [Output Only] A warning code, if applicable. For example,
  11767. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  11768. // the response.
  11769. //
  11770. // Possible values:
  11771. // "CLEANUP_FAILED"
  11772. // "DEPRECATED_RESOURCE_USED"
  11773. // "DEPRECATED_TYPE_USED"
  11774. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  11775. // "EXPERIMENTAL_TYPE_USED"
  11776. // "EXTERNAL_API_WARNING"
  11777. // "FIELD_VALUE_OVERRIDEN"
  11778. // "INJECTED_KERNELS_DEPRECATED"
  11779. // "MISSING_TYPE_DEPENDENCY"
  11780. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  11781. // "NEXT_HOP_CANNOT_IP_FORWARD"
  11782. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  11783. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  11784. // "NEXT_HOP_NOT_RUNNING"
  11785. // "NOT_CRITICAL_ERROR"
  11786. // "NO_RESULTS_ON_PAGE"
  11787. // "REQUIRED_TOS_AGREEMENT"
  11788. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  11789. // "RESOURCE_NOT_DELETED"
  11790. // "SCHEMA_VALIDATION_IGNORED"
  11791. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  11792. // "UNDECLARED_PROPERTIES"
  11793. // "UNREACHABLE"
  11794. Code string `json:"code,omitempty"`
  11795. // Data: [Output Only] Metadata about this warning in key: value format.
  11796. // For example:
  11797. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  11798. Data []*InstanceGroupManagersScopedListWarningData `json:"data,omitempty"`
  11799. // Message: [Output Only] A human-readable description of the warning
  11800. // code.
  11801. Message string `json:"message,omitempty"`
  11802. // ForceSendFields is a list of field names (e.g. "Code") to
  11803. // unconditionally include in API requests. By default, fields with
  11804. // empty values are omitted from API requests. However, any non-pointer,
  11805. // non-interface field appearing in ForceSendFields will be sent to the
  11806. // server regardless of whether the field is empty or not. This may be
  11807. // used to include empty fields in Patch requests.
  11808. ForceSendFields []string `json:"-"`
  11809. // NullFields is a list of field names (e.g. "Code") to include in API
  11810. // requests with the JSON null value. By default, fields with empty
  11811. // values are omitted from API requests. However, any field with an
  11812. // empty value appearing in NullFields will be sent to the server as
  11813. // null. It is an error if a field in this list has a non-empty value.
  11814. // This may be used to include null fields in Patch requests.
  11815. NullFields []string `json:"-"`
  11816. }
  11817. func (s *InstanceGroupManagersScopedListWarning) MarshalJSON() ([]byte, error) {
  11818. type NoMethod InstanceGroupManagersScopedListWarning
  11819. raw := NoMethod(*s)
  11820. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11821. }
  11822. type InstanceGroupManagersScopedListWarningData struct {
  11823. // Key: [Output Only] A key that provides more detail on the warning
  11824. // being returned. For example, for warnings where there are no results
  11825. // in a list request for a particular zone, this key might be scope and
  11826. // the key value might be the zone name. Other examples might be a key
  11827. // indicating a deprecated resource and a suggested replacement, or a
  11828. // warning about invalid network settings (for example, if an instance
  11829. // attempts to perform IP forwarding but is not enabled for IP
  11830. // forwarding).
  11831. Key string `json:"key,omitempty"`
  11832. // Value: [Output Only] A warning data value corresponding to the key.
  11833. Value string `json:"value,omitempty"`
  11834. // ForceSendFields is a list of field names (e.g. "Key") to
  11835. // unconditionally include in API requests. By default, fields with
  11836. // empty values are omitted from API requests. However, any non-pointer,
  11837. // non-interface field appearing in ForceSendFields will be sent to the
  11838. // server regardless of whether the field is empty or not. This may be
  11839. // used to include empty fields in Patch requests.
  11840. ForceSendFields []string `json:"-"`
  11841. // NullFields is a list of field names (e.g. "Key") to include in API
  11842. // requests with the JSON null value. By default, fields with empty
  11843. // values are omitted from API requests. However, any field with an
  11844. // empty value appearing in NullFields will be sent to the server as
  11845. // null. It is an error if a field in this list has a non-empty value.
  11846. // This may be used to include null fields in Patch requests.
  11847. NullFields []string `json:"-"`
  11848. }
  11849. func (s *InstanceGroupManagersScopedListWarningData) MarshalJSON() ([]byte, error) {
  11850. type NoMethod InstanceGroupManagersScopedListWarningData
  11851. raw := NoMethod(*s)
  11852. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11853. }
  11854. type InstanceGroupManagersSetAutoHealingRequest struct {
  11855. AutoHealingPolicies []*InstanceGroupManagerAutoHealingPolicy `json:"autoHealingPolicies,omitempty"`
  11856. // ForceSendFields is a list of field names (e.g. "AutoHealingPolicies")
  11857. // to unconditionally include in API requests. By default, fields with
  11858. // empty values are omitted from API requests. However, any non-pointer,
  11859. // non-interface field appearing in ForceSendFields will be sent to the
  11860. // server regardless of whether the field is empty or not. This may be
  11861. // used to include empty fields in Patch requests.
  11862. ForceSendFields []string `json:"-"`
  11863. // NullFields is a list of field names (e.g. "AutoHealingPolicies") to
  11864. // include in API requests with the JSON null value. By default, fields
  11865. // with empty values are omitted from API requests. However, any field
  11866. // with an empty value appearing in NullFields will be sent to the
  11867. // server as null. It is an error if a field in this list has a
  11868. // non-empty value. This may be used to include null fields in Patch
  11869. // requests.
  11870. NullFields []string `json:"-"`
  11871. }
  11872. func (s *InstanceGroupManagersSetAutoHealingRequest) MarshalJSON() ([]byte, error) {
  11873. type NoMethod InstanceGroupManagersSetAutoHealingRequest
  11874. raw := NoMethod(*s)
  11875. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11876. }
  11877. type InstanceGroupManagersSetInstanceTemplateRequest struct {
  11878. // InstanceTemplate: The URL of the instance template that is specified
  11879. // for this managed instance group. The group uses this template to
  11880. // create all new instances in the managed instance group.
  11881. InstanceTemplate string `json:"instanceTemplate,omitempty"`
  11882. // ForceSendFields is a list of field names (e.g. "InstanceTemplate") to
  11883. // unconditionally include in API requests. By default, fields with
  11884. // empty values are omitted from API requests. However, any non-pointer,
  11885. // non-interface field appearing in ForceSendFields will be sent to the
  11886. // server regardless of whether the field is empty or not. This may be
  11887. // used to include empty fields in Patch requests.
  11888. ForceSendFields []string `json:"-"`
  11889. // NullFields is a list of field names (e.g. "InstanceTemplate") to
  11890. // include in API requests with the JSON null value. By default, fields
  11891. // with empty values are omitted from API requests. However, any field
  11892. // with an empty value appearing in NullFields will be sent to the
  11893. // server as null. It is an error if a field in this list has a
  11894. // non-empty value. This may be used to include null fields in Patch
  11895. // requests.
  11896. NullFields []string `json:"-"`
  11897. }
  11898. func (s *InstanceGroupManagersSetInstanceTemplateRequest) MarshalJSON() ([]byte, error) {
  11899. type NoMethod InstanceGroupManagersSetInstanceTemplateRequest
  11900. raw := NoMethod(*s)
  11901. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11902. }
  11903. type InstanceGroupManagersSetTargetPoolsRequest struct {
  11904. // Fingerprint: The fingerprint of the target pools information. Use
  11905. // this optional property to prevent conflicts when multiple users
  11906. // change the target pools settings concurrently. Obtain the fingerprint
  11907. // with the instanceGroupManagers.get method. Then, include the
  11908. // fingerprint in your request to ensure that you do not overwrite
  11909. // changes that were applied from another concurrent request.
  11910. Fingerprint string `json:"fingerprint,omitempty"`
  11911. // TargetPools: The list of target pool URLs that instances in this
  11912. // managed instance group belong to. The managed instance group applies
  11913. // these target pools to all of the instances in the group. Existing
  11914. // instances and new instances in the group all receive these target
  11915. // pool settings.
  11916. TargetPools []string `json:"targetPools,omitempty"`
  11917. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  11918. // unconditionally include in API requests. By default, fields with
  11919. // empty values are omitted from API requests. However, any non-pointer,
  11920. // non-interface field appearing in ForceSendFields will be sent to the
  11921. // server regardless of whether the field is empty or not. This may be
  11922. // used to include empty fields in Patch requests.
  11923. ForceSendFields []string `json:"-"`
  11924. // NullFields is a list of field names (e.g. "Fingerprint") to include
  11925. // in API requests with the JSON null value. By default, fields with
  11926. // empty values are omitted from API requests. However, any field with
  11927. // an empty value appearing in NullFields will be sent to the server as
  11928. // null. It is an error if a field in this list has a non-empty value.
  11929. // This may be used to include null fields in Patch requests.
  11930. NullFields []string `json:"-"`
  11931. }
  11932. func (s *InstanceGroupManagersSetTargetPoolsRequest) MarshalJSON() ([]byte, error) {
  11933. type NoMethod InstanceGroupManagersSetTargetPoolsRequest
  11934. raw := NoMethod(*s)
  11935. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11936. }
  11937. // InstanceGroupManagersUpdatePerInstanceConfigsReq:
  11938. // InstanceGroupManagers.updatePerInstanceConfigs
  11939. type InstanceGroupManagersUpdatePerInstanceConfigsReq struct {
  11940. // PerInstanceConfigs: The list of per-instance configs to insert or
  11941. // patch on this managed instance group.
  11942. PerInstanceConfigs []*PerInstanceConfig `json:"perInstanceConfigs,omitempty"`
  11943. // ForceSendFields is a list of field names (e.g. "PerInstanceConfigs")
  11944. // to unconditionally include in API requests. By default, fields with
  11945. // empty values are omitted from API requests. However, any non-pointer,
  11946. // non-interface field appearing in ForceSendFields will be sent to the
  11947. // server regardless of whether the field is empty or not. This may be
  11948. // used to include empty fields in Patch requests.
  11949. ForceSendFields []string `json:"-"`
  11950. // NullFields is a list of field names (e.g. "PerInstanceConfigs") to
  11951. // include in API requests with the JSON null value. By default, fields
  11952. // with empty values are omitted from API requests. However, any field
  11953. // with an empty value appearing in NullFields will be sent to the
  11954. // server as null. It is an error if a field in this list has a
  11955. // non-empty value. This may be used to include null fields in Patch
  11956. // requests.
  11957. NullFields []string `json:"-"`
  11958. }
  11959. func (s *InstanceGroupManagersUpdatePerInstanceConfigsReq) MarshalJSON() ([]byte, error) {
  11960. type NoMethod InstanceGroupManagersUpdatePerInstanceConfigsReq
  11961. raw := NoMethod(*s)
  11962. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11963. }
  11964. type InstanceGroupsAddInstancesRequest struct {
  11965. // Instances: The list of instances to add to the instance group.
  11966. Instances []*InstanceReference `json:"instances,omitempty"`
  11967. // ForceSendFields is a list of field names (e.g. "Instances") to
  11968. // unconditionally include in API requests. By default, fields with
  11969. // empty values are omitted from API requests. However, any non-pointer,
  11970. // non-interface field appearing in ForceSendFields will be sent to the
  11971. // server regardless of whether the field is empty or not. This may be
  11972. // used to include empty fields in Patch requests.
  11973. ForceSendFields []string `json:"-"`
  11974. // NullFields is a list of field names (e.g. "Instances") to include in
  11975. // API requests with the JSON null value. By default, fields with empty
  11976. // values are omitted from API requests. However, any field with an
  11977. // empty value appearing in NullFields will be sent to the server as
  11978. // null. It is an error if a field in this list has a non-empty value.
  11979. // This may be used to include null fields in Patch requests.
  11980. NullFields []string `json:"-"`
  11981. }
  11982. func (s *InstanceGroupsAddInstancesRequest) MarshalJSON() ([]byte, error) {
  11983. type NoMethod InstanceGroupsAddInstancesRequest
  11984. raw := NoMethod(*s)
  11985. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11986. }
  11987. type InstanceGroupsListInstances struct {
  11988. // Id: [Output Only] Unique identifier for the resource; defined by the
  11989. // server.
  11990. Id string `json:"id,omitempty"`
  11991. // Items: A list of InstanceWithNamedPorts resources.
  11992. Items []*InstanceWithNamedPorts `json:"items,omitempty"`
  11993. // Kind: [Output Only] The resource type, which is always
  11994. // compute#instanceGroupsListInstances for the list of instances in the
  11995. // specified instance group.
  11996. Kind string `json:"kind,omitempty"`
  11997. // NextPageToken: [Output Only] This token allows you to get the next
  11998. // page of results for list requests. If the number of results is larger
  11999. // than maxResults, use the nextPageToken as a value for the query
  12000. // parameter pageToken in the next list request. Subsequent list
  12001. // requests will have their own nextPageToken to continue paging through
  12002. // the results.
  12003. NextPageToken string `json:"nextPageToken,omitempty"`
  12004. // SelfLink: [Output Only] Server-defined URL for this resource.
  12005. SelfLink string `json:"selfLink,omitempty"`
  12006. // Warning: [Output Only] Informational warning message.
  12007. Warning *InstanceGroupsListInstancesWarning `json:"warning,omitempty"`
  12008. // ServerResponse contains the HTTP response code and headers from the
  12009. // server.
  12010. googleapi.ServerResponse `json:"-"`
  12011. // ForceSendFields is a list of field names (e.g. "Id") to
  12012. // unconditionally include in API requests. By default, fields with
  12013. // empty values are omitted from API requests. However, any non-pointer,
  12014. // non-interface field appearing in ForceSendFields will be sent to the
  12015. // server regardless of whether the field is empty or not. This may be
  12016. // used to include empty fields in Patch requests.
  12017. ForceSendFields []string `json:"-"`
  12018. // NullFields is a list of field names (e.g. "Id") to include in API
  12019. // requests with the JSON null value. By default, fields with empty
  12020. // values are omitted from API requests. However, any field with an
  12021. // empty value appearing in NullFields will be sent to the server as
  12022. // null. It is an error if a field in this list has a non-empty value.
  12023. // This may be used to include null fields in Patch requests.
  12024. NullFields []string `json:"-"`
  12025. }
  12026. func (s *InstanceGroupsListInstances) MarshalJSON() ([]byte, error) {
  12027. type NoMethod InstanceGroupsListInstances
  12028. raw := NoMethod(*s)
  12029. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12030. }
  12031. // InstanceGroupsListInstancesWarning: [Output Only] Informational
  12032. // warning message.
  12033. type InstanceGroupsListInstancesWarning struct {
  12034. // Code: [Output Only] A warning code, if applicable. For example,
  12035. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  12036. // the response.
  12037. //
  12038. // Possible values:
  12039. // "CLEANUP_FAILED"
  12040. // "DEPRECATED_RESOURCE_USED"
  12041. // "DEPRECATED_TYPE_USED"
  12042. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  12043. // "EXPERIMENTAL_TYPE_USED"
  12044. // "EXTERNAL_API_WARNING"
  12045. // "FIELD_VALUE_OVERRIDEN"
  12046. // "INJECTED_KERNELS_DEPRECATED"
  12047. // "MISSING_TYPE_DEPENDENCY"
  12048. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  12049. // "NEXT_HOP_CANNOT_IP_FORWARD"
  12050. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  12051. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  12052. // "NEXT_HOP_NOT_RUNNING"
  12053. // "NOT_CRITICAL_ERROR"
  12054. // "NO_RESULTS_ON_PAGE"
  12055. // "REQUIRED_TOS_AGREEMENT"
  12056. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  12057. // "RESOURCE_NOT_DELETED"
  12058. // "SCHEMA_VALIDATION_IGNORED"
  12059. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  12060. // "UNDECLARED_PROPERTIES"
  12061. // "UNREACHABLE"
  12062. Code string `json:"code,omitempty"`
  12063. // Data: [Output Only] Metadata about this warning in key: value format.
  12064. // For example:
  12065. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  12066. Data []*InstanceGroupsListInstancesWarningData `json:"data,omitempty"`
  12067. // Message: [Output Only] A human-readable description of the warning
  12068. // code.
  12069. Message string `json:"message,omitempty"`
  12070. // ForceSendFields is a list of field names (e.g. "Code") to
  12071. // unconditionally include in API requests. By default, fields with
  12072. // empty values are omitted from API requests. However, any non-pointer,
  12073. // non-interface field appearing in ForceSendFields will be sent to the
  12074. // server regardless of whether the field is empty or not. This may be
  12075. // used to include empty fields in Patch requests.
  12076. ForceSendFields []string `json:"-"`
  12077. // NullFields is a list of field names (e.g. "Code") to include in API
  12078. // requests with the JSON null value. By default, fields with empty
  12079. // values are omitted from API requests. However, any field with an
  12080. // empty value appearing in NullFields will be sent to the server as
  12081. // null. It is an error if a field in this list has a non-empty value.
  12082. // This may be used to include null fields in Patch requests.
  12083. NullFields []string `json:"-"`
  12084. }
  12085. func (s *InstanceGroupsListInstancesWarning) MarshalJSON() ([]byte, error) {
  12086. type NoMethod InstanceGroupsListInstancesWarning
  12087. raw := NoMethod(*s)
  12088. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12089. }
  12090. type InstanceGroupsListInstancesWarningData struct {
  12091. // Key: [Output Only] A key that provides more detail on the warning
  12092. // being returned. For example, for warnings where there are no results
  12093. // in a list request for a particular zone, this key might be scope and
  12094. // the key value might be the zone name. Other examples might be a key
  12095. // indicating a deprecated resource and a suggested replacement, or a
  12096. // warning about invalid network settings (for example, if an instance
  12097. // attempts to perform IP forwarding but is not enabled for IP
  12098. // forwarding).
  12099. Key string `json:"key,omitempty"`
  12100. // Value: [Output Only] A warning data value corresponding to the key.
  12101. Value string `json:"value,omitempty"`
  12102. // ForceSendFields is a list of field names (e.g. "Key") to
  12103. // unconditionally include in API requests. By default, fields with
  12104. // empty values are omitted from API requests. However, any non-pointer,
  12105. // non-interface field appearing in ForceSendFields will be sent to the
  12106. // server regardless of whether the field is empty or not. This may be
  12107. // used to include empty fields in Patch requests.
  12108. ForceSendFields []string `json:"-"`
  12109. // NullFields is a list of field names (e.g. "Key") to include in API
  12110. // requests with the JSON null value. By default, fields with empty
  12111. // values are omitted from API requests. However, any field with an
  12112. // empty value appearing in NullFields will be sent to the server as
  12113. // null. It is an error if a field in this list has a non-empty value.
  12114. // This may be used to include null fields in Patch requests.
  12115. NullFields []string `json:"-"`
  12116. }
  12117. func (s *InstanceGroupsListInstancesWarningData) MarshalJSON() ([]byte, error) {
  12118. type NoMethod InstanceGroupsListInstancesWarningData
  12119. raw := NoMethod(*s)
  12120. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12121. }
  12122. type InstanceGroupsListInstancesRequest struct {
  12123. // InstanceState: A filter for the state of the instances in the
  12124. // instance group. Valid options are ALL or RUNNING. If you do not
  12125. // specify this parameter the list includes all instances regardless of
  12126. // their state.
  12127. //
  12128. // Possible values:
  12129. // "ALL"
  12130. // "RUNNING"
  12131. InstanceState string `json:"instanceState,omitempty"`
  12132. // ForceSendFields is a list of field names (e.g. "InstanceState") to
  12133. // unconditionally include in API requests. By default, fields with
  12134. // empty values are omitted from API requests. However, any non-pointer,
  12135. // non-interface field appearing in ForceSendFields will be sent to the
  12136. // server regardless of whether the field is empty or not. This may be
  12137. // used to include empty fields in Patch requests.
  12138. ForceSendFields []string `json:"-"`
  12139. // NullFields is a list of field names (e.g. "InstanceState") to include
  12140. // in API requests with the JSON null value. By default, fields with
  12141. // empty values are omitted from API requests. However, any field with
  12142. // an empty value appearing in NullFields will be sent to the server as
  12143. // null. It is an error if a field in this list has a non-empty value.
  12144. // This may be used to include null fields in Patch requests.
  12145. NullFields []string `json:"-"`
  12146. }
  12147. func (s *InstanceGroupsListInstancesRequest) MarshalJSON() ([]byte, error) {
  12148. type NoMethod InstanceGroupsListInstancesRequest
  12149. raw := NoMethod(*s)
  12150. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12151. }
  12152. type InstanceGroupsRemoveInstancesRequest struct {
  12153. // Instances: The list of instances to remove from the instance group.
  12154. Instances []*InstanceReference `json:"instances,omitempty"`
  12155. // ForceSendFields is a list of field names (e.g. "Instances") to
  12156. // unconditionally include in API requests. By default, fields with
  12157. // empty values are omitted from API requests. However, any non-pointer,
  12158. // non-interface field appearing in ForceSendFields will be sent to the
  12159. // server regardless of whether the field is empty or not. This may be
  12160. // used to include empty fields in Patch requests.
  12161. ForceSendFields []string `json:"-"`
  12162. // NullFields is a list of field names (e.g. "Instances") to include in
  12163. // API requests with the JSON null value. By default, fields with empty
  12164. // values are omitted from API requests. However, any field with an
  12165. // empty value appearing in NullFields will be sent to the server as
  12166. // null. It is an error if a field in this list has a non-empty value.
  12167. // This may be used to include null fields in Patch requests.
  12168. NullFields []string `json:"-"`
  12169. }
  12170. func (s *InstanceGroupsRemoveInstancesRequest) MarshalJSON() ([]byte, error) {
  12171. type NoMethod InstanceGroupsRemoveInstancesRequest
  12172. raw := NoMethod(*s)
  12173. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12174. }
  12175. type InstanceGroupsScopedList struct {
  12176. // InstanceGroups: [Output Only] The list of instance groups that are
  12177. // contained in this scope.
  12178. InstanceGroups []*InstanceGroup `json:"instanceGroups,omitempty"`
  12179. // Warning: [Output Only] An informational warning that replaces the
  12180. // list of instance groups when the list is empty.
  12181. Warning *InstanceGroupsScopedListWarning `json:"warning,omitempty"`
  12182. // ForceSendFields is a list of field names (e.g. "InstanceGroups") to
  12183. // unconditionally include in API requests. By default, fields with
  12184. // empty values are omitted from API requests. However, any non-pointer,
  12185. // non-interface field appearing in ForceSendFields will be sent to the
  12186. // server regardless of whether the field is empty or not. This may be
  12187. // used to include empty fields in Patch requests.
  12188. ForceSendFields []string `json:"-"`
  12189. // NullFields is a list of field names (e.g. "InstanceGroups") to
  12190. // include in API requests with the JSON null value. By default, fields
  12191. // with empty values are omitted from API requests. However, any field
  12192. // with an empty value appearing in NullFields will be sent to the
  12193. // server as null. It is an error if a field in this list has a
  12194. // non-empty value. This may be used to include null fields in Patch
  12195. // requests.
  12196. NullFields []string `json:"-"`
  12197. }
  12198. func (s *InstanceGroupsScopedList) MarshalJSON() ([]byte, error) {
  12199. type NoMethod InstanceGroupsScopedList
  12200. raw := NoMethod(*s)
  12201. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12202. }
  12203. // InstanceGroupsScopedListWarning: [Output Only] An informational
  12204. // warning that replaces the list of instance groups when the list is
  12205. // empty.
  12206. type InstanceGroupsScopedListWarning struct {
  12207. // Code: [Output Only] A warning code, if applicable. For example,
  12208. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  12209. // the response.
  12210. //
  12211. // Possible values:
  12212. // "CLEANUP_FAILED"
  12213. // "DEPRECATED_RESOURCE_USED"
  12214. // "DEPRECATED_TYPE_USED"
  12215. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  12216. // "EXPERIMENTAL_TYPE_USED"
  12217. // "EXTERNAL_API_WARNING"
  12218. // "FIELD_VALUE_OVERRIDEN"
  12219. // "INJECTED_KERNELS_DEPRECATED"
  12220. // "MISSING_TYPE_DEPENDENCY"
  12221. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  12222. // "NEXT_HOP_CANNOT_IP_FORWARD"
  12223. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  12224. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  12225. // "NEXT_HOP_NOT_RUNNING"
  12226. // "NOT_CRITICAL_ERROR"
  12227. // "NO_RESULTS_ON_PAGE"
  12228. // "REQUIRED_TOS_AGREEMENT"
  12229. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  12230. // "RESOURCE_NOT_DELETED"
  12231. // "SCHEMA_VALIDATION_IGNORED"
  12232. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  12233. // "UNDECLARED_PROPERTIES"
  12234. // "UNREACHABLE"
  12235. Code string `json:"code,omitempty"`
  12236. // Data: [Output Only] Metadata about this warning in key: value format.
  12237. // For example:
  12238. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  12239. Data []*InstanceGroupsScopedListWarningData `json:"data,omitempty"`
  12240. // Message: [Output Only] A human-readable description of the warning
  12241. // code.
  12242. Message string `json:"message,omitempty"`
  12243. // ForceSendFields is a list of field names (e.g. "Code") to
  12244. // unconditionally include in API requests. By default, fields with
  12245. // empty values are omitted from API requests. However, any non-pointer,
  12246. // non-interface field appearing in ForceSendFields will be sent to the
  12247. // server regardless of whether the field is empty or not. This may be
  12248. // used to include empty fields in Patch requests.
  12249. ForceSendFields []string `json:"-"`
  12250. // NullFields is a list of field names (e.g. "Code") to include in API
  12251. // requests with the JSON null value. By default, fields with empty
  12252. // values are omitted from API requests. However, any field with an
  12253. // empty value appearing in NullFields will be sent to the server as
  12254. // null. It is an error if a field in this list has a non-empty value.
  12255. // This may be used to include null fields in Patch requests.
  12256. NullFields []string `json:"-"`
  12257. }
  12258. func (s *InstanceGroupsScopedListWarning) MarshalJSON() ([]byte, error) {
  12259. type NoMethod InstanceGroupsScopedListWarning
  12260. raw := NoMethod(*s)
  12261. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12262. }
  12263. type InstanceGroupsScopedListWarningData struct {
  12264. // Key: [Output Only] A key that provides more detail on the warning
  12265. // being returned. For example, for warnings where there are no results
  12266. // in a list request for a particular zone, this key might be scope and
  12267. // the key value might be the zone name. Other examples might be a key
  12268. // indicating a deprecated resource and a suggested replacement, or a
  12269. // warning about invalid network settings (for example, if an instance
  12270. // attempts to perform IP forwarding but is not enabled for IP
  12271. // forwarding).
  12272. Key string `json:"key,omitempty"`
  12273. // Value: [Output Only] A warning data value corresponding to the key.
  12274. Value string `json:"value,omitempty"`
  12275. // ForceSendFields is a list of field names (e.g. "Key") to
  12276. // unconditionally include in API requests. By default, fields with
  12277. // empty values are omitted from API requests. However, any non-pointer,
  12278. // non-interface field appearing in ForceSendFields will be sent to the
  12279. // server regardless of whether the field is empty or not. This may be
  12280. // used to include empty fields in Patch requests.
  12281. ForceSendFields []string `json:"-"`
  12282. // NullFields is a list of field names (e.g. "Key") to include in API
  12283. // requests with the JSON null value. By default, fields with empty
  12284. // values are omitted from API requests. However, any field with an
  12285. // empty value appearing in NullFields will be sent to the server as
  12286. // null. It is an error if a field in this list has a non-empty value.
  12287. // This may be used to include null fields in Patch requests.
  12288. NullFields []string `json:"-"`
  12289. }
  12290. func (s *InstanceGroupsScopedListWarningData) MarshalJSON() ([]byte, error) {
  12291. type NoMethod InstanceGroupsScopedListWarningData
  12292. raw := NoMethod(*s)
  12293. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12294. }
  12295. type InstanceGroupsSetNamedPortsRequest struct {
  12296. // Fingerprint: The fingerprint of the named ports information for this
  12297. // instance group. Use this optional property to prevent conflicts when
  12298. // multiple users change the named ports settings concurrently. Obtain
  12299. // the fingerprint with the instanceGroups.get method. Then, include the
  12300. // fingerprint in your request to ensure that you do not overwrite
  12301. // changes that were applied from another concurrent request.
  12302. Fingerprint string `json:"fingerprint,omitempty"`
  12303. // NamedPorts: The list of named ports to set for this instance group.
  12304. NamedPorts []*NamedPort `json:"namedPorts,omitempty"`
  12305. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  12306. // unconditionally include in API requests. By default, fields with
  12307. // empty values are omitted from API requests. However, any non-pointer,
  12308. // non-interface field appearing in ForceSendFields will be sent to the
  12309. // server regardless of whether the field is empty or not. This may be
  12310. // used to include empty fields in Patch requests.
  12311. ForceSendFields []string `json:"-"`
  12312. // NullFields is a list of field names (e.g. "Fingerprint") to include
  12313. // in API requests with the JSON null value. By default, fields with
  12314. // empty values are omitted from API requests. However, any field with
  12315. // an empty value appearing in NullFields will be sent to the server as
  12316. // null. It is an error if a field in this list has a non-empty value.
  12317. // This may be used to include null fields in Patch requests.
  12318. NullFields []string `json:"-"`
  12319. }
  12320. func (s *InstanceGroupsSetNamedPortsRequest) MarshalJSON() ([]byte, error) {
  12321. type NoMethod InstanceGroupsSetNamedPortsRequest
  12322. raw := NoMethod(*s)
  12323. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12324. }
  12325. // InstanceList: Contains a list of instances.
  12326. type InstanceList struct {
  12327. // Id: [Output Only] Unique identifier for the resource; defined by the
  12328. // server.
  12329. Id string `json:"id,omitempty"`
  12330. // Items: A list of Instance resources.
  12331. Items []*Instance `json:"items,omitempty"`
  12332. // Kind: [Output Only] Type of resource. Always compute#instanceList for
  12333. // lists of Instance resources.
  12334. Kind string `json:"kind,omitempty"`
  12335. // NextPageToken: [Output Only] This token allows you to get the next
  12336. // page of results for list requests. If the number of results is larger
  12337. // than maxResults, use the nextPageToken as a value for the query
  12338. // parameter pageToken in the next list request. Subsequent list
  12339. // requests will have their own nextPageToken to continue paging through
  12340. // the results.
  12341. NextPageToken string `json:"nextPageToken,omitempty"`
  12342. // SelfLink: [Output Only] Server-defined URL for this resource.
  12343. SelfLink string `json:"selfLink,omitempty"`
  12344. // Warning: [Output Only] Informational warning message.
  12345. Warning *InstanceListWarning `json:"warning,omitempty"`
  12346. // ServerResponse contains the HTTP response code and headers from the
  12347. // server.
  12348. googleapi.ServerResponse `json:"-"`
  12349. // ForceSendFields is a list of field names (e.g. "Id") to
  12350. // unconditionally include in API requests. By default, fields with
  12351. // empty values are omitted from API requests. However, any non-pointer,
  12352. // non-interface field appearing in ForceSendFields will be sent to the
  12353. // server regardless of whether the field is empty or not. This may be
  12354. // used to include empty fields in Patch requests.
  12355. ForceSendFields []string `json:"-"`
  12356. // NullFields is a list of field names (e.g. "Id") to include in API
  12357. // requests with the JSON null value. By default, fields with empty
  12358. // values are omitted from API requests. However, any field with an
  12359. // empty value appearing in NullFields will be sent to the server as
  12360. // null. It is an error if a field in this list has a non-empty value.
  12361. // This may be used to include null fields in Patch requests.
  12362. NullFields []string `json:"-"`
  12363. }
  12364. func (s *InstanceList) MarshalJSON() ([]byte, error) {
  12365. type NoMethod InstanceList
  12366. raw := NoMethod(*s)
  12367. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12368. }
  12369. // InstanceListWarning: [Output Only] Informational warning message.
  12370. type InstanceListWarning struct {
  12371. // Code: [Output Only] A warning code, if applicable. For example,
  12372. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  12373. // the response.
  12374. //
  12375. // Possible values:
  12376. // "CLEANUP_FAILED"
  12377. // "DEPRECATED_RESOURCE_USED"
  12378. // "DEPRECATED_TYPE_USED"
  12379. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  12380. // "EXPERIMENTAL_TYPE_USED"
  12381. // "EXTERNAL_API_WARNING"
  12382. // "FIELD_VALUE_OVERRIDEN"
  12383. // "INJECTED_KERNELS_DEPRECATED"
  12384. // "MISSING_TYPE_DEPENDENCY"
  12385. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  12386. // "NEXT_HOP_CANNOT_IP_FORWARD"
  12387. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  12388. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  12389. // "NEXT_HOP_NOT_RUNNING"
  12390. // "NOT_CRITICAL_ERROR"
  12391. // "NO_RESULTS_ON_PAGE"
  12392. // "REQUIRED_TOS_AGREEMENT"
  12393. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  12394. // "RESOURCE_NOT_DELETED"
  12395. // "SCHEMA_VALIDATION_IGNORED"
  12396. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  12397. // "UNDECLARED_PROPERTIES"
  12398. // "UNREACHABLE"
  12399. Code string `json:"code,omitempty"`
  12400. // Data: [Output Only] Metadata about this warning in key: value format.
  12401. // For example:
  12402. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  12403. Data []*InstanceListWarningData `json:"data,omitempty"`
  12404. // Message: [Output Only] A human-readable description of the warning
  12405. // code.
  12406. Message string `json:"message,omitempty"`
  12407. // ForceSendFields is a list of field names (e.g. "Code") to
  12408. // unconditionally include in API requests. By default, fields with
  12409. // empty values are omitted from API requests. However, any non-pointer,
  12410. // non-interface field appearing in ForceSendFields will be sent to the
  12411. // server regardless of whether the field is empty or not. This may be
  12412. // used to include empty fields in Patch requests.
  12413. ForceSendFields []string `json:"-"`
  12414. // NullFields is a list of field names (e.g. "Code") to include in API
  12415. // requests with the JSON null value. By default, fields with empty
  12416. // values are omitted from API requests. However, any field with an
  12417. // empty value appearing in NullFields will be sent to the server as
  12418. // null. It is an error if a field in this list has a non-empty value.
  12419. // This may be used to include null fields in Patch requests.
  12420. NullFields []string `json:"-"`
  12421. }
  12422. func (s *InstanceListWarning) MarshalJSON() ([]byte, error) {
  12423. type NoMethod InstanceListWarning
  12424. raw := NoMethod(*s)
  12425. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12426. }
  12427. type InstanceListWarningData struct {
  12428. // Key: [Output Only] A key that provides more detail on the warning
  12429. // being returned. For example, for warnings where there are no results
  12430. // in a list request for a particular zone, this key might be scope and
  12431. // the key value might be the zone name. Other examples might be a key
  12432. // indicating a deprecated resource and a suggested replacement, or a
  12433. // warning about invalid network settings (for example, if an instance
  12434. // attempts to perform IP forwarding but is not enabled for IP
  12435. // forwarding).
  12436. Key string `json:"key,omitempty"`
  12437. // Value: [Output Only] A warning data value corresponding to the key.
  12438. Value string `json:"value,omitempty"`
  12439. // ForceSendFields is a list of field names (e.g. "Key") to
  12440. // unconditionally include in API requests. By default, fields with
  12441. // empty values are omitted from API requests. However, any non-pointer,
  12442. // non-interface field appearing in ForceSendFields will be sent to the
  12443. // server regardless of whether the field is empty or not. This may be
  12444. // used to include empty fields in Patch requests.
  12445. ForceSendFields []string `json:"-"`
  12446. // NullFields is a list of field names (e.g. "Key") to include in API
  12447. // requests with the JSON null value. By default, fields with empty
  12448. // values are omitted from API requests. However, any field with an
  12449. // empty value appearing in NullFields will be sent to the server as
  12450. // null. It is an error if a field in this list has a non-empty value.
  12451. // This may be used to include null fields in Patch requests.
  12452. NullFields []string `json:"-"`
  12453. }
  12454. func (s *InstanceListWarningData) MarshalJSON() ([]byte, error) {
  12455. type NoMethod InstanceListWarningData
  12456. raw := NoMethod(*s)
  12457. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12458. }
  12459. // InstanceListReferrers: Contains a list of instance referrers.
  12460. type InstanceListReferrers struct {
  12461. // Id: [Output Only] Unique identifier for the resource; defined by the
  12462. // server.
  12463. Id string `json:"id,omitempty"`
  12464. // Items: A list of Reference resources.
  12465. Items []*Reference `json:"items,omitempty"`
  12466. // Kind: [Output Only] Type of resource. Always
  12467. // compute#instanceListReferrers for lists of Instance referrers.
  12468. Kind string `json:"kind,omitempty"`
  12469. // NextPageToken: [Output Only] This token allows you to get the next
  12470. // page of results for list requests. If the number of results is larger
  12471. // than maxResults, use the nextPageToken as a value for the query
  12472. // parameter pageToken in the next list request. Subsequent list
  12473. // requests will have their own nextPageToken to continue paging through
  12474. // the results.
  12475. NextPageToken string `json:"nextPageToken,omitempty"`
  12476. // SelfLink: [Output Only] Server-defined URL for this resource.
  12477. SelfLink string `json:"selfLink,omitempty"`
  12478. // Warning: [Output Only] Informational warning message.
  12479. Warning *InstanceListReferrersWarning `json:"warning,omitempty"`
  12480. // ServerResponse contains the HTTP response code and headers from the
  12481. // server.
  12482. googleapi.ServerResponse `json:"-"`
  12483. // ForceSendFields is a list of field names (e.g. "Id") to
  12484. // unconditionally include in API requests. By default, fields with
  12485. // empty values are omitted from API requests. However, any non-pointer,
  12486. // non-interface field appearing in ForceSendFields will be sent to the
  12487. // server regardless of whether the field is empty or not. This may be
  12488. // used to include empty fields in Patch requests.
  12489. ForceSendFields []string `json:"-"`
  12490. // NullFields is a list of field names (e.g. "Id") to include in API
  12491. // requests with the JSON null value. By default, fields with empty
  12492. // values are omitted from API requests. However, any field with an
  12493. // empty value appearing in NullFields will be sent to the server as
  12494. // null. It is an error if a field in this list has a non-empty value.
  12495. // This may be used to include null fields in Patch requests.
  12496. NullFields []string `json:"-"`
  12497. }
  12498. func (s *InstanceListReferrers) MarshalJSON() ([]byte, error) {
  12499. type NoMethod InstanceListReferrers
  12500. raw := NoMethod(*s)
  12501. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12502. }
  12503. // InstanceListReferrersWarning: [Output Only] Informational warning
  12504. // message.
  12505. type InstanceListReferrersWarning struct {
  12506. // Code: [Output Only] A warning code, if applicable. For example,
  12507. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  12508. // the response.
  12509. //
  12510. // Possible values:
  12511. // "CLEANUP_FAILED"
  12512. // "DEPRECATED_RESOURCE_USED"
  12513. // "DEPRECATED_TYPE_USED"
  12514. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  12515. // "EXPERIMENTAL_TYPE_USED"
  12516. // "EXTERNAL_API_WARNING"
  12517. // "FIELD_VALUE_OVERRIDEN"
  12518. // "INJECTED_KERNELS_DEPRECATED"
  12519. // "MISSING_TYPE_DEPENDENCY"
  12520. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  12521. // "NEXT_HOP_CANNOT_IP_FORWARD"
  12522. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  12523. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  12524. // "NEXT_HOP_NOT_RUNNING"
  12525. // "NOT_CRITICAL_ERROR"
  12526. // "NO_RESULTS_ON_PAGE"
  12527. // "REQUIRED_TOS_AGREEMENT"
  12528. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  12529. // "RESOURCE_NOT_DELETED"
  12530. // "SCHEMA_VALIDATION_IGNORED"
  12531. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  12532. // "UNDECLARED_PROPERTIES"
  12533. // "UNREACHABLE"
  12534. Code string `json:"code,omitempty"`
  12535. // Data: [Output Only] Metadata about this warning in key: value format.
  12536. // For example:
  12537. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  12538. Data []*InstanceListReferrersWarningData `json:"data,omitempty"`
  12539. // Message: [Output Only] A human-readable description of the warning
  12540. // code.
  12541. Message string `json:"message,omitempty"`
  12542. // ForceSendFields is a list of field names (e.g. "Code") to
  12543. // unconditionally include in API requests. By default, fields with
  12544. // empty values are omitted from API requests. However, any non-pointer,
  12545. // non-interface field appearing in ForceSendFields will be sent to the
  12546. // server regardless of whether the field is empty or not. This may be
  12547. // used to include empty fields in Patch requests.
  12548. ForceSendFields []string `json:"-"`
  12549. // NullFields is a list of field names (e.g. "Code") to include in API
  12550. // requests with the JSON null value. By default, fields with empty
  12551. // values are omitted from API requests. However, any field with an
  12552. // empty value appearing in NullFields will be sent to the server as
  12553. // null. It is an error if a field in this list has a non-empty value.
  12554. // This may be used to include null fields in Patch requests.
  12555. NullFields []string `json:"-"`
  12556. }
  12557. func (s *InstanceListReferrersWarning) MarshalJSON() ([]byte, error) {
  12558. type NoMethod InstanceListReferrersWarning
  12559. raw := NoMethod(*s)
  12560. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12561. }
  12562. type InstanceListReferrersWarningData struct {
  12563. // Key: [Output Only] A key that provides more detail on the warning
  12564. // being returned. For example, for warnings where there are no results
  12565. // in a list request for a particular zone, this key might be scope and
  12566. // the key value might be the zone name. Other examples might be a key
  12567. // indicating a deprecated resource and a suggested replacement, or a
  12568. // warning about invalid network settings (for example, if an instance
  12569. // attempts to perform IP forwarding but is not enabled for IP
  12570. // forwarding).
  12571. Key string `json:"key,omitempty"`
  12572. // Value: [Output Only] A warning data value corresponding to the key.
  12573. Value string `json:"value,omitempty"`
  12574. // ForceSendFields is a list of field names (e.g. "Key") to
  12575. // unconditionally include in API requests. By default, fields with
  12576. // empty values are omitted from API requests. However, any non-pointer,
  12577. // non-interface field appearing in ForceSendFields will be sent to the
  12578. // server regardless of whether the field is empty or not. This may be
  12579. // used to include empty fields in Patch requests.
  12580. ForceSendFields []string `json:"-"`
  12581. // NullFields is a list of field names (e.g. "Key") to include in API
  12582. // requests with the JSON null value. By default, fields with empty
  12583. // values are omitted from API requests. However, any field with an
  12584. // empty value appearing in NullFields will be sent to the server as
  12585. // null. It is an error if a field in this list has a non-empty value.
  12586. // This may be used to include null fields in Patch requests.
  12587. NullFields []string `json:"-"`
  12588. }
  12589. func (s *InstanceListReferrersWarningData) MarshalJSON() ([]byte, error) {
  12590. type NoMethod InstanceListReferrersWarningData
  12591. raw := NoMethod(*s)
  12592. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12593. }
  12594. type InstanceMoveRequest struct {
  12595. // DestinationZone: The URL of the destination zone to move the
  12596. // instance. This can be a full or partial URL. For example, the
  12597. // following are all valid URLs to a zone:
  12598. // - https://www.googleapis.com/compute/v1/projects/project/zones/zone
  12599. //
  12600. // - projects/project/zones/zone
  12601. // - zones/zone
  12602. DestinationZone string `json:"destinationZone,omitempty"`
  12603. // TargetInstance: The URL of the target instance to move. This can be a
  12604. // full or partial URL. For example, the following are all valid URLs to
  12605. // an instance:
  12606. // -
  12607. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance
  12608. // - projects/project/zones/zone/instances/instance
  12609. // - zones/zone/instances/instance
  12610. TargetInstance string `json:"targetInstance,omitempty"`
  12611. // ForceSendFields is a list of field names (e.g. "DestinationZone") to
  12612. // unconditionally include in API requests. By default, fields with
  12613. // empty values are omitted from API requests. However, any non-pointer,
  12614. // non-interface field appearing in ForceSendFields will be sent to the
  12615. // server regardless of whether the field is empty or not. This may be
  12616. // used to include empty fields in Patch requests.
  12617. ForceSendFields []string `json:"-"`
  12618. // NullFields is a list of field names (e.g. "DestinationZone") to
  12619. // include in API requests with the JSON null value. By default, fields
  12620. // with empty values are omitted from API requests. However, any field
  12621. // with an empty value appearing in NullFields will be sent to the
  12622. // server as null. It is an error if a field in this list has a
  12623. // non-empty value. This may be used to include null fields in Patch
  12624. // requests.
  12625. NullFields []string `json:"-"`
  12626. }
  12627. func (s *InstanceMoveRequest) MarshalJSON() ([]byte, error) {
  12628. type NoMethod InstanceMoveRequest
  12629. raw := NoMethod(*s)
  12630. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12631. }
  12632. type InstanceProperties struct {
  12633. // CanIpForward: Enables instances created based on this template to
  12634. // send packets with source IP addresses other than their own and
  12635. // receive packets with destination IP addresses other than their own.
  12636. // If these instances will be used as an IP gateway or it will be set as
  12637. // the next-hop in a Route resource, specify true. If unsure, leave this
  12638. // set to false. See the Enable IP forwarding documentation for more
  12639. // information.
  12640. CanIpForward bool `json:"canIpForward,omitempty"`
  12641. // Description: An optional text description for the instances that are
  12642. // created from this instance template.
  12643. Description string `json:"description,omitempty"`
  12644. // Disks: An array of disks that are associated with the instances that
  12645. // are created from this template.
  12646. Disks []*AttachedDisk `json:"disks,omitempty"`
  12647. // GuestAccelerators: A list of guest accelerator cards' type and count
  12648. // to use for instances created from the instance template.
  12649. GuestAccelerators []*AcceleratorConfig `json:"guestAccelerators,omitempty"`
  12650. // Labels: Labels to apply to instances that are created from this
  12651. // template.
  12652. Labels map[string]string `json:"labels,omitempty"`
  12653. // MachineType: The machine type to use for instances that are created
  12654. // from this template.
  12655. MachineType string `json:"machineType,omitempty"`
  12656. // Metadata: The metadata key/value pairs to assign to instances that
  12657. // are created from this template. These pairs can consist of custom
  12658. // metadata or predefined keys. See Project and instance metadata for
  12659. // more information.
  12660. Metadata *Metadata `json:"metadata,omitempty"`
  12661. // MinCpuPlatform: Minimum cpu/platform to be used by this instance. The
  12662. // instance may be scheduled on the specified or newer cpu/platform.
  12663. // Applicable values are the friendly names of CPU platforms, such as
  12664. // minCpuPlatform: "Intel Haswell" or minCpuPlatform: "Intel Sandy
  12665. // Bridge". For more information, read Specifying a Minimum CPU
  12666. // Platform.
  12667. MinCpuPlatform string `json:"minCpuPlatform,omitempty"`
  12668. // NetworkInterfaces: An array of network access configurations for this
  12669. // interface.
  12670. NetworkInterfaces []*NetworkInterface `json:"networkInterfaces,omitempty"`
  12671. // Scheduling: Specifies the scheduling options for the instances that
  12672. // are created from this template.
  12673. Scheduling *Scheduling `json:"scheduling,omitempty"`
  12674. // ServiceAccounts: A list of service accounts with specified scopes.
  12675. // Access tokens for these service accounts are available to the
  12676. // instances that are created from this template. Use metadata queries
  12677. // to obtain the access tokens for these instances.
  12678. ServiceAccounts []*ServiceAccount `json:"serviceAccounts,omitempty"`
  12679. // ShieldedVmConfig: Specifies the Shielded VM options for the instances
  12680. // that are created from this template.
  12681. ShieldedVmConfig *ShieldedVmConfig `json:"shieldedVmConfig,omitempty"`
  12682. // Tags: A list of tags to apply to the instances that are created from
  12683. // this template. The tags identify valid sources or targets for network
  12684. // firewalls. The setTags method can modify this list of tags. Each tag
  12685. // within the list must comply with RFC1035.
  12686. Tags *Tags `json:"tags,omitempty"`
  12687. // ForceSendFields is a list of field names (e.g. "CanIpForward") to
  12688. // unconditionally include in API requests. By default, fields with
  12689. // empty values are omitted from API requests. However, any non-pointer,
  12690. // non-interface field appearing in ForceSendFields will be sent to the
  12691. // server regardless of whether the field is empty or not. This may be
  12692. // used to include empty fields in Patch requests.
  12693. ForceSendFields []string `json:"-"`
  12694. // NullFields is a list of field names (e.g. "CanIpForward") to include
  12695. // in API requests with the JSON null value. By default, fields with
  12696. // empty values are omitted from API requests. However, any field with
  12697. // an empty value appearing in NullFields will be sent to the server as
  12698. // null. It is an error if a field in this list has a non-empty value.
  12699. // This may be used to include null fields in Patch requests.
  12700. NullFields []string `json:"-"`
  12701. }
  12702. func (s *InstanceProperties) MarshalJSON() ([]byte, error) {
  12703. type NoMethod InstanceProperties
  12704. raw := NoMethod(*s)
  12705. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12706. }
  12707. type InstanceReference struct {
  12708. // Instance: The URL for a specific instance.
  12709. Instance string `json:"instance,omitempty"`
  12710. // ForceSendFields is a list of field names (e.g. "Instance") to
  12711. // unconditionally include in API requests. By default, fields with
  12712. // empty values are omitted from API requests. However, any non-pointer,
  12713. // non-interface field appearing in ForceSendFields will be sent to the
  12714. // server regardless of whether the field is empty or not. This may be
  12715. // used to include empty fields in Patch requests.
  12716. ForceSendFields []string `json:"-"`
  12717. // NullFields is a list of field names (e.g. "Instance") to include in
  12718. // API requests with the JSON null value. By default, fields with empty
  12719. // values are omitted from API requests. However, any field with an
  12720. // empty value appearing in NullFields will be sent to the server as
  12721. // null. It is an error if a field in this list has a non-empty value.
  12722. // This may be used to include null fields in Patch requests.
  12723. NullFields []string `json:"-"`
  12724. }
  12725. func (s *InstanceReference) MarshalJSON() ([]byte, error) {
  12726. type NoMethod InstanceReference
  12727. raw := NoMethod(*s)
  12728. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12729. }
  12730. // InstanceTemplate: An Instance Template resource. (== resource_for
  12731. // beta.instanceTemplates ==) (== resource_for v1.instanceTemplates ==)
  12732. type InstanceTemplate struct {
  12733. // CreationTimestamp: [Output Only] The creation timestamp for this
  12734. // instance template in RFC3339 text format.
  12735. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  12736. // Description: An optional description of this resource. Provide this
  12737. // property when you create the resource.
  12738. Description string `json:"description,omitempty"`
  12739. // Id: [Output Only] A unique identifier for this instance template. The
  12740. // server defines this identifier.
  12741. Id uint64 `json:"id,omitempty,string"`
  12742. // Kind: [Output Only] The resource type, which is always
  12743. // compute#instanceTemplate for instance templates.
  12744. Kind string `json:"kind,omitempty"`
  12745. // Name: Name of the resource; provided by the client when the resource
  12746. // is created. The name must be 1-63 characters long, and comply with
  12747. // RFC1035. Specifically, the name must be 1-63 characters long and
  12748. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  12749. // the first character must be a lowercase letter, and all following
  12750. // characters must be a dash, lowercase letter, or digit, except the
  12751. // last character, which cannot be a dash.
  12752. Name string `json:"name,omitempty"`
  12753. // Properties: The instance properties for this instance template.
  12754. Properties *InstanceProperties `json:"properties,omitempty"`
  12755. // SelfLink: [Output Only] The URL for this instance template. The
  12756. // server defines this URL.
  12757. SelfLink string `json:"selfLink,omitempty"`
  12758. // SourceInstance: The source instance used to create the template. You
  12759. // can provide this as a partial or full URL to the resource. For
  12760. // example, the following are valid values:
  12761. // -
  12762. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance
  12763. // - projects/project/zones/zone/instances/instance
  12764. SourceInstance string `json:"sourceInstance,omitempty"`
  12765. // SourceInstanceParams: The source instance params to use to create
  12766. // this instance template.
  12767. SourceInstanceParams *SourceInstanceParams `json:"sourceInstanceParams,omitempty"`
  12768. // ServerResponse contains the HTTP response code and headers from the
  12769. // server.
  12770. googleapi.ServerResponse `json:"-"`
  12771. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  12772. // to unconditionally include in API requests. By default, fields with
  12773. // empty values are omitted from API requests. However, any non-pointer,
  12774. // non-interface field appearing in ForceSendFields will be sent to the
  12775. // server regardless of whether the field is empty or not. This may be
  12776. // used to include empty fields in Patch requests.
  12777. ForceSendFields []string `json:"-"`
  12778. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  12779. // include in API requests with the JSON null value. By default, fields
  12780. // with empty values are omitted from API requests. However, any field
  12781. // with an empty value appearing in NullFields will be sent to the
  12782. // server as null. It is an error if a field in this list has a
  12783. // non-empty value. This may be used to include null fields in Patch
  12784. // requests.
  12785. NullFields []string `json:"-"`
  12786. }
  12787. func (s *InstanceTemplate) MarshalJSON() ([]byte, error) {
  12788. type NoMethod InstanceTemplate
  12789. raw := NoMethod(*s)
  12790. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12791. }
  12792. // InstanceTemplateList: A list of instance templates.
  12793. type InstanceTemplateList struct {
  12794. // Id: [Output Only] Unique identifier for the resource; defined by the
  12795. // server.
  12796. Id string `json:"id,omitempty"`
  12797. // Items: A list of InstanceTemplate resources.
  12798. Items []*InstanceTemplate `json:"items,omitempty"`
  12799. // Kind: [Output Only] The resource type, which is always
  12800. // compute#instanceTemplatesListResponse for instance template lists.
  12801. Kind string `json:"kind,omitempty"`
  12802. // NextPageToken: [Output Only] This token allows you to get the next
  12803. // page of results for list requests. If the number of results is larger
  12804. // than maxResults, use the nextPageToken as a value for the query
  12805. // parameter pageToken in the next list request. Subsequent list
  12806. // requests will have their own nextPageToken to continue paging through
  12807. // the results.
  12808. NextPageToken string `json:"nextPageToken,omitempty"`
  12809. // SelfLink: [Output Only] Server-defined URL for this resource.
  12810. SelfLink string `json:"selfLink,omitempty"`
  12811. // Warning: [Output Only] Informational warning message.
  12812. Warning *InstanceTemplateListWarning `json:"warning,omitempty"`
  12813. // ServerResponse contains the HTTP response code and headers from the
  12814. // server.
  12815. googleapi.ServerResponse `json:"-"`
  12816. // ForceSendFields is a list of field names (e.g. "Id") to
  12817. // unconditionally include in API requests. By default, fields with
  12818. // empty values are omitted from API requests. However, any non-pointer,
  12819. // non-interface field appearing in ForceSendFields will be sent to the
  12820. // server regardless of whether the field is empty or not. This may be
  12821. // used to include empty fields in Patch requests.
  12822. ForceSendFields []string `json:"-"`
  12823. // NullFields is a list of field names (e.g. "Id") to include in API
  12824. // requests with the JSON null value. By default, fields with empty
  12825. // values are omitted from API requests. However, any field with an
  12826. // empty value appearing in NullFields will be sent to the server as
  12827. // null. It is an error if a field in this list has a non-empty value.
  12828. // This may be used to include null fields in Patch requests.
  12829. NullFields []string `json:"-"`
  12830. }
  12831. func (s *InstanceTemplateList) MarshalJSON() ([]byte, error) {
  12832. type NoMethod InstanceTemplateList
  12833. raw := NoMethod(*s)
  12834. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12835. }
  12836. // InstanceTemplateListWarning: [Output Only] Informational warning
  12837. // message.
  12838. type InstanceTemplateListWarning struct {
  12839. // Code: [Output Only] A warning code, if applicable. For example,
  12840. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  12841. // the response.
  12842. //
  12843. // Possible values:
  12844. // "CLEANUP_FAILED"
  12845. // "DEPRECATED_RESOURCE_USED"
  12846. // "DEPRECATED_TYPE_USED"
  12847. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  12848. // "EXPERIMENTAL_TYPE_USED"
  12849. // "EXTERNAL_API_WARNING"
  12850. // "FIELD_VALUE_OVERRIDEN"
  12851. // "INJECTED_KERNELS_DEPRECATED"
  12852. // "MISSING_TYPE_DEPENDENCY"
  12853. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  12854. // "NEXT_HOP_CANNOT_IP_FORWARD"
  12855. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  12856. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  12857. // "NEXT_HOP_NOT_RUNNING"
  12858. // "NOT_CRITICAL_ERROR"
  12859. // "NO_RESULTS_ON_PAGE"
  12860. // "REQUIRED_TOS_AGREEMENT"
  12861. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  12862. // "RESOURCE_NOT_DELETED"
  12863. // "SCHEMA_VALIDATION_IGNORED"
  12864. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  12865. // "UNDECLARED_PROPERTIES"
  12866. // "UNREACHABLE"
  12867. Code string `json:"code,omitempty"`
  12868. // Data: [Output Only] Metadata about this warning in key: value format.
  12869. // For example:
  12870. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  12871. Data []*InstanceTemplateListWarningData `json:"data,omitempty"`
  12872. // Message: [Output Only] A human-readable description of the warning
  12873. // code.
  12874. Message string `json:"message,omitempty"`
  12875. // ForceSendFields is a list of field names (e.g. "Code") to
  12876. // unconditionally include in API requests. By default, fields with
  12877. // empty values are omitted from API requests. However, any non-pointer,
  12878. // non-interface field appearing in ForceSendFields will be sent to the
  12879. // server regardless of whether the field is empty or not. This may be
  12880. // used to include empty fields in Patch requests.
  12881. ForceSendFields []string `json:"-"`
  12882. // NullFields is a list of field names (e.g. "Code") to include in API
  12883. // requests with the JSON null value. By default, fields with empty
  12884. // values are omitted from API requests. However, any field with an
  12885. // empty value appearing in NullFields will be sent to the server as
  12886. // null. It is an error if a field in this list has a non-empty value.
  12887. // This may be used to include null fields in Patch requests.
  12888. NullFields []string `json:"-"`
  12889. }
  12890. func (s *InstanceTemplateListWarning) MarshalJSON() ([]byte, error) {
  12891. type NoMethod InstanceTemplateListWarning
  12892. raw := NoMethod(*s)
  12893. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12894. }
  12895. type InstanceTemplateListWarningData struct {
  12896. // Key: [Output Only] A key that provides more detail on the warning
  12897. // being returned. For example, for warnings where there are no results
  12898. // in a list request for a particular zone, this key might be scope and
  12899. // the key value might be the zone name. Other examples might be a key
  12900. // indicating a deprecated resource and a suggested replacement, or a
  12901. // warning about invalid network settings (for example, if an instance
  12902. // attempts to perform IP forwarding but is not enabled for IP
  12903. // forwarding).
  12904. Key string `json:"key,omitempty"`
  12905. // Value: [Output Only] A warning data value corresponding to the key.
  12906. Value string `json:"value,omitempty"`
  12907. // ForceSendFields is a list of field names (e.g. "Key") to
  12908. // unconditionally include in API requests. By default, fields with
  12909. // empty values are omitted from API requests. However, any non-pointer,
  12910. // non-interface field appearing in ForceSendFields will be sent to the
  12911. // server regardless of whether the field is empty or not. This may be
  12912. // used to include empty fields in Patch requests.
  12913. ForceSendFields []string `json:"-"`
  12914. // NullFields is a list of field names (e.g. "Key") to include in API
  12915. // requests with the JSON null value. By default, fields with empty
  12916. // values are omitted from API requests. However, any field with an
  12917. // empty value appearing in NullFields will be sent to the server as
  12918. // null. It is an error if a field in this list has a non-empty value.
  12919. // This may be used to include null fields in Patch requests.
  12920. NullFields []string `json:"-"`
  12921. }
  12922. func (s *InstanceTemplateListWarningData) MarshalJSON() ([]byte, error) {
  12923. type NoMethod InstanceTemplateListWarningData
  12924. raw := NoMethod(*s)
  12925. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12926. }
  12927. type InstanceWithNamedPorts struct {
  12928. // Instance: [Output Only] The URL of the instance.
  12929. Instance string `json:"instance,omitempty"`
  12930. // NamedPorts: [Output Only] The named ports that belong to this
  12931. // instance group.
  12932. NamedPorts []*NamedPort `json:"namedPorts,omitempty"`
  12933. // Status: [Output Only] The status of the instance.
  12934. //
  12935. // Possible values:
  12936. // "PROVISIONING"
  12937. // "RUNNING"
  12938. // "STAGING"
  12939. // "STOPPED"
  12940. // "STOPPING"
  12941. // "SUSPENDED"
  12942. // "SUSPENDING"
  12943. // "TERMINATED"
  12944. Status string `json:"status,omitempty"`
  12945. // ForceSendFields is a list of field names (e.g. "Instance") to
  12946. // unconditionally include in API requests. By default, fields with
  12947. // empty values are omitted from API requests. However, any non-pointer,
  12948. // non-interface field appearing in ForceSendFields will be sent to the
  12949. // server regardless of whether the field is empty or not. This may be
  12950. // used to include empty fields in Patch requests.
  12951. ForceSendFields []string `json:"-"`
  12952. // NullFields is a list of field names (e.g. "Instance") to include in
  12953. // API requests with the JSON null value. By default, fields with empty
  12954. // values are omitted from API requests. However, any field with an
  12955. // empty value appearing in NullFields will be sent to the server as
  12956. // null. It is an error if a field in this list has a non-empty value.
  12957. // This may be used to include null fields in Patch requests.
  12958. NullFields []string `json:"-"`
  12959. }
  12960. func (s *InstanceWithNamedPorts) MarshalJSON() ([]byte, error) {
  12961. type NoMethod InstanceWithNamedPorts
  12962. raw := NoMethod(*s)
  12963. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12964. }
  12965. type InstancesAddResourcePoliciesRequest struct {
  12966. // ResourcePolicies: Resource policies to be added to this instance.
  12967. ResourcePolicies []string `json:"resourcePolicies,omitempty"`
  12968. // ForceSendFields is a list of field names (e.g. "ResourcePolicies") to
  12969. // unconditionally include in API requests. By default, fields with
  12970. // empty values are omitted from API requests. However, any non-pointer,
  12971. // non-interface field appearing in ForceSendFields will be sent to the
  12972. // server regardless of whether the field is empty or not. This may be
  12973. // used to include empty fields in Patch requests.
  12974. ForceSendFields []string `json:"-"`
  12975. // NullFields is a list of field names (e.g. "ResourcePolicies") to
  12976. // include in API requests with the JSON null value. By default, fields
  12977. // with empty values are omitted from API requests. However, any field
  12978. // with an empty value appearing in NullFields will be sent to the
  12979. // server as null. It is an error if a field in this list has a
  12980. // non-empty value. This may be used to include null fields in Patch
  12981. // requests.
  12982. NullFields []string `json:"-"`
  12983. }
  12984. func (s *InstancesAddResourcePoliciesRequest) MarshalJSON() ([]byte, error) {
  12985. type NoMethod InstancesAddResourcePoliciesRequest
  12986. raw := NoMethod(*s)
  12987. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12988. }
  12989. type InstancesRemoveResourcePoliciesRequest struct {
  12990. // ResourcePolicies: Resource policies to be removed from this instance.
  12991. ResourcePolicies []string `json:"resourcePolicies,omitempty"`
  12992. // ForceSendFields is a list of field names (e.g. "ResourcePolicies") to
  12993. // unconditionally include in API requests. By default, fields with
  12994. // empty values are omitted from API requests. However, any non-pointer,
  12995. // non-interface field appearing in ForceSendFields will be sent to the
  12996. // server regardless of whether the field is empty or not. This may be
  12997. // used to include empty fields in Patch requests.
  12998. ForceSendFields []string `json:"-"`
  12999. // NullFields is a list of field names (e.g. "ResourcePolicies") to
  13000. // include in API requests with the JSON null value. By default, fields
  13001. // with empty values are omitted from API requests. However, any field
  13002. // with an empty value appearing in NullFields will be sent to the
  13003. // server as null. It is an error if a field in this list has a
  13004. // non-empty value. This may be used to include null fields in Patch
  13005. // requests.
  13006. NullFields []string `json:"-"`
  13007. }
  13008. func (s *InstancesRemoveResourcePoliciesRequest) MarshalJSON() ([]byte, error) {
  13009. type NoMethod InstancesRemoveResourcePoliciesRequest
  13010. raw := NoMethod(*s)
  13011. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13012. }
  13013. type InstancesResumeRequest struct {
  13014. // Disks: Array of disks associated with this instance that are
  13015. // protected with a customer-supplied encryption key.
  13016. //
  13017. // In order to resume the instance, the disk url and its corresponding
  13018. // key must be provided.
  13019. //
  13020. // If the disk is not protected with a customer-supplied encryption key
  13021. // it should not be specified.
  13022. Disks []*CustomerEncryptionKeyProtectedDisk `json:"disks,omitempty"`
  13023. // InstanceEncryptionKey: Decrypts data associated with an instance that
  13024. // is protected with a customer-supplied encryption key.
  13025. //
  13026. // If the instance you are starting is protected with a
  13027. // customer-supplied encryption key, the correct key must be provided
  13028. // otherwise the instance resume will not succeed.
  13029. InstanceEncryptionKey *CustomerEncryptionKey `json:"instanceEncryptionKey,omitempty"`
  13030. // ForceSendFields is a list of field names (e.g. "Disks") to
  13031. // unconditionally include in API requests. By default, fields with
  13032. // empty values are omitted from API requests. However, any non-pointer,
  13033. // non-interface field appearing in ForceSendFields will be sent to the
  13034. // server regardless of whether the field is empty or not. This may be
  13035. // used to include empty fields in Patch requests.
  13036. ForceSendFields []string `json:"-"`
  13037. // NullFields is a list of field names (e.g. "Disks") to include in API
  13038. // requests with the JSON null value. By default, fields with empty
  13039. // values are omitted from API requests. However, any field with an
  13040. // empty value appearing in NullFields will be sent to the server as
  13041. // null. It is an error if a field in this list has a non-empty value.
  13042. // This may be used to include null fields in Patch requests.
  13043. NullFields []string `json:"-"`
  13044. }
  13045. func (s *InstancesResumeRequest) MarshalJSON() ([]byte, error) {
  13046. type NoMethod InstancesResumeRequest
  13047. raw := NoMethod(*s)
  13048. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13049. }
  13050. type InstancesScopedList struct {
  13051. // Instances: [Output Only] A list of instances contained in this scope.
  13052. Instances []*Instance `json:"instances,omitempty"`
  13053. // Warning: [Output Only] Informational warning which replaces the list
  13054. // of instances when the list is empty.
  13055. Warning *InstancesScopedListWarning `json:"warning,omitempty"`
  13056. // ForceSendFields is a list of field names (e.g. "Instances") to
  13057. // unconditionally include in API requests. By default, fields with
  13058. // empty values are omitted from API requests. However, any non-pointer,
  13059. // non-interface field appearing in ForceSendFields will be sent to the
  13060. // server regardless of whether the field is empty or not. This may be
  13061. // used to include empty fields in Patch requests.
  13062. ForceSendFields []string `json:"-"`
  13063. // NullFields is a list of field names (e.g. "Instances") to include in
  13064. // API requests with the JSON null value. By default, fields with empty
  13065. // values are omitted from API requests. However, any field with an
  13066. // empty value appearing in NullFields will be sent to the server as
  13067. // null. It is an error if a field in this list has a non-empty value.
  13068. // This may be used to include null fields in Patch requests.
  13069. NullFields []string `json:"-"`
  13070. }
  13071. func (s *InstancesScopedList) MarshalJSON() ([]byte, error) {
  13072. type NoMethod InstancesScopedList
  13073. raw := NoMethod(*s)
  13074. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13075. }
  13076. // InstancesScopedListWarning: [Output Only] Informational warning which
  13077. // replaces the list of instances when the list is empty.
  13078. type InstancesScopedListWarning struct {
  13079. // Code: [Output Only] A warning code, if applicable. For example,
  13080. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  13081. // the response.
  13082. //
  13083. // Possible values:
  13084. // "CLEANUP_FAILED"
  13085. // "DEPRECATED_RESOURCE_USED"
  13086. // "DEPRECATED_TYPE_USED"
  13087. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  13088. // "EXPERIMENTAL_TYPE_USED"
  13089. // "EXTERNAL_API_WARNING"
  13090. // "FIELD_VALUE_OVERRIDEN"
  13091. // "INJECTED_KERNELS_DEPRECATED"
  13092. // "MISSING_TYPE_DEPENDENCY"
  13093. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  13094. // "NEXT_HOP_CANNOT_IP_FORWARD"
  13095. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  13096. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  13097. // "NEXT_HOP_NOT_RUNNING"
  13098. // "NOT_CRITICAL_ERROR"
  13099. // "NO_RESULTS_ON_PAGE"
  13100. // "REQUIRED_TOS_AGREEMENT"
  13101. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  13102. // "RESOURCE_NOT_DELETED"
  13103. // "SCHEMA_VALIDATION_IGNORED"
  13104. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  13105. // "UNDECLARED_PROPERTIES"
  13106. // "UNREACHABLE"
  13107. Code string `json:"code,omitempty"`
  13108. // Data: [Output Only] Metadata about this warning in key: value format.
  13109. // For example:
  13110. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  13111. Data []*InstancesScopedListWarningData `json:"data,omitempty"`
  13112. // Message: [Output Only] A human-readable description of the warning
  13113. // code.
  13114. Message string `json:"message,omitempty"`
  13115. // ForceSendFields is a list of field names (e.g. "Code") to
  13116. // unconditionally include in API requests. By default, fields with
  13117. // empty values are omitted from API requests. However, any non-pointer,
  13118. // non-interface field appearing in ForceSendFields will be sent to the
  13119. // server regardless of whether the field is empty or not. This may be
  13120. // used to include empty fields in Patch requests.
  13121. ForceSendFields []string `json:"-"`
  13122. // NullFields is a list of field names (e.g. "Code") to include in API
  13123. // requests with the JSON null value. By default, fields with empty
  13124. // values are omitted from API requests. However, any field with an
  13125. // empty value appearing in NullFields will be sent to the server as
  13126. // null. It is an error if a field in this list has a non-empty value.
  13127. // This may be used to include null fields in Patch requests.
  13128. NullFields []string `json:"-"`
  13129. }
  13130. func (s *InstancesScopedListWarning) MarshalJSON() ([]byte, error) {
  13131. type NoMethod InstancesScopedListWarning
  13132. raw := NoMethod(*s)
  13133. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13134. }
  13135. type InstancesScopedListWarningData struct {
  13136. // Key: [Output Only] A key that provides more detail on the warning
  13137. // being returned. For example, for warnings where there are no results
  13138. // in a list request for a particular zone, this key might be scope and
  13139. // the key value might be the zone name. Other examples might be a key
  13140. // indicating a deprecated resource and a suggested replacement, or a
  13141. // warning about invalid network settings (for example, if an instance
  13142. // attempts to perform IP forwarding but is not enabled for IP
  13143. // forwarding).
  13144. Key string `json:"key,omitempty"`
  13145. // Value: [Output Only] A warning data value corresponding to the key.
  13146. Value string `json:"value,omitempty"`
  13147. // ForceSendFields is a list of field names (e.g. "Key") to
  13148. // unconditionally include in API requests. By default, fields with
  13149. // empty values are omitted from API requests. However, any non-pointer,
  13150. // non-interface field appearing in ForceSendFields will be sent to the
  13151. // server regardless of whether the field is empty or not. This may be
  13152. // used to include empty fields in Patch requests.
  13153. ForceSendFields []string `json:"-"`
  13154. // NullFields is a list of field names (e.g. "Key") to include in API
  13155. // requests with the JSON null value. By default, fields with empty
  13156. // values are omitted from API requests. However, any field with an
  13157. // empty value appearing in NullFields will be sent to the server as
  13158. // null. It is an error if a field in this list has a non-empty value.
  13159. // This may be used to include null fields in Patch requests.
  13160. NullFields []string `json:"-"`
  13161. }
  13162. func (s *InstancesScopedListWarningData) MarshalJSON() ([]byte, error) {
  13163. type NoMethod InstancesScopedListWarningData
  13164. raw := NoMethod(*s)
  13165. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13166. }
  13167. type InstancesSetLabelsRequest struct {
  13168. // LabelFingerprint: Fingerprint of the previous set of labels for this
  13169. // resource, used to prevent conflicts. Provide the latest fingerprint
  13170. // value when making a request to add or change labels.
  13171. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  13172. Labels map[string]string `json:"labels,omitempty"`
  13173. // ForceSendFields is a list of field names (e.g. "LabelFingerprint") to
  13174. // unconditionally include in API requests. By default, fields with
  13175. // empty values are omitted from API requests. However, any non-pointer,
  13176. // non-interface field appearing in ForceSendFields will be sent to the
  13177. // server regardless of whether the field is empty or not. This may be
  13178. // used to include empty fields in Patch requests.
  13179. ForceSendFields []string `json:"-"`
  13180. // NullFields is a list of field names (e.g. "LabelFingerprint") to
  13181. // include in API requests with the JSON null value. By default, fields
  13182. // with empty values are omitted from API requests. However, any field
  13183. // with an empty value appearing in NullFields will be sent to the
  13184. // server as null. It is an error if a field in this list has a
  13185. // non-empty value. This may be used to include null fields in Patch
  13186. // requests.
  13187. NullFields []string `json:"-"`
  13188. }
  13189. func (s *InstancesSetLabelsRequest) MarshalJSON() ([]byte, error) {
  13190. type NoMethod InstancesSetLabelsRequest
  13191. raw := NoMethod(*s)
  13192. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13193. }
  13194. type InstancesSetMachineResourcesRequest struct {
  13195. // GuestAccelerators: A list of the type and count of accelerator cards
  13196. // attached to the instance.
  13197. GuestAccelerators []*AcceleratorConfig `json:"guestAccelerators,omitempty"`
  13198. // ForceSendFields is a list of field names (e.g. "GuestAccelerators")
  13199. // to unconditionally include in API requests. By default, fields with
  13200. // empty values are omitted from API requests. However, any non-pointer,
  13201. // non-interface field appearing in ForceSendFields will be sent to the
  13202. // server regardless of whether the field is empty or not. This may be
  13203. // used to include empty fields in Patch requests.
  13204. ForceSendFields []string `json:"-"`
  13205. // NullFields is a list of field names (e.g. "GuestAccelerators") to
  13206. // include in API requests with the JSON null value. By default, fields
  13207. // with empty values are omitted from API requests. However, any field
  13208. // with an empty value appearing in NullFields will be sent to the
  13209. // server as null. It is an error if a field in this list has a
  13210. // non-empty value. This may be used to include null fields in Patch
  13211. // requests.
  13212. NullFields []string `json:"-"`
  13213. }
  13214. func (s *InstancesSetMachineResourcesRequest) MarshalJSON() ([]byte, error) {
  13215. type NoMethod InstancesSetMachineResourcesRequest
  13216. raw := NoMethod(*s)
  13217. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13218. }
  13219. type InstancesSetMachineTypeRequest struct {
  13220. // MachineType: Full or partial URL of the machine type resource. See
  13221. // Machine Types for a full list of machine types. For example:
  13222. // zones/us-central1-f/machineTypes/n1-standard-1
  13223. MachineType string `json:"machineType,omitempty"`
  13224. // ForceSendFields is a list of field names (e.g. "MachineType") to
  13225. // unconditionally include in API requests. By default, fields with
  13226. // empty values are omitted from API requests. However, any non-pointer,
  13227. // non-interface field appearing in ForceSendFields will be sent to the
  13228. // server regardless of whether the field is empty or not. This may be
  13229. // used to include empty fields in Patch requests.
  13230. ForceSendFields []string `json:"-"`
  13231. // NullFields is a list of field names (e.g. "MachineType") to include
  13232. // in API requests with the JSON null value. By default, fields with
  13233. // empty values are omitted from API requests. However, any field with
  13234. // an empty value appearing in NullFields will be sent to the server as
  13235. // null. It is an error if a field in this list has a non-empty value.
  13236. // This may be used to include null fields in Patch requests.
  13237. NullFields []string `json:"-"`
  13238. }
  13239. func (s *InstancesSetMachineTypeRequest) MarshalJSON() ([]byte, error) {
  13240. type NoMethod InstancesSetMachineTypeRequest
  13241. raw := NoMethod(*s)
  13242. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13243. }
  13244. type InstancesSetMinCpuPlatformRequest struct {
  13245. // MinCpuPlatform: Minimum cpu/platform this instance should be started
  13246. // at.
  13247. MinCpuPlatform string `json:"minCpuPlatform,omitempty"`
  13248. // ForceSendFields is a list of field names (e.g. "MinCpuPlatform") to
  13249. // unconditionally include in API requests. By default, fields with
  13250. // empty values are omitted from API requests. However, any non-pointer,
  13251. // non-interface field appearing in ForceSendFields will be sent to the
  13252. // server regardless of whether the field is empty or not. This may be
  13253. // used to include empty fields in Patch requests.
  13254. ForceSendFields []string `json:"-"`
  13255. // NullFields is a list of field names (e.g. "MinCpuPlatform") to
  13256. // include in API requests with the JSON null value. By default, fields
  13257. // with empty values are omitted from API requests. However, any field
  13258. // with an empty value appearing in NullFields will be sent to the
  13259. // server as null. It is an error if a field in this list has a
  13260. // non-empty value. This may be used to include null fields in Patch
  13261. // requests.
  13262. NullFields []string `json:"-"`
  13263. }
  13264. func (s *InstancesSetMinCpuPlatformRequest) MarshalJSON() ([]byte, error) {
  13265. type NoMethod InstancesSetMinCpuPlatformRequest
  13266. raw := NoMethod(*s)
  13267. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13268. }
  13269. type InstancesSetServiceAccountRequest struct {
  13270. // Email: Email address of the service account.
  13271. Email string `json:"email,omitempty"`
  13272. // Scopes: The list of scopes to be made available for this service
  13273. // account.
  13274. Scopes []string `json:"scopes,omitempty"`
  13275. // ForceSendFields is a list of field names (e.g. "Email") to
  13276. // unconditionally include in API requests. By default, fields with
  13277. // empty values are omitted from API requests. However, any non-pointer,
  13278. // non-interface field appearing in ForceSendFields will be sent to the
  13279. // server regardless of whether the field is empty or not. This may be
  13280. // used to include empty fields in Patch requests.
  13281. ForceSendFields []string `json:"-"`
  13282. // NullFields is a list of field names (e.g. "Email") to include in API
  13283. // requests with the JSON null value. By default, fields with empty
  13284. // values are omitted from API requests. However, any field with an
  13285. // empty value appearing in NullFields will be sent to the server as
  13286. // null. It is an error if a field in this list has a non-empty value.
  13287. // This may be used to include null fields in Patch requests.
  13288. NullFields []string `json:"-"`
  13289. }
  13290. func (s *InstancesSetServiceAccountRequest) MarshalJSON() ([]byte, error) {
  13291. type NoMethod InstancesSetServiceAccountRequest
  13292. raw := NoMethod(*s)
  13293. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13294. }
  13295. type InstancesStartWithEncryptionKeyRequest struct {
  13296. // Disks: Array of disks associated with this instance that are
  13297. // protected with a customer-supplied encryption key.
  13298. //
  13299. // In order to start the instance, the disk url and its corresponding
  13300. // key must be provided.
  13301. //
  13302. // If the disk is not protected with a customer-supplied encryption key
  13303. // it should not be specified.
  13304. Disks []*CustomerEncryptionKeyProtectedDisk `json:"disks,omitempty"`
  13305. // InstanceEncryptionKey: Decrypts data associated with an instance that
  13306. // is protected with a customer-supplied encryption key.
  13307. //
  13308. // If the instance you are starting is protected with a
  13309. // customer-supplied encryption key, the correct key must be provided
  13310. // otherwise the instance start will not succeed.
  13311. InstanceEncryptionKey *CustomerEncryptionKey `json:"instanceEncryptionKey,omitempty"`
  13312. // ForceSendFields is a list of field names (e.g. "Disks") to
  13313. // unconditionally include in API requests. By default, fields with
  13314. // empty values are omitted from API requests. However, any non-pointer,
  13315. // non-interface field appearing in ForceSendFields will be sent to the
  13316. // server regardless of whether the field is empty or not. This may be
  13317. // used to include empty fields in Patch requests.
  13318. ForceSendFields []string `json:"-"`
  13319. // NullFields is a list of field names (e.g. "Disks") to include in API
  13320. // requests with the JSON null value. By default, fields with empty
  13321. // values are omitted from API requests. However, any field with an
  13322. // empty value appearing in NullFields will be sent to the server as
  13323. // null. It is an error if a field in this list has a non-empty value.
  13324. // This may be used to include null fields in Patch requests.
  13325. NullFields []string `json:"-"`
  13326. }
  13327. func (s *InstancesStartWithEncryptionKeyRequest) MarshalJSON() ([]byte, error) {
  13328. type NoMethod InstancesStartWithEncryptionKeyRequest
  13329. raw := NoMethod(*s)
  13330. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13331. }
  13332. // Interconnect: Represents an Interconnects resource. The Interconnects
  13333. // resource is a dedicated connection between Google's network and your
  13334. // on-premises network. For more information, see the Dedicated
  13335. // overview page. (== resource_for v1.interconnects ==) (== resource_for
  13336. // beta.interconnects ==)
  13337. type Interconnect struct {
  13338. // AdminEnabled: Administrative status of the interconnect. When this is
  13339. // set to true, the Interconnect is functional and can carry traffic.
  13340. // When set to false, no packets can be carried over the interconnect
  13341. // and no BGP routes are exchanged over it. By default, the status is
  13342. // set to true.
  13343. AdminEnabled bool `json:"adminEnabled,omitempty"`
  13344. // CircuitInfos: [Output Only] A list of CircuitInfo objects, that
  13345. // describe the individual circuits in this LAG.
  13346. CircuitInfos []*InterconnectCircuitInfo `json:"circuitInfos,omitempty"`
  13347. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  13348. // format.
  13349. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  13350. // CustomerName: Customer name, to put in the Letter of Authorization as
  13351. // the party authorized to request a crossconnect.
  13352. CustomerName string `json:"customerName,omitempty"`
  13353. // Description: An optional description of this resource. Provide this
  13354. // property when you create the resource.
  13355. Description string `json:"description,omitempty"`
  13356. // ExpectedOutages: [Output Only] A list of outages expected for this
  13357. // Interconnect.
  13358. ExpectedOutages []*InterconnectOutageNotification `json:"expectedOutages,omitempty"`
  13359. // GoogleIpAddress: [Output Only] IP address configured on the Google
  13360. // side of the Interconnect link. This can be used only for ping tests.
  13361. GoogleIpAddress string `json:"googleIpAddress,omitempty"`
  13362. // GoogleReferenceId: [Output Only] Google reference ID; to be used when
  13363. // raising support tickets with Google or otherwise to debug backend
  13364. // connectivity issues.
  13365. GoogleReferenceId string `json:"googleReferenceId,omitempty"`
  13366. // Id: [Output Only] The unique identifier for the resource. This
  13367. // identifier is defined by the server.
  13368. Id uint64 `json:"id,omitempty,string"`
  13369. // InterconnectAttachments: [Output Only] A list of the URLs of all
  13370. // InterconnectAttachments configured to use this Interconnect.
  13371. InterconnectAttachments []string `json:"interconnectAttachments,omitempty"`
  13372. // InterconnectType: Type of interconnect. Note that "IT_PRIVATE" has
  13373. // been deprecated in favor of "DEDICATED"
  13374. //
  13375. // Possible values:
  13376. // "DEDICATED"
  13377. // "IT_PRIVATE"
  13378. // "PARTNER"
  13379. InterconnectType string `json:"interconnectType,omitempty"`
  13380. // Kind: [Output Only] Type of the resource. Always compute#interconnect
  13381. // for interconnects.
  13382. Kind string `json:"kind,omitempty"`
  13383. // LabelFingerprint: A fingerprint for the labels being applied to this
  13384. // Interconnect, which is essentially a hash of the labels set used for
  13385. // optimistic locking. The fingerprint is initially generated by Compute
  13386. // Engine and changes after every request to modify or update labels.
  13387. // You must always provide an up-to-date fingerprint hash in order to
  13388. // update or change labels.
  13389. //
  13390. // To see the latest fingerprint, make a get() request to retrieve an
  13391. // Interconnect.
  13392. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  13393. // Labels: Labels to apply to this Interconnect resource. These can be
  13394. // later modified by the setLabels method. Each label key/value must
  13395. // comply with RFC1035. Label values may be empty.
  13396. Labels map[string]string `json:"labels,omitempty"`
  13397. // LinkType: Type of link requested. This field indicates speed of each
  13398. // of the links in the bundle, not the entire bundle. Only 10G per link
  13399. // is allowed for a dedicated interconnect. Options: Ethernet_10G_LR
  13400. //
  13401. // Possible values:
  13402. // "LINK_TYPE_ETHERNET_10G_LR"
  13403. LinkType string `json:"linkType,omitempty"`
  13404. // Location: URL of the InterconnectLocation object that represents
  13405. // where this connection is to be provisioned.
  13406. Location string `json:"location,omitempty"`
  13407. // Name: Name of the resource. Provided by the client when the resource
  13408. // is created. The name must be 1-63 characters long, and comply with
  13409. // RFC1035. Specifically, the name must be 1-63 characters long and
  13410. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  13411. // the first character must be a lowercase letter, and all following
  13412. // characters must be a dash, lowercase letter, or digit, except the
  13413. // last character, which cannot be a dash.
  13414. Name string `json:"name,omitempty"`
  13415. // NocContactEmail: Email address to contact the customer NOC for
  13416. // operations and maintenance notifications regarding this Interconnect.
  13417. // If specified, this will be used for notifications in addition to all
  13418. // other forms described, such as Stackdriver logs alerting and Cloud
  13419. // Notifications.
  13420. NocContactEmail string `json:"nocContactEmail,omitempty"`
  13421. // OperationalStatus: [Output Only] The current status of whether or not
  13422. // this Interconnect is functional.
  13423. //
  13424. // Possible values:
  13425. // "OS_ACTIVE"
  13426. // "OS_UNPROVISIONED"
  13427. OperationalStatus string `json:"operationalStatus,omitempty"`
  13428. // PeerIpAddress: [Output Only] IP address configured on the customer
  13429. // side of the Interconnect link. The customer should configure this IP
  13430. // address during turnup when prompted by Google NOC. This can be used
  13431. // only for ping tests.
  13432. PeerIpAddress string `json:"peerIpAddress,omitempty"`
  13433. // ProvisionedLinkCount: [Output Only] Number of links actually
  13434. // provisioned in this interconnect.
  13435. ProvisionedLinkCount int64 `json:"provisionedLinkCount,omitempty"`
  13436. // RequestedLinkCount: Target number of physical links in the link
  13437. // bundle, as requested by the customer.
  13438. RequestedLinkCount int64 `json:"requestedLinkCount,omitempty"`
  13439. // SelfLink: [Output Only] Server-defined URL for the resource.
  13440. SelfLink string `json:"selfLink,omitempty"`
  13441. // State: [Output Only] The current state of whether or not this
  13442. // Interconnect is functional.
  13443. //
  13444. // Possible values:
  13445. // "ACTIVE"
  13446. // "UNPROVISIONED"
  13447. State string `json:"state,omitempty"`
  13448. // ServerResponse contains the HTTP response code and headers from the
  13449. // server.
  13450. googleapi.ServerResponse `json:"-"`
  13451. // ForceSendFields is a list of field names (e.g. "AdminEnabled") to
  13452. // unconditionally include in API requests. By default, fields with
  13453. // empty values are omitted from API requests. However, any non-pointer,
  13454. // non-interface field appearing in ForceSendFields will be sent to the
  13455. // server regardless of whether the field is empty or not. This may be
  13456. // used to include empty fields in Patch requests.
  13457. ForceSendFields []string `json:"-"`
  13458. // NullFields is a list of field names (e.g. "AdminEnabled") to include
  13459. // in API requests with the JSON null value. By default, fields with
  13460. // empty values are omitted from API requests. However, any field with
  13461. // an empty value appearing in NullFields will be sent to the server as
  13462. // null. It is an error if a field in this list has a non-empty value.
  13463. // This may be used to include null fields in Patch requests.
  13464. NullFields []string `json:"-"`
  13465. }
  13466. func (s *Interconnect) MarshalJSON() ([]byte, error) {
  13467. type NoMethod Interconnect
  13468. raw := NoMethod(*s)
  13469. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13470. }
  13471. // InterconnectAttachment: Represents an InterconnectAttachment (VLAN
  13472. // attachment) resource. For more information, see Creating VLAN
  13473. // Attachments. (== resource_for beta.interconnectAttachments ==) (==
  13474. // resource_for v1.interconnectAttachments ==)
  13475. type InterconnectAttachment struct {
  13476. // AdminEnabled: Determines whether this Attachment will carry packets.
  13477. // Not present for PARTNER_PROVIDER.
  13478. AdminEnabled bool `json:"adminEnabled,omitempty"`
  13479. // AvailabilityZone: [Deprecated] Replaced by edge_availability_domain.
  13480. //
  13481. // Possible values:
  13482. // "ZONE_1"
  13483. // "ZONE_2"
  13484. // "ZONE_ANY"
  13485. AvailabilityZone string `json:"availabilityZone,omitempty"`
  13486. // Bandwidth: Provisioned bandwidth capacity for the
  13487. // interconnectAttachment. Can be set by the partner to update the
  13488. // customer's provisioned bandwidth. Output only for for PARTNER type,
  13489. // mutable for PARTNER_PROVIDER, not available for DEDICATED.
  13490. //
  13491. // Possible values:
  13492. // "BPS_100M"
  13493. // "BPS_10G"
  13494. // "BPS_1G"
  13495. // "BPS_200M"
  13496. // "BPS_2G"
  13497. // "BPS_300M"
  13498. // "BPS_400M"
  13499. // "BPS_500M"
  13500. // "BPS_50M"
  13501. // "BPS_5G"
  13502. Bandwidth string `json:"bandwidth,omitempty"`
  13503. // CandidateSubnets: Up to 16 candidate prefixes that can be used to
  13504. // restrict the allocation of cloudRouterIpAddress and
  13505. // customerRouterIpAddress for this attachment. All prefixes must be
  13506. // within link-local address space (169.254.0.0/16) and must be /29 or
  13507. // shorter (/28, /27, etc). Google will attempt to select an unused /29
  13508. // from the supplied candidate prefix(es). The request will fail if all
  13509. // possible /29s are in use on Google?s edge. If not supplied, Google
  13510. // will randomly select an unused /29 from all of link-local space.
  13511. CandidateSubnets []string `json:"candidateSubnets,omitempty"`
  13512. // CloudRouterIpAddress: [Output Only] IPv4 address + prefix length to
  13513. // be configured on Cloud Router Interface for this interconnect
  13514. // attachment.
  13515. CloudRouterIpAddress string `json:"cloudRouterIpAddress,omitempty"`
  13516. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  13517. // format.
  13518. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  13519. // CustomerRouterIpAddress: [Output Only] IPv4 address + prefix length
  13520. // to be configured on the customer router subinterface for this
  13521. // interconnect attachment.
  13522. CustomerRouterIpAddress string `json:"customerRouterIpAddress,omitempty"`
  13523. // Description: An optional description of this resource.
  13524. Description string `json:"description,omitempty"`
  13525. // EdgeAvailabilityDomain: Desired availability domain for the
  13526. // attachment. Only available for type PARTNER, at creation time. For
  13527. // improved reliability, customers should configure a pair of
  13528. // attachments with one per availability domain. The selected
  13529. // availability domain will be provided to the Partner via the pairing
  13530. // key so that the provisioned circuit will lie in the specified domain.
  13531. // If not specified, the value will default to AVAILABILITY_DOMAIN_ANY.
  13532. //
  13533. // Possible values:
  13534. // "AVAILABILITY_DOMAIN_1"
  13535. // "AVAILABILITY_DOMAIN_2"
  13536. // "AVAILABILITY_DOMAIN_ANY"
  13537. EdgeAvailabilityDomain string `json:"edgeAvailabilityDomain,omitempty"`
  13538. // GoogleReferenceId: [Output Only] Google reference ID, to be used when
  13539. // raising support tickets with Google or otherwise to debug backend
  13540. // connectivity issues.
  13541. GoogleReferenceId string `json:"googleReferenceId,omitempty"`
  13542. // Id: [Output Only] The unique identifier for the resource. This
  13543. // identifier is defined by the server.
  13544. Id uint64 `json:"id,omitempty,string"`
  13545. // Interconnect: URL of the underlying Interconnect object that this
  13546. // attachment's traffic will traverse through.
  13547. Interconnect string `json:"interconnect,omitempty"`
  13548. // Kind: [Output Only] Type of the resource. Always
  13549. // compute#interconnectAttachment for interconnect attachments.
  13550. Kind string `json:"kind,omitempty"`
  13551. // LabelFingerprint: A fingerprint for the labels being applied to this
  13552. // InterconnectAttachment, which is essentially a hash of the labels set
  13553. // used for optimistic locking. The fingerprint is initially generated
  13554. // by Compute Engine and changes after every request to modify or update
  13555. // labels. You must always provide an up-to-date fingerprint hash in
  13556. // order to update or change labels.
  13557. //
  13558. // To see the latest fingerprint, make a get() request to retrieve an
  13559. // InterconnectAttachment.
  13560. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  13561. // Labels: Labels to apply to this InterconnectAttachment resource.
  13562. // These can be later modified by the setLabels method. Each label
  13563. // key/value must comply with RFC1035. Label values may be empty.
  13564. Labels map[string]string `json:"labels,omitempty"`
  13565. // Name: Name of the resource. Provided by the client when the resource
  13566. // is created. The name must be 1-63 characters long, and comply with
  13567. // RFC1035. Specifically, the name must be 1-63 characters long and
  13568. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  13569. // the first character must be a lowercase letter, and all following
  13570. // characters must be a dash, lowercase letter, or digit, except the
  13571. // last character, which cannot be a dash.
  13572. Name string `json:"name,omitempty"`
  13573. // OperationalStatus: [Output Only] The current status of whether or not
  13574. // this interconnect attachment is functional.
  13575. //
  13576. // Possible values:
  13577. // "OS_ACTIVE"
  13578. // "OS_UNPROVISIONED"
  13579. OperationalStatus string `json:"operationalStatus,omitempty"`
  13580. // PairingKey: [Output only for type PARTNER. Input only for
  13581. // PARTNER_PROVIDER. Not present for DEDICATED]. The opaque identifier
  13582. // of an PARTNER attachment used to initiate provisioning with a
  13583. // selected partner. Of the form "XXXXX/region/domain"
  13584. PairingKey string `json:"pairingKey,omitempty"`
  13585. // PartnerAsn: Optional BGP ASN for the router that should be supplied
  13586. // by a layer 3 Partner if they configured BGP on behalf of the
  13587. // customer. Output only for PARTNER type, input only for
  13588. // PARTNER_PROVIDER, not available for DEDICATED.
  13589. PartnerAsn int64 `json:"partnerAsn,omitempty,string"`
  13590. // PartnerMetadata: Informational metadata about Partner attachments
  13591. // from Partners to display to customers. Output only for for PARTNER
  13592. // type, mutable for PARTNER_PROVIDER, not available for DEDICATED.
  13593. PartnerMetadata *InterconnectAttachmentPartnerMetadata `json:"partnerMetadata,omitempty"`
  13594. // PrivateInterconnectInfo: [Output Only] Information specific to an
  13595. // InterconnectAttachment. This property is populated if the
  13596. // interconnect that this is attached to is of type DEDICATED.
  13597. PrivateInterconnectInfo *InterconnectAttachmentPrivateInfo `json:"privateInterconnectInfo,omitempty"`
  13598. // Region: [Output Only] URL of the region where the regional
  13599. // interconnect attachment resides. You must specify this field as part
  13600. // of the HTTP request URL. It is not settable as a field in the request
  13601. // body.
  13602. Region string `json:"region,omitempty"`
  13603. // Router: URL of the cloud router to be used for dynamic routing. This
  13604. // router must be in the same region as this InterconnectAttachment. The
  13605. // InterconnectAttachment will automatically connect the Interconnect to
  13606. // the network & region within which the Cloud Router is configured.
  13607. Router string `json:"router,omitempty"`
  13608. // SelfLink: [Output Only] Server-defined URL for the resource.
  13609. SelfLink string `json:"selfLink,omitempty"`
  13610. // State: [Output Only] The current state of this attachment's
  13611. // functionality.
  13612. //
  13613. // Possible values:
  13614. // "ACTIVE"
  13615. // "DEFUNCT"
  13616. // "PARTNER_REQUEST_RECEIVED"
  13617. // "PENDING_CUSTOMER"
  13618. // "PENDING_PARTNER"
  13619. // "STATE_UNSPECIFIED"
  13620. // "UNPROVISIONED"
  13621. State string `json:"state,omitempty"`
  13622. // Possible values:
  13623. // "DEDICATED"
  13624. // "PARTNER"
  13625. // "PARTNER_PROVIDER"
  13626. Type string `json:"type,omitempty"`
  13627. // VlanTag8021q: Available only for DEDICATED and PARTNER_PROVIDER.
  13628. // Desired VLAN tag for this attachment, in the range 2-4094. This field
  13629. // refers to 802.1q VLAN tag, also known as IEEE 802.1Q Only specified
  13630. // at creation time.
  13631. VlanTag8021q int64 `json:"vlanTag8021q,omitempty"`
  13632. // ServerResponse contains the HTTP response code and headers from the
  13633. // server.
  13634. googleapi.ServerResponse `json:"-"`
  13635. // ForceSendFields is a list of field names (e.g. "AdminEnabled") to
  13636. // unconditionally include in API requests. By default, fields with
  13637. // empty values are omitted from API requests. However, any non-pointer,
  13638. // non-interface field appearing in ForceSendFields will be sent to the
  13639. // server regardless of whether the field is empty or not. This may be
  13640. // used to include empty fields in Patch requests.
  13641. ForceSendFields []string `json:"-"`
  13642. // NullFields is a list of field names (e.g. "AdminEnabled") to include
  13643. // in API requests with the JSON null value. By default, fields with
  13644. // empty values are omitted from API requests. However, any field with
  13645. // an empty value appearing in NullFields will be sent to the server as
  13646. // null. It is an error if a field in this list has a non-empty value.
  13647. // This may be used to include null fields in Patch requests.
  13648. NullFields []string `json:"-"`
  13649. }
  13650. func (s *InterconnectAttachment) MarshalJSON() ([]byte, error) {
  13651. type NoMethod InterconnectAttachment
  13652. raw := NoMethod(*s)
  13653. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13654. }
  13655. type InterconnectAttachmentAggregatedList struct {
  13656. // Id: [Output Only] Unique identifier for the resource; defined by the
  13657. // server.
  13658. Id string `json:"id,omitempty"`
  13659. // Items: A list of InterconnectAttachmentsScopedList resources.
  13660. Items map[string]InterconnectAttachmentsScopedList `json:"items,omitempty"`
  13661. // Kind: [Output Only] Type of resource. Always
  13662. // compute#interconnectAttachmentAggregatedList for aggregated lists of
  13663. // interconnect attachments.
  13664. Kind string `json:"kind,omitempty"`
  13665. // NextPageToken: [Output Only] This token allows you to get the next
  13666. // page of results for list requests. If the number of results is larger
  13667. // than maxResults, use the nextPageToken as a value for the query
  13668. // parameter pageToken in the next list request. Subsequent list
  13669. // requests will have their own nextPageToken to continue paging through
  13670. // the results.
  13671. NextPageToken string `json:"nextPageToken,omitempty"`
  13672. // SelfLink: [Output Only] Server-defined URL for this resource.
  13673. SelfLink string `json:"selfLink,omitempty"`
  13674. // Warning: [Output Only] Informational warning message.
  13675. Warning *InterconnectAttachmentAggregatedListWarning `json:"warning,omitempty"`
  13676. // ServerResponse contains the HTTP response code and headers from the
  13677. // server.
  13678. googleapi.ServerResponse `json:"-"`
  13679. // ForceSendFields is a list of field names (e.g. "Id") to
  13680. // unconditionally include in API requests. By default, fields with
  13681. // empty values are omitted from API requests. However, any non-pointer,
  13682. // non-interface field appearing in ForceSendFields will be sent to the
  13683. // server regardless of whether the field is empty or not. This may be
  13684. // used to include empty fields in Patch requests.
  13685. ForceSendFields []string `json:"-"`
  13686. // NullFields is a list of field names (e.g. "Id") to include in API
  13687. // requests with the JSON null value. By default, fields with empty
  13688. // values are omitted from API requests. However, any field with an
  13689. // empty value appearing in NullFields will be sent to the server as
  13690. // null. It is an error if a field in this list has a non-empty value.
  13691. // This may be used to include null fields in Patch requests.
  13692. NullFields []string `json:"-"`
  13693. }
  13694. func (s *InterconnectAttachmentAggregatedList) MarshalJSON() ([]byte, error) {
  13695. type NoMethod InterconnectAttachmentAggregatedList
  13696. raw := NoMethod(*s)
  13697. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13698. }
  13699. // InterconnectAttachmentAggregatedListWarning: [Output Only]
  13700. // Informational warning message.
  13701. type InterconnectAttachmentAggregatedListWarning struct {
  13702. // Code: [Output Only] A warning code, if applicable. For example,
  13703. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  13704. // the response.
  13705. //
  13706. // Possible values:
  13707. // "CLEANUP_FAILED"
  13708. // "DEPRECATED_RESOURCE_USED"
  13709. // "DEPRECATED_TYPE_USED"
  13710. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  13711. // "EXPERIMENTAL_TYPE_USED"
  13712. // "EXTERNAL_API_WARNING"
  13713. // "FIELD_VALUE_OVERRIDEN"
  13714. // "INJECTED_KERNELS_DEPRECATED"
  13715. // "MISSING_TYPE_DEPENDENCY"
  13716. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  13717. // "NEXT_HOP_CANNOT_IP_FORWARD"
  13718. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  13719. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  13720. // "NEXT_HOP_NOT_RUNNING"
  13721. // "NOT_CRITICAL_ERROR"
  13722. // "NO_RESULTS_ON_PAGE"
  13723. // "REQUIRED_TOS_AGREEMENT"
  13724. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  13725. // "RESOURCE_NOT_DELETED"
  13726. // "SCHEMA_VALIDATION_IGNORED"
  13727. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  13728. // "UNDECLARED_PROPERTIES"
  13729. // "UNREACHABLE"
  13730. Code string `json:"code,omitempty"`
  13731. // Data: [Output Only] Metadata about this warning in key: value format.
  13732. // For example:
  13733. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  13734. Data []*InterconnectAttachmentAggregatedListWarningData `json:"data,omitempty"`
  13735. // Message: [Output Only] A human-readable description of the warning
  13736. // code.
  13737. Message string `json:"message,omitempty"`
  13738. // ForceSendFields is a list of field names (e.g. "Code") to
  13739. // unconditionally include in API requests. By default, fields with
  13740. // empty values are omitted from API requests. However, any non-pointer,
  13741. // non-interface field appearing in ForceSendFields will be sent to the
  13742. // server regardless of whether the field is empty or not. This may be
  13743. // used to include empty fields in Patch requests.
  13744. ForceSendFields []string `json:"-"`
  13745. // NullFields is a list of field names (e.g. "Code") to include in API
  13746. // requests with the JSON null value. By default, fields with empty
  13747. // values are omitted from API requests. However, any field with an
  13748. // empty value appearing in NullFields will be sent to the server as
  13749. // null. It is an error if a field in this list has a non-empty value.
  13750. // This may be used to include null fields in Patch requests.
  13751. NullFields []string `json:"-"`
  13752. }
  13753. func (s *InterconnectAttachmentAggregatedListWarning) MarshalJSON() ([]byte, error) {
  13754. type NoMethod InterconnectAttachmentAggregatedListWarning
  13755. raw := NoMethod(*s)
  13756. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13757. }
  13758. type InterconnectAttachmentAggregatedListWarningData struct {
  13759. // Key: [Output Only] A key that provides more detail on the warning
  13760. // being returned. For example, for warnings where there are no results
  13761. // in a list request for a particular zone, this key might be scope and
  13762. // the key value might be the zone name. Other examples might be a key
  13763. // indicating a deprecated resource and a suggested replacement, or a
  13764. // warning about invalid network settings (for example, if an instance
  13765. // attempts to perform IP forwarding but is not enabled for IP
  13766. // forwarding).
  13767. Key string `json:"key,omitempty"`
  13768. // Value: [Output Only] A warning data value corresponding to the key.
  13769. Value string `json:"value,omitempty"`
  13770. // ForceSendFields is a list of field names (e.g. "Key") to
  13771. // unconditionally include in API requests. By default, fields with
  13772. // empty values are omitted from API requests. However, any non-pointer,
  13773. // non-interface field appearing in ForceSendFields will be sent to the
  13774. // server regardless of whether the field is empty or not. This may be
  13775. // used to include empty fields in Patch requests.
  13776. ForceSendFields []string `json:"-"`
  13777. // NullFields is a list of field names (e.g. "Key") to include in API
  13778. // requests with the JSON null value. By default, fields with empty
  13779. // values are omitted from API requests. However, any field with an
  13780. // empty value appearing in NullFields will be sent to the server as
  13781. // null. It is an error if a field in this list has a non-empty value.
  13782. // This may be used to include null fields in Patch requests.
  13783. NullFields []string `json:"-"`
  13784. }
  13785. func (s *InterconnectAttachmentAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  13786. type NoMethod InterconnectAttachmentAggregatedListWarningData
  13787. raw := NoMethod(*s)
  13788. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13789. }
  13790. // InterconnectAttachmentList: Response to the list request, and
  13791. // contains a list of interconnect attachments.
  13792. type InterconnectAttachmentList struct {
  13793. // Id: [Output Only] Unique identifier for the resource; defined by the
  13794. // server.
  13795. Id string `json:"id,omitempty"`
  13796. // Items: A list of InterconnectAttachment resources.
  13797. Items []*InterconnectAttachment `json:"items,omitempty"`
  13798. // Kind: [Output Only] Type of resource. Always
  13799. // compute#interconnectAttachmentList for lists of interconnect
  13800. // attachments.
  13801. Kind string `json:"kind,omitempty"`
  13802. // NextPageToken: [Output Only] This token allows you to get the next
  13803. // page of results for list requests. If the number of results is larger
  13804. // than maxResults, use the nextPageToken as a value for the query
  13805. // parameter pageToken in the next list request. Subsequent list
  13806. // requests will have their own nextPageToken to continue paging through
  13807. // the results.
  13808. NextPageToken string `json:"nextPageToken,omitempty"`
  13809. // SelfLink: [Output Only] Server-defined URL for this resource.
  13810. SelfLink string `json:"selfLink,omitempty"`
  13811. // Warning: [Output Only] Informational warning message.
  13812. Warning *InterconnectAttachmentListWarning `json:"warning,omitempty"`
  13813. // ServerResponse contains the HTTP response code and headers from the
  13814. // server.
  13815. googleapi.ServerResponse `json:"-"`
  13816. // ForceSendFields is a list of field names (e.g. "Id") to
  13817. // unconditionally include in API requests. By default, fields with
  13818. // empty values are omitted from API requests. However, any non-pointer,
  13819. // non-interface field appearing in ForceSendFields will be sent to the
  13820. // server regardless of whether the field is empty or not. This may be
  13821. // used to include empty fields in Patch requests.
  13822. ForceSendFields []string `json:"-"`
  13823. // NullFields is a list of field names (e.g. "Id") to include in API
  13824. // requests with the JSON null value. By default, fields with empty
  13825. // values are omitted from API requests. However, any field with an
  13826. // empty value appearing in NullFields will be sent to the server as
  13827. // null. It is an error if a field in this list has a non-empty value.
  13828. // This may be used to include null fields in Patch requests.
  13829. NullFields []string `json:"-"`
  13830. }
  13831. func (s *InterconnectAttachmentList) MarshalJSON() ([]byte, error) {
  13832. type NoMethod InterconnectAttachmentList
  13833. raw := NoMethod(*s)
  13834. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13835. }
  13836. // InterconnectAttachmentListWarning: [Output Only] Informational
  13837. // warning message.
  13838. type InterconnectAttachmentListWarning struct {
  13839. // Code: [Output Only] A warning code, if applicable. For example,
  13840. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  13841. // the response.
  13842. //
  13843. // Possible values:
  13844. // "CLEANUP_FAILED"
  13845. // "DEPRECATED_RESOURCE_USED"
  13846. // "DEPRECATED_TYPE_USED"
  13847. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  13848. // "EXPERIMENTAL_TYPE_USED"
  13849. // "EXTERNAL_API_WARNING"
  13850. // "FIELD_VALUE_OVERRIDEN"
  13851. // "INJECTED_KERNELS_DEPRECATED"
  13852. // "MISSING_TYPE_DEPENDENCY"
  13853. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  13854. // "NEXT_HOP_CANNOT_IP_FORWARD"
  13855. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  13856. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  13857. // "NEXT_HOP_NOT_RUNNING"
  13858. // "NOT_CRITICAL_ERROR"
  13859. // "NO_RESULTS_ON_PAGE"
  13860. // "REQUIRED_TOS_AGREEMENT"
  13861. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  13862. // "RESOURCE_NOT_DELETED"
  13863. // "SCHEMA_VALIDATION_IGNORED"
  13864. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  13865. // "UNDECLARED_PROPERTIES"
  13866. // "UNREACHABLE"
  13867. Code string `json:"code,omitempty"`
  13868. // Data: [Output Only] Metadata about this warning in key: value format.
  13869. // For example:
  13870. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  13871. Data []*InterconnectAttachmentListWarningData `json:"data,omitempty"`
  13872. // Message: [Output Only] A human-readable description of the warning
  13873. // code.
  13874. Message string `json:"message,omitempty"`
  13875. // ForceSendFields is a list of field names (e.g. "Code") to
  13876. // unconditionally include in API requests. By default, fields with
  13877. // empty values are omitted from API requests. However, any non-pointer,
  13878. // non-interface field appearing in ForceSendFields will be sent to the
  13879. // server regardless of whether the field is empty or not. This may be
  13880. // used to include empty fields in Patch requests.
  13881. ForceSendFields []string `json:"-"`
  13882. // NullFields is a list of field names (e.g. "Code") to include in API
  13883. // requests with the JSON null value. By default, fields with empty
  13884. // values are omitted from API requests. However, any field with an
  13885. // empty value appearing in NullFields will be sent to the server as
  13886. // null. It is an error if a field in this list has a non-empty value.
  13887. // This may be used to include null fields in Patch requests.
  13888. NullFields []string `json:"-"`
  13889. }
  13890. func (s *InterconnectAttachmentListWarning) MarshalJSON() ([]byte, error) {
  13891. type NoMethod InterconnectAttachmentListWarning
  13892. raw := NoMethod(*s)
  13893. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13894. }
  13895. type InterconnectAttachmentListWarningData struct {
  13896. // Key: [Output Only] A key that provides more detail on the warning
  13897. // being returned. For example, for warnings where there are no results
  13898. // in a list request for a particular zone, this key might be scope and
  13899. // the key value might be the zone name. Other examples might be a key
  13900. // indicating a deprecated resource and a suggested replacement, or a
  13901. // warning about invalid network settings (for example, if an instance
  13902. // attempts to perform IP forwarding but is not enabled for IP
  13903. // forwarding).
  13904. Key string `json:"key,omitempty"`
  13905. // Value: [Output Only] A warning data value corresponding to the key.
  13906. Value string `json:"value,omitempty"`
  13907. // ForceSendFields is a list of field names (e.g. "Key") to
  13908. // unconditionally include in API requests. By default, fields with
  13909. // empty values are omitted from API requests. However, any non-pointer,
  13910. // non-interface field appearing in ForceSendFields will be sent to the
  13911. // server regardless of whether the field is empty or not. This may be
  13912. // used to include empty fields in Patch requests.
  13913. ForceSendFields []string `json:"-"`
  13914. // NullFields is a list of field names (e.g. "Key") to include in API
  13915. // requests with the JSON null value. By default, fields with empty
  13916. // values are omitted from API requests. However, any field with an
  13917. // empty value appearing in NullFields will be sent to the server as
  13918. // null. It is an error if a field in this list has a non-empty value.
  13919. // This may be used to include null fields in Patch requests.
  13920. NullFields []string `json:"-"`
  13921. }
  13922. func (s *InterconnectAttachmentListWarningData) MarshalJSON() ([]byte, error) {
  13923. type NoMethod InterconnectAttachmentListWarningData
  13924. raw := NoMethod(*s)
  13925. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13926. }
  13927. // InterconnectAttachmentPartnerMetadata: Informational metadata about
  13928. // Partner attachments from Partners to display to customers. These
  13929. // fields are propagated from PARTNER_PROVIDER attachments to their
  13930. // corresponding PARTNER attachments.
  13931. type InterconnectAttachmentPartnerMetadata struct {
  13932. // InterconnectName: Plain text name of the Interconnect this attachment
  13933. // is connected to, as displayed in the Partner?s portal. For instance
  13934. // ?Chicago 1?. This value may be validated to match approved Partner
  13935. // values.
  13936. InterconnectName string `json:"interconnectName,omitempty"`
  13937. // PartnerName: Plain text name of the Partner providing this
  13938. // attachment. This value may be validated to match approved Partner
  13939. // values.
  13940. PartnerName string `json:"partnerName,omitempty"`
  13941. // PortalUrl: URL of the Partner?s portal for this Attachment. Partners
  13942. // may customise this to be a deep-link to the specific resource on the
  13943. // Partner portal. This value may be validated to match approved Partner
  13944. // values.
  13945. PortalUrl string `json:"portalUrl,omitempty"`
  13946. // ForceSendFields is a list of field names (e.g. "InterconnectName") to
  13947. // unconditionally include in API requests. By default, fields with
  13948. // empty values are omitted from API requests. However, any non-pointer,
  13949. // non-interface field appearing in ForceSendFields will be sent to the
  13950. // server regardless of whether the field is empty or not. This may be
  13951. // used to include empty fields in Patch requests.
  13952. ForceSendFields []string `json:"-"`
  13953. // NullFields is a list of field names (e.g. "InterconnectName") to
  13954. // include in API requests with the JSON null value. By default, fields
  13955. // with empty values are omitted from API requests. However, any field
  13956. // with an empty value appearing in NullFields will be sent to the
  13957. // server as null. It is an error if a field in this list has a
  13958. // non-empty value. This may be used to include null fields in Patch
  13959. // requests.
  13960. NullFields []string `json:"-"`
  13961. }
  13962. func (s *InterconnectAttachmentPartnerMetadata) MarshalJSON() ([]byte, error) {
  13963. type NoMethod InterconnectAttachmentPartnerMetadata
  13964. raw := NoMethod(*s)
  13965. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13966. }
  13967. // InterconnectAttachmentPrivateInfo: Information for an interconnect
  13968. // attachment when this belongs to an interconnect of type DEDICATED.
  13969. type InterconnectAttachmentPrivateInfo struct {
  13970. // Tag8021q: [Output Only] 802.1q encapsulation tag to be used for
  13971. // traffic between Google and the customer, going to and from this
  13972. // network and region.
  13973. Tag8021q int64 `json:"tag8021q,omitempty"`
  13974. // ForceSendFields is a list of field names (e.g. "Tag8021q") to
  13975. // unconditionally include in API requests. By default, fields with
  13976. // empty values are omitted from API requests. However, any non-pointer,
  13977. // non-interface field appearing in ForceSendFields will be sent to the
  13978. // server regardless of whether the field is empty or not. This may be
  13979. // used to include empty fields in Patch requests.
  13980. ForceSendFields []string `json:"-"`
  13981. // NullFields is a list of field names (e.g. "Tag8021q") to include in
  13982. // API requests with the JSON null value. By default, fields with empty
  13983. // values are omitted from API requests. However, any field with an
  13984. // empty value appearing in NullFields will be sent to the server as
  13985. // null. It is an error if a field in this list has a non-empty value.
  13986. // This may be used to include null fields in Patch requests.
  13987. NullFields []string `json:"-"`
  13988. }
  13989. func (s *InterconnectAttachmentPrivateInfo) MarshalJSON() ([]byte, error) {
  13990. type NoMethod InterconnectAttachmentPrivateInfo
  13991. raw := NoMethod(*s)
  13992. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13993. }
  13994. type InterconnectAttachmentsScopedList struct {
  13995. // InterconnectAttachments: A list of interconnect attachments contained
  13996. // in this scope.
  13997. InterconnectAttachments []*InterconnectAttachment `json:"interconnectAttachments,omitempty"`
  13998. // Warning: Informational warning which replaces the list of addresses
  13999. // when the list is empty.
  14000. Warning *InterconnectAttachmentsScopedListWarning `json:"warning,omitempty"`
  14001. // ForceSendFields is a list of field names (e.g.
  14002. // "InterconnectAttachments") to unconditionally include in API
  14003. // requests. By default, fields with empty values are omitted from API
  14004. // requests. However, any non-pointer, non-interface field appearing in
  14005. // ForceSendFields will be sent to the server regardless of whether the
  14006. // field is empty or not. This may be used to include empty fields in
  14007. // Patch requests.
  14008. ForceSendFields []string `json:"-"`
  14009. // NullFields is a list of field names (e.g. "InterconnectAttachments")
  14010. // to include in API requests with the JSON null value. By default,
  14011. // fields with empty values are omitted from API requests. However, any
  14012. // field with an empty value appearing in NullFields will be sent to the
  14013. // server as null. It is an error if a field in this list has a
  14014. // non-empty value. This may be used to include null fields in Patch
  14015. // requests.
  14016. NullFields []string `json:"-"`
  14017. }
  14018. func (s *InterconnectAttachmentsScopedList) MarshalJSON() ([]byte, error) {
  14019. type NoMethod InterconnectAttachmentsScopedList
  14020. raw := NoMethod(*s)
  14021. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14022. }
  14023. // InterconnectAttachmentsScopedListWarning: Informational warning which
  14024. // replaces the list of addresses when the list is empty.
  14025. type InterconnectAttachmentsScopedListWarning struct {
  14026. // Code: [Output Only] A warning code, if applicable. For example,
  14027. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  14028. // the response.
  14029. //
  14030. // Possible values:
  14031. // "CLEANUP_FAILED"
  14032. // "DEPRECATED_RESOURCE_USED"
  14033. // "DEPRECATED_TYPE_USED"
  14034. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  14035. // "EXPERIMENTAL_TYPE_USED"
  14036. // "EXTERNAL_API_WARNING"
  14037. // "FIELD_VALUE_OVERRIDEN"
  14038. // "INJECTED_KERNELS_DEPRECATED"
  14039. // "MISSING_TYPE_DEPENDENCY"
  14040. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  14041. // "NEXT_HOP_CANNOT_IP_FORWARD"
  14042. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  14043. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  14044. // "NEXT_HOP_NOT_RUNNING"
  14045. // "NOT_CRITICAL_ERROR"
  14046. // "NO_RESULTS_ON_PAGE"
  14047. // "REQUIRED_TOS_AGREEMENT"
  14048. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  14049. // "RESOURCE_NOT_DELETED"
  14050. // "SCHEMA_VALIDATION_IGNORED"
  14051. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  14052. // "UNDECLARED_PROPERTIES"
  14053. // "UNREACHABLE"
  14054. Code string `json:"code,omitempty"`
  14055. // Data: [Output Only] Metadata about this warning in key: value format.
  14056. // For example:
  14057. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  14058. Data []*InterconnectAttachmentsScopedListWarningData `json:"data,omitempty"`
  14059. // Message: [Output Only] A human-readable description of the warning
  14060. // code.
  14061. Message string `json:"message,omitempty"`
  14062. // ForceSendFields is a list of field names (e.g. "Code") to
  14063. // unconditionally include in API requests. By default, fields with
  14064. // empty values are omitted from API requests. However, any non-pointer,
  14065. // non-interface field appearing in ForceSendFields will be sent to the
  14066. // server regardless of whether the field is empty or not. This may be
  14067. // used to include empty fields in Patch requests.
  14068. ForceSendFields []string `json:"-"`
  14069. // NullFields is a list of field names (e.g. "Code") to include in API
  14070. // requests with the JSON null value. By default, fields with empty
  14071. // values are omitted from API requests. However, any field with an
  14072. // empty value appearing in NullFields will be sent to the server as
  14073. // null. It is an error if a field in this list has a non-empty value.
  14074. // This may be used to include null fields in Patch requests.
  14075. NullFields []string `json:"-"`
  14076. }
  14077. func (s *InterconnectAttachmentsScopedListWarning) MarshalJSON() ([]byte, error) {
  14078. type NoMethod InterconnectAttachmentsScopedListWarning
  14079. raw := NoMethod(*s)
  14080. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14081. }
  14082. type InterconnectAttachmentsScopedListWarningData struct {
  14083. // Key: [Output Only] A key that provides more detail on the warning
  14084. // being returned. For example, for warnings where there are no results
  14085. // in a list request for a particular zone, this key might be scope and
  14086. // the key value might be the zone name. Other examples might be a key
  14087. // indicating a deprecated resource and a suggested replacement, or a
  14088. // warning about invalid network settings (for example, if an instance
  14089. // attempts to perform IP forwarding but is not enabled for IP
  14090. // forwarding).
  14091. Key string `json:"key,omitempty"`
  14092. // Value: [Output Only] A warning data value corresponding to the key.
  14093. Value string `json:"value,omitempty"`
  14094. // ForceSendFields is a list of field names (e.g. "Key") to
  14095. // unconditionally include in API requests. By default, fields with
  14096. // empty values are omitted from API requests. However, any non-pointer,
  14097. // non-interface field appearing in ForceSendFields will be sent to the
  14098. // server regardless of whether the field is empty or not. This may be
  14099. // used to include empty fields in Patch requests.
  14100. ForceSendFields []string `json:"-"`
  14101. // NullFields is a list of field names (e.g. "Key") to include in API
  14102. // requests with the JSON null value. By default, fields with empty
  14103. // values are omitted from API requests. However, any field with an
  14104. // empty value appearing in NullFields will be sent to the server as
  14105. // null. It is an error if a field in this list has a non-empty value.
  14106. // This may be used to include null fields in Patch requests.
  14107. NullFields []string `json:"-"`
  14108. }
  14109. func (s *InterconnectAttachmentsScopedListWarningData) MarshalJSON() ([]byte, error) {
  14110. type NoMethod InterconnectAttachmentsScopedListWarningData
  14111. raw := NoMethod(*s)
  14112. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14113. }
  14114. // InterconnectCircuitInfo: Describes a single physical circuit between
  14115. // the Customer and Google. CircuitInfo objects are created by Google,
  14116. // so all fields are output only. Next id: 4
  14117. type InterconnectCircuitInfo struct {
  14118. // CustomerDemarcId: Customer-side demarc ID for this circuit.
  14119. CustomerDemarcId string `json:"customerDemarcId,omitempty"`
  14120. // GoogleCircuitId: Google-assigned unique ID for this circuit. Assigned
  14121. // at circuit turn-up.
  14122. GoogleCircuitId string `json:"googleCircuitId,omitempty"`
  14123. // GoogleDemarcId: Google-side demarc ID for this circuit. Assigned at
  14124. // circuit turn-up and provided by Google to the customer in the LOA.
  14125. GoogleDemarcId string `json:"googleDemarcId,omitempty"`
  14126. // ForceSendFields is a list of field names (e.g. "CustomerDemarcId") to
  14127. // unconditionally include in API requests. By default, fields with
  14128. // empty values are omitted from API requests. However, any non-pointer,
  14129. // non-interface field appearing in ForceSendFields will be sent to the
  14130. // server regardless of whether the field is empty or not. This may be
  14131. // used to include empty fields in Patch requests.
  14132. ForceSendFields []string `json:"-"`
  14133. // NullFields is a list of field names (e.g. "CustomerDemarcId") to
  14134. // include in API requests with the JSON null value. By default, fields
  14135. // with empty values are omitted from API requests. However, any field
  14136. // with an empty value appearing in NullFields will be sent to the
  14137. // server as null. It is an error if a field in this list has a
  14138. // non-empty value. This may be used to include null fields in Patch
  14139. // requests.
  14140. NullFields []string `json:"-"`
  14141. }
  14142. func (s *InterconnectCircuitInfo) MarshalJSON() ([]byte, error) {
  14143. type NoMethod InterconnectCircuitInfo
  14144. raw := NoMethod(*s)
  14145. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14146. }
  14147. // InterconnectList: Response to the list request, and contains a list
  14148. // of interconnects.
  14149. type InterconnectList struct {
  14150. // Id: [Output Only] Unique identifier for the resource; defined by the
  14151. // server.
  14152. Id string `json:"id,omitempty"`
  14153. // Items: A list of Interconnect resources.
  14154. Items []*Interconnect `json:"items,omitempty"`
  14155. // Kind: [Output Only] Type of resource. Always compute#interconnectList
  14156. // for lists of interconnects.
  14157. Kind string `json:"kind,omitempty"`
  14158. // NextPageToken: [Output Only] This token allows you to get the next
  14159. // page of results for list requests. If the number of results is larger
  14160. // than maxResults, use the nextPageToken as a value for the query
  14161. // parameter pageToken in the next list request. Subsequent list
  14162. // requests will have their own nextPageToken to continue paging through
  14163. // the results.
  14164. NextPageToken string `json:"nextPageToken,omitempty"`
  14165. // SelfLink: [Output Only] Server-defined URL for this resource.
  14166. SelfLink string `json:"selfLink,omitempty"`
  14167. // Warning: [Output Only] Informational warning message.
  14168. Warning *InterconnectListWarning `json:"warning,omitempty"`
  14169. // ServerResponse contains the HTTP response code and headers from the
  14170. // server.
  14171. googleapi.ServerResponse `json:"-"`
  14172. // ForceSendFields is a list of field names (e.g. "Id") to
  14173. // unconditionally include in API requests. By default, fields with
  14174. // empty values are omitted from API requests. However, any non-pointer,
  14175. // non-interface field appearing in ForceSendFields will be sent to the
  14176. // server regardless of whether the field is empty or not. This may be
  14177. // used to include empty fields in Patch requests.
  14178. ForceSendFields []string `json:"-"`
  14179. // NullFields is a list of field names (e.g. "Id") to include in API
  14180. // requests with the JSON null value. By default, fields with empty
  14181. // values are omitted from API requests. However, any field with an
  14182. // empty value appearing in NullFields will be sent to the server as
  14183. // null. It is an error if a field in this list has a non-empty value.
  14184. // This may be used to include null fields in Patch requests.
  14185. NullFields []string `json:"-"`
  14186. }
  14187. func (s *InterconnectList) MarshalJSON() ([]byte, error) {
  14188. type NoMethod InterconnectList
  14189. raw := NoMethod(*s)
  14190. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14191. }
  14192. // InterconnectListWarning: [Output Only] Informational warning message.
  14193. type InterconnectListWarning struct {
  14194. // Code: [Output Only] A warning code, if applicable. For example,
  14195. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  14196. // the response.
  14197. //
  14198. // Possible values:
  14199. // "CLEANUP_FAILED"
  14200. // "DEPRECATED_RESOURCE_USED"
  14201. // "DEPRECATED_TYPE_USED"
  14202. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  14203. // "EXPERIMENTAL_TYPE_USED"
  14204. // "EXTERNAL_API_WARNING"
  14205. // "FIELD_VALUE_OVERRIDEN"
  14206. // "INJECTED_KERNELS_DEPRECATED"
  14207. // "MISSING_TYPE_DEPENDENCY"
  14208. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  14209. // "NEXT_HOP_CANNOT_IP_FORWARD"
  14210. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  14211. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  14212. // "NEXT_HOP_NOT_RUNNING"
  14213. // "NOT_CRITICAL_ERROR"
  14214. // "NO_RESULTS_ON_PAGE"
  14215. // "REQUIRED_TOS_AGREEMENT"
  14216. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  14217. // "RESOURCE_NOT_DELETED"
  14218. // "SCHEMA_VALIDATION_IGNORED"
  14219. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  14220. // "UNDECLARED_PROPERTIES"
  14221. // "UNREACHABLE"
  14222. Code string `json:"code,omitempty"`
  14223. // Data: [Output Only] Metadata about this warning in key: value format.
  14224. // For example:
  14225. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  14226. Data []*InterconnectListWarningData `json:"data,omitempty"`
  14227. // Message: [Output Only] A human-readable description of the warning
  14228. // code.
  14229. Message string `json:"message,omitempty"`
  14230. // ForceSendFields is a list of field names (e.g. "Code") to
  14231. // unconditionally include in API requests. By default, fields with
  14232. // empty values are omitted from API requests. However, any non-pointer,
  14233. // non-interface field appearing in ForceSendFields will be sent to the
  14234. // server regardless of whether the field is empty or not. This may be
  14235. // used to include empty fields in Patch requests.
  14236. ForceSendFields []string `json:"-"`
  14237. // NullFields is a list of field names (e.g. "Code") to include in API
  14238. // requests with the JSON null value. By default, fields with empty
  14239. // values are omitted from API requests. However, any field with an
  14240. // empty value appearing in NullFields will be sent to the server as
  14241. // null. It is an error if a field in this list has a non-empty value.
  14242. // This may be used to include null fields in Patch requests.
  14243. NullFields []string `json:"-"`
  14244. }
  14245. func (s *InterconnectListWarning) MarshalJSON() ([]byte, error) {
  14246. type NoMethod InterconnectListWarning
  14247. raw := NoMethod(*s)
  14248. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14249. }
  14250. type InterconnectListWarningData struct {
  14251. // Key: [Output Only] A key that provides more detail on the warning
  14252. // being returned. For example, for warnings where there are no results
  14253. // in a list request for a particular zone, this key might be scope and
  14254. // the key value might be the zone name. Other examples might be a key
  14255. // indicating a deprecated resource and a suggested replacement, or a
  14256. // warning about invalid network settings (for example, if an instance
  14257. // attempts to perform IP forwarding but is not enabled for IP
  14258. // forwarding).
  14259. Key string `json:"key,omitempty"`
  14260. // Value: [Output Only] A warning data value corresponding to the key.
  14261. Value string `json:"value,omitempty"`
  14262. // ForceSendFields is a list of field names (e.g. "Key") to
  14263. // unconditionally include in API requests. By default, fields with
  14264. // empty values are omitted from API requests. However, any non-pointer,
  14265. // non-interface field appearing in ForceSendFields will be sent to the
  14266. // server regardless of whether the field is empty or not. This may be
  14267. // used to include empty fields in Patch requests.
  14268. ForceSendFields []string `json:"-"`
  14269. // NullFields is a list of field names (e.g. "Key") to include in API
  14270. // requests with the JSON null value. By default, fields with empty
  14271. // values are omitted from API requests. However, any field with an
  14272. // empty value appearing in NullFields will be sent to the server as
  14273. // null. It is an error if a field in this list has a non-empty value.
  14274. // This may be used to include null fields in Patch requests.
  14275. NullFields []string `json:"-"`
  14276. }
  14277. func (s *InterconnectListWarningData) MarshalJSON() ([]byte, error) {
  14278. type NoMethod InterconnectListWarningData
  14279. raw := NoMethod(*s)
  14280. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14281. }
  14282. // InterconnectLocation: Represents an InterconnectLocations resource.
  14283. // The InterconnectLocations resource describes the locations where you
  14284. // can connect to Google's networks. For more information, see
  14285. // Colocation Facilities.
  14286. type InterconnectLocation struct {
  14287. // Address: [Output Only] The postal address of the Point of Presence,
  14288. // each line in the address is separated by a newline character.
  14289. Address string `json:"address,omitempty"`
  14290. // AvailabilityZone: [Output Only] Availability zone for this location.
  14291. // Within a metropolitan area (metro), maintenance will not be
  14292. // simultaneously scheduled in more than one availability zone. Example:
  14293. // "zone1" or "zone2".
  14294. AvailabilityZone string `json:"availabilityZone,omitempty"`
  14295. // City: [Output Only] Metropolitan area designator that indicates which
  14296. // city an interconnect is located. For example: "Chicago, IL",
  14297. // "Amsterdam, Netherlands".
  14298. City string `json:"city,omitempty"`
  14299. // Continent: [Output Only] Continent for this location.
  14300. //
  14301. // Possible values:
  14302. // "AFRICA"
  14303. // "ASIA_PAC"
  14304. // "C_AFRICA"
  14305. // "C_ASIA_PAC"
  14306. // "C_EUROPE"
  14307. // "C_NORTH_AMERICA"
  14308. // "C_SOUTH_AMERICA"
  14309. // "EUROPE"
  14310. // "NORTH_AMERICA"
  14311. // "SOUTH_AMERICA"
  14312. Continent string `json:"continent,omitempty"`
  14313. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  14314. // format.
  14315. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  14316. // Description: [Output Only] An optional description of the resource.
  14317. Description string `json:"description,omitempty"`
  14318. // FacilityProvider: [Output Only] The name of the provider for this
  14319. // facility (e.g., EQUINIX).
  14320. FacilityProvider string `json:"facilityProvider,omitempty"`
  14321. // FacilityProviderFacilityId: [Output Only] A provider-assigned
  14322. // Identifier for this facility (e.g., Ashburn-DC1).
  14323. FacilityProviderFacilityId string `json:"facilityProviderFacilityId,omitempty"`
  14324. // Id: [Output Only] The unique identifier for the resource. This
  14325. // identifier is defined by the server.
  14326. Id uint64 `json:"id,omitempty,string"`
  14327. // Kind: [Output Only] Type of the resource. Always
  14328. // compute#interconnectLocation for interconnect locations.
  14329. Kind string `json:"kind,omitempty"`
  14330. // Name: [Output Only] Name of the resource.
  14331. Name string `json:"name,omitempty"`
  14332. // PeeringdbFacilityId: [Output Only] The peeringdb identifier for this
  14333. // facility (corresponding with a netfac type in peeringdb).
  14334. PeeringdbFacilityId string `json:"peeringdbFacilityId,omitempty"`
  14335. // RegionInfos: [Output Only] A list of InterconnectLocation.RegionInfo
  14336. // objects, that describe parameters pertaining to the relation between
  14337. // this InterconnectLocation and various Google Cloud regions.
  14338. RegionInfos []*InterconnectLocationRegionInfo `json:"regionInfos,omitempty"`
  14339. // SelfLink: [Output Only] Server-defined URL for the resource.
  14340. SelfLink string `json:"selfLink,omitempty"`
  14341. // ServerResponse contains the HTTP response code and headers from the
  14342. // server.
  14343. googleapi.ServerResponse `json:"-"`
  14344. // ForceSendFields is a list of field names (e.g. "Address") to
  14345. // unconditionally include in API requests. By default, fields with
  14346. // empty values are omitted from API requests. However, any non-pointer,
  14347. // non-interface field appearing in ForceSendFields will be sent to the
  14348. // server regardless of whether the field is empty or not. This may be
  14349. // used to include empty fields in Patch requests.
  14350. ForceSendFields []string `json:"-"`
  14351. // NullFields is a list of field names (e.g. "Address") to include in
  14352. // API requests with the JSON null value. By default, fields with empty
  14353. // values are omitted from API requests. However, any field with an
  14354. // empty value appearing in NullFields will be sent to the server as
  14355. // null. It is an error if a field in this list has a non-empty value.
  14356. // This may be used to include null fields in Patch requests.
  14357. NullFields []string `json:"-"`
  14358. }
  14359. func (s *InterconnectLocation) MarshalJSON() ([]byte, error) {
  14360. type NoMethod InterconnectLocation
  14361. raw := NoMethod(*s)
  14362. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14363. }
  14364. // InterconnectLocationList: Response to the list request, and contains
  14365. // a list of interconnect locations.
  14366. type InterconnectLocationList struct {
  14367. // Id: [Output Only] Unique identifier for the resource; defined by the
  14368. // server.
  14369. Id string `json:"id,omitempty"`
  14370. // Items: A list of InterconnectLocation resources.
  14371. Items []*InterconnectLocation `json:"items,omitempty"`
  14372. // Kind: [Output Only] Type of resource. Always
  14373. // compute#interconnectLocationList for lists of interconnect locations.
  14374. Kind string `json:"kind,omitempty"`
  14375. // NextPageToken: [Output Only] This token allows you to get the next
  14376. // page of results for list requests. If the number of results is larger
  14377. // than maxResults, use the nextPageToken as a value for the query
  14378. // parameter pageToken in the next list request. Subsequent list
  14379. // requests will have their own nextPageToken to continue paging through
  14380. // the results.
  14381. NextPageToken string `json:"nextPageToken,omitempty"`
  14382. // SelfLink: [Output Only] Server-defined URL for this resource.
  14383. SelfLink string `json:"selfLink,omitempty"`
  14384. // Warning: [Output Only] Informational warning message.
  14385. Warning *InterconnectLocationListWarning `json:"warning,omitempty"`
  14386. // ServerResponse contains the HTTP response code and headers from the
  14387. // server.
  14388. googleapi.ServerResponse `json:"-"`
  14389. // ForceSendFields is a list of field names (e.g. "Id") to
  14390. // unconditionally include in API requests. By default, fields with
  14391. // empty values are omitted from API requests. However, any non-pointer,
  14392. // non-interface field appearing in ForceSendFields will be sent to the
  14393. // server regardless of whether the field is empty or not. This may be
  14394. // used to include empty fields in Patch requests.
  14395. ForceSendFields []string `json:"-"`
  14396. // NullFields is a list of field names (e.g. "Id") to include in API
  14397. // requests with the JSON null value. By default, fields with empty
  14398. // values are omitted from API requests. However, any field with an
  14399. // empty value appearing in NullFields will be sent to the server as
  14400. // null. It is an error if a field in this list has a non-empty value.
  14401. // This may be used to include null fields in Patch requests.
  14402. NullFields []string `json:"-"`
  14403. }
  14404. func (s *InterconnectLocationList) MarshalJSON() ([]byte, error) {
  14405. type NoMethod InterconnectLocationList
  14406. raw := NoMethod(*s)
  14407. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14408. }
  14409. // InterconnectLocationListWarning: [Output Only] Informational warning
  14410. // message.
  14411. type InterconnectLocationListWarning struct {
  14412. // Code: [Output Only] A warning code, if applicable. For example,
  14413. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  14414. // the response.
  14415. //
  14416. // Possible values:
  14417. // "CLEANUP_FAILED"
  14418. // "DEPRECATED_RESOURCE_USED"
  14419. // "DEPRECATED_TYPE_USED"
  14420. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  14421. // "EXPERIMENTAL_TYPE_USED"
  14422. // "EXTERNAL_API_WARNING"
  14423. // "FIELD_VALUE_OVERRIDEN"
  14424. // "INJECTED_KERNELS_DEPRECATED"
  14425. // "MISSING_TYPE_DEPENDENCY"
  14426. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  14427. // "NEXT_HOP_CANNOT_IP_FORWARD"
  14428. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  14429. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  14430. // "NEXT_HOP_NOT_RUNNING"
  14431. // "NOT_CRITICAL_ERROR"
  14432. // "NO_RESULTS_ON_PAGE"
  14433. // "REQUIRED_TOS_AGREEMENT"
  14434. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  14435. // "RESOURCE_NOT_DELETED"
  14436. // "SCHEMA_VALIDATION_IGNORED"
  14437. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  14438. // "UNDECLARED_PROPERTIES"
  14439. // "UNREACHABLE"
  14440. Code string `json:"code,omitempty"`
  14441. // Data: [Output Only] Metadata about this warning in key: value format.
  14442. // For example:
  14443. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  14444. Data []*InterconnectLocationListWarningData `json:"data,omitempty"`
  14445. // Message: [Output Only] A human-readable description of the warning
  14446. // code.
  14447. Message string `json:"message,omitempty"`
  14448. // ForceSendFields is a list of field names (e.g. "Code") to
  14449. // unconditionally include in API requests. By default, fields with
  14450. // empty values are omitted from API requests. However, any non-pointer,
  14451. // non-interface field appearing in ForceSendFields will be sent to the
  14452. // server regardless of whether the field is empty or not. This may be
  14453. // used to include empty fields in Patch requests.
  14454. ForceSendFields []string `json:"-"`
  14455. // NullFields is a list of field names (e.g. "Code") to include in API
  14456. // requests with the JSON null value. By default, fields with empty
  14457. // values are omitted from API requests. However, any field with an
  14458. // empty value appearing in NullFields will be sent to the server as
  14459. // null. It is an error if a field in this list has a non-empty value.
  14460. // This may be used to include null fields in Patch requests.
  14461. NullFields []string `json:"-"`
  14462. }
  14463. func (s *InterconnectLocationListWarning) MarshalJSON() ([]byte, error) {
  14464. type NoMethod InterconnectLocationListWarning
  14465. raw := NoMethod(*s)
  14466. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14467. }
  14468. type InterconnectLocationListWarningData struct {
  14469. // Key: [Output Only] A key that provides more detail on the warning
  14470. // being returned. For example, for warnings where there are no results
  14471. // in a list request for a particular zone, this key might be scope and
  14472. // the key value might be the zone name. Other examples might be a key
  14473. // indicating a deprecated resource and a suggested replacement, or a
  14474. // warning about invalid network settings (for example, if an instance
  14475. // attempts to perform IP forwarding but is not enabled for IP
  14476. // forwarding).
  14477. Key string `json:"key,omitempty"`
  14478. // Value: [Output Only] A warning data value corresponding to the key.
  14479. Value string `json:"value,omitempty"`
  14480. // ForceSendFields is a list of field names (e.g. "Key") to
  14481. // unconditionally include in API requests. By default, fields with
  14482. // empty values are omitted from API requests. However, any non-pointer,
  14483. // non-interface field appearing in ForceSendFields will be sent to the
  14484. // server regardless of whether the field is empty or not. This may be
  14485. // used to include empty fields in Patch requests.
  14486. ForceSendFields []string `json:"-"`
  14487. // NullFields is a list of field names (e.g. "Key") to include in API
  14488. // requests with the JSON null value. By default, fields with empty
  14489. // values are omitted from API requests. However, any field with an
  14490. // empty value appearing in NullFields will be sent to the server as
  14491. // null. It is an error if a field in this list has a non-empty value.
  14492. // This may be used to include null fields in Patch requests.
  14493. NullFields []string `json:"-"`
  14494. }
  14495. func (s *InterconnectLocationListWarningData) MarshalJSON() ([]byte, error) {
  14496. type NoMethod InterconnectLocationListWarningData
  14497. raw := NoMethod(*s)
  14498. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14499. }
  14500. // InterconnectLocationRegionInfo: Information about any potential
  14501. // InterconnectAttachments between an Interconnect at a specific
  14502. // InterconnectLocation, and a specific Cloud Region.
  14503. type InterconnectLocationRegionInfo struct {
  14504. // ExpectedRttMs: Expected round-trip time in milliseconds, from this
  14505. // InterconnectLocation to a VM in this region.
  14506. ExpectedRttMs int64 `json:"expectedRttMs,omitempty,string"`
  14507. // LocationPresence: Identifies the network presence of this location.
  14508. //
  14509. // Possible values:
  14510. // "GLOBAL"
  14511. // "LOCAL_REGION"
  14512. // "LP_GLOBAL"
  14513. // "LP_LOCAL_REGION"
  14514. LocationPresence string `json:"locationPresence,omitempty"`
  14515. // Region: URL for the region of this location.
  14516. Region string `json:"region,omitempty"`
  14517. // ForceSendFields is a list of field names (e.g. "ExpectedRttMs") to
  14518. // unconditionally include in API requests. By default, fields with
  14519. // empty values are omitted from API requests. However, any non-pointer,
  14520. // non-interface field appearing in ForceSendFields will be sent to the
  14521. // server regardless of whether the field is empty or not. This may be
  14522. // used to include empty fields in Patch requests.
  14523. ForceSendFields []string `json:"-"`
  14524. // NullFields is a list of field names (e.g. "ExpectedRttMs") to include
  14525. // in API requests with the JSON null value. By default, fields with
  14526. // empty values are omitted from API requests. However, any field with
  14527. // an empty value appearing in NullFields will be sent to the server as
  14528. // null. It is an error if a field in this list has a non-empty value.
  14529. // This may be used to include null fields in Patch requests.
  14530. NullFields []string `json:"-"`
  14531. }
  14532. func (s *InterconnectLocationRegionInfo) MarshalJSON() ([]byte, error) {
  14533. type NoMethod InterconnectLocationRegionInfo
  14534. raw := NoMethod(*s)
  14535. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14536. }
  14537. // InterconnectOutageNotification: Description of a planned outage on
  14538. // this Interconnect. Next id: 9
  14539. type InterconnectOutageNotification struct {
  14540. // AffectedCircuits: If issue_type is IT_PARTIAL_OUTAGE, a list of the
  14541. // Google-side circuit IDs that will be affected.
  14542. AffectedCircuits []string `json:"affectedCircuits,omitempty"`
  14543. // Description: A description about the purpose of the outage.
  14544. Description string `json:"description,omitempty"`
  14545. // EndTime: Scheduled end time for the outage (milliseconds since Unix
  14546. // epoch).
  14547. EndTime int64 `json:"endTime,omitempty,string"`
  14548. // IssueType: Form this outage is expected to take. Note that the "IT_"
  14549. // versions of this enum have been deprecated in favor of the unprefixed
  14550. // values.
  14551. //
  14552. // Possible values:
  14553. // "IT_OUTAGE"
  14554. // "IT_PARTIAL_OUTAGE"
  14555. // "OUTAGE"
  14556. // "PARTIAL_OUTAGE"
  14557. IssueType string `json:"issueType,omitempty"`
  14558. // Name: Unique identifier for this outage notification.
  14559. Name string `json:"name,omitempty"`
  14560. // Source: The party that generated this notification. Note that
  14561. // "NSRC_GOOGLE" has been deprecated in favor of "GOOGLE"
  14562. //
  14563. // Possible values:
  14564. // "GOOGLE"
  14565. // "NSRC_GOOGLE"
  14566. Source string `json:"source,omitempty"`
  14567. // StartTime: Scheduled start time for the outage (milliseconds since
  14568. // Unix epoch).
  14569. StartTime int64 `json:"startTime,omitempty,string"`
  14570. // State: State of this notification. Note that the "NS_" versions of
  14571. // this enum have been deprecated in favor of the unprefixed values.
  14572. //
  14573. // Possible values:
  14574. // "ACTIVE"
  14575. // "CANCELLED"
  14576. // "NS_ACTIVE"
  14577. // "NS_CANCELED"
  14578. State string `json:"state,omitempty"`
  14579. // ForceSendFields is a list of field names (e.g. "AffectedCircuits") to
  14580. // unconditionally include in API requests. By default, fields with
  14581. // empty values are omitted from API requests. However, any non-pointer,
  14582. // non-interface field appearing in ForceSendFields will be sent to the
  14583. // server regardless of whether the field is empty or not. This may be
  14584. // used to include empty fields in Patch requests.
  14585. ForceSendFields []string `json:"-"`
  14586. // NullFields is a list of field names (e.g. "AffectedCircuits") to
  14587. // include in API requests with the JSON null value. By default, fields
  14588. // with empty values are omitted from API requests. However, any field
  14589. // with an empty value appearing in NullFields will be sent to the
  14590. // server as null. It is an error if a field in this list has a
  14591. // non-empty value. This may be used to include null fields in Patch
  14592. // requests.
  14593. NullFields []string `json:"-"`
  14594. }
  14595. func (s *InterconnectOutageNotification) MarshalJSON() ([]byte, error) {
  14596. type NoMethod InterconnectOutageNotification
  14597. raw := NoMethod(*s)
  14598. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14599. }
  14600. type InternalIpOwner struct {
  14601. // IpCidrRange: IP CIDR range being owned.
  14602. IpCidrRange string `json:"ipCidrRange,omitempty"`
  14603. // Owners: URLs of the IP owners of the IP CIDR range.
  14604. Owners []string `json:"owners,omitempty"`
  14605. // SystemOwned: Whether this IP CIDR range is reserved for system use.
  14606. SystemOwned bool `json:"systemOwned,omitempty"`
  14607. // ForceSendFields is a list of field names (e.g. "IpCidrRange") to
  14608. // unconditionally include in API requests. By default, fields with
  14609. // empty values are omitted from API requests. However, any non-pointer,
  14610. // non-interface field appearing in ForceSendFields will be sent to the
  14611. // server regardless of whether the field is empty or not. This may be
  14612. // used to include empty fields in Patch requests.
  14613. ForceSendFields []string `json:"-"`
  14614. // NullFields is a list of field names (e.g. "IpCidrRange") to include
  14615. // in API requests with the JSON null value. By default, fields with
  14616. // empty values are omitted from API requests. However, any field with
  14617. // an empty value appearing in NullFields will be sent to the server as
  14618. // null. It is an error if a field in this list has a non-empty value.
  14619. // This may be used to include null fields in Patch requests.
  14620. NullFields []string `json:"-"`
  14621. }
  14622. func (s *InternalIpOwner) MarshalJSON() ([]byte, error) {
  14623. type NoMethod InternalIpOwner
  14624. raw := NoMethod(*s)
  14625. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14626. }
  14627. // IpOwnerList: Contains a list of IP owners.
  14628. type IpOwnerList struct {
  14629. // Id: [Output Only] Unique identifier for the resource; defined by the
  14630. // server.
  14631. Id string `json:"id,omitempty"`
  14632. // Items: A list of InternalIpOwner resources.
  14633. Items []*InternalIpOwner `json:"items,omitempty"`
  14634. // Kind: [Output Only] Type of resource. Always compute#ipOwnerList for
  14635. // lists of IP owners.
  14636. Kind string `json:"kind,omitempty"`
  14637. // NextPageToken: [Output Only] This token allows you to get the next
  14638. // page of results for list requests. If the number of results is larger
  14639. // than maxResults, use the nextPageToken as a value for the query
  14640. // parameter pageToken in the next list request. Subsequent list
  14641. // requests will have their own nextPageToken to continue paging through
  14642. // the results.
  14643. NextPageToken string `json:"nextPageToken,omitempty"`
  14644. // SelfLink: [Output Only] Server-defined URL for this resource.
  14645. SelfLink string `json:"selfLink,omitempty"`
  14646. // Warning: [Output Only] Informational warning message.
  14647. Warning *IpOwnerListWarning `json:"warning,omitempty"`
  14648. // ServerResponse contains the HTTP response code and headers from the
  14649. // server.
  14650. googleapi.ServerResponse `json:"-"`
  14651. // ForceSendFields is a list of field names (e.g. "Id") to
  14652. // unconditionally include in API requests. By default, fields with
  14653. // empty values are omitted from API requests. However, any non-pointer,
  14654. // non-interface field appearing in ForceSendFields will be sent to the
  14655. // server regardless of whether the field is empty or not. This may be
  14656. // used to include empty fields in Patch requests.
  14657. ForceSendFields []string `json:"-"`
  14658. // NullFields is a list of field names (e.g. "Id") to include in API
  14659. // requests with the JSON null value. By default, fields with empty
  14660. // values are omitted from API requests. However, any field with an
  14661. // empty value appearing in NullFields will be sent to the server as
  14662. // null. It is an error if a field in this list has a non-empty value.
  14663. // This may be used to include null fields in Patch requests.
  14664. NullFields []string `json:"-"`
  14665. }
  14666. func (s *IpOwnerList) MarshalJSON() ([]byte, error) {
  14667. type NoMethod IpOwnerList
  14668. raw := NoMethod(*s)
  14669. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14670. }
  14671. // IpOwnerListWarning: [Output Only] Informational warning message.
  14672. type IpOwnerListWarning struct {
  14673. // Code: [Output Only] A warning code, if applicable. For example,
  14674. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  14675. // the response.
  14676. //
  14677. // Possible values:
  14678. // "CLEANUP_FAILED"
  14679. // "DEPRECATED_RESOURCE_USED"
  14680. // "DEPRECATED_TYPE_USED"
  14681. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  14682. // "EXPERIMENTAL_TYPE_USED"
  14683. // "EXTERNAL_API_WARNING"
  14684. // "FIELD_VALUE_OVERRIDEN"
  14685. // "INJECTED_KERNELS_DEPRECATED"
  14686. // "MISSING_TYPE_DEPENDENCY"
  14687. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  14688. // "NEXT_HOP_CANNOT_IP_FORWARD"
  14689. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  14690. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  14691. // "NEXT_HOP_NOT_RUNNING"
  14692. // "NOT_CRITICAL_ERROR"
  14693. // "NO_RESULTS_ON_PAGE"
  14694. // "REQUIRED_TOS_AGREEMENT"
  14695. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  14696. // "RESOURCE_NOT_DELETED"
  14697. // "SCHEMA_VALIDATION_IGNORED"
  14698. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  14699. // "UNDECLARED_PROPERTIES"
  14700. // "UNREACHABLE"
  14701. Code string `json:"code,omitempty"`
  14702. // Data: [Output Only] Metadata about this warning in key: value format.
  14703. // For example:
  14704. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  14705. Data []*IpOwnerListWarningData `json:"data,omitempty"`
  14706. // Message: [Output Only] A human-readable description of the warning
  14707. // code.
  14708. Message string `json:"message,omitempty"`
  14709. // ForceSendFields is a list of field names (e.g. "Code") to
  14710. // unconditionally include in API requests. By default, fields with
  14711. // empty values are omitted from API requests. However, any non-pointer,
  14712. // non-interface field appearing in ForceSendFields will be sent to the
  14713. // server regardless of whether the field is empty or not. This may be
  14714. // used to include empty fields in Patch requests.
  14715. ForceSendFields []string `json:"-"`
  14716. // NullFields is a list of field names (e.g. "Code") to include in API
  14717. // requests with the JSON null value. By default, fields with empty
  14718. // values are omitted from API requests. However, any field with an
  14719. // empty value appearing in NullFields will be sent to the server as
  14720. // null. It is an error if a field in this list has a non-empty value.
  14721. // This may be used to include null fields in Patch requests.
  14722. NullFields []string `json:"-"`
  14723. }
  14724. func (s *IpOwnerListWarning) MarshalJSON() ([]byte, error) {
  14725. type NoMethod IpOwnerListWarning
  14726. raw := NoMethod(*s)
  14727. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14728. }
  14729. type IpOwnerListWarningData struct {
  14730. // Key: [Output Only] A key that provides more detail on the warning
  14731. // being returned. For example, for warnings where there are no results
  14732. // in a list request for a particular zone, this key might be scope and
  14733. // the key value might be the zone name. Other examples might be a key
  14734. // indicating a deprecated resource and a suggested replacement, or a
  14735. // warning about invalid network settings (for example, if an instance
  14736. // attempts to perform IP forwarding but is not enabled for IP
  14737. // forwarding).
  14738. Key string `json:"key,omitempty"`
  14739. // Value: [Output Only] A warning data value corresponding to the key.
  14740. Value string `json:"value,omitempty"`
  14741. // ForceSendFields is a list of field names (e.g. "Key") to
  14742. // unconditionally include in API requests. By default, fields with
  14743. // empty values are omitted from API requests. However, any non-pointer,
  14744. // non-interface field appearing in ForceSendFields will be sent to the
  14745. // server regardless of whether the field is empty or not. This may be
  14746. // used to include empty fields in Patch requests.
  14747. ForceSendFields []string `json:"-"`
  14748. // NullFields is a list of field names (e.g. "Key") to include in API
  14749. // requests with the JSON null value. By default, fields with empty
  14750. // values are omitted from API requests. However, any field with an
  14751. // empty value appearing in NullFields will be sent to the server as
  14752. // null. It is an error if a field in this list has a non-empty value.
  14753. // This may be used to include null fields in Patch requests.
  14754. NullFields []string `json:"-"`
  14755. }
  14756. func (s *IpOwnerListWarningData) MarshalJSON() ([]byte, error) {
  14757. type NoMethod IpOwnerListWarningData
  14758. raw := NoMethod(*s)
  14759. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14760. }
  14761. // License: A license resource.
  14762. type License struct {
  14763. // ChargesUseFee: [Output Only] Deprecated. This field no longer
  14764. // reflects whether a license charges a usage fee.
  14765. ChargesUseFee bool `json:"chargesUseFee,omitempty"`
  14766. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  14767. // format.
  14768. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  14769. // Description: An optional textual description of the resource;
  14770. // provided by the client when the resource is created.
  14771. Description string `json:"description,omitempty"`
  14772. // Id: [Output Only] The unique identifier for the resource. This
  14773. // identifier is defined by the server.
  14774. Id uint64 `json:"id,omitempty,string"`
  14775. // Kind: [Output Only] Type of resource. Always compute#license for
  14776. // licenses.
  14777. Kind string `json:"kind,omitempty"`
  14778. // LicenseCode: [Output Only] The unique code used to attach this
  14779. // license to images, snapshots, and disks.
  14780. LicenseCode uint64 `json:"licenseCode,omitempty,string"`
  14781. // Name: [Output Only] Name of the resource. The name is 1-63 characters
  14782. // long and complies with RFC1035.
  14783. Name string `json:"name,omitempty"`
  14784. ResourceRequirements *LicenseResourceRequirements `json:"resourceRequirements,omitempty"`
  14785. // SelfLink: [Output Only] Server-defined URL for the resource.
  14786. SelfLink string `json:"selfLink,omitempty"`
  14787. // Transferable: If false, licenses will not be copied from the source
  14788. // resource when creating an image from a disk, disk from snapshot, or
  14789. // snapshot from disk.
  14790. Transferable bool `json:"transferable,omitempty"`
  14791. // ServerResponse contains the HTTP response code and headers from the
  14792. // server.
  14793. googleapi.ServerResponse `json:"-"`
  14794. // ForceSendFields is a list of field names (e.g. "ChargesUseFee") to
  14795. // unconditionally include in API requests. By default, fields with
  14796. // empty values are omitted from API requests. However, any non-pointer,
  14797. // non-interface field appearing in ForceSendFields will be sent to the
  14798. // server regardless of whether the field is empty or not. This may be
  14799. // used to include empty fields in Patch requests.
  14800. ForceSendFields []string `json:"-"`
  14801. // NullFields is a list of field names (e.g. "ChargesUseFee") to include
  14802. // in API requests with the JSON null value. By default, fields with
  14803. // empty values are omitted from API requests. However, any field with
  14804. // an empty value appearing in NullFields will be sent to the server as
  14805. // null. It is an error if a field in this list has a non-empty value.
  14806. // This may be used to include null fields in Patch requests.
  14807. NullFields []string `json:"-"`
  14808. }
  14809. func (s *License) MarshalJSON() ([]byte, error) {
  14810. type NoMethod License
  14811. raw := NoMethod(*s)
  14812. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14813. }
  14814. type LicenseCode struct {
  14815. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  14816. // format.
  14817. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  14818. // Description: [Output Only] Description of this License Code.
  14819. Description string `json:"description,omitempty"`
  14820. // Id: [Output Only] The unique identifier for the resource. This
  14821. // identifier is defined by the server.
  14822. Id uint64 `json:"id,omitempty,string"`
  14823. // Kind: [Output Only] Type of resource. Always compute#licenseCode for
  14824. // licenses.
  14825. Kind string `json:"kind,omitempty"`
  14826. // LicenseAlias: [Output Only] URL and description aliases of Licenses
  14827. // with the same License Code.
  14828. LicenseAlias []*LicenseCodeLicenseAlias `json:"licenseAlias,omitempty"`
  14829. // Name: [Output Only] Name of the resource. The name is 1-20 characters
  14830. // long and must be a valid 64 bit integer.
  14831. Name string `json:"name,omitempty"`
  14832. // SelfLink: [Output Only] Server-defined URL for the resource.
  14833. SelfLink string `json:"selfLink,omitempty"`
  14834. // State: [Output Only] Current state of this License Code.
  14835. //
  14836. // Possible values:
  14837. // "DISABLED"
  14838. // "ENABLED"
  14839. // "RESTRICTED"
  14840. // "STATE_UNSPECIFIED"
  14841. // "TERMINATED"
  14842. State string `json:"state,omitempty"`
  14843. // Transferable: [Output Only] If true, the license will remain attached
  14844. // when creating images or snapshots from disks. Otherwise, the license
  14845. // is not transferred.
  14846. Transferable bool `json:"transferable,omitempty"`
  14847. // ServerResponse contains the HTTP response code and headers from the
  14848. // server.
  14849. googleapi.ServerResponse `json:"-"`
  14850. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  14851. // to unconditionally include in API requests. By default, fields with
  14852. // empty values are omitted from API requests. However, any non-pointer,
  14853. // non-interface field appearing in ForceSendFields will be sent to the
  14854. // server regardless of whether the field is empty or not. This may be
  14855. // used to include empty fields in Patch requests.
  14856. ForceSendFields []string `json:"-"`
  14857. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  14858. // include in API requests with the JSON null value. By default, fields
  14859. // with empty values are omitted from API requests. However, any field
  14860. // with an empty value appearing in NullFields will be sent to the
  14861. // server as null. It is an error if a field in this list has a
  14862. // non-empty value. This may be used to include null fields in Patch
  14863. // requests.
  14864. NullFields []string `json:"-"`
  14865. }
  14866. func (s *LicenseCode) MarshalJSON() ([]byte, error) {
  14867. type NoMethod LicenseCode
  14868. raw := NoMethod(*s)
  14869. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14870. }
  14871. type LicenseCodeLicenseAlias struct {
  14872. // Description: [Output Only] Description of this License Code.
  14873. Description string `json:"description,omitempty"`
  14874. // SelfLink: [Output Only] URL of license corresponding to this License
  14875. // Code.
  14876. SelfLink string `json:"selfLink,omitempty"`
  14877. // ForceSendFields is a list of field names (e.g. "Description") to
  14878. // unconditionally include in API requests. By default, fields with
  14879. // empty values are omitted from API requests. However, any non-pointer,
  14880. // non-interface field appearing in ForceSendFields will be sent to the
  14881. // server regardless of whether the field is empty or not. This may be
  14882. // used to include empty fields in Patch requests.
  14883. ForceSendFields []string `json:"-"`
  14884. // NullFields is a list of field names (e.g. "Description") to include
  14885. // in API requests with the JSON null value. By default, fields with
  14886. // empty values are omitted from API requests. However, any field with
  14887. // an empty value appearing in NullFields will be sent to the server as
  14888. // null. It is an error if a field in this list has a non-empty value.
  14889. // This may be used to include null fields in Patch requests.
  14890. NullFields []string `json:"-"`
  14891. }
  14892. func (s *LicenseCodeLicenseAlias) MarshalJSON() ([]byte, error) {
  14893. type NoMethod LicenseCodeLicenseAlias
  14894. raw := NoMethod(*s)
  14895. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14896. }
  14897. type LicenseResourceRequirements struct {
  14898. // MinGuestCpuCount: Minimum number of guest cpus required to use the
  14899. // Instance. Enforced at Instance creation and Instance start.
  14900. MinGuestCpuCount int64 `json:"minGuestCpuCount,omitempty"`
  14901. // MinMemoryMb: Minimum memory required to use the Instance. Enforced at
  14902. // Instance creation and Instance start.
  14903. MinMemoryMb int64 `json:"minMemoryMb,omitempty"`
  14904. // ForceSendFields is a list of field names (e.g. "MinGuestCpuCount") to
  14905. // unconditionally include in API requests. By default, fields with
  14906. // empty values are omitted from API requests. However, any non-pointer,
  14907. // non-interface field appearing in ForceSendFields will be sent to the
  14908. // server regardless of whether the field is empty or not. This may be
  14909. // used to include empty fields in Patch requests.
  14910. ForceSendFields []string `json:"-"`
  14911. // NullFields is a list of field names (e.g. "MinGuestCpuCount") to
  14912. // include in API requests with the JSON null value. By default, fields
  14913. // with empty values are omitted from API requests. However, any field
  14914. // with an empty value appearing in NullFields will be sent to the
  14915. // server as null. It is an error if a field in this list has a
  14916. // non-empty value. This may be used to include null fields in Patch
  14917. // requests.
  14918. NullFields []string `json:"-"`
  14919. }
  14920. func (s *LicenseResourceRequirements) MarshalJSON() ([]byte, error) {
  14921. type NoMethod LicenseResourceRequirements
  14922. raw := NoMethod(*s)
  14923. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14924. }
  14925. type LicensesListResponse struct {
  14926. // Id: [Output Only] Unique identifier for the resource; defined by the
  14927. // server.
  14928. Id string `json:"id,omitempty"`
  14929. // Items: A list of License resources.
  14930. Items []*License `json:"items,omitempty"`
  14931. // NextPageToken: [Output Only] This token allows you to get the next
  14932. // page of results for list requests. If the number of results is larger
  14933. // than maxResults, use the nextPageToken as a value for the query
  14934. // parameter pageToken in the next list request. Subsequent list
  14935. // requests will have their own nextPageToken to continue paging through
  14936. // the results.
  14937. NextPageToken string `json:"nextPageToken,omitempty"`
  14938. // SelfLink: [Output Only] Server-defined URL for this resource.
  14939. SelfLink string `json:"selfLink,omitempty"`
  14940. // Warning: [Output Only] Informational warning message.
  14941. Warning *LicensesListResponseWarning `json:"warning,omitempty"`
  14942. // ServerResponse contains the HTTP response code and headers from the
  14943. // server.
  14944. googleapi.ServerResponse `json:"-"`
  14945. // ForceSendFields is a list of field names (e.g. "Id") to
  14946. // unconditionally include in API requests. By default, fields with
  14947. // empty values are omitted from API requests. However, any non-pointer,
  14948. // non-interface field appearing in ForceSendFields will be sent to the
  14949. // server regardless of whether the field is empty or not. This may be
  14950. // used to include empty fields in Patch requests.
  14951. ForceSendFields []string `json:"-"`
  14952. // NullFields is a list of field names (e.g. "Id") to include in API
  14953. // requests with the JSON null value. By default, fields with empty
  14954. // values are omitted from API requests. However, any field with an
  14955. // empty value appearing in NullFields will be sent to the server as
  14956. // null. It is an error if a field in this list has a non-empty value.
  14957. // This may be used to include null fields in Patch requests.
  14958. NullFields []string `json:"-"`
  14959. }
  14960. func (s *LicensesListResponse) MarshalJSON() ([]byte, error) {
  14961. type NoMethod LicensesListResponse
  14962. raw := NoMethod(*s)
  14963. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14964. }
  14965. // LicensesListResponseWarning: [Output Only] Informational warning
  14966. // message.
  14967. type LicensesListResponseWarning struct {
  14968. // Code: [Output Only] A warning code, if applicable. For example,
  14969. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  14970. // the response.
  14971. //
  14972. // Possible values:
  14973. // "CLEANUP_FAILED"
  14974. // "DEPRECATED_RESOURCE_USED"
  14975. // "DEPRECATED_TYPE_USED"
  14976. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  14977. // "EXPERIMENTAL_TYPE_USED"
  14978. // "EXTERNAL_API_WARNING"
  14979. // "FIELD_VALUE_OVERRIDEN"
  14980. // "INJECTED_KERNELS_DEPRECATED"
  14981. // "MISSING_TYPE_DEPENDENCY"
  14982. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  14983. // "NEXT_HOP_CANNOT_IP_FORWARD"
  14984. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  14985. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  14986. // "NEXT_HOP_NOT_RUNNING"
  14987. // "NOT_CRITICAL_ERROR"
  14988. // "NO_RESULTS_ON_PAGE"
  14989. // "REQUIRED_TOS_AGREEMENT"
  14990. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  14991. // "RESOURCE_NOT_DELETED"
  14992. // "SCHEMA_VALIDATION_IGNORED"
  14993. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  14994. // "UNDECLARED_PROPERTIES"
  14995. // "UNREACHABLE"
  14996. Code string `json:"code,omitempty"`
  14997. // Data: [Output Only] Metadata about this warning in key: value format.
  14998. // For example:
  14999. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  15000. Data []*LicensesListResponseWarningData `json:"data,omitempty"`
  15001. // Message: [Output Only] A human-readable description of the warning
  15002. // code.
  15003. Message string `json:"message,omitempty"`
  15004. // ForceSendFields is a list of field names (e.g. "Code") to
  15005. // unconditionally include in API requests. By default, fields with
  15006. // empty values are omitted from API requests. However, any non-pointer,
  15007. // non-interface field appearing in ForceSendFields will be sent to the
  15008. // server regardless of whether the field is empty or not. This may be
  15009. // used to include empty fields in Patch requests.
  15010. ForceSendFields []string `json:"-"`
  15011. // NullFields is a list of field names (e.g. "Code") to include in API
  15012. // requests with the JSON null value. By default, fields with empty
  15013. // values are omitted from API requests. However, any field with an
  15014. // empty value appearing in NullFields will be sent to the server as
  15015. // null. It is an error if a field in this list has a non-empty value.
  15016. // This may be used to include null fields in Patch requests.
  15017. NullFields []string `json:"-"`
  15018. }
  15019. func (s *LicensesListResponseWarning) MarshalJSON() ([]byte, error) {
  15020. type NoMethod LicensesListResponseWarning
  15021. raw := NoMethod(*s)
  15022. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15023. }
  15024. type LicensesListResponseWarningData struct {
  15025. // Key: [Output Only] A key that provides more detail on the warning
  15026. // being returned. For example, for warnings where there are no results
  15027. // in a list request for a particular zone, this key might be scope and
  15028. // the key value might be the zone name. Other examples might be a key
  15029. // indicating a deprecated resource and a suggested replacement, or a
  15030. // warning about invalid network settings (for example, if an instance
  15031. // attempts to perform IP forwarding but is not enabled for IP
  15032. // forwarding).
  15033. Key string `json:"key,omitempty"`
  15034. // Value: [Output Only] A warning data value corresponding to the key.
  15035. Value string `json:"value,omitempty"`
  15036. // ForceSendFields is a list of field names (e.g. "Key") to
  15037. // unconditionally include in API requests. By default, fields with
  15038. // empty values are omitted from API requests. However, any non-pointer,
  15039. // non-interface field appearing in ForceSendFields will be sent to the
  15040. // server regardless of whether the field is empty or not. This may be
  15041. // used to include empty fields in Patch requests.
  15042. ForceSendFields []string `json:"-"`
  15043. // NullFields is a list of field names (e.g. "Key") to include in API
  15044. // requests with the JSON null value. By default, fields with empty
  15045. // values are omitted from API requests. However, any field with an
  15046. // empty value appearing in NullFields will be sent to the server as
  15047. // null. It is an error if a field in this list has a non-empty value.
  15048. // This may be used to include null fields in Patch requests.
  15049. NullFields []string `json:"-"`
  15050. }
  15051. func (s *LicensesListResponseWarningData) MarshalJSON() ([]byte, error) {
  15052. type NoMethod LicensesListResponseWarningData
  15053. raw := NoMethod(*s)
  15054. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15055. }
  15056. // LogConfig: Specifies what kind of log the caller must write
  15057. type LogConfig struct {
  15058. // CloudAudit: Cloud audit options.
  15059. CloudAudit *LogConfigCloudAuditOptions `json:"cloudAudit,omitempty"`
  15060. // Counter: Counter options.
  15061. Counter *LogConfigCounterOptions `json:"counter,omitempty"`
  15062. // DataAccess: Data access options.
  15063. DataAccess *LogConfigDataAccessOptions `json:"dataAccess,omitempty"`
  15064. // ForceSendFields is a list of field names (e.g. "CloudAudit") to
  15065. // unconditionally include in API requests. By default, fields with
  15066. // empty values are omitted from API requests. However, any non-pointer,
  15067. // non-interface field appearing in ForceSendFields will be sent to the
  15068. // server regardless of whether the field is empty or not. This may be
  15069. // used to include empty fields in Patch requests.
  15070. ForceSendFields []string `json:"-"`
  15071. // NullFields is a list of field names (e.g. "CloudAudit") to include in
  15072. // API requests with the JSON null value. By default, fields with empty
  15073. // values are omitted from API requests. However, any field with an
  15074. // empty value appearing in NullFields will be sent to the server as
  15075. // null. It is an error if a field in this list has a non-empty value.
  15076. // This may be used to include null fields in Patch requests.
  15077. NullFields []string `json:"-"`
  15078. }
  15079. func (s *LogConfig) MarshalJSON() ([]byte, error) {
  15080. type NoMethod LogConfig
  15081. raw := NoMethod(*s)
  15082. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15083. }
  15084. // LogConfigCloudAuditOptions: Write a Cloud Audit log
  15085. type LogConfigCloudAuditOptions struct {
  15086. // AuthorizationLoggingOptions: Information used by the Cloud Audit
  15087. // Logging pipeline.
  15088. AuthorizationLoggingOptions *AuthorizationLoggingOptions `json:"authorizationLoggingOptions,omitempty"`
  15089. // LogName: The log_name to populate in the Cloud Audit Record.
  15090. //
  15091. // Possible values:
  15092. // "ADMIN_ACTIVITY"
  15093. // "DATA_ACCESS"
  15094. // "UNSPECIFIED_LOG_NAME"
  15095. LogName string `json:"logName,omitempty"`
  15096. // ForceSendFields is a list of field names (e.g.
  15097. // "AuthorizationLoggingOptions") to unconditionally include in API
  15098. // requests. By default, fields with empty values are omitted from API
  15099. // requests. However, any non-pointer, non-interface field appearing in
  15100. // ForceSendFields will be sent to the server regardless of whether the
  15101. // field is empty or not. This may be used to include empty fields in
  15102. // Patch requests.
  15103. ForceSendFields []string `json:"-"`
  15104. // NullFields is a list of field names (e.g.
  15105. // "AuthorizationLoggingOptions") to include in API requests with the
  15106. // JSON null value. By default, fields with empty values are omitted
  15107. // from API requests. However, any field with an empty value appearing
  15108. // in NullFields will be sent to the server as null. It is an error if a
  15109. // field in this list has a non-empty value. This may be used to include
  15110. // null fields in Patch requests.
  15111. NullFields []string `json:"-"`
  15112. }
  15113. func (s *LogConfigCloudAuditOptions) MarshalJSON() ([]byte, error) {
  15114. type NoMethod LogConfigCloudAuditOptions
  15115. raw := NoMethod(*s)
  15116. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15117. }
  15118. // LogConfigCounterOptions: Increment a streamz counter with the
  15119. // specified metric and field names.
  15120. //
  15121. // Metric names should start with a '/', generally be lowercase-only,
  15122. // and end in "_count". Field names should not contain an initial slash.
  15123. // The actual exported metric names will have "/iam/policy"
  15124. // prepended.
  15125. //
  15126. // Field names correspond to IAM request parameters and field values are
  15127. // their respective values.
  15128. //
  15129. // At present the only supported field names are - "iam_principal",
  15130. // corresponding to IAMContext.principal; - "" (empty string), resulting
  15131. // in one aggretated counter with no field.
  15132. //
  15133. // Examples: counter { metric: "/debug_access_count" field:
  15134. // "iam_principal" } ==> increment counter
  15135. // /iam/policy/backend_debug_access_count {iam_principal=[value of
  15136. // IAMContext.principal]}
  15137. //
  15138. // At this time we do not support: * multiple field names (though this
  15139. // may be supported in the future) * decrementing the counter *
  15140. // incrementing it by anything other than 1
  15141. type LogConfigCounterOptions struct {
  15142. // Field: The field value to attribute.
  15143. Field string `json:"field,omitempty"`
  15144. // Metric: The metric to update.
  15145. Metric string `json:"metric,omitempty"`
  15146. // ForceSendFields is a list of field names (e.g. "Field") to
  15147. // unconditionally include in API requests. By default, fields with
  15148. // empty values are omitted from API requests. However, any non-pointer,
  15149. // non-interface field appearing in ForceSendFields will be sent to the
  15150. // server regardless of whether the field is empty or not. This may be
  15151. // used to include empty fields in Patch requests.
  15152. ForceSendFields []string `json:"-"`
  15153. // NullFields is a list of field names (e.g. "Field") to include in API
  15154. // requests with the JSON null value. By default, fields with empty
  15155. // values are omitted from API requests. However, any field with an
  15156. // empty value appearing in NullFields will be sent to the server as
  15157. // null. It is an error if a field in this list has a non-empty value.
  15158. // This may be used to include null fields in Patch requests.
  15159. NullFields []string `json:"-"`
  15160. }
  15161. func (s *LogConfigCounterOptions) MarshalJSON() ([]byte, error) {
  15162. type NoMethod LogConfigCounterOptions
  15163. raw := NoMethod(*s)
  15164. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15165. }
  15166. // LogConfigDataAccessOptions: Write a Data Access (Gin) log
  15167. type LogConfigDataAccessOptions struct {
  15168. // LogMode: Whether Gin logging should happen in a fail-closed manner at
  15169. // the caller. This is relevant only in the LocalIAM implementation, for
  15170. // now.
  15171. //
  15172. // Possible values:
  15173. // "LOG_FAIL_CLOSED"
  15174. // "LOG_MODE_UNSPECIFIED"
  15175. LogMode string `json:"logMode,omitempty"`
  15176. // ForceSendFields is a list of field names (e.g. "LogMode") to
  15177. // unconditionally include in API requests. By default, fields with
  15178. // empty values are omitted from API requests. However, any non-pointer,
  15179. // non-interface field appearing in ForceSendFields will be sent to the
  15180. // server regardless of whether the field is empty or not. This may be
  15181. // used to include empty fields in Patch requests.
  15182. ForceSendFields []string `json:"-"`
  15183. // NullFields is a list of field names (e.g. "LogMode") to include in
  15184. // API requests with the JSON null value. By default, fields with empty
  15185. // values are omitted from API requests. However, any field with an
  15186. // empty value appearing in NullFields will be sent to the server as
  15187. // null. It is an error if a field in this list has a non-empty value.
  15188. // This may be used to include null fields in Patch requests.
  15189. NullFields []string `json:"-"`
  15190. }
  15191. func (s *LogConfigDataAccessOptions) MarshalJSON() ([]byte, error) {
  15192. type NoMethod LogConfigDataAccessOptions
  15193. raw := NoMethod(*s)
  15194. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15195. }
  15196. // MachineType: A Machine Type resource. (== resource_for
  15197. // v1.machineTypes ==) (== resource_for beta.machineTypes ==)
  15198. type MachineType struct {
  15199. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  15200. // format.
  15201. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  15202. // Deprecated: [Output Only] The deprecation status associated with this
  15203. // machine type.
  15204. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  15205. // Description: [Output Only] An optional textual description of the
  15206. // resource.
  15207. Description string `json:"description,omitempty"`
  15208. // GuestCpus: [Output Only] The number of virtual CPUs that are
  15209. // available to the instance.
  15210. GuestCpus int64 `json:"guestCpus,omitempty"`
  15211. // Id: [Output Only] The unique identifier for the resource. This
  15212. // identifier is defined by the server.
  15213. Id uint64 `json:"id,omitempty,string"`
  15214. // IsSharedCpu: [Output Only] Whether this machine type has a shared
  15215. // CPU. See Shared-core machine types for more information.
  15216. IsSharedCpu bool `json:"isSharedCpu,omitempty"`
  15217. // Kind: [Output Only] The type of the resource. Always
  15218. // compute#machineType for machine types.
  15219. Kind string `json:"kind,omitempty"`
  15220. // MaximumPersistentDisks: [Output Only] Maximum persistent disks
  15221. // allowed.
  15222. MaximumPersistentDisks int64 `json:"maximumPersistentDisks,omitempty"`
  15223. // MaximumPersistentDisksSizeGb: [Output Only] Maximum total persistent
  15224. // disks size (GB) allowed.
  15225. MaximumPersistentDisksSizeGb int64 `json:"maximumPersistentDisksSizeGb,omitempty,string"`
  15226. // MemoryMb: [Output Only] The amount of physical memory available to
  15227. // the instance, defined in MB.
  15228. MemoryMb int64 `json:"memoryMb,omitempty"`
  15229. // Name: [Output Only] Name of the resource.
  15230. Name string `json:"name,omitempty"`
  15231. // SelfLink: [Output Only] Server-defined URL for the resource.
  15232. SelfLink string `json:"selfLink,omitempty"`
  15233. // Zone: [Output Only] The name of the zone where the machine type
  15234. // resides, such as us-central1-a.
  15235. Zone string `json:"zone,omitempty"`
  15236. // ServerResponse contains the HTTP response code and headers from the
  15237. // server.
  15238. googleapi.ServerResponse `json:"-"`
  15239. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  15240. // to unconditionally include in API requests. By default, fields with
  15241. // empty values are omitted from API requests. However, any non-pointer,
  15242. // non-interface field appearing in ForceSendFields will be sent to the
  15243. // server regardless of whether the field is empty or not. This may be
  15244. // used to include empty fields in Patch requests.
  15245. ForceSendFields []string `json:"-"`
  15246. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  15247. // include in API requests with the JSON null value. By default, fields
  15248. // with empty values are omitted from API requests. However, any field
  15249. // with an empty value appearing in NullFields will be sent to the
  15250. // server as null. It is an error if a field in this list has a
  15251. // non-empty value. This may be used to include null fields in Patch
  15252. // requests.
  15253. NullFields []string `json:"-"`
  15254. }
  15255. func (s *MachineType) MarshalJSON() ([]byte, error) {
  15256. type NoMethod MachineType
  15257. raw := NoMethod(*s)
  15258. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15259. }
  15260. type MachineTypeAggregatedList struct {
  15261. // Id: [Output Only] Unique identifier for the resource; defined by the
  15262. // server.
  15263. Id string `json:"id,omitempty"`
  15264. // Items: A list of MachineTypesScopedList resources.
  15265. Items map[string]MachineTypesScopedList `json:"items,omitempty"`
  15266. // Kind: [Output Only] Type of resource. Always
  15267. // compute#machineTypeAggregatedList for aggregated lists of machine
  15268. // types.
  15269. Kind string `json:"kind,omitempty"`
  15270. // NextPageToken: [Output Only] This token allows you to get the next
  15271. // page of results for list requests. If the number of results is larger
  15272. // than maxResults, use the nextPageToken as a value for the query
  15273. // parameter pageToken in the next list request. Subsequent list
  15274. // requests will have their own nextPageToken to continue paging through
  15275. // the results.
  15276. NextPageToken string `json:"nextPageToken,omitempty"`
  15277. // SelfLink: [Output Only] Server-defined URL for this resource.
  15278. SelfLink string `json:"selfLink,omitempty"`
  15279. // Warning: [Output Only] Informational warning message.
  15280. Warning *MachineTypeAggregatedListWarning `json:"warning,omitempty"`
  15281. // ServerResponse contains the HTTP response code and headers from the
  15282. // server.
  15283. googleapi.ServerResponse `json:"-"`
  15284. // ForceSendFields is a list of field names (e.g. "Id") to
  15285. // unconditionally include in API requests. By default, fields with
  15286. // empty values are omitted from API requests. However, any non-pointer,
  15287. // non-interface field appearing in ForceSendFields will be sent to the
  15288. // server regardless of whether the field is empty or not. This may be
  15289. // used to include empty fields in Patch requests.
  15290. ForceSendFields []string `json:"-"`
  15291. // NullFields is a list of field names (e.g. "Id") to include in API
  15292. // requests with the JSON null value. By default, fields with empty
  15293. // values are omitted from API requests. However, any field with an
  15294. // empty value appearing in NullFields will be sent to the server as
  15295. // null. It is an error if a field in this list has a non-empty value.
  15296. // This may be used to include null fields in Patch requests.
  15297. NullFields []string `json:"-"`
  15298. }
  15299. func (s *MachineTypeAggregatedList) MarshalJSON() ([]byte, error) {
  15300. type NoMethod MachineTypeAggregatedList
  15301. raw := NoMethod(*s)
  15302. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15303. }
  15304. // MachineTypeAggregatedListWarning: [Output Only] Informational warning
  15305. // message.
  15306. type MachineTypeAggregatedListWarning struct {
  15307. // Code: [Output Only] A warning code, if applicable. For example,
  15308. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  15309. // the response.
  15310. //
  15311. // Possible values:
  15312. // "CLEANUP_FAILED"
  15313. // "DEPRECATED_RESOURCE_USED"
  15314. // "DEPRECATED_TYPE_USED"
  15315. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  15316. // "EXPERIMENTAL_TYPE_USED"
  15317. // "EXTERNAL_API_WARNING"
  15318. // "FIELD_VALUE_OVERRIDEN"
  15319. // "INJECTED_KERNELS_DEPRECATED"
  15320. // "MISSING_TYPE_DEPENDENCY"
  15321. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  15322. // "NEXT_HOP_CANNOT_IP_FORWARD"
  15323. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  15324. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  15325. // "NEXT_HOP_NOT_RUNNING"
  15326. // "NOT_CRITICAL_ERROR"
  15327. // "NO_RESULTS_ON_PAGE"
  15328. // "REQUIRED_TOS_AGREEMENT"
  15329. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  15330. // "RESOURCE_NOT_DELETED"
  15331. // "SCHEMA_VALIDATION_IGNORED"
  15332. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  15333. // "UNDECLARED_PROPERTIES"
  15334. // "UNREACHABLE"
  15335. Code string `json:"code,omitempty"`
  15336. // Data: [Output Only] Metadata about this warning in key: value format.
  15337. // For example:
  15338. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  15339. Data []*MachineTypeAggregatedListWarningData `json:"data,omitempty"`
  15340. // Message: [Output Only] A human-readable description of the warning
  15341. // code.
  15342. Message string `json:"message,omitempty"`
  15343. // ForceSendFields is a list of field names (e.g. "Code") to
  15344. // unconditionally include in API requests. By default, fields with
  15345. // empty values are omitted from API requests. However, any non-pointer,
  15346. // non-interface field appearing in ForceSendFields will be sent to the
  15347. // server regardless of whether the field is empty or not. This may be
  15348. // used to include empty fields in Patch requests.
  15349. ForceSendFields []string `json:"-"`
  15350. // NullFields is a list of field names (e.g. "Code") to include in API
  15351. // requests with the JSON null value. By default, fields with empty
  15352. // values are omitted from API requests. However, any field with an
  15353. // empty value appearing in NullFields will be sent to the server as
  15354. // null. It is an error if a field in this list has a non-empty value.
  15355. // This may be used to include null fields in Patch requests.
  15356. NullFields []string `json:"-"`
  15357. }
  15358. func (s *MachineTypeAggregatedListWarning) MarshalJSON() ([]byte, error) {
  15359. type NoMethod MachineTypeAggregatedListWarning
  15360. raw := NoMethod(*s)
  15361. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15362. }
  15363. type MachineTypeAggregatedListWarningData struct {
  15364. // Key: [Output Only] A key that provides more detail on the warning
  15365. // being returned. For example, for warnings where there are no results
  15366. // in a list request for a particular zone, this key might be scope and
  15367. // the key value might be the zone name. Other examples might be a key
  15368. // indicating a deprecated resource and a suggested replacement, or a
  15369. // warning about invalid network settings (for example, if an instance
  15370. // attempts to perform IP forwarding but is not enabled for IP
  15371. // forwarding).
  15372. Key string `json:"key,omitempty"`
  15373. // Value: [Output Only] A warning data value corresponding to the key.
  15374. Value string `json:"value,omitempty"`
  15375. // ForceSendFields is a list of field names (e.g. "Key") to
  15376. // unconditionally include in API requests. By default, fields with
  15377. // empty values are omitted from API requests. However, any non-pointer,
  15378. // non-interface field appearing in ForceSendFields will be sent to the
  15379. // server regardless of whether the field is empty or not. This may be
  15380. // used to include empty fields in Patch requests.
  15381. ForceSendFields []string `json:"-"`
  15382. // NullFields is a list of field names (e.g. "Key") to include in API
  15383. // requests with the JSON null value. By default, fields with empty
  15384. // values are omitted from API requests. However, any field with an
  15385. // empty value appearing in NullFields will be sent to the server as
  15386. // null. It is an error if a field in this list has a non-empty value.
  15387. // This may be used to include null fields in Patch requests.
  15388. NullFields []string `json:"-"`
  15389. }
  15390. func (s *MachineTypeAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  15391. type NoMethod MachineTypeAggregatedListWarningData
  15392. raw := NoMethod(*s)
  15393. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15394. }
  15395. // MachineTypeList: Contains a list of machine types.
  15396. type MachineTypeList struct {
  15397. // Id: [Output Only] Unique identifier for the resource; defined by the
  15398. // server.
  15399. Id string `json:"id,omitempty"`
  15400. // Items: A list of MachineType resources.
  15401. Items []*MachineType `json:"items,omitempty"`
  15402. // Kind: [Output Only] Type of resource. Always compute#machineTypeList
  15403. // for lists of machine types.
  15404. Kind string `json:"kind,omitempty"`
  15405. // NextPageToken: [Output Only] This token allows you to get the next
  15406. // page of results for list requests. If the number of results is larger
  15407. // than maxResults, use the nextPageToken as a value for the query
  15408. // parameter pageToken in the next list request. Subsequent list
  15409. // requests will have their own nextPageToken to continue paging through
  15410. // the results.
  15411. NextPageToken string `json:"nextPageToken,omitempty"`
  15412. // SelfLink: [Output Only] Server-defined URL for this resource.
  15413. SelfLink string `json:"selfLink,omitempty"`
  15414. // Warning: [Output Only] Informational warning message.
  15415. Warning *MachineTypeListWarning `json:"warning,omitempty"`
  15416. // ServerResponse contains the HTTP response code and headers from the
  15417. // server.
  15418. googleapi.ServerResponse `json:"-"`
  15419. // ForceSendFields is a list of field names (e.g. "Id") to
  15420. // unconditionally include in API requests. By default, fields with
  15421. // empty values are omitted from API requests. However, any non-pointer,
  15422. // non-interface field appearing in ForceSendFields will be sent to the
  15423. // server regardless of whether the field is empty or not. This may be
  15424. // used to include empty fields in Patch requests.
  15425. ForceSendFields []string `json:"-"`
  15426. // NullFields is a list of field names (e.g. "Id") to include in API
  15427. // requests with the JSON null value. By default, fields with empty
  15428. // values are omitted from API requests. However, any field with an
  15429. // empty value appearing in NullFields will be sent to the server as
  15430. // null. It is an error if a field in this list has a non-empty value.
  15431. // This may be used to include null fields in Patch requests.
  15432. NullFields []string `json:"-"`
  15433. }
  15434. func (s *MachineTypeList) MarshalJSON() ([]byte, error) {
  15435. type NoMethod MachineTypeList
  15436. raw := NoMethod(*s)
  15437. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15438. }
  15439. // MachineTypeListWarning: [Output Only] Informational warning message.
  15440. type MachineTypeListWarning struct {
  15441. // Code: [Output Only] A warning code, if applicable. For example,
  15442. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  15443. // the response.
  15444. //
  15445. // Possible values:
  15446. // "CLEANUP_FAILED"
  15447. // "DEPRECATED_RESOURCE_USED"
  15448. // "DEPRECATED_TYPE_USED"
  15449. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  15450. // "EXPERIMENTAL_TYPE_USED"
  15451. // "EXTERNAL_API_WARNING"
  15452. // "FIELD_VALUE_OVERRIDEN"
  15453. // "INJECTED_KERNELS_DEPRECATED"
  15454. // "MISSING_TYPE_DEPENDENCY"
  15455. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  15456. // "NEXT_HOP_CANNOT_IP_FORWARD"
  15457. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  15458. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  15459. // "NEXT_HOP_NOT_RUNNING"
  15460. // "NOT_CRITICAL_ERROR"
  15461. // "NO_RESULTS_ON_PAGE"
  15462. // "REQUIRED_TOS_AGREEMENT"
  15463. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  15464. // "RESOURCE_NOT_DELETED"
  15465. // "SCHEMA_VALIDATION_IGNORED"
  15466. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  15467. // "UNDECLARED_PROPERTIES"
  15468. // "UNREACHABLE"
  15469. Code string `json:"code,omitempty"`
  15470. // Data: [Output Only] Metadata about this warning in key: value format.
  15471. // For example:
  15472. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  15473. Data []*MachineTypeListWarningData `json:"data,omitempty"`
  15474. // Message: [Output Only] A human-readable description of the warning
  15475. // code.
  15476. Message string `json:"message,omitempty"`
  15477. // ForceSendFields is a list of field names (e.g. "Code") to
  15478. // unconditionally include in API requests. By default, fields with
  15479. // empty values are omitted from API requests. However, any non-pointer,
  15480. // non-interface field appearing in ForceSendFields will be sent to the
  15481. // server regardless of whether the field is empty or not. This may be
  15482. // used to include empty fields in Patch requests.
  15483. ForceSendFields []string `json:"-"`
  15484. // NullFields is a list of field names (e.g. "Code") to include in API
  15485. // requests with the JSON null value. By default, fields with empty
  15486. // values are omitted from API requests. However, any field with an
  15487. // empty value appearing in NullFields will be sent to the server as
  15488. // null. It is an error if a field in this list has a non-empty value.
  15489. // This may be used to include null fields in Patch requests.
  15490. NullFields []string `json:"-"`
  15491. }
  15492. func (s *MachineTypeListWarning) MarshalJSON() ([]byte, error) {
  15493. type NoMethod MachineTypeListWarning
  15494. raw := NoMethod(*s)
  15495. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15496. }
  15497. type MachineTypeListWarningData struct {
  15498. // Key: [Output Only] A key that provides more detail on the warning
  15499. // being returned. For example, for warnings where there are no results
  15500. // in a list request for a particular zone, this key might be scope and
  15501. // the key value might be the zone name. Other examples might be a key
  15502. // indicating a deprecated resource and a suggested replacement, or a
  15503. // warning about invalid network settings (for example, if an instance
  15504. // attempts to perform IP forwarding but is not enabled for IP
  15505. // forwarding).
  15506. Key string `json:"key,omitempty"`
  15507. // Value: [Output Only] A warning data value corresponding to the key.
  15508. Value string `json:"value,omitempty"`
  15509. // ForceSendFields is a list of field names (e.g. "Key") to
  15510. // unconditionally include in API requests. By default, fields with
  15511. // empty values are omitted from API requests. However, any non-pointer,
  15512. // non-interface field appearing in ForceSendFields will be sent to the
  15513. // server regardless of whether the field is empty or not. This may be
  15514. // used to include empty fields in Patch requests.
  15515. ForceSendFields []string `json:"-"`
  15516. // NullFields is a list of field names (e.g. "Key") to include in API
  15517. // requests with the JSON null value. By default, fields with empty
  15518. // values are omitted from API requests. However, any field with an
  15519. // empty value appearing in NullFields will be sent to the server as
  15520. // null. It is an error if a field in this list has a non-empty value.
  15521. // This may be used to include null fields in Patch requests.
  15522. NullFields []string `json:"-"`
  15523. }
  15524. func (s *MachineTypeListWarningData) MarshalJSON() ([]byte, error) {
  15525. type NoMethod MachineTypeListWarningData
  15526. raw := NoMethod(*s)
  15527. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15528. }
  15529. type MachineTypesScopedList struct {
  15530. // MachineTypes: [Output Only] A list of machine types contained in this
  15531. // scope.
  15532. MachineTypes []*MachineType `json:"machineTypes,omitempty"`
  15533. // Warning: [Output Only] An informational warning that appears when the
  15534. // machine types list is empty.
  15535. Warning *MachineTypesScopedListWarning `json:"warning,omitempty"`
  15536. // ForceSendFields is a list of field names (e.g. "MachineTypes") to
  15537. // unconditionally include in API requests. By default, fields with
  15538. // empty values are omitted from API requests. However, any non-pointer,
  15539. // non-interface field appearing in ForceSendFields will be sent to the
  15540. // server regardless of whether the field is empty or not. This may be
  15541. // used to include empty fields in Patch requests.
  15542. ForceSendFields []string `json:"-"`
  15543. // NullFields is a list of field names (e.g. "MachineTypes") to include
  15544. // in API requests with the JSON null value. By default, fields with
  15545. // empty values are omitted from API requests. However, any field with
  15546. // an empty value appearing in NullFields will be sent to the server as
  15547. // null. It is an error if a field in this list has a non-empty value.
  15548. // This may be used to include null fields in Patch requests.
  15549. NullFields []string `json:"-"`
  15550. }
  15551. func (s *MachineTypesScopedList) MarshalJSON() ([]byte, error) {
  15552. type NoMethod MachineTypesScopedList
  15553. raw := NoMethod(*s)
  15554. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15555. }
  15556. // MachineTypesScopedListWarning: [Output Only] An informational warning
  15557. // that appears when the machine types list is empty.
  15558. type MachineTypesScopedListWarning struct {
  15559. // Code: [Output Only] A warning code, if applicable. For example,
  15560. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  15561. // the response.
  15562. //
  15563. // Possible values:
  15564. // "CLEANUP_FAILED"
  15565. // "DEPRECATED_RESOURCE_USED"
  15566. // "DEPRECATED_TYPE_USED"
  15567. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  15568. // "EXPERIMENTAL_TYPE_USED"
  15569. // "EXTERNAL_API_WARNING"
  15570. // "FIELD_VALUE_OVERRIDEN"
  15571. // "INJECTED_KERNELS_DEPRECATED"
  15572. // "MISSING_TYPE_DEPENDENCY"
  15573. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  15574. // "NEXT_HOP_CANNOT_IP_FORWARD"
  15575. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  15576. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  15577. // "NEXT_HOP_NOT_RUNNING"
  15578. // "NOT_CRITICAL_ERROR"
  15579. // "NO_RESULTS_ON_PAGE"
  15580. // "REQUIRED_TOS_AGREEMENT"
  15581. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  15582. // "RESOURCE_NOT_DELETED"
  15583. // "SCHEMA_VALIDATION_IGNORED"
  15584. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  15585. // "UNDECLARED_PROPERTIES"
  15586. // "UNREACHABLE"
  15587. Code string `json:"code,omitempty"`
  15588. // Data: [Output Only] Metadata about this warning in key: value format.
  15589. // For example:
  15590. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  15591. Data []*MachineTypesScopedListWarningData `json:"data,omitempty"`
  15592. // Message: [Output Only] A human-readable description of the warning
  15593. // code.
  15594. Message string `json:"message,omitempty"`
  15595. // ForceSendFields is a list of field names (e.g. "Code") to
  15596. // unconditionally include in API requests. By default, fields with
  15597. // empty values are omitted from API requests. However, any non-pointer,
  15598. // non-interface field appearing in ForceSendFields will be sent to the
  15599. // server regardless of whether the field is empty or not. This may be
  15600. // used to include empty fields in Patch requests.
  15601. ForceSendFields []string `json:"-"`
  15602. // NullFields is a list of field names (e.g. "Code") to include in API
  15603. // requests with the JSON null value. By default, fields with empty
  15604. // values are omitted from API requests. However, any field with an
  15605. // empty value appearing in NullFields will be sent to the server as
  15606. // null. It is an error if a field in this list has a non-empty value.
  15607. // This may be used to include null fields in Patch requests.
  15608. NullFields []string `json:"-"`
  15609. }
  15610. func (s *MachineTypesScopedListWarning) MarshalJSON() ([]byte, error) {
  15611. type NoMethod MachineTypesScopedListWarning
  15612. raw := NoMethod(*s)
  15613. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15614. }
  15615. type MachineTypesScopedListWarningData struct {
  15616. // Key: [Output Only] A key that provides more detail on the warning
  15617. // being returned. For example, for warnings where there are no results
  15618. // in a list request for a particular zone, this key might be scope and
  15619. // the key value might be the zone name. Other examples might be a key
  15620. // indicating a deprecated resource and a suggested replacement, or a
  15621. // warning about invalid network settings (for example, if an instance
  15622. // attempts to perform IP forwarding but is not enabled for IP
  15623. // forwarding).
  15624. Key string `json:"key,omitempty"`
  15625. // Value: [Output Only] A warning data value corresponding to the key.
  15626. Value string `json:"value,omitempty"`
  15627. // ForceSendFields is a list of field names (e.g. "Key") to
  15628. // unconditionally include in API requests. By default, fields with
  15629. // empty values are omitted from API requests. However, any non-pointer,
  15630. // non-interface field appearing in ForceSendFields will be sent to the
  15631. // server regardless of whether the field is empty or not. This may be
  15632. // used to include empty fields in Patch requests.
  15633. ForceSendFields []string `json:"-"`
  15634. // NullFields is a list of field names (e.g. "Key") to include in API
  15635. // requests with the JSON null value. By default, fields with empty
  15636. // values are omitted from API requests. However, any field with an
  15637. // empty value appearing in NullFields will be sent to the server as
  15638. // null. It is an error if a field in this list has a non-empty value.
  15639. // This may be used to include null fields in Patch requests.
  15640. NullFields []string `json:"-"`
  15641. }
  15642. func (s *MachineTypesScopedListWarningData) MarshalJSON() ([]byte, error) {
  15643. type NoMethod MachineTypesScopedListWarningData
  15644. raw := NoMethod(*s)
  15645. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15646. }
  15647. // ManagedInstance: A Managed Instance resource.
  15648. type ManagedInstance struct {
  15649. // CurrentAction: [Output Only] The current action that the managed
  15650. // instance group has scheduled for the instance. Possible values:
  15651. // - NONE The instance is running, and the managed instance group does
  15652. // not have any scheduled actions for this instance.
  15653. // - CREATING The managed instance group is creating this instance. If
  15654. // the group fails to create this instance, it will try again until it
  15655. // is successful.
  15656. // - CREATING_WITHOUT_RETRIES The managed instance group is attempting
  15657. // to create this instance only once. If the group fails to create this
  15658. // instance, it does not try again and the group's targetSize value is
  15659. // decreased instead.
  15660. // - RECREATING The managed instance group is recreating this instance.
  15661. //
  15662. // - DELETING The managed instance group is permanently deleting this
  15663. // instance.
  15664. // - ABANDONING The managed instance group is abandoning this instance.
  15665. // The instance will be removed from the instance group and from any
  15666. // target pools that are associated with this group.
  15667. // - RESTARTING The managed instance group is restarting the instance.
  15668. //
  15669. // - REFRESHING The managed instance group is applying configuration
  15670. // changes to the instance without stopping it. For example, the group
  15671. // can update the target pool list for an instance without stopping that
  15672. // instance.
  15673. // - VERIFYING The managed instance group has created the instance and
  15674. // it is in the process of being verified.
  15675. //
  15676. // Possible values:
  15677. // "ABANDONING"
  15678. // "CREATING"
  15679. // "CREATING_WITHOUT_RETRIES"
  15680. // "DELETING"
  15681. // "NONE"
  15682. // "RECREATING"
  15683. // "REFRESHING"
  15684. // "RESTARTING"
  15685. // "VERIFYING"
  15686. CurrentAction string `json:"currentAction,omitempty"`
  15687. // Id: [Output only] The unique identifier for this resource. This field
  15688. // is empty when instance does not exist.
  15689. Id uint64 `json:"id,omitempty,string"`
  15690. // Instance: [Output Only] The URL of the instance. The URL can exist
  15691. // even if the instance has not yet been created.
  15692. Instance string `json:"instance,omitempty"`
  15693. // InstanceStatus: [Output Only] The status of the instance. This field
  15694. // is empty when the instance does not exist.
  15695. //
  15696. // Possible values:
  15697. // "PROVISIONING"
  15698. // "RUNNING"
  15699. // "STAGING"
  15700. // "STOPPED"
  15701. // "STOPPING"
  15702. // "SUSPENDED"
  15703. // "SUSPENDING"
  15704. // "TERMINATED"
  15705. InstanceStatus string `json:"instanceStatus,omitempty"`
  15706. // InstanceTemplate: [Output Only] The intended template of the
  15707. // instance. This field is empty when current_action is one of {
  15708. // DELETING, ABANDONING }.
  15709. InstanceTemplate string `json:"instanceTemplate,omitempty"`
  15710. // LastAttempt: [Output Only] Information about the last attempt to
  15711. // create or delete the instance.
  15712. LastAttempt *ManagedInstanceLastAttempt `json:"lastAttempt,omitempty"`
  15713. // Override: [Output Only] Override defined for this instance.
  15714. Override *ManagedInstanceOverride `json:"override,omitempty"`
  15715. // Tag: [Output Only] Tag describing the version.
  15716. Tag string `json:"tag,omitempty"`
  15717. // Version: [Output Only] Intended version of this instance.
  15718. Version *ManagedInstanceVersion `json:"version,omitempty"`
  15719. // ForceSendFields is a list of field names (e.g. "CurrentAction") to
  15720. // unconditionally include in API requests. By default, fields with
  15721. // empty values are omitted from API requests. However, any non-pointer,
  15722. // non-interface field appearing in ForceSendFields will be sent to the
  15723. // server regardless of whether the field is empty or not. This may be
  15724. // used to include empty fields in Patch requests.
  15725. ForceSendFields []string `json:"-"`
  15726. // NullFields is a list of field names (e.g. "CurrentAction") to include
  15727. // in API requests with the JSON null value. By default, fields with
  15728. // empty values are omitted from API requests. However, any field with
  15729. // an empty value appearing in NullFields will be sent to the server as
  15730. // null. It is an error if a field in this list has a non-empty value.
  15731. // This may be used to include null fields in Patch requests.
  15732. NullFields []string `json:"-"`
  15733. }
  15734. func (s *ManagedInstance) MarshalJSON() ([]byte, error) {
  15735. type NoMethod ManagedInstance
  15736. raw := NoMethod(*s)
  15737. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15738. }
  15739. type ManagedInstanceLastAttempt struct {
  15740. // Errors: [Output Only] Encountered errors during the last attempt to
  15741. // create or delete the instance.
  15742. Errors *ManagedInstanceLastAttemptErrors `json:"errors,omitempty"`
  15743. // ForceSendFields is a list of field names (e.g. "Errors") to
  15744. // unconditionally include in API requests. By default, fields with
  15745. // empty values are omitted from API requests. However, any non-pointer,
  15746. // non-interface field appearing in ForceSendFields will be sent to the
  15747. // server regardless of whether the field is empty or not. This may be
  15748. // used to include empty fields in Patch requests.
  15749. ForceSendFields []string `json:"-"`
  15750. // NullFields is a list of field names (e.g. "Errors") to include in API
  15751. // requests with the JSON null value. By default, fields with empty
  15752. // values are omitted from API requests. However, any field with an
  15753. // empty value appearing in NullFields will be sent to the server as
  15754. // null. It is an error if a field in this list has a non-empty value.
  15755. // This may be used to include null fields in Patch requests.
  15756. NullFields []string `json:"-"`
  15757. }
  15758. func (s *ManagedInstanceLastAttempt) MarshalJSON() ([]byte, error) {
  15759. type NoMethod ManagedInstanceLastAttempt
  15760. raw := NoMethod(*s)
  15761. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15762. }
  15763. // ManagedInstanceLastAttemptErrors: [Output Only] Encountered errors
  15764. // during the last attempt to create or delete the instance.
  15765. type ManagedInstanceLastAttemptErrors struct {
  15766. // Errors: [Output Only] The array of errors encountered while
  15767. // processing this operation.
  15768. Errors []*ManagedInstanceLastAttemptErrorsErrors `json:"errors,omitempty"`
  15769. // ForceSendFields is a list of field names (e.g. "Errors") to
  15770. // unconditionally include in API requests. By default, fields with
  15771. // empty values are omitted from API requests. However, any non-pointer,
  15772. // non-interface field appearing in ForceSendFields will be sent to the
  15773. // server regardless of whether the field is empty or not. This may be
  15774. // used to include empty fields in Patch requests.
  15775. ForceSendFields []string `json:"-"`
  15776. // NullFields is a list of field names (e.g. "Errors") to include in API
  15777. // requests with the JSON null value. By default, fields with empty
  15778. // values are omitted from API requests. However, any field with an
  15779. // empty value appearing in NullFields will be sent to the server as
  15780. // null. It is an error if a field in this list has a non-empty value.
  15781. // This may be used to include null fields in Patch requests.
  15782. NullFields []string `json:"-"`
  15783. }
  15784. func (s *ManagedInstanceLastAttemptErrors) MarshalJSON() ([]byte, error) {
  15785. type NoMethod ManagedInstanceLastAttemptErrors
  15786. raw := NoMethod(*s)
  15787. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15788. }
  15789. type ManagedInstanceLastAttemptErrorsErrors struct {
  15790. // Code: [Output Only] The error type identifier for this error.
  15791. Code string `json:"code,omitempty"`
  15792. // Location: [Output Only] Indicates the field in the request that
  15793. // caused the error. This property is optional.
  15794. Location string `json:"location,omitempty"`
  15795. // Message: [Output Only] An optional, human-readable error message.
  15796. Message string `json:"message,omitempty"`
  15797. // ForceSendFields is a list of field names (e.g. "Code") to
  15798. // unconditionally include in API requests. By default, fields with
  15799. // empty values are omitted from API requests. However, any non-pointer,
  15800. // non-interface field appearing in ForceSendFields will be sent to the
  15801. // server regardless of whether the field is empty or not. This may be
  15802. // used to include empty fields in Patch requests.
  15803. ForceSendFields []string `json:"-"`
  15804. // NullFields is a list of field names (e.g. "Code") to include in API
  15805. // requests with the JSON null value. By default, fields with empty
  15806. // values are omitted from API requests. However, any field with an
  15807. // empty value appearing in NullFields will be sent to the server as
  15808. // null. It is an error if a field in this list has a non-empty value.
  15809. // This may be used to include null fields in Patch requests.
  15810. NullFields []string `json:"-"`
  15811. }
  15812. func (s *ManagedInstanceLastAttemptErrorsErrors) MarshalJSON() ([]byte, error) {
  15813. type NoMethod ManagedInstanceLastAttemptErrorsErrors
  15814. raw := NoMethod(*s)
  15815. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15816. }
  15817. // ManagedInstanceOverride: Overrides of stateful properties for a given
  15818. // instance
  15819. type ManagedInstanceOverride struct {
  15820. // Disks: Disk overrides defined for this instance. According to
  15821. // documentation the maximum number of disks attached to an instance is
  15822. // 128: https://cloud.google.com/compute/docs/disks/ However, compute
  15823. // API defines the limit at 140, so this is what we check.
  15824. Disks []*ManagedInstanceOverrideDiskOverride `json:"disks,omitempty"`
  15825. // Metadata: Metadata overrides defined for this instance.
  15826. // TODO(b/69785416) validate the total length is <9 KB
  15827. Metadata []*ManagedInstanceOverrideMetadata `json:"metadata,omitempty"`
  15828. // Origin: [Output Only] Indicates where does the override come from.
  15829. //
  15830. // Possible values:
  15831. // "AUTO_GENERATED"
  15832. // "USER_PROVIDED"
  15833. Origin string `json:"origin,omitempty"`
  15834. // ForceSendFields is a list of field names (e.g. "Disks") to
  15835. // unconditionally include in API requests. By default, fields with
  15836. // empty values are omitted from API requests. However, any non-pointer,
  15837. // non-interface field appearing in ForceSendFields will be sent to the
  15838. // server regardless of whether the field is empty or not. This may be
  15839. // used to include empty fields in Patch requests.
  15840. ForceSendFields []string `json:"-"`
  15841. // NullFields is a list of field names (e.g. "Disks") to include in API
  15842. // requests with the JSON null value. By default, fields with empty
  15843. // values are omitted from API requests. However, any field with an
  15844. // empty value appearing in NullFields will be sent to the server as
  15845. // null. It is an error if a field in this list has a non-empty value.
  15846. // This may be used to include null fields in Patch requests.
  15847. NullFields []string `json:"-"`
  15848. }
  15849. func (s *ManagedInstanceOverride) MarshalJSON() ([]byte, error) {
  15850. type NoMethod ManagedInstanceOverride
  15851. raw := NoMethod(*s)
  15852. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15853. }
  15854. type ManagedInstanceOverrideMetadata struct {
  15855. // Key: Key for the metadata entry. Keys must conform to the following
  15856. // regexp: [a-zA-Z0-9-_]+, and be less than 128 bytes in length. This is
  15857. // reflected as part of a URL in the metadata server. Additionally, to
  15858. // avoid ambiguity, keys must not conflict with any other metadata keys
  15859. // for the project.
  15860. Key string `json:"key,omitempty"`
  15861. // Value: Value for the metadata entry. These are free-form strings, and
  15862. // only have meaning as interpreted by the image running in the
  15863. // instance. The only restriction placed on values is that their size
  15864. // must be less than or equal to 262144 bytes (256 KiB).
  15865. Value string `json:"value,omitempty"`
  15866. // ForceSendFields is a list of field names (e.g. "Key") to
  15867. // unconditionally include in API requests. By default, fields with
  15868. // empty values are omitted from API requests. However, any non-pointer,
  15869. // non-interface field appearing in ForceSendFields will be sent to the
  15870. // server regardless of whether the field is empty or not. This may be
  15871. // used to include empty fields in Patch requests.
  15872. ForceSendFields []string `json:"-"`
  15873. // NullFields is a list of field names (e.g. "Key") to include in API
  15874. // requests with the JSON null value. By default, fields with empty
  15875. // values are omitted from API requests. However, any field with an
  15876. // empty value appearing in NullFields will be sent to the server as
  15877. // null. It is an error if a field in this list has a non-empty value.
  15878. // This may be used to include null fields in Patch requests.
  15879. NullFields []string `json:"-"`
  15880. }
  15881. func (s *ManagedInstanceOverrideMetadata) MarshalJSON() ([]byte, error) {
  15882. type NoMethod ManagedInstanceOverrideMetadata
  15883. raw := NoMethod(*s)
  15884. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15885. }
  15886. type ManagedInstanceOverrideDiskOverride struct {
  15887. // DeviceName: The name of the device on the VM
  15888. DeviceName string `json:"deviceName,omitempty"`
  15889. // Mode: The mode in which to attach this disk, either READ_WRITE or
  15890. // READ_ONLY. If not specified, the default is to attach the disk in
  15891. // READ_WRITE mode.
  15892. //
  15893. // Possible values:
  15894. // "READ_ONLY"
  15895. // "READ_WRITE"
  15896. Mode string `json:"mode,omitempty"`
  15897. // Source: The disk that is/will be mounted
  15898. Source string `json:"source,omitempty"`
  15899. // ForceSendFields is a list of field names (e.g. "DeviceName") to
  15900. // unconditionally include in API requests. By default, fields with
  15901. // empty values are omitted from API requests. However, any non-pointer,
  15902. // non-interface field appearing in ForceSendFields will be sent to the
  15903. // server regardless of whether the field is empty or not. This may be
  15904. // used to include empty fields in Patch requests.
  15905. ForceSendFields []string `json:"-"`
  15906. // NullFields is a list of field names (e.g. "DeviceName") to include in
  15907. // API requests with the JSON null value. By default, fields with empty
  15908. // values are omitted from API requests. However, any field with an
  15909. // empty value appearing in NullFields will be sent to the server as
  15910. // null. It is an error if a field in this list has a non-empty value.
  15911. // This may be used to include null fields in Patch requests.
  15912. NullFields []string `json:"-"`
  15913. }
  15914. func (s *ManagedInstanceOverrideDiskOverride) MarshalJSON() ([]byte, error) {
  15915. type NoMethod ManagedInstanceOverrideDiskOverride
  15916. raw := NoMethod(*s)
  15917. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15918. }
  15919. type ManagedInstanceVersion struct {
  15920. // InstanceTemplate: [Output Only] The intended template of the
  15921. // instance. This field is empty when current_action is one of {
  15922. // DELETING, ABANDONING }.
  15923. InstanceTemplate string `json:"instanceTemplate,omitempty"`
  15924. // Name: [Output Only] Name of the version.
  15925. Name string `json:"name,omitempty"`
  15926. // ForceSendFields is a list of field names (e.g. "InstanceTemplate") to
  15927. // unconditionally include in API requests. By default, fields with
  15928. // empty values are omitted from API requests. However, any non-pointer,
  15929. // non-interface field appearing in ForceSendFields will be sent to the
  15930. // server regardless of whether the field is empty or not. This may be
  15931. // used to include empty fields in Patch requests.
  15932. ForceSendFields []string `json:"-"`
  15933. // NullFields is a list of field names (e.g. "InstanceTemplate") to
  15934. // include in API requests with the JSON null value. By default, fields
  15935. // with empty values are omitted from API requests. However, any field
  15936. // with an empty value appearing in NullFields will be sent to the
  15937. // server as null. It is an error if a field in this list has a
  15938. // non-empty value. This may be used to include null fields in Patch
  15939. // requests.
  15940. NullFields []string `json:"-"`
  15941. }
  15942. func (s *ManagedInstanceVersion) MarshalJSON() ([]byte, error) {
  15943. type NoMethod ManagedInstanceVersion
  15944. raw := NoMethod(*s)
  15945. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15946. }
  15947. // Metadata: A metadata key/value entry.
  15948. type Metadata struct {
  15949. // Fingerprint: Specifies a fingerprint for this request, which is
  15950. // essentially a hash of the metadata's contents and used for optimistic
  15951. // locking. The fingerprint is initially generated by Compute Engine and
  15952. // changes after every request to modify or update metadata. You must
  15953. // always provide an up-to-date fingerprint hash in order to update or
  15954. // change metadata.
  15955. Fingerprint string `json:"fingerprint,omitempty"`
  15956. // Items: Array of key/value pairs. The total size of all keys and
  15957. // values must be less than 512 KB.
  15958. Items []*MetadataItems `json:"items,omitempty"`
  15959. // Kind: [Output Only] Type of the resource. Always compute#metadata for
  15960. // metadata.
  15961. Kind string `json:"kind,omitempty"`
  15962. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  15963. // unconditionally include in API requests. By default, fields with
  15964. // empty values are omitted from API requests. However, any non-pointer,
  15965. // non-interface field appearing in ForceSendFields will be sent to the
  15966. // server regardless of whether the field is empty or not. This may be
  15967. // used to include empty fields in Patch requests.
  15968. ForceSendFields []string `json:"-"`
  15969. // NullFields is a list of field names (e.g. "Fingerprint") to include
  15970. // in API requests with the JSON null value. By default, fields with
  15971. // empty values are omitted from API requests. However, any field with
  15972. // an empty value appearing in NullFields will be sent to the server as
  15973. // null. It is an error if a field in this list has a non-empty value.
  15974. // This may be used to include null fields in Patch requests.
  15975. NullFields []string `json:"-"`
  15976. }
  15977. func (s *Metadata) MarshalJSON() ([]byte, error) {
  15978. type NoMethod Metadata
  15979. raw := NoMethod(*s)
  15980. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15981. }
  15982. type MetadataItems struct {
  15983. // Key: Key for the metadata entry. Keys must conform to the following
  15984. // regexp: [a-zA-Z0-9-_]+, and be less than 128 bytes in length. This is
  15985. // reflected as part of a URL in the metadata server. Additionally, to
  15986. // avoid ambiguity, keys must not conflict with any other metadata keys
  15987. // for the project.
  15988. Key string `json:"key,omitempty"`
  15989. // Value: Value for the metadata entry. These are free-form strings, and
  15990. // only have meaning as interpreted by the image running in the
  15991. // instance. The only restriction placed on values is that their size
  15992. // must be less than or equal to 262144 bytes (256 KiB).
  15993. Value string `json:"value,omitempty"`
  15994. // ForceSendFields is a list of field names (e.g. "Key") 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. "Key") to include in API
  16002. // requests with the JSON null value. By default, fields with empty
  16003. // values are omitted from API requests. However, any field with an
  16004. // empty value appearing in NullFields will be sent to the server as
  16005. // null. It is an error if a field in this list has a non-empty value.
  16006. // This may be used to include null fields in Patch requests.
  16007. NullFields []string `json:"-"`
  16008. }
  16009. func (s *MetadataItems) MarshalJSON() ([]byte, error) {
  16010. type NoMethod MetadataItems
  16011. raw := NoMethod(*s)
  16012. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16013. }
  16014. // NamedPort: The named port. For example: .
  16015. type NamedPort struct {
  16016. // Name: The name for this named port. The name must be 1-63 characters
  16017. // long, and comply with RFC1035.
  16018. Name string `json:"name,omitempty"`
  16019. // Port: The port number, which can be a value between 1 and 65535.
  16020. Port int64 `json:"port,omitempty"`
  16021. // ForceSendFields is a list of field names (e.g. "Name") to
  16022. // unconditionally include in API requests. By default, fields with
  16023. // empty values are omitted from API requests. However, any non-pointer,
  16024. // non-interface field appearing in ForceSendFields will be sent to the
  16025. // server regardless of whether the field is empty or not. This may be
  16026. // used to include empty fields in Patch requests.
  16027. ForceSendFields []string `json:"-"`
  16028. // NullFields is a list of field names (e.g. "Name") to include in API
  16029. // requests with the JSON null value. By default, fields with empty
  16030. // values are omitted from API requests. However, any field with an
  16031. // empty value appearing in NullFields will be sent to the server as
  16032. // null. It is an error if a field in this list has a non-empty value.
  16033. // This may be used to include null fields in Patch requests.
  16034. NullFields []string `json:"-"`
  16035. }
  16036. func (s *NamedPort) MarshalJSON() ([]byte, error) {
  16037. type NoMethod NamedPort
  16038. raw := NoMethod(*s)
  16039. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16040. }
  16041. // Network: Represents a Network resource. Read Networks and Firewalls
  16042. // for more information. (== resource_for v1.networks ==) (==
  16043. // resource_for beta.networks ==)
  16044. type Network struct {
  16045. // IPv4Range: The range of internal addresses that are legal on this
  16046. // network. This range is a CIDR specification, for example:
  16047. // 192.168.0.0/16. Provided by the client when the network is created.
  16048. IPv4Range string `json:"IPv4Range,omitempty"`
  16049. // AutoCreateSubnetworks: When set to true, the network is created in
  16050. // "auto subnet mode". When set to false, the network is in "custom
  16051. // subnet mode".
  16052. //
  16053. // In "auto subnet mode", a newly created network is assigned the
  16054. // default CIDR of 10.128.0.0/9 and it automatically creates one
  16055. // subnetwork per region.
  16056. AutoCreateSubnetworks bool `json:"autoCreateSubnetworks,omitempty"`
  16057. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  16058. // format.
  16059. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  16060. // CrossVmEncryption: [Output Only] Type of VM-to-VM traffic encryption
  16061. // for this network.
  16062. //
  16063. // Possible values:
  16064. // "ENCRYPTED"
  16065. // "UNENCRYPTED"
  16066. CrossVmEncryption string `json:"crossVmEncryption,omitempty"`
  16067. // Description: An optional description of this resource. Provide this
  16068. // property when you create the resource.
  16069. Description string `json:"description,omitempty"`
  16070. // GatewayIPv4: A gateway address for default routing to other networks.
  16071. // This value is read only and is selected by the Google Compute Engine,
  16072. // typically as the first usable address in the IPv4Range.
  16073. GatewayIPv4 string `json:"gatewayIPv4,omitempty"`
  16074. // Id: [Output Only] The unique identifier for the resource. This
  16075. // identifier is defined by the server.
  16076. Id uint64 `json:"id,omitempty,string"`
  16077. // Kind: [Output Only] Type of the resource. Always compute#network for
  16078. // networks.
  16079. Kind string `json:"kind,omitempty"`
  16080. // LoadBalancerVmEncryption: [Output Only] Type of LB-to-VM traffic
  16081. // encryption for this network.
  16082. //
  16083. // Possible values:
  16084. // "ENCRYPTED"
  16085. // "UNENCRYPTED"
  16086. LoadBalancerVmEncryption string `json:"loadBalancerVmEncryption,omitempty"`
  16087. // Name: Name of the resource. Provided by the client when the resource
  16088. // is created. The name must be 1-63 characters long, and comply with
  16089. // RFC1035. Specifically, the name must be 1-63 characters long and
  16090. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  16091. // the first character must be a lowercase letter, and all following
  16092. // characters must be a dash, lowercase letter, or digit, except the
  16093. // last character, which cannot be a dash.
  16094. Name string `json:"name,omitempty"`
  16095. // Peerings: [Output Only] A list of network peerings for the resource.
  16096. Peerings []*NetworkPeering `json:"peerings,omitempty"`
  16097. // RoutingConfig: The network-level routing configuration for this
  16098. // network. Used by Cloud Router to determine what type of network-wide
  16099. // routing behavior to enforce.
  16100. RoutingConfig *NetworkRoutingConfig `json:"routingConfig,omitempty"`
  16101. // SelfLink: [Output Only] Server-defined URL for the resource.
  16102. SelfLink string `json:"selfLink,omitempty"`
  16103. // Subnetworks: [Output Only] Server-defined fully-qualified URLs for
  16104. // all subnetworks in this network.
  16105. Subnetworks []string `json:"subnetworks,omitempty"`
  16106. // ServerResponse contains the HTTP response code and headers from the
  16107. // server.
  16108. googleapi.ServerResponse `json:"-"`
  16109. // ForceSendFields is a list of field names (e.g. "IPv4Range") to
  16110. // unconditionally include in API requests. By default, fields with
  16111. // empty values are omitted from API requests. However, any non-pointer,
  16112. // non-interface field appearing in ForceSendFields will be sent to the
  16113. // server regardless of whether the field is empty or not. This may be
  16114. // used to include empty fields in Patch requests.
  16115. ForceSendFields []string `json:"-"`
  16116. // NullFields is a list of field names (e.g. "IPv4Range") to include in
  16117. // API requests with the JSON null value. By default, fields with empty
  16118. // values are omitted from API requests. However, any field with an
  16119. // empty value appearing in NullFields will be sent to the server as
  16120. // null. It is an error if a field in this list has a non-empty value.
  16121. // This may be used to include null fields in Patch requests.
  16122. NullFields []string `json:"-"`
  16123. }
  16124. func (s *Network) MarshalJSON() ([]byte, error) {
  16125. type NoMethod Network
  16126. raw := NoMethod(*s)
  16127. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16128. }
  16129. // NetworkEndpoint: The network endpoint.
  16130. type NetworkEndpoint struct {
  16131. // Instance: The name for a specific VM instance that the IP address
  16132. // belongs to. This is required for network endpoints of type GCE_VM_IP
  16133. // and GCE_VM_IP_PORT. The instance must be in the same zone of network
  16134. // endpoint group.
  16135. //
  16136. // The name must be 1-63 characters long, and comply with RFC1035.
  16137. Instance string `json:"instance,omitempty"`
  16138. // IpAddress: Optional IPv4 address of network endpoint. The IP address
  16139. // must belong to a VM in GCE (either the primary IP or as part of an
  16140. // aliased IP range). If the IP address is not specified, then the
  16141. // primary IP address for the VM instance in the network that the
  16142. // network endpoint group belongs to will be used.
  16143. IpAddress string `json:"ipAddress,omitempty"`
  16144. // Port: Optional port number of network endpoint. If not specified and
  16145. // the NetworkEndpointGroup.network_endpoint_type is GCE_IP_PORT, the
  16146. // defaultPort for the network endpoint group will be used.
  16147. Port int64 `json:"port,omitempty"`
  16148. // ForceSendFields is a list of field names (e.g. "Instance") to
  16149. // unconditionally include in API requests. By default, fields with
  16150. // empty values are omitted from API requests. However, any non-pointer,
  16151. // non-interface field appearing in ForceSendFields will be sent to the
  16152. // server regardless of whether the field is empty or not. This may be
  16153. // used to include empty fields in Patch requests.
  16154. ForceSendFields []string `json:"-"`
  16155. // NullFields is a list of field names (e.g. "Instance") to include in
  16156. // API requests with the JSON null value. By default, fields with empty
  16157. // values are omitted from API requests. However, any field with an
  16158. // empty value appearing in NullFields will be sent to the server as
  16159. // null. It is an error if a field in this list has a non-empty value.
  16160. // This may be used to include null fields in Patch requests.
  16161. NullFields []string `json:"-"`
  16162. }
  16163. func (s *NetworkEndpoint) MarshalJSON() ([]byte, error) {
  16164. type NoMethod NetworkEndpoint
  16165. raw := NoMethod(*s)
  16166. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16167. }
  16168. // NetworkEndpointGroup: Represents a collection of network endpoints.
  16169. type NetworkEndpointGroup struct {
  16170. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  16171. // format.
  16172. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  16173. // Description: An optional description of this resource. Provide this
  16174. // property when you create the resource.
  16175. Description string `json:"description,omitempty"`
  16176. // Id: [Output Only] The unique identifier for the resource. This
  16177. // identifier is defined by the server.
  16178. Id uint64 `json:"id,omitempty,string"`
  16179. // Kind: [Output Only] Type of the resource. Always
  16180. // compute#networkEndpointGroup for network endpoint group.
  16181. Kind string `json:"kind,omitempty"`
  16182. // LoadBalancer: This field is only valid when the network endpoint
  16183. // group type is LOAD_BALANCING.
  16184. LoadBalancer *NetworkEndpointGroupLbNetworkEndpointGroup `json:"loadBalancer,omitempty"`
  16185. // Name: Name of the resource; provided by the client when the resource
  16186. // is created. The name must be 1-63 characters long, and comply with
  16187. // RFC1035. Specifically, the name must be 1-63 characters long and
  16188. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  16189. // the first character must be a lowercase letter, and all following
  16190. // characters must be a dash, lowercase letter, or digit, except the
  16191. // last character, which cannot be a dash.
  16192. Name string `json:"name,omitempty"`
  16193. // NetworkEndpointType: Type of network endpoints in this network
  16194. // endpoint group. Only supported values for LOAD_BALANCING are
  16195. // GCE_VM_IP or GCE_VM_IP_PORT.
  16196. //
  16197. // Possible values:
  16198. // "GCE_VM_IP_PORT"
  16199. NetworkEndpointType string `json:"networkEndpointType,omitempty"`
  16200. // SelfLink: [Output Only] Server-defined URL for the resource.
  16201. SelfLink string `json:"selfLink,omitempty"`
  16202. // Size: [Output only] Number of network endpoints in the network
  16203. // endpoint group.
  16204. Size int64 `json:"size,omitempty"`
  16205. // Type: Specify the type of this network endpoint group. Only
  16206. // LOAD_BALANCING is valid for now.
  16207. //
  16208. // Possible values:
  16209. // "LOAD_BALANCING"
  16210. Type string `json:"type,omitempty"`
  16211. // ServerResponse contains the HTTP response code and headers from the
  16212. // server.
  16213. googleapi.ServerResponse `json:"-"`
  16214. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  16215. // to unconditionally include in API requests. By default, fields with
  16216. // empty values are omitted from API requests. However, any non-pointer,
  16217. // non-interface field appearing in ForceSendFields will be sent to the
  16218. // server regardless of whether the field is empty or not. This may be
  16219. // used to include empty fields in Patch requests.
  16220. ForceSendFields []string `json:"-"`
  16221. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  16222. // include in API requests with the JSON null value. By default, fields
  16223. // with empty values are omitted from API requests. However, any field
  16224. // with an empty value appearing in NullFields will be sent to the
  16225. // server as null. It is an error if a field in this list has a
  16226. // non-empty value. This may be used to include null fields in Patch
  16227. // requests.
  16228. NullFields []string `json:"-"`
  16229. }
  16230. func (s *NetworkEndpointGroup) MarshalJSON() ([]byte, error) {
  16231. type NoMethod NetworkEndpointGroup
  16232. raw := NoMethod(*s)
  16233. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16234. }
  16235. type NetworkEndpointGroupAggregatedList struct {
  16236. // Id: [Output Only] Unique identifier for the resource; defined by the
  16237. // server.
  16238. Id string `json:"id,omitempty"`
  16239. // Items: A list of NetworkEndpointGroupsScopedList resources.
  16240. Items map[string]NetworkEndpointGroupsScopedList `json:"items,omitempty"`
  16241. // Kind: [Output Only] The resource type, which is always
  16242. // compute#networkEndpointGroupAggregatedList for aggregated lists of
  16243. // network endpoint groups.
  16244. Kind string `json:"kind,omitempty"`
  16245. // NextPageToken: [Output Only] This token allows you to get the next
  16246. // page of results for list requests. If the number of results is larger
  16247. // than maxResults, use the nextPageToken as a value for the query
  16248. // parameter pageToken in the next list request. Subsequent list
  16249. // requests will have their own nextPageToken to continue paging through
  16250. // the results.
  16251. NextPageToken string `json:"nextPageToken,omitempty"`
  16252. // SelfLink: [Output Only] Server-defined URL for this resource.
  16253. SelfLink string `json:"selfLink,omitempty"`
  16254. // Warning: [Output Only] Informational warning message.
  16255. Warning *NetworkEndpointGroupAggregatedListWarning `json:"warning,omitempty"`
  16256. // ServerResponse contains the HTTP response code and headers from the
  16257. // server.
  16258. googleapi.ServerResponse `json:"-"`
  16259. // ForceSendFields is a list of field names (e.g. "Id") to
  16260. // unconditionally include in API requests. By default, fields with
  16261. // empty values are omitted from API requests. However, any non-pointer,
  16262. // non-interface field appearing in ForceSendFields will be sent to the
  16263. // server regardless of whether the field is empty or not. This may be
  16264. // used to include empty fields in Patch requests.
  16265. ForceSendFields []string `json:"-"`
  16266. // NullFields is a list of field names (e.g. "Id") to include in API
  16267. // requests with the JSON null value. By default, fields with empty
  16268. // values are omitted from API requests. However, any field with an
  16269. // empty value appearing in NullFields will be sent to the server as
  16270. // null. It is an error if a field in this list has a non-empty value.
  16271. // This may be used to include null fields in Patch requests.
  16272. NullFields []string `json:"-"`
  16273. }
  16274. func (s *NetworkEndpointGroupAggregatedList) MarshalJSON() ([]byte, error) {
  16275. type NoMethod NetworkEndpointGroupAggregatedList
  16276. raw := NoMethod(*s)
  16277. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16278. }
  16279. // NetworkEndpointGroupAggregatedListWarning: [Output Only]
  16280. // Informational warning message.
  16281. type NetworkEndpointGroupAggregatedListWarning struct {
  16282. // Code: [Output Only] A warning code, if applicable. For example,
  16283. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  16284. // the response.
  16285. //
  16286. // Possible values:
  16287. // "CLEANUP_FAILED"
  16288. // "DEPRECATED_RESOURCE_USED"
  16289. // "DEPRECATED_TYPE_USED"
  16290. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  16291. // "EXPERIMENTAL_TYPE_USED"
  16292. // "EXTERNAL_API_WARNING"
  16293. // "FIELD_VALUE_OVERRIDEN"
  16294. // "INJECTED_KERNELS_DEPRECATED"
  16295. // "MISSING_TYPE_DEPENDENCY"
  16296. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  16297. // "NEXT_HOP_CANNOT_IP_FORWARD"
  16298. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  16299. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  16300. // "NEXT_HOP_NOT_RUNNING"
  16301. // "NOT_CRITICAL_ERROR"
  16302. // "NO_RESULTS_ON_PAGE"
  16303. // "REQUIRED_TOS_AGREEMENT"
  16304. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  16305. // "RESOURCE_NOT_DELETED"
  16306. // "SCHEMA_VALIDATION_IGNORED"
  16307. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  16308. // "UNDECLARED_PROPERTIES"
  16309. // "UNREACHABLE"
  16310. Code string `json:"code,omitempty"`
  16311. // Data: [Output Only] Metadata about this warning in key: value format.
  16312. // For example:
  16313. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  16314. Data []*NetworkEndpointGroupAggregatedListWarningData `json:"data,omitempty"`
  16315. // Message: [Output Only] A human-readable description of the warning
  16316. // code.
  16317. Message string `json:"message,omitempty"`
  16318. // ForceSendFields is a list of field names (e.g. "Code") to
  16319. // unconditionally include in API requests. By default, fields with
  16320. // empty values are omitted from API requests. However, any non-pointer,
  16321. // non-interface field appearing in ForceSendFields will be sent to the
  16322. // server regardless of whether the field is empty or not. This may be
  16323. // used to include empty fields in Patch requests.
  16324. ForceSendFields []string `json:"-"`
  16325. // NullFields is a list of field names (e.g. "Code") to include in API
  16326. // requests with the JSON null value. By default, fields with empty
  16327. // values are omitted from API requests. However, any field with an
  16328. // empty value appearing in NullFields will be sent to the server as
  16329. // null. It is an error if a field in this list has a non-empty value.
  16330. // This may be used to include null fields in Patch requests.
  16331. NullFields []string `json:"-"`
  16332. }
  16333. func (s *NetworkEndpointGroupAggregatedListWarning) MarshalJSON() ([]byte, error) {
  16334. type NoMethod NetworkEndpointGroupAggregatedListWarning
  16335. raw := NoMethod(*s)
  16336. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16337. }
  16338. type NetworkEndpointGroupAggregatedListWarningData struct {
  16339. // Key: [Output Only] A key that provides more detail on the warning
  16340. // being returned. For example, for warnings where there are no results
  16341. // in a list request for a particular zone, this key might be scope and
  16342. // the key value might be the zone name. Other examples might be a key
  16343. // indicating a deprecated resource and a suggested replacement, or a
  16344. // warning about invalid network settings (for example, if an instance
  16345. // attempts to perform IP forwarding but is not enabled for IP
  16346. // forwarding).
  16347. Key string `json:"key,omitempty"`
  16348. // Value: [Output Only] A warning data value corresponding to the key.
  16349. Value string `json:"value,omitempty"`
  16350. // ForceSendFields is a list of field names (e.g. "Key") to
  16351. // unconditionally include in API requests. By default, fields with
  16352. // empty values are omitted from API requests. However, any non-pointer,
  16353. // non-interface field appearing in ForceSendFields will be sent to the
  16354. // server regardless of whether the field is empty or not. This may be
  16355. // used to include empty fields in Patch requests.
  16356. ForceSendFields []string `json:"-"`
  16357. // NullFields is a list of field names (e.g. "Key") to include in API
  16358. // requests with the JSON null value. By default, fields with empty
  16359. // values are omitted from API requests. However, any field with an
  16360. // empty value appearing in NullFields will be sent to the server as
  16361. // null. It is an error if a field in this list has a non-empty value.
  16362. // This may be used to include null fields in Patch requests.
  16363. NullFields []string `json:"-"`
  16364. }
  16365. func (s *NetworkEndpointGroupAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  16366. type NoMethod NetworkEndpointGroupAggregatedListWarningData
  16367. raw := NoMethod(*s)
  16368. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16369. }
  16370. // NetworkEndpointGroupLbNetworkEndpointGroup: Load balancing specific
  16371. // fields for network endpoint group of type LOAD_BALANCING.
  16372. type NetworkEndpointGroupLbNetworkEndpointGroup struct {
  16373. // DefaultPort: The default port used if the port number is not
  16374. // specified in the network endpoint. If the network endpoint type is
  16375. // GCE_VM_IP, this field must not be specified.
  16376. DefaultPort int64 `json:"defaultPort,omitempty"`
  16377. // Network: The URL of the network to which all network endpoints in the
  16378. // NEG belong. Uses "default" project network if unspecified.
  16379. Network string `json:"network,omitempty"`
  16380. // Subnetwork: Optional URL of the subnetwork to which all network
  16381. // endpoints in the NEG belong.
  16382. Subnetwork string `json:"subnetwork,omitempty"`
  16383. // Zone: [Output Only] The URL of the zone where the network endpoint
  16384. // group is located.
  16385. Zone string `json:"zone,omitempty"`
  16386. // ForceSendFields is a list of field names (e.g. "DefaultPort") to
  16387. // unconditionally include in API requests. By default, fields with
  16388. // empty values are omitted from API requests. However, any non-pointer,
  16389. // non-interface field appearing in ForceSendFields will be sent to the
  16390. // server regardless of whether the field is empty or not. This may be
  16391. // used to include empty fields in Patch requests.
  16392. ForceSendFields []string `json:"-"`
  16393. // NullFields is a list of field names (e.g. "DefaultPort") to include
  16394. // in API requests with the JSON null value. By default, fields with
  16395. // empty values are omitted from API requests. However, any field with
  16396. // an empty value appearing in NullFields will be sent to the server as
  16397. // null. It is an error if a field in this list has a non-empty value.
  16398. // This may be used to include null fields in Patch requests.
  16399. NullFields []string `json:"-"`
  16400. }
  16401. func (s *NetworkEndpointGroupLbNetworkEndpointGroup) MarshalJSON() ([]byte, error) {
  16402. type NoMethod NetworkEndpointGroupLbNetworkEndpointGroup
  16403. raw := NoMethod(*s)
  16404. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16405. }
  16406. type NetworkEndpointGroupList struct {
  16407. // Id: [Output Only] Unique identifier for the resource; defined by the
  16408. // server.
  16409. Id string `json:"id,omitempty"`
  16410. // Items: A list of NetworkEndpointGroup resources.
  16411. Items []*NetworkEndpointGroup `json:"items,omitempty"`
  16412. // Kind: [Output Only] The resource type, which is always
  16413. // compute#networkEndpointGroupList for network endpoint group lists.
  16414. Kind string `json:"kind,omitempty"`
  16415. // NextPageToken: [Output Only] This token allows you to get the next
  16416. // page of results for list requests. If the number of results is larger
  16417. // than maxResults, use the nextPageToken as a value for the query
  16418. // parameter pageToken in the next list request. Subsequent list
  16419. // requests will have their own nextPageToken to continue paging through
  16420. // the results.
  16421. NextPageToken string `json:"nextPageToken,omitempty"`
  16422. // SelfLink: [Output Only] Server-defined URL for this resource.
  16423. SelfLink string `json:"selfLink,omitempty"`
  16424. // Warning: [Output Only] Informational warning message.
  16425. Warning *NetworkEndpointGroupListWarning `json:"warning,omitempty"`
  16426. // ServerResponse contains the HTTP response code and headers from the
  16427. // server.
  16428. googleapi.ServerResponse `json:"-"`
  16429. // ForceSendFields is a list of field names (e.g. "Id") to
  16430. // unconditionally include in API requests. By default, fields with
  16431. // empty values are omitted from API requests. However, any non-pointer,
  16432. // non-interface field appearing in ForceSendFields will be sent to the
  16433. // server regardless of whether the field is empty or not. This may be
  16434. // used to include empty fields in Patch requests.
  16435. ForceSendFields []string `json:"-"`
  16436. // NullFields is a list of field names (e.g. "Id") to include in API
  16437. // requests with the JSON null value. By default, fields with empty
  16438. // values are omitted from API requests. However, any field with an
  16439. // empty value appearing in NullFields will be sent to the server as
  16440. // null. It is an error if a field in this list has a non-empty value.
  16441. // This may be used to include null fields in Patch requests.
  16442. NullFields []string `json:"-"`
  16443. }
  16444. func (s *NetworkEndpointGroupList) MarshalJSON() ([]byte, error) {
  16445. type NoMethod NetworkEndpointGroupList
  16446. raw := NoMethod(*s)
  16447. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16448. }
  16449. // NetworkEndpointGroupListWarning: [Output Only] Informational warning
  16450. // message.
  16451. type NetworkEndpointGroupListWarning struct {
  16452. // Code: [Output Only] A warning code, if applicable. For example,
  16453. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  16454. // the response.
  16455. //
  16456. // Possible values:
  16457. // "CLEANUP_FAILED"
  16458. // "DEPRECATED_RESOURCE_USED"
  16459. // "DEPRECATED_TYPE_USED"
  16460. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  16461. // "EXPERIMENTAL_TYPE_USED"
  16462. // "EXTERNAL_API_WARNING"
  16463. // "FIELD_VALUE_OVERRIDEN"
  16464. // "INJECTED_KERNELS_DEPRECATED"
  16465. // "MISSING_TYPE_DEPENDENCY"
  16466. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  16467. // "NEXT_HOP_CANNOT_IP_FORWARD"
  16468. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  16469. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  16470. // "NEXT_HOP_NOT_RUNNING"
  16471. // "NOT_CRITICAL_ERROR"
  16472. // "NO_RESULTS_ON_PAGE"
  16473. // "REQUIRED_TOS_AGREEMENT"
  16474. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  16475. // "RESOURCE_NOT_DELETED"
  16476. // "SCHEMA_VALIDATION_IGNORED"
  16477. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  16478. // "UNDECLARED_PROPERTIES"
  16479. // "UNREACHABLE"
  16480. Code string `json:"code,omitempty"`
  16481. // Data: [Output Only] Metadata about this warning in key: value format.
  16482. // For example:
  16483. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  16484. Data []*NetworkEndpointGroupListWarningData `json:"data,omitempty"`
  16485. // Message: [Output Only] A human-readable description of the warning
  16486. // code.
  16487. Message string `json:"message,omitempty"`
  16488. // ForceSendFields is a list of field names (e.g. "Code") to
  16489. // unconditionally include in API requests. By default, fields with
  16490. // empty values are omitted from API requests. However, any non-pointer,
  16491. // non-interface field appearing in ForceSendFields will be sent to the
  16492. // server regardless of whether the field is empty or not. This may be
  16493. // used to include empty fields in Patch requests.
  16494. ForceSendFields []string `json:"-"`
  16495. // NullFields is a list of field names (e.g. "Code") to include in API
  16496. // requests with the JSON null value. By default, fields with empty
  16497. // values are omitted from API requests. However, any field with an
  16498. // empty value appearing in NullFields will be sent to the server as
  16499. // null. It is an error if a field in this list has a non-empty value.
  16500. // This may be used to include null fields in Patch requests.
  16501. NullFields []string `json:"-"`
  16502. }
  16503. func (s *NetworkEndpointGroupListWarning) MarshalJSON() ([]byte, error) {
  16504. type NoMethod NetworkEndpointGroupListWarning
  16505. raw := NoMethod(*s)
  16506. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16507. }
  16508. type NetworkEndpointGroupListWarningData struct {
  16509. // Key: [Output Only] A key that provides more detail on the warning
  16510. // being returned. For example, for warnings where there are no results
  16511. // in a list request for a particular zone, this key might be scope and
  16512. // the key value might be the zone name. Other examples might be a key
  16513. // indicating a deprecated resource and a suggested replacement, or a
  16514. // warning about invalid network settings (for example, if an instance
  16515. // attempts to perform IP forwarding but is not enabled for IP
  16516. // forwarding).
  16517. Key string `json:"key,omitempty"`
  16518. // Value: [Output Only] A warning data value corresponding to the key.
  16519. Value string `json:"value,omitempty"`
  16520. // ForceSendFields is a list of field names (e.g. "Key") to
  16521. // unconditionally include in API requests. By default, fields with
  16522. // empty values are omitted from API requests. However, any non-pointer,
  16523. // non-interface field appearing in ForceSendFields will be sent to the
  16524. // server regardless of whether the field is empty or not. This may be
  16525. // used to include empty fields in Patch requests.
  16526. ForceSendFields []string `json:"-"`
  16527. // NullFields is a list of field names (e.g. "Key") to include in API
  16528. // requests with the JSON null value. By default, fields with empty
  16529. // values are omitted from API requests. However, any field with an
  16530. // empty value appearing in NullFields will be sent to the server as
  16531. // null. It is an error if a field in this list has a non-empty value.
  16532. // This may be used to include null fields in Patch requests.
  16533. NullFields []string `json:"-"`
  16534. }
  16535. func (s *NetworkEndpointGroupListWarningData) MarshalJSON() ([]byte, error) {
  16536. type NoMethod NetworkEndpointGroupListWarningData
  16537. raw := NoMethod(*s)
  16538. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16539. }
  16540. type NetworkEndpointGroupsAttachEndpointsRequest struct {
  16541. // NetworkEndpoints: The list of network endpoints to be attached.
  16542. NetworkEndpoints []*NetworkEndpoint `json:"networkEndpoints,omitempty"`
  16543. // ForceSendFields is a list of field names (e.g. "NetworkEndpoints") to
  16544. // unconditionally include in API requests. By default, fields with
  16545. // empty values are omitted from API requests. However, any non-pointer,
  16546. // non-interface field appearing in ForceSendFields will be sent to the
  16547. // server regardless of whether the field is empty or not. This may be
  16548. // used to include empty fields in Patch requests.
  16549. ForceSendFields []string `json:"-"`
  16550. // NullFields is a list of field names (e.g. "NetworkEndpoints") to
  16551. // include in API requests with the JSON null value. By default, fields
  16552. // with empty values are omitted from API requests. However, any field
  16553. // with an empty value appearing in NullFields will be sent to the
  16554. // server as null. It is an error if a field in this list has a
  16555. // non-empty value. This may be used to include null fields in Patch
  16556. // requests.
  16557. NullFields []string `json:"-"`
  16558. }
  16559. func (s *NetworkEndpointGroupsAttachEndpointsRequest) MarshalJSON() ([]byte, error) {
  16560. type NoMethod NetworkEndpointGroupsAttachEndpointsRequest
  16561. raw := NoMethod(*s)
  16562. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16563. }
  16564. type NetworkEndpointGroupsDetachEndpointsRequest struct {
  16565. // NetworkEndpoints: The list of network endpoints to be detached.
  16566. NetworkEndpoints []*NetworkEndpoint `json:"networkEndpoints,omitempty"`
  16567. // ForceSendFields is a list of field names (e.g. "NetworkEndpoints") to
  16568. // unconditionally include in API requests. By default, fields with
  16569. // empty values are omitted from API requests. However, any non-pointer,
  16570. // non-interface field appearing in ForceSendFields will be sent to the
  16571. // server regardless of whether the field is empty or not. This may be
  16572. // used to include empty fields in Patch requests.
  16573. ForceSendFields []string `json:"-"`
  16574. // NullFields is a list of field names (e.g. "NetworkEndpoints") to
  16575. // include in API requests with the JSON null value. By default, fields
  16576. // with empty values are omitted from API requests. However, any field
  16577. // with an empty value appearing in NullFields will be sent to the
  16578. // server as null. It is an error if a field in this list has a
  16579. // non-empty value. This may be used to include null fields in Patch
  16580. // requests.
  16581. NullFields []string `json:"-"`
  16582. }
  16583. func (s *NetworkEndpointGroupsDetachEndpointsRequest) MarshalJSON() ([]byte, error) {
  16584. type NoMethod NetworkEndpointGroupsDetachEndpointsRequest
  16585. raw := NoMethod(*s)
  16586. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16587. }
  16588. type NetworkEndpointGroupsListEndpointsRequest struct {
  16589. // HealthStatus: Optional query parameter for showing the health status
  16590. // of each network endpoint. Valid options are SKIP or SHOW. If you
  16591. // don't specifiy this parameter, the health status of network endpoints
  16592. // will not be provided.
  16593. //
  16594. // Possible values:
  16595. // "SHOW"
  16596. // "SKIP"
  16597. HealthStatus string `json:"healthStatus,omitempty"`
  16598. // ForceSendFields is a list of field names (e.g. "HealthStatus") to
  16599. // unconditionally include in API requests. By default, fields with
  16600. // empty values are omitted from API requests. However, any non-pointer,
  16601. // non-interface field appearing in ForceSendFields will be sent to the
  16602. // server regardless of whether the field is empty or not. This may be
  16603. // used to include empty fields in Patch requests.
  16604. ForceSendFields []string `json:"-"`
  16605. // NullFields is a list of field names (e.g. "HealthStatus") to include
  16606. // in API requests with the JSON null value. By default, fields with
  16607. // empty values are omitted from API requests. However, any field with
  16608. // an empty value appearing in NullFields will be sent to the server as
  16609. // null. It is an error if a field in this list has a non-empty value.
  16610. // This may be used to include null fields in Patch requests.
  16611. NullFields []string `json:"-"`
  16612. }
  16613. func (s *NetworkEndpointGroupsListEndpointsRequest) MarshalJSON() ([]byte, error) {
  16614. type NoMethod NetworkEndpointGroupsListEndpointsRequest
  16615. raw := NoMethod(*s)
  16616. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16617. }
  16618. type NetworkEndpointGroupsListNetworkEndpoints struct {
  16619. // Id: [Output Only] Unique identifier for the resource; defined by the
  16620. // server.
  16621. Id string `json:"id,omitempty"`
  16622. // Items: A list of NetworkEndpointWithHealthStatus resources.
  16623. Items []*NetworkEndpointWithHealthStatus `json:"items,omitempty"`
  16624. // Kind: [Output Only] The resource type, which is always
  16625. // compute#networkEndpointGroupsListNetworkEndpoints for the list of
  16626. // network endpoints in the specified network endpoint group.
  16627. Kind string `json:"kind,omitempty"`
  16628. // NextPageToken: [Output Only] This token allows you to get the next
  16629. // page of results for list requests. If the number of results is larger
  16630. // than maxResults, use the nextPageToken as a value for the query
  16631. // parameter pageToken in the next list request. Subsequent list
  16632. // requests will have their own nextPageToken to continue paging through
  16633. // the results.
  16634. NextPageToken string `json:"nextPageToken,omitempty"`
  16635. // Warning: [Output Only] Informational warning message.
  16636. Warning *NetworkEndpointGroupsListNetworkEndpointsWarning `json:"warning,omitempty"`
  16637. // ServerResponse contains the HTTP response code and headers from the
  16638. // server.
  16639. googleapi.ServerResponse `json:"-"`
  16640. // ForceSendFields is a list of field names (e.g. "Id") to
  16641. // unconditionally include in API requests. By default, fields with
  16642. // empty values are omitted from API requests. However, any non-pointer,
  16643. // non-interface field appearing in ForceSendFields will be sent to the
  16644. // server regardless of whether the field is empty or not. This may be
  16645. // used to include empty fields in Patch requests.
  16646. ForceSendFields []string `json:"-"`
  16647. // NullFields is a list of field names (e.g. "Id") to include in API
  16648. // requests with the JSON null value. By default, fields with empty
  16649. // values are omitted from API requests. However, any field with an
  16650. // empty value appearing in NullFields will be sent to the server as
  16651. // null. It is an error if a field in this list has a non-empty value.
  16652. // This may be used to include null fields in Patch requests.
  16653. NullFields []string `json:"-"`
  16654. }
  16655. func (s *NetworkEndpointGroupsListNetworkEndpoints) MarshalJSON() ([]byte, error) {
  16656. type NoMethod NetworkEndpointGroupsListNetworkEndpoints
  16657. raw := NoMethod(*s)
  16658. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16659. }
  16660. // NetworkEndpointGroupsListNetworkEndpointsWarning: [Output Only]
  16661. // Informational warning message.
  16662. type NetworkEndpointGroupsListNetworkEndpointsWarning struct {
  16663. // Code: [Output Only] A warning code, if applicable. For example,
  16664. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  16665. // the response.
  16666. //
  16667. // Possible values:
  16668. // "CLEANUP_FAILED"
  16669. // "DEPRECATED_RESOURCE_USED"
  16670. // "DEPRECATED_TYPE_USED"
  16671. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  16672. // "EXPERIMENTAL_TYPE_USED"
  16673. // "EXTERNAL_API_WARNING"
  16674. // "FIELD_VALUE_OVERRIDEN"
  16675. // "INJECTED_KERNELS_DEPRECATED"
  16676. // "MISSING_TYPE_DEPENDENCY"
  16677. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  16678. // "NEXT_HOP_CANNOT_IP_FORWARD"
  16679. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  16680. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  16681. // "NEXT_HOP_NOT_RUNNING"
  16682. // "NOT_CRITICAL_ERROR"
  16683. // "NO_RESULTS_ON_PAGE"
  16684. // "REQUIRED_TOS_AGREEMENT"
  16685. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  16686. // "RESOURCE_NOT_DELETED"
  16687. // "SCHEMA_VALIDATION_IGNORED"
  16688. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  16689. // "UNDECLARED_PROPERTIES"
  16690. // "UNREACHABLE"
  16691. Code string `json:"code,omitempty"`
  16692. // Data: [Output Only] Metadata about this warning in key: value format.
  16693. // For example:
  16694. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  16695. Data []*NetworkEndpointGroupsListNetworkEndpointsWarningData `json:"data,omitempty"`
  16696. // Message: [Output Only] A human-readable description of the warning
  16697. // code.
  16698. Message string `json:"message,omitempty"`
  16699. // ForceSendFields is a list of field names (e.g. "Code") to
  16700. // unconditionally include in API requests. By default, fields with
  16701. // empty values are omitted from API requests. However, any non-pointer,
  16702. // non-interface field appearing in ForceSendFields will be sent to the
  16703. // server regardless of whether the field is empty or not. This may be
  16704. // used to include empty fields in Patch requests.
  16705. ForceSendFields []string `json:"-"`
  16706. // NullFields is a list of field names (e.g. "Code") to include in API
  16707. // requests with the JSON null value. By default, fields with empty
  16708. // values are omitted from API requests. However, any field with an
  16709. // empty value appearing in NullFields will be sent to the server as
  16710. // null. It is an error if a field in this list has a non-empty value.
  16711. // This may be used to include null fields in Patch requests.
  16712. NullFields []string `json:"-"`
  16713. }
  16714. func (s *NetworkEndpointGroupsListNetworkEndpointsWarning) MarshalJSON() ([]byte, error) {
  16715. type NoMethod NetworkEndpointGroupsListNetworkEndpointsWarning
  16716. raw := NoMethod(*s)
  16717. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16718. }
  16719. type NetworkEndpointGroupsListNetworkEndpointsWarningData struct {
  16720. // Key: [Output Only] A key that provides more detail on the warning
  16721. // being returned. For example, for warnings where there are no results
  16722. // in a list request for a particular zone, this key might be scope and
  16723. // the key value might be the zone name. Other examples might be a key
  16724. // indicating a deprecated resource and a suggested replacement, or a
  16725. // warning about invalid network settings (for example, if an instance
  16726. // attempts to perform IP forwarding but is not enabled for IP
  16727. // forwarding).
  16728. Key string `json:"key,omitempty"`
  16729. // Value: [Output Only] A warning data value corresponding to the key.
  16730. Value string `json:"value,omitempty"`
  16731. // ForceSendFields is a list of field names (e.g. "Key") to
  16732. // unconditionally include in API requests. By default, fields with
  16733. // empty values are omitted from API requests. However, any non-pointer,
  16734. // non-interface field appearing in ForceSendFields will be sent to the
  16735. // server regardless of whether the field is empty or not. This may be
  16736. // used to include empty fields in Patch requests.
  16737. ForceSendFields []string `json:"-"`
  16738. // NullFields is a list of field names (e.g. "Key") to include in API
  16739. // requests with the JSON null value. By default, fields with empty
  16740. // values are omitted from API requests. However, any field with an
  16741. // empty value appearing in NullFields will be sent to the server as
  16742. // null. It is an error if a field in this list has a non-empty value.
  16743. // This may be used to include null fields in Patch requests.
  16744. NullFields []string `json:"-"`
  16745. }
  16746. func (s *NetworkEndpointGroupsListNetworkEndpointsWarningData) MarshalJSON() ([]byte, error) {
  16747. type NoMethod NetworkEndpointGroupsListNetworkEndpointsWarningData
  16748. raw := NoMethod(*s)
  16749. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16750. }
  16751. type NetworkEndpointGroupsScopedList struct {
  16752. // NetworkEndpointGroups: [Output Only] The list of network endpoint
  16753. // groups that are contained in this scope.
  16754. NetworkEndpointGroups []*NetworkEndpointGroup `json:"networkEndpointGroups,omitempty"`
  16755. // Warning: [Output Only] An informational warning that replaces the
  16756. // list of network endpoint groups when the list is empty.
  16757. Warning *NetworkEndpointGroupsScopedListWarning `json:"warning,omitempty"`
  16758. // ForceSendFields is a list of field names (e.g.
  16759. // "NetworkEndpointGroups") to unconditionally include in API requests.
  16760. // By default, fields with empty values are omitted from API requests.
  16761. // However, any non-pointer, non-interface field appearing in
  16762. // ForceSendFields will be sent to the server regardless of whether the
  16763. // field is empty or not. This may be used to include empty fields in
  16764. // Patch requests.
  16765. ForceSendFields []string `json:"-"`
  16766. // NullFields is a list of field names (e.g. "NetworkEndpointGroups") to
  16767. // include in API requests with the JSON null value. By default, fields
  16768. // with empty values are omitted from API requests. However, any field
  16769. // with an empty value appearing in NullFields will be sent to the
  16770. // server as null. It is an error if a field in this list has a
  16771. // non-empty value. This may be used to include null fields in Patch
  16772. // requests.
  16773. NullFields []string `json:"-"`
  16774. }
  16775. func (s *NetworkEndpointGroupsScopedList) MarshalJSON() ([]byte, error) {
  16776. type NoMethod NetworkEndpointGroupsScopedList
  16777. raw := NoMethod(*s)
  16778. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16779. }
  16780. // NetworkEndpointGroupsScopedListWarning: [Output Only] An
  16781. // informational warning that replaces the list of network endpoint
  16782. // groups when the list is empty.
  16783. type NetworkEndpointGroupsScopedListWarning struct {
  16784. // Code: [Output Only] A warning code, if applicable. For example,
  16785. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  16786. // the response.
  16787. //
  16788. // Possible values:
  16789. // "CLEANUP_FAILED"
  16790. // "DEPRECATED_RESOURCE_USED"
  16791. // "DEPRECATED_TYPE_USED"
  16792. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  16793. // "EXPERIMENTAL_TYPE_USED"
  16794. // "EXTERNAL_API_WARNING"
  16795. // "FIELD_VALUE_OVERRIDEN"
  16796. // "INJECTED_KERNELS_DEPRECATED"
  16797. // "MISSING_TYPE_DEPENDENCY"
  16798. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  16799. // "NEXT_HOP_CANNOT_IP_FORWARD"
  16800. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  16801. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  16802. // "NEXT_HOP_NOT_RUNNING"
  16803. // "NOT_CRITICAL_ERROR"
  16804. // "NO_RESULTS_ON_PAGE"
  16805. // "REQUIRED_TOS_AGREEMENT"
  16806. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  16807. // "RESOURCE_NOT_DELETED"
  16808. // "SCHEMA_VALIDATION_IGNORED"
  16809. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  16810. // "UNDECLARED_PROPERTIES"
  16811. // "UNREACHABLE"
  16812. Code string `json:"code,omitempty"`
  16813. // Data: [Output Only] Metadata about this warning in key: value format.
  16814. // For example:
  16815. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  16816. Data []*NetworkEndpointGroupsScopedListWarningData `json:"data,omitempty"`
  16817. // Message: [Output Only] A human-readable description of the warning
  16818. // code.
  16819. Message string `json:"message,omitempty"`
  16820. // ForceSendFields is a list of field names (e.g. "Code") to
  16821. // unconditionally include in API requests. By default, fields with
  16822. // empty values are omitted from API requests. However, any non-pointer,
  16823. // non-interface field appearing in ForceSendFields will be sent to the
  16824. // server regardless of whether the field is empty or not. This may be
  16825. // used to include empty fields in Patch requests.
  16826. ForceSendFields []string `json:"-"`
  16827. // NullFields is a list of field names (e.g. "Code") to include in API
  16828. // requests with the JSON null value. By default, fields with empty
  16829. // values are omitted from API requests. However, any field with an
  16830. // empty value appearing in NullFields will be sent to the server as
  16831. // null. It is an error if a field in this list has a non-empty value.
  16832. // This may be used to include null fields in Patch requests.
  16833. NullFields []string `json:"-"`
  16834. }
  16835. func (s *NetworkEndpointGroupsScopedListWarning) MarshalJSON() ([]byte, error) {
  16836. type NoMethod NetworkEndpointGroupsScopedListWarning
  16837. raw := NoMethod(*s)
  16838. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16839. }
  16840. type NetworkEndpointGroupsScopedListWarningData struct {
  16841. // Key: [Output Only] A key that provides more detail on the warning
  16842. // being returned. For example, for warnings where there are no results
  16843. // in a list request for a particular zone, this key might be scope and
  16844. // the key value might be the zone name. Other examples might be a key
  16845. // indicating a deprecated resource and a suggested replacement, or a
  16846. // warning about invalid network settings (for example, if an instance
  16847. // attempts to perform IP forwarding but is not enabled for IP
  16848. // forwarding).
  16849. Key string `json:"key,omitempty"`
  16850. // Value: [Output Only] A warning data value corresponding to the key.
  16851. Value string `json:"value,omitempty"`
  16852. // ForceSendFields is a list of field names (e.g. "Key") to
  16853. // unconditionally include in API requests. By default, fields with
  16854. // empty values are omitted from API requests. However, any non-pointer,
  16855. // non-interface field appearing in ForceSendFields will be sent to the
  16856. // server regardless of whether the field is empty or not. This may be
  16857. // used to include empty fields in Patch requests.
  16858. ForceSendFields []string `json:"-"`
  16859. // NullFields is a list of field names (e.g. "Key") to include in API
  16860. // requests with the JSON null value. By default, fields with empty
  16861. // values are omitted from API requests. However, any field with an
  16862. // empty value appearing in NullFields will be sent to the server as
  16863. // null. It is an error if a field in this list has a non-empty value.
  16864. // This may be used to include null fields in Patch requests.
  16865. NullFields []string `json:"-"`
  16866. }
  16867. func (s *NetworkEndpointGroupsScopedListWarningData) MarshalJSON() ([]byte, error) {
  16868. type NoMethod NetworkEndpointGroupsScopedListWarningData
  16869. raw := NoMethod(*s)
  16870. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16871. }
  16872. type NetworkEndpointWithHealthStatus struct {
  16873. // Healths: [Output only] The health status of network endpoint;
  16874. Healths []*HealthStatusForNetworkEndpoint `json:"healths,omitempty"`
  16875. // NetworkEndpoint: [Output only] The network endpoint;
  16876. NetworkEndpoint *NetworkEndpoint `json:"networkEndpoint,omitempty"`
  16877. // ForceSendFields is a list of field names (e.g. "Healths") to
  16878. // unconditionally include in API requests. By default, fields with
  16879. // empty values are omitted from API requests. However, any non-pointer,
  16880. // non-interface field appearing in ForceSendFields will be sent to the
  16881. // server regardless of whether the field is empty or not. This may be
  16882. // used to include empty fields in Patch requests.
  16883. ForceSendFields []string `json:"-"`
  16884. // NullFields is a list of field names (e.g. "Healths") to include in
  16885. // API requests with the JSON null value. By default, fields with empty
  16886. // values are omitted from API requests. However, any field with an
  16887. // empty value appearing in NullFields will be sent to the server as
  16888. // null. It is an error if a field in this list has a non-empty value.
  16889. // This may be used to include null fields in Patch requests.
  16890. NullFields []string `json:"-"`
  16891. }
  16892. func (s *NetworkEndpointWithHealthStatus) MarshalJSON() ([]byte, error) {
  16893. type NoMethod NetworkEndpointWithHealthStatus
  16894. raw := NoMethod(*s)
  16895. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16896. }
  16897. // NetworkInterface: A network interface resource attached to an
  16898. // instance.
  16899. type NetworkInterface struct {
  16900. // AccessConfigs: An array of configurations for this interface.
  16901. // Currently, only one access config, ONE_TO_ONE_NAT, is supported. If
  16902. // there are no accessConfigs specified, then this instance will have no
  16903. // external internet access.
  16904. AccessConfigs []*AccessConfig `json:"accessConfigs,omitempty"`
  16905. // AliasIpRanges: An array of alias IP ranges for this network
  16906. // interface. Can only be specified for network interfaces on
  16907. // subnet-mode networks.
  16908. AliasIpRanges []*AliasIpRange `json:"aliasIpRanges,omitempty"`
  16909. // Fingerprint: Fingerprint hash of contents stored in this network
  16910. // interface. This field will be ignored when inserting an Instance or
  16911. // adding a NetworkInterface. An up-to-date fingerprint must be provided
  16912. // in order to update the NetworkInterface.
  16913. Fingerprint string `json:"fingerprint,omitempty"`
  16914. // Kind: [Output Only] Type of the resource. Always
  16915. // compute#networkInterface for network interfaces.
  16916. Kind string `json:"kind,omitempty"`
  16917. // Name: [Output Only] The name of the network interface, generated by
  16918. // the server. For network devices, these are eth0, eth1, etc.
  16919. Name string `json:"name,omitempty"`
  16920. // Network: URL of the network resource for this instance. When creating
  16921. // an instance, if neither the network nor the subnetwork is specified,
  16922. // the default network global/networks/default is used; if the network
  16923. // is not specified but the subnetwork is specified, the network is
  16924. // inferred.
  16925. //
  16926. // This field is optional when creating a firewall rule. If not
  16927. // specified when creating a firewall rule, the default network
  16928. // global/networks/default is used.
  16929. //
  16930. // If you specify this property, you can specify the network as a full
  16931. // or partial URL. For example, the following are all valid URLs:
  16932. // -
  16933. // https://www.googleapis.com/compute/v1/projects/project/global/networks/network
  16934. // - projects/project/global/networks/network
  16935. // - global/networks/default
  16936. Network string `json:"network,omitempty"`
  16937. // NetworkIP: An IPv4 internal network address to assign to the instance
  16938. // for this network interface. If not specified by the user, an unused
  16939. // internal IP is assigned by the system.
  16940. NetworkIP string `json:"networkIP,omitempty"`
  16941. // Subnetwork: The URL of the Subnetwork resource for this instance. If
  16942. // the network resource is in legacy mode, do not provide this property.
  16943. // If the network is in auto subnet mode, providing the subnetwork is
  16944. // optional. If the network is in custom subnet mode, then this field
  16945. // should be specified. If you specify this property, you can specify
  16946. // the subnetwork as a full or partial URL. For example, the following
  16947. // are all valid URLs:
  16948. // -
  16949. // https://www.googleapis.com/compute/v1/projects/project/regions/region/subnetworks/subnetwork
  16950. // - regions/region/subnetworks/subnetwork
  16951. Subnetwork string `json:"subnetwork,omitempty"`
  16952. // ForceSendFields is a list of field names (e.g. "AccessConfigs") to
  16953. // unconditionally include in API requests. By default, fields with
  16954. // empty values are omitted from API requests. However, any non-pointer,
  16955. // non-interface field appearing in ForceSendFields will be sent to the
  16956. // server regardless of whether the field is empty or not. This may be
  16957. // used to include empty fields in Patch requests.
  16958. ForceSendFields []string `json:"-"`
  16959. // NullFields is a list of field names (e.g. "AccessConfigs") to include
  16960. // in API requests with the JSON null value. By default, fields with
  16961. // empty values are omitted from API requests. However, any field with
  16962. // an empty value appearing in NullFields will be sent to the server as
  16963. // null. It is an error if a field in this list has a non-empty value.
  16964. // This may be used to include null fields in Patch requests.
  16965. NullFields []string `json:"-"`
  16966. }
  16967. func (s *NetworkInterface) MarshalJSON() ([]byte, error) {
  16968. type NoMethod NetworkInterface
  16969. raw := NoMethod(*s)
  16970. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16971. }
  16972. // NetworkList: Contains a list of networks.
  16973. type NetworkList struct {
  16974. // Id: [Output Only] Unique identifier for the resource; defined by the
  16975. // server.
  16976. Id string `json:"id,omitempty"`
  16977. // Items: A list of Network resources.
  16978. Items []*Network `json:"items,omitempty"`
  16979. // Kind: [Output Only] Type of resource. Always compute#networkList for
  16980. // lists of networks.
  16981. Kind string `json:"kind,omitempty"`
  16982. // NextPageToken: [Output Only] This token allows you to get the next
  16983. // page of results for list requests. If the number of results is larger
  16984. // than maxResults, use the nextPageToken as a value for the query
  16985. // parameter pageToken in the next list request. Subsequent list
  16986. // requests will have their own nextPageToken to continue paging through
  16987. // the results.
  16988. NextPageToken string `json:"nextPageToken,omitempty"`
  16989. // SelfLink: [Output Only] Server-defined URL for this resource.
  16990. SelfLink string `json:"selfLink,omitempty"`
  16991. // Warning: [Output Only] Informational warning message.
  16992. Warning *NetworkListWarning `json:"warning,omitempty"`
  16993. // ServerResponse contains the HTTP response code and headers from the
  16994. // server.
  16995. googleapi.ServerResponse `json:"-"`
  16996. // ForceSendFields is a list of field names (e.g. "Id") to
  16997. // unconditionally include in API requests. By default, fields with
  16998. // empty values are omitted from API requests. However, any non-pointer,
  16999. // non-interface field appearing in ForceSendFields will be sent to the
  17000. // server regardless of whether the field is empty or not. This may be
  17001. // used to include empty fields in Patch requests.
  17002. ForceSendFields []string `json:"-"`
  17003. // NullFields is a list of field names (e.g. "Id") to include in API
  17004. // requests with the JSON null value. By default, fields with empty
  17005. // values are omitted from API requests. However, any field with an
  17006. // empty value appearing in NullFields will be sent to the server as
  17007. // null. It is an error if a field in this list has a non-empty value.
  17008. // This may be used to include null fields in Patch requests.
  17009. NullFields []string `json:"-"`
  17010. }
  17011. func (s *NetworkList) MarshalJSON() ([]byte, error) {
  17012. type NoMethod NetworkList
  17013. raw := NoMethod(*s)
  17014. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17015. }
  17016. // NetworkListWarning: [Output Only] Informational warning message.
  17017. type NetworkListWarning struct {
  17018. // Code: [Output Only] A warning code, if applicable. For example,
  17019. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  17020. // the response.
  17021. //
  17022. // Possible values:
  17023. // "CLEANUP_FAILED"
  17024. // "DEPRECATED_RESOURCE_USED"
  17025. // "DEPRECATED_TYPE_USED"
  17026. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  17027. // "EXPERIMENTAL_TYPE_USED"
  17028. // "EXTERNAL_API_WARNING"
  17029. // "FIELD_VALUE_OVERRIDEN"
  17030. // "INJECTED_KERNELS_DEPRECATED"
  17031. // "MISSING_TYPE_DEPENDENCY"
  17032. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  17033. // "NEXT_HOP_CANNOT_IP_FORWARD"
  17034. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  17035. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  17036. // "NEXT_HOP_NOT_RUNNING"
  17037. // "NOT_CRITICAL_ERROR"
  17038. // "NO_RESULTS_ON_PAGE"
  17039. // "REQUIRED_TOS_AGREEMENT"
  17040. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  17041. // "RESOURCE_NOT_DELETED"
  17042. // "SCHEMA_VALIDATION_IGNORED"
  17043. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  17044. // "UNDECLARED_PROPERTIES"
  17045. // "UNREACHABLE"
  17046. Code string `json:"code,omitempty"`
  17047. // Data: [Output Only] Metadata about this warning in key: value format.
  17048. // For example:
  17049. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  17050. Data []*NetworkListWarningData `json:"data,omitempty"`
  17051. // Message: [Output Only] A human-readable description of the warning
  17052. // code.
  17053. Message string `json:"message,omitempty"`
  17054. // ForceSendFields is a list of field names (e.g. "Code") to
  17055. // unconditionally include in API requests. By default, fields with
  17056. // empty values are omitted from API requests. However, any non-pointer,
  17057. // non-interface field appearing in ForceSendFields will be sent to the
  17058. // server regardless of whether the field is empty or not. This may be
  17059. // used to include empty fields in Patch requests.
  17060. ForceSendFields []string `json:"-"`
  17061. // NullFields is a list of field names (e.g. "Code") to include in API
  17062. // requests with the JSON null value. By default, fields with empty
  17063. // values are omitted from API requests. However, any field with an
  17064. // empty value appearing in NullFields will be sent to the server as
  17065. // null. It is an error if a field in this list has a non-empty value.
  17066. // This may be used to include null fields in Patch requests.
  17067. NullFields []string `json:"-"`
  17068. }
  17069. func (s *NetworkListWarning) MarshalJSON() ([]byte, error) {
  17070. type NoMethod NetworkListWarning
  17071. raw := NoMethod(*s)
  17072. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17073. }
  17074. type NetworkListWarningData struct {
  17075. // Key: [Output Only] A key that provides more detail on the warning
  17076. // being returned. For example, for warnings where there are no results
  17077. // in a list request for a particular zone, this key might be scope and
  17078. // the key value might be the zone name. Other examples might be a key
  17079. // indicating a deprecated resource and a suggested replacement, or a
  17080. // warning about invalid network settings (for example, if an instance
  17081. // attempts to perform IP forwarding but is not enabled for IP
  17082. // forwarding).
  17083. Key string `json:"key,omitempty"`
  17084. // Value: [Output Only] A warning data value corresponding to the key.
  17085. Value string `json:"value,omitempty"`
  17086. // ForceSendFields is a list of field names (e.g. "Key") to
  17087. // unconditionally include in API requests. By default, fields with
  17088. // empty values are omitted from API requests. However, any non-pointer,
  17089. // non-interface field appearing in ForceSendFields will be sent to the
  17090. // server regardless of whether the field is empty or not. This may be
  17091. // used to include empty fields in Patch requests.
  17092. ForceSendFields []string `json:"-"`
  17093. // NullFields is a list of field names (e.g. "Key") to include in API
  17094. // requests with the JSON null value. By default, fields with empty
  17095. // values are omitted from API requests. However, any field with an
  17096. // empty value appearing in NullFields will be sent to the server as
  17097. // null. It is an error if a field in this list has a non-empty value.
  17098. // This may be used to include null fields in Patch requests.
  17099. NullFields []string `json:"-"`
  17100. }
  17101. func (s *NetworkListWarningData) MarshalJSON() ([]byte, error) {
  17102. type NoMethod NetworkListWarningData
  17103. raw := NoMethod(*s)
  17104. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17105. }
  17106. // NetworkPeering: A network peering attached to a network resource. The
  17107. // message includes the peering name, peer network, peering state, and a
  17108. // flag indicating whether Google Compute Engine should automatically
  17109. // create routes for the peering.
  17110. type NetworkPeering struct {
  17111. // AutoCreateRoutes: Whether full mesh connectivity is created and
  17112. // managed automatically. When it is set to true, Google Compute Engine
  17113. // will automatically create and manage the routes between two networks
  17114. // when the state is ACTIVE. Otherwise, user needs to create routes
  17115. // manually to route packets to peer network.
  17116. AutoCreateRoutes bool `json:"autoCreateRoutes,omitempty"`
  17117. // ExportCustomRoutes: Whether to export the custom routes to peer
  17118. // network.
  17119. ExportCustomRoutes bool `json:"exportCustomRoutes,omitempty"`
  17120. // ImportCustomRoutes: Whether to import the custom routes from peer
  17121. // network.
  17122. ImportCustomRoutes bool `json:"importCustomRoutes,omitempty"`
  17123. // Name: Name of this peering. Provided by the client when the peering
  17124. // is created. The name must comply with RFC1035. Specifically, the name
  17125. // must be 1-63 characters long and match regular expression
  17126. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  17127. // a lowercase letter, and all the following characters must be a dash,
  17128. // lowercase letter, or digit, except the last character, which cannot
  17129. // be a dash.
  17130. Name string `json:"name,omitempty"`
  17131. // Network: The URL of the peer network. It can be either full URL or
  17132. // partial URL. The peer network may belong to a different project. If
  17133. // the partial URL does not contain project, it is assumed that the peer
  17134. // network is in the same project as the current network.
  17135. Network string `json:"network,omitempty"`
  17136. // State: [Output Only] State for the peering.
  17137. //
  17138. // Possible values:
  17139. // "ACTIVE"
  17140. // "INACTIVE"
  17141. State string `json:"state,omitempty"`
  17142. // StateDetails: [Output Only] Details about the current state of the
  17143. // peering.
  17144. StateDetails string `json:"stateDetails,omitempty"`
  17145. // ForceSendFields is a list of field names (e.g. "AutoCreateRoutes") to
  17146. // unconditionally include in API requests. By default, fields with
  17147. // empty values are omitted from API requests. However, any non-pointer,
  17148. // non-interface field appearing in ForceSendFields will be sent to the
  17149. // server regardless of whether the field is empty or not. This may be
  17150. // used to include empty fields in Patch requests.
  17151. ForceSendFields []string `json:"-"`
  17152. // NullFields is a list of field names (e.g. "AutoCreateRoutes") to
  17153. // include in API requests with the JSON null value. By default, fields
  17154. // with empty values are omitted from API requests. However, any field
  17155. // with an empty value appearing in NullFields will be sent to the
  17156. // server as null. It is an error if a field in this list has a
  17157. // non-empty value. This may be used to include null fields in Patch
  17158. // requests.
  17159. NullFields []string `json:"-"`
  17160. }
  17161. func (s *NetworkPeering) MarshalJSON() ([]byte, error) {
  17162. type NoMethod NetworkPeering
  17163. raw := NoMethod(*s)
  17164. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17165. }
  17166. // NetworkRoutingConfig: A routing configuration attached to a network
  17167. // resource. The message includes the list of routers associated with
  17168. // the network, and a flag indicating the type of routing behavior to
  17169. // enforce network-wide.
  17170. type NetworkRoutingConfig struct {
  17171. // RoutingMode: The network-wide routing mode to use. If set to
  17172. // REGIONAL, this network's cloud routers will only advertise routes
  17173. // with subnetworks of this network in the same region as the router. If
  17174. // set to GLOBAL, this network's cloud routers will advertise routes
  17175. // with all subnetworks of this network, across regions.
  17176. //
  17177. // Possible values:
  17178. // "GLOBAL"
  17179. // "REGIONAL"
  17180. RoutingMode string `json:"routingMode,omitempty"`
  17181. // ForceSendFields is a list of field names (e.g. "RoutingMode") to
  17182. // unconditionally include in API requests. By default, fields with
  17183. // empty values are omitted from API requests. However, any non-pointer,
  17184. // non-interface field appearing in ForceSendFields will be sent to the
  17185. // server regardless of whether the field is empty or not. This may be
  17186. // used to include empty fields in Patch requests.
  17187. ForceSendFields []string `json:"-"`
  17188. // NullFields is a list of field names (e.g. "RoutingMode") to include
  17189. // in API requests with the JSON null value. By default, fields with
  17190. // empty values are omitted from API requests. However, any field with
  17191. // an empty value appearing in NullFields will be sent to the server as
  17192. // null. It is an error if a field in this list has a non-empty value.
  17193. // This may be used to include null fields in Patch requests.
  17194. NullFields []string `json:"-"`
  17195. }
  17196. func (s *NetworkRoutingConfig) MarshalJSON() ([]byte, error) {
  17197. type NoMethod NetworkRoutingConfig
  17198. raw := NoMethod(*s)
  17199. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17200. }
  17201. type NetworksAddPeeringRequest struct {
  17202. // AutoCreateRoutes: Whether Google Compute Engine manages the routes
  17203. // automatically.
  17204. AutoCreateRoutes bool `json:"autoCreateRoutes,omitempty"`
  17205. // ExportCustomRoutes: Whether to export the custom routes to peer
  17206. // network.
  17207. ExportCustomRoutes bool `json:"exportCustomRoutes,omitempty"`
  17208. // ImportCustomRoutes: Whether to import the custom routes from peer
  17209. // network.
  17210. ImportCustomRoutes bool `json:"importCustomRoutes,omitempty"`
  17211. // Name: Name of the peering, which should conform to RFC1035.
  17212. Name string `json:"name,omitempty"`
  17213. // PeerNetwork: URL of the peer network. It can be either full URL or
  17214. // partial URL. The peer network may belong to a different project. If
  17215. // the partial URL does not contain project, it is assumed that the peer
  17216. // network is in the same project as the current network.
  17217. PeerNetwork string `json:"peerNetwork,omitempty"`
  17218. // ForceSendFields is a list of field names (e.g. "AutoCreateRoutes") 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. "AutoCreateRoutes") to
  17226. // include in API requests with the JSON null value. By default, fields
  17227. // with empty values are omitted from API requests. However, any field
  17228. // with an empty value appearing in NullFields will be sent to the
  17229. // server as null. It is an error if a field in this list has a
  17230. // non-empty value. This may be used to include null fields in Patch
  17231. // requests.
  17232. NullFields []string `json:"-"`
  17233. }
  17234. func (s *NetworksAddPeeringRequest) MarshalJSON() ([]byte, error) {
  17235. type NoMethod NetworksAddPeeringRequest
  17236. raw := NoMethod(*s)
  17237. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17238. }
  17239. type NetworksRemovePeeringRequest struct {
  17240. // Name: Name of the peering, which should conform to RFC1035.
  17241. Name string `json:"name,omitempty"`
  17242. // ForceSendFields is a list of field names (e.g. "Name") to
  17243. // unconditionally include in API requests. By default, fields with
  17244. // empty values are omitted from API requests. However, any non-pointer,
  17245. // non-interface field appearing in ForceSendFields will be sent to the
  17246. // server regardless of whether the field is empty or not. This may be
  17247. // used to include empty fields in Patch requests.
  17248. ForceSendFields []string `json:"-"`
  17249. // NullFields is a list of field names (e.g. "Name") to include in API
  17250. // requests with the JSON null value. By default, fields with empty
  17251. // values are omitted from API requests. However, any field with an
  17252. // empty value appearing in NullFields will be sent to the server as
  17253. // null. It is an error if a field in this list has a non-empty value.
  17254. // This may be used to include null fields in Patch requests.
  17255. NullFields []string `json:"-"`
  17256. }
  17257. func (s *NetworksRemovePeeringRequest) MarshalJSON() ([]byte, error) {
  17258. type NoMethod NetworksRemovePeeringRequest
  17259. raw := NoMethod(*s)
  17260. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17261. }
  17262. // NodeGroup: A NodeGroup resource.
  17263. type NodeGroup struct {
  17264. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  17265. // format.
  17266. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  17267. // Description: An optional description of this resource. Provide this
  17268. // property when you create the resource.
  17269. Description string `json:"description,omitempty"`
  17270. // Id: [Output Only] The unique identifier for the resource. This
  17271. // identifier is defined by the server.
  17272. Id uint64 `json:"id,omitempty,string"`
  17273. // Kind: [Output Only] The type of the resource. Always
  17274. // compute#nodeGroup for node group.
  17275. Kind string `json:"kind,omitempty"`
  17276. // Name: The name of the resource, provided by the client when initially
  17277. // creating the resource. The resource name must be 1-63 characters
  17278. // long, and comply with RFC1035. Specifically, the name must be 1-63
  17279. // characters long and match the regular expression
  17280. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  17281. // a lowercase letter, and all following characters must be a dash,
  17282. // lowercase letter, or digit, except the last character, which cannot
  17283. // be a dash.
  17284. Name string `json:"name,omitempty"`
  17285. // NodeTemplate: The URL of the node template to which this node group
  17286. // belongs.
  17287. NodeTemplate string `json:"nodeTemplate,omitempty"`
  17288. // Nodes: [Output Only] A list of nodes in this node group.
  17289. Nodes []*NodeGroupNode `json:"nodes,omitempty"`
  17290. // SelfLink: [Output Only] Server-defined URL for the resource.
  17291. SelfLink string `json:"selfLink,omitempty"`
  17292. // Possible values:
  17293. // "CREATING"
  17294. // "DELETING"
  17295. // "INVALID"
  17296. // "READY"
  17297. Status string `json:"status,omitempty"`
  17298. // Zone: [Output Only] The name of the zone where the node group
  17299. // resides, such as us-central1-a.
  17300. Zone string `json:"zone,omitempty"`
  17301. // ServerResponse contains the HTTP response code and headers from the
  17302. // server.
  17303. googleapi.ServerResponse `json:"-"`
  17304. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  17305. // to unconditionally include in API requests. By default, fields with
  17306. // empty values are omitted from API requests. However, any non-pointer,
  17307. // non-interface field appearing in ForceSendFields will be sent to the
  17308. // server regardless of whether the field is empty or not. This may be
  17309. // used to include empty fields in Patch requests.
  17310. ForceSendFields []string `json:"-"`
  17311. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  17312. // include in API requests with the JSON null value. By default, fields
  17313. // with empty values are omitted from API requests. However, any field
  17314. // with an empty value appearing in NullFields will be sent to the
  17315. // server as null. It is an error if a field in this list has a
  17316. // non-empty value. This may be used to include null fields in Patch
  17317. // requests.
  17318. NullFields []string `json:"-"`
  17319. }
  17320. func (s *NodeGroup) MarshalJSON() ([]byte, error) {
  17321. type NoMethod NodeGroup
  17322. raw := NoMethod(*s)
  17323. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17324. }
  17325. type NodeGroupAggregatedList struct {
  17326. // Id: [Output Only] Unique identifier for the resource; defined by the
  17327. // server.
  17328. Id string `json:"id,omitempty"`
  17329. // Items: A list of NodeGroupsScopedList resources.
  17330. Items map[string]NodeGroupsScopedList `json:"items,omitempty"`
  17331. // Kind: [Output Only] Type of resource.Always
  17332. // compute#nodeGroupAggregatedList for aggregated lists of node groups.
  17333. Kind string `json:"kind,omitempty"`
  17334. // NextPageToken: [Output Only] This token allows you to get the next
  17335. // page of results for list requests. If the number of results is larger
  17336. // than maxResults, use the nextPageToken as a value for the query
  17337. // parameter pageToken in the next list request. Subsequent list
  17338. // requests will have their own nextPageToken to continue paging through
  17339. // the results.
  17340. NextPageToken string `json:"nextPageToken,omitempty"`
  17341. // SelfLink: [Output Only] Server-defined URL for this resource.
  17342. SelfLink string `json:"selfLink,omitempty"`
  17343. // Warning: [Output Only] Informational warning message.
  17344. Warning *NodeGroupAggregatedListWarning `json:"warning,omitempty"`
  17345. // ServerResponse contains the HTTP response code and headers from the
  17346. // server.
  17347. googleapi.ServerResponse `json:"-"`
  17348. // ForceSendFields is a list of field names (e.g. "Id") to
  17349. // unconditionally include in API requests. By default, fields with
  17350. // empty values are omitted from API requests. However, any non-pointer,
  17351. // non-interface field appearing in ForceSendFields will be sent to the
  17352. // server regardless of whether the field is empty or not. This may be
  17353. // used to include empty fields in Patch requests.
  17354. ForceSendFields []string `json:"-"`
  17355. // NullFields is a list of field names (e.g. "Id") to include in API
  17356. // requests with the JSON null value. By default, fields with empty
  17357. // values are omitted from API requests. However, any field with an
  17358. // empty value appearing in NullFields will be sent to the server as
  17359. // null. It is an error if a field in this list has a non-empty value.
  17360. // This may be used to include null fields in Patch requests.
  17361. NullFields []string `json:"-"`
  17362. }
  17363. func (s *NodeGroupAggregatedList) MarshalJSON() ([]byte, error) {
  17364. type NoMethod NodeGroupAggregatedList
  17365. raw := NoMethod(*s)
  17366. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17367. }
  17368. // NodeGroupAggregatedListWarning: [Output Only] Informational warning
  17369. // message.
  17370. type NodeGroupAggregatedListWarning struct {
  17371. // Code: [Output Only] A warning code, if applicable. For example,
  17372. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  17373. // the response.
  17374. //
  17375. // Possible values:
  17376. // "CLEANUP_FAILED"
  17377. // "DEPRECATED_RESOURCE_USED"
  17378. // "DEPRECATED_TYPE_USED"
  17379. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  17380. // "EXPERIMENTAL_TYPE_USED"
  17381. // "EXTERNAL_API_WARNING"
  17382. // "FIELD_VALUE_OVERRIDEN"
  17383. // "INJECTED_KERNELS_DEPRECATED"
  17384. // "MISSING_TYPE_DEPENDENCY"
  17385. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  17386. // "NEXT_HOP_CANNOT_IP_FORWARD"
  17387. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  17388. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  17389. // "NEXT_HOP_NOT_RUNNING"
  17390. // "NOT_CRITICAL_ERROR"
  17391. // "NO_RESULTS_ON_PAGE"
  17392. // "REQUIRED_TOS_AGREEMENT"
  17393. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  17394. // "RESOURCE_NOT_DELETED"
  17395. // "SCHEMA_VALIDATION_IGNORED"
  17396. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  17397. // "UNDECLARED_PROPERTIES"
  17398. // "UNREACHABLE"
  17399. Code string `json:"code,omitempty"`
  17400. // Data: [Output Only] Metadata about this warning in key: value format.
  17401. // For example:
  17402. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  17403. Data []*NodeGroupAggregatedListWarningData `json:"data,omitempty"`
  17404. // Message: [Output Only] A human-readable description of the warning
  17405. // code.
  17406. Message string `json:"message,omitempty"`
  17407. // ForceSendFields is a list of field names (e.g. "Code") to
  17408. // unconditionally include in API requests. By default, fields with
  17409. // empty values are omitted from API requests. However, any non-pointer,
  17410. // non-interface field appearing in ForceSendFields will be sent to the
  17411. // server regardless of whether the field is empty or not. This may be
  17412. // used to include empty fields in Patch requests.
  17413. ForceSendFields []string `json:"-"`
  17414. // NullFields is a list of field names (e.g. "Code") to include in API
  17415. // requests with the JSON null value. By default, fields with empty
  17416. // values are omitted from API requests. However, any field with an
  17417. // empty value appearing in NullFields will be sent to the server as
  17418. // null. It is an error if a field in this list has a non-empty value.
  17419. // This may be used to include null fields in Patch requests.
  17420. NullFields []string `json:"-"`
  17421. }
  17422. func (s *NodeGroupAggregatedListWarning) MarshalJSON() ([]byte, error) {
  17423. type NoMethod NodeGroupAggregatedListWarning
  17424. raw := NoMethod(*s)
  17425. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17426. }
  17427. type NodeGroupAggregatedListWarningData struct {
  17428. // Key: [Output Only] A key that provides more detail on the warning
  17429. // being returned. For example, for warnings where there are no results
  17430. // in a list request for a particular zone, this key might be scope and
  17431. // the key value might be the zone name. Other examples might be a key
  17432. // indicating a deprecated resource and a suggested replacement, or a
  17433. // warning about invalid network settings (for example, if an instance
  17434. // attempts to perform IP forwarding but is not enabled for IP
  17435. // forwarding).
  17436. Key string `json:"key,omitempty"`
  17437. // Value: [Output Only] A warning data value corresponding to the key.
  17438. Value string `json:"value,omitempty"`
  17439. // ForceSendFields is a list of field names (e.g. "Key") to
  17440. // unconditionally include in API requests. By default, fields with
  17441. // empty values are omitted from API requests. However, any non-pointer,
  17442. // non-interface field appearing in ForceSendFields will be sent to the
  17443. // server regardless of whether the field is empty or not. This may be
  17444. // used to include empty fields in Patch requests.
  17445. ForceSendFields []string `json:"-"`
  17446. // NullFields is a list of field names (e.g. "Key") to include in API
  17447. // requests with the JSON null value. By default, fields with empty
  17448. // values are omitted from API requests. However, any field with an
  17449. // empty value appearing in NullFields will be sent to the server as
  17450. // null. It is an error if a field in this list has a non-empty value.
  17451. // This may be used to include null fields in Patch requests.
  17452. NullFields []string `json:"-"`
  17453. }
  17454. func (s *NodeGroupAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  17455. type NoMethod NodeGroupAggregatedListWarningData
  17456. raw := NoMethod(*s)
  17457. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17458. }
  17459. // NodeGroupList: Contains a list of nodeGroups.
  17460. type NodeGroupList struct {
  17461. // Id: [Output Only] Unique identifier for the resource; defined by the
  17462. // server.
  17463. Id string `json:"id,omitempty"`
  17464. // Items: A list of NodeGroup resources.
  17465. Items []*NodeGroup `json:"items,omitempty"`
  17466. // Kind: [Output Only] Type of resource.Always compute#nodeGroupList for
  17467. // lists of node groups.
  17468. Kind string `json:"kind,omitempty"`
  17469. // NextPageToken: [Output Only] This token allows you to get the next
  17470. // page of results for list requests. If the number of results is larger
  17471. // than maxResults, use the nextPageToken as a value for the query
  17472. // parameter pageToken in the next list request. Subsequent list
  17473. // requests will have their own nextPageToken to continue paging through
  17474. // the results.
  17475. NextPageToken string `json:"nextPageToken,omitempty"`
  17476. // SelfLink: [Output Only] Server-defined URL for this resource.
  17477. SelfLink string `json:"selfLink,omitempty"`
  17478. // Warning: [Output Only] Informational warning message.
  17479. Warning *NodeGroupListWarning `json:"warning,omitempty"`
  17480. // ServerResponse contains the HTTP response code and headers from the
  17481. // server.
  17482. googleapi.ServerResponse `json:"-"`
  17483. // ForceSendFields is a list of field names (e.g. "Id") to
  17484. // unconditionally include in API requests. By default, fields with
  17485. // empty values are omitted from API requests. However, any non-pointer,
  17486. // non-interface field appearing in ForceSendFields will be sent to the
  17487. // server regardless of whether the field is empty or not. This may be
  17488. // used to include empty fields in Patch requests.
  17489. ForceSendFields []string `json:"-"`
  17490. // NullFields is a list of field names (e.g. "Id") to include in API
  17491. // requests with the JSON null value. By default, fields with empty
  17492. // values are omitted from API requests. However, any field with an
  17493. // empty value appearing in NullFields will be sent to the server as
  17494. // null. It is an error if a field in this list has a non-empty value.
  17495. // This may be used to include null fields in Patch requests.
  17496. NullFields []string `json:"-"`
  17497. }
  17498. func (s *NodeGroupList) MarshalJSON() ([]byte, error) {
  17499. type NoMethod NodeGroupList
  17500. raw := NoMethod(*s)
  17501. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17502. }
  17503. // NodeGroupListWarning: [Output Only] Informational warning message.
  17504. type NodeGroupListWarning struct {
  17505. // Code: [Output Only] A warning code, if applicable. For example,
  17506. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  17507. // the response.
  17508. //
  17509. // Possible values:
  17510. // "CLEANUP_FAILED"
  17511. // "DEPRECATED_RESOURCE_USED"
  17512. // "DEPRECATED_TYPE_USED"
  17513. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  17514. // "EXPERIMENTAL_TYPE_USED"
  17515. // "EXTERNAL_API_WARNING"
  17516. // "FIELD_VALUE_OVERRIDEN"
  17517. // "INJECTED_KERNELS_DEPRECATED"
  17518. // "MISSING_TYPE_DEPENDENCY"
  17519. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  17520. // "NEXT_HOP_CANNOT_IP_FORWARD"
  17521. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  17522. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  17523. // "NEXT_HOP_NOT_RUNNING"
  17524. // "NOT_CRITICAL_ERROR"
  17525. // "NO_RESULTS_ON_PAGE"
  17526. // "REQUIRED_TOS_AGREEMENT"
  17527. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  17528. // "RESOURCE_NOT_DELETED"
  17529. // "SCHEMA_VALIDATION_IGNORED"
  17530. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  17531. // "UNDECLARED_PROPERTIES"
  17532. // "UNREACHABLE"
  17533. Code string `json:"code,omitempty"`
  17534. // Data: [Output Only] Metadata about this warning in key: value format.
  17535. // For example:
  17536. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  17537. Data []*NodeGroupListWarningData `json:"data,omitempty"`
  17538. // Message: [Output Only] A human-readable description of the warning
  17539. // code.
  17540. Message string `json:"message,omitempty"`
  17541. // ForceSendFields is a list of field names (e.g. "Code") to
  17542. // unconditionally include in API requests. By default, fields with
  17543. // empty values are omitted from API requests. However, any non-pointer,
  17544. // non-interface field appearing in ForceSendFields will be sent to the
  17545. // server regardless of whether the field is empty or not. This may be
  17546. // used to include empty fields in Patch requests.
  17547. ForceSendFields []string `json:"-"`
  17548. // NullFields is a list of field names (e.g. "Code") to include in API
  17549. // requests with the JSON null value. By default, fields with empty
  17550. // values are omitted from API requests. However, any field with an
  17551. // empty value appearing in NullFields will be sent to the server as
  17552. // null. It is an error if a field in this list has a non-empty value.
  17553. // This may be used to include null fields in Patch requests.
  17554. NullFields []string `json:"-"`
  17555. }
  17556. func (s *NodeGroupListWarning) MarshalJSON() ([]byte, error) {
  17557. type NoMethod NodeGroupListWarning
  17558. raw := NoMethod(*s)
  17559. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17560. }
  17561. type NodeGroupListWarningData struct {
  17562. // Key: [Output Only] A key that provides more detail on the warning
  17563. // being returned. For example, for warnings where there are no results
  17564. // in a list request for a particular zone, this key might be scope and
  17565. // the key value might be the zone name. Other examples might be a key
  17566. // indicating a deprecated resource and a suggested replacement, or a
  17567. // warning about invalid network settings (for example, if an instance
  17568. // attempts to perform IP forwarding but is not enabled for IP
  17569. // forwarding).
  17570. Key string `json:"key,omitempty"`
  17571. // Value: [Output Only] A warning data value corresponding to the key.
  17572. Value string `json:"value,omitempty"`
  17573. // ForceSendFields is a list of field names (e.g. "Key") to
  17574. // unconditionally include in API requests. By default, fields with
  17575. // empty values are omitted from API requests. However, any non-pointer,
  17576. // non-interface field appearing in ForceSendFields will be sent to the
  17577. // server regardless of whether the field is empty or not. This may be
  17578. // used to include empty fields in Patch requests.
  17579. ForceSendFields []string `json:"-"`
  17580. // NullFields is a list of field names (e.g. "Key") to include in API
  17581. // requests with the JSON null value. By default, fields with empty
  17582. // values are omitted from API requests. However, any field with an
  17583. // empty value appearing in NullFields will be sent to the server as
  17584. // null. It is an error if a field in this list has a non-empty value.
  17585. // This may be used to include null fields in Patch requests.
  17586. NullFields []string `json:"-"`
  17587. }
  17588. func (s *NodeGroupListWarningData) MarshalJSON() ([]byte, error) {
  17589. type NoMethod NodeGroupListWarningData
  17590. raw := NoMethod(*s)
  17591. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17592. }
  17593. type NodeGroupNode struct {
  17594. Index int64 `json:"index,omitempty"`
  17595. // Instances: Instances scheduled on this node.
  17596. Instances []string `json:"instances,omitempty"`
  17597. // Name: The name of the node.
  17598. Name string `json:"name,omitempty"`
  17599. // NodeType: The type of this node.
  17600. NodeType string `json:"nodeType,omitempty"`
  17601. // ForceSendFields is a list of field names (e.g. "Index") to
  17602. // unconditionally include in API requests. By default, fields with
  17603. // empty values are omitted from API requests. However, any non-pointer,
  17604. // non-interface field appearing in ForceSendFields will be sent to the
  17605. // server regardless of whether the field is empty or not. This may be
  17606. // used to include empty fields in Patch requests.
  17607. ForceSendFields []string `json:"-"`
  17608. // NullFields is a list of field names (e.g. "Index") to include in API
  17609. // requests with the JSON null value. By default, fields with empty
  17610. // values are omitted from API requests. However, any field with an
  17611. // empty value appearing in NullFields will be sent to the server as
  17612. // null. It is an error if a field in this list has a non-empty value.
  17613. // This may be used to include null fields in Patch requests.
  17614. NullFields []string `json:"-"`
  17615. }
  17616. func (s *NodeGroupNode) MarshalJSON() ([]byte, error) {
  17617. type NoMethod NodeGroupNode
  17618. raw := NoMethod(*s)
  17619. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17620. }
  17621. type NodeGroupsAddNodesRequest struct {
  17622. // AdditionalNodeCount: Count of additional nodes to be added to the
  17623. // node group.
  17624. AdditionalNodeCount int64 `json:"additionalNodeCount,omitempty"`
  17625. // ForceSendFields is a list of field names (e.g. "AdditionalNodeCount")
  17626. // to unconditionally include in API requests. By default, fields with
  17627. // empty values are omitted from API requests. However, any non-pointer,
  17628. // non-interface field appearing in ForceSendFields will be sent to the
  17629. // server regardless of whether the field is empty or not. This may be
  17630. // used to include empty fields in Patch requests.
  17631. ForceSendFields []string `json:"-"`
  17632. // NullFields is a list of field names (e.g. "AdditionalNodeCount") to
  17633. // include in API requests with the JSON null value. By default, fields
  17634. // with empty values are omitted from API requests. However, any field
  17635. // with an empty value appearing in NullFields will be sent to the
  17636. // server as null. It is an error if a field in this list has a
  17637. // non-empty value. This may be used to include null fields in Patch
  17638. // requests.
  17639. NullFields []string `json:"-"`
  17640. }
  17641. func (s *NodeGroupsAddNodesRequest) MarshalJSON() ([]byte, error) {
  17642. type NoMethod NodeGroupsAddNodesRequest
  17643. raw := NoMethod(*s)
  17644. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17645. }
  17646. type NodeGroupsDeleteNodesRequest struct {
  17647. // NodeIndexes: Indexes of the nodes to be deleted from the node group.
  17648. NodeIndexes []int64 `json:"nodeIndexes,omitempty"`
  17649. Nodes []string `json:"nodes,omitempty"`
  17650. // ForceSendFields is a list of field names (e.g. "NodeIndexes") 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. "NodeIndexes") to include
  17658. // in API requests with the JSON null value. By default, fields with
  17659. // empty values are omitted from API requests. However, any field with
  17660. // an 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 *NodeGroupsDeleteNodesRequest) MarshalJSON() ([]byte, error) {
  17666. type NoMethod NodeGroupsDeleteNodesRequest
  17667. raw := NoMethod(*s)
  17668. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17669. }
  17670. type NodeGroupsScopedList struct {
  17671. // NodeGroups: [Output Only] A list of node groups contained in this
  17672. // scope.
  17673. NodeGroups []*NodeGroup `json:"nodeGroups,omitempty"`
  17674. // Warning: [Output Only] An informational warning that appears when the
  17675. // nodeGroup list is empty.
  17676. Warning *NodeGroupsScopedListWarning `json:"warning,omitempty"`
  17677. // ForceSendFields is a list of field names (e.g. "NodeGroups") to
  17678. // unconditionally include in API requests. By default, fields with
  17679. // empty values are omitted from API requests. However, any non-pointer,
  17680. // non-interface field appearing in ForceSendFields will be sent to the
  17681. // server regardless of whether the field is empty or not. This may be
  17682. // used to include empty fields in Patch requests.
  17683. ForceSendFields []string `json:"-"`
  17684. // NullFields is a list of field names (e.g. "NodeGroups") to include in
  17685. // API requests with the JSON null value. By default, fields with empty
  17686. // values are omitted from API requests. However, any field with an
  17687. // empty value appearing in NullFields will be sent to the server as
  17688. // null. It is an error if a field in this list has a non-empty value.
  17689. // This may be used to include null fields in Patch requests.
  17690. NullFields []string `json:"-"`
  17691. }
  17692. func (s *NodeGroupsScopedList) MarshalJSON() ([]byte, error) {
  17693. type NoMethod NodeGroupsScopedList
  17694. raw := NoMethod(*s)
  17695. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17696. }
  17697. // NodeGroupsScopedListWarning: [Output Only] An informational warning
  17698. // that appears when the nodeGroup list is empty.
  17699. type NodeGroupsScopedListWarning struct {
  17700. // Code: [Output Only] A warning code, if applicable. For example,
  17701. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  17702. // the response.
  17703. //
  17704. // Possible values:
  17705. // "CLEANUP_FAILED"
  17706. // "DEPRECATED_RESOURCE_USED"
  17707. // "DEPRECATED_TYPE_USED"
  17708. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  17709. // "EXPERIMENTAL_TYPE_USED"
  17710. // "EXTERNAL_API_WARNING"
  17711. // "FIELD_VALUE_OVERRIDEN"
  17712. // "INJECTED_KERNELS_DEPRECATED"
  17713. // "MISSING_TYPE_DEPENDENCY"
  17714. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  17715. // "NEXT_HOP_CANNOT_IP_FORWARD"
  17716. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  17717. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  17718. // "NEXT_HOP_NOT_RUNNING"
  17719. // "NOT_CRITICAL_ERROR"
  17720. // "NO_RESULTS_ON_PAGE"
  17721. // "REQUIRED_TOS_AGREEMENT"
  17722. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  17723. // "RESOURCE_NOT_DELETED"
  17724. // "SCHEMA_VALIDATION_IGNORED"
  17725. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  17726. // "UNDECLARED_PROPERTIES"
  17727. // "UNREACHABLE"
  17728. Code string `json:"code,omitempty"`
  17729. // Data: [Output Only] Metadata about this warning in key: value format.
  17730. // For example:
  17731. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  17732. Data []*NodeGroupsScopedListWarningData `json:"data,omitempty"`
  17733. // Message: [Output Only] A human-readable description of the warning
  17734. // code.
  17735. Message string `json:"message,omitempty"`
  17736. // ForceSendFields is a list of field names (e.g. "Code") to
  17737. // unconditionally include in API requests. By default, fields with
  17738. // empty values are omitted from API requests. However, any non-pointer,
  17739. // non-interface field appearing in ForceSendFields will be sent to the
  17740. // server regardless of whether the field is empty or not. This may be
  17741. // used to include empty fields in Patch requests.
  17742. ForceSendFields []string `json:"-"`
  17743. // NullFields is a list of field names (e.g. "Code") to include in API
  17744. // requests with the JSON null value. By default, fields with empty
  17745. // values are omitted from API requests. However, any field with an
  17746. // empty value appearing in NullFields will be sent to the server as
  17747. // null. It is an error if a field in this list has a non-empty value.
  17748. // This may be used to include null fields in Patch requests.
  17749. NullFields []string `json:"-"`
  17750. }
  17751. func (s *NodeGroupsScopedListWarning) MarshalJSON() ([]byte, error) {
  17752. type NoMethod NodeGroupsScopedListWarning
  17753. raw := NoMethod(*s)
  17754. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17755. }
  17756. type NodeGroupsScopedListWarningData struct {
  17757. // Key: [Output Only] A key that provides more detail on the warning
  17758. // being returned. For example, for warnings where there are no results
  17759. // in a list request for a particular zone, this key might be scope and
  17760. // the key value might be the zone name. Other examples might be a key
  17761. // indicating a deprecated resource and a suggested replacement, or a
  17762. // warning about invalid network settings (for example, if an instance
  17763. // attempts to perform IP forwarding but is not enabled for IP
  17764. // forwarding).
  17765. Key string `json:"key,omitempty"`
  17766. // Value: [Output Only] A warning data value corresponding to the key.
  17767. Value string `json:"value,omitempty"`
  17768. // ForceSendFields is a list of field names (e.g. "Key") to
  17769. // unconditionally include in API requests. By default, fields with
  17770. // empty values are omitted from API requests. However, any non-pointer,
  17771. // non-interface field appearing in ForceSendFields will be sent to the
  17772. // server regardless of whether the field is empty or not. This may be
  17773. // used to include empty fields in Patch requests.
  17774. ForceSendFields []string `json:"-"`
  17775. // NullFields is a list of field names (e.g. "Key") to include in API
  17776. // requests with the JSON null value. By default, fields with empty
  17777. // values are omitted from API requests. However, any field with an
  17778. // empty value appearing in NullFields will be sent to the server as
  17779. // null. It is an error if a field in this list has a non-empty value.
  17780. // This may be used to include null fields in Patch requests.
  17781. NullFields []string `json:"-"`
  17782. }
  17783. func (s *NodeGroupsScopedListWarningData) MarshalJSON() ([]byte, error) {
  17784. type NoMethod NodeGroupsScopedListWarningData
  17785. raw := NoMethod(*s)
  17786. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17787. }
  17788. type NodeGroupsSetNodeTemplateRequest struct {
  17789. // NodeTemplate: Full or partial URL of the node template resource to be
  17790. // updated for this node group.
  17791. NodeTemplate string `json:"nodeTemplate,omitempty"`
  17792. // ForceSendFields is a list of field names (e.g. "NodeTemplate") to
  17793. // unconditionally include in API requests. By default, fields with
  17794. // empty values are omitted from API requests. However, any non-pointer,
  17795. // non-interface field appearing in ForceSendFields will be sent to the
  17796. // server regardless of whether the field is empty or not. This may be
  17797. // used to include empty fields in Patch requests.
  17798. ForceSendFields []string `json:"-"`
  17799. // NullFields is a list of field names (e.g. "NodeTemplate") to include
  17800. // in API requests with the JSON null value. By default, fields with
  17801. // empty values are omitted from API requests. However, any field with
  17802. // an empty value appearing in NullFields will be sent to the server as
  17803. // null. It is an error if a field in this list has a non-empty value.
  17804. // This may be used to include null fields in Patch requests.
  17805. NullFields []string `json:"-"`
  17806. }
  17807. func (s *NodeGroupsSetNodeTemplateRequest) MarshalJSON() ([]byte, error) {
  17808. type NoMethod NodeGroupsSetNodeTemplateRequest
  17809. raw := NoMethod(*s)
  17810. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17811. }
  17812. // NodeTemplate: A Node Template resource.
  17813. type NodeTemplate struct {
  17814. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  17815. // format.
  17816. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  17817. // Description: An optional description of this resource. Provide this
  17818. // property when you create the resource.
  17819. Description string `json:"description,omitempty"`
  17820. // Id: [Output Only] The unique identifier for the resource. This
  17821. // identifier is defined by the server.
  17822. Id uint64 `json:"id,omitempty,string"`
  17823. // Kind: [Output Only] The type of the resource. Always
  17824. // compute#nodeTemplate for node templates.
  17825. Kind string `json:"kind,omitempty"`
  17826. // Name: The name of the resource, provided by the client when initially
  17827. // creating the resource. The resource name must be 1-63 characters
  17828. // long, and comply with RFC1035. Specifically, the name must be 1-63
  17829. // characters long and match the regular expression
  17830. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  17831. // a lowercase letter, and all following characters must be a dash,
  17832. // lowercase letter, or digit, except the last charaicter, which cannot
  17833. // be a dash.
  17834. Name string `json:"name,omitempty"`
  17835. // NodeAffinityLabels: Labels to use for node affinity, which will be
  17836. // used in instance scheduling.
  17837. NodeAffinityLabels map[string]string `json:"nodeAffinityLabels,omitempty"`
  17838. // NodeType: The node type to use for nodes group that are created from
  17839. // this template.
  17840. NodeType string `json:"nodeType,omitempty"`
  17841. // NodeTypeFlexibility: The flexible properties of the desired node
  17842. // type. Node groups that use this node template will create nodes of a
  17843. // type that matches these properties.
  17844. //
  17845. // This field is mutually exclusive with the node_type property; you can
  17846. // only define one or the other, but not both.
  17847. NodeTypeFlexibility *NodeTemplateNodeTypeFlexibility `json:"nodeTypeFlexibility,omitempty"`
  17848. // Region: [Output Only] The name of the region where the node template
  17849. // resides, such as us-central1.
  17850. Region string `json:"region,omitempty"`
  17851. // SelfLink: [Output Only] Server-defined URL for the resource.
  17852. SelfLink string `json:"selfLink,omitempty"`
  17853. // Status: [Output Only] The status of the node template. One of the
  17854. // following values: CREATING, READY, and DELETING.
  17855. //
  17856. // Possible values:
  17857. // "CREATING"
  17858. // "DELETING"
  17859. // "INVALID"
  17860. // "READY"
  17861. Status string `json:"status,omitempty"`
  17862. // StatusMessage: [Output Only] An optional, human-readable explanation
  17863. // of the status.
  17864. StatusMessage string `json:"statusMessage,omitempty"`
  17865. // ServerResponse contains the HTTP response code and headers from the
  17866. // server.
  17867. googleapi.ServerResponse `json:"-"`
  17868. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  17869. // to unconditionally include in API requests. By default, fields with
  17870. // empty values are omitted from API requests. However, any non-pointer,
  17871. // non-interface field appearing in ForceSendFields will be sent to the
  17872. // server regardless of whether the field is empty or not. This may be
  17873. // used to include empty fields in Patch requests.
  17874. ForceSendFields []string `json:"-"`
  17875. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  17876. // include in API requests with the JSON null value. By default, fields
  17877. // with empty values are omitted from API requests. However, any field
  17878. // with an empty value appearing in NullFields will be sent to the
  17879. // server as null. It is an error if a field in this list has a
  17880. // non-empty value. This may be used to include null fields in Patch
  17881. // requests.
  17882. NullFields []string `json:"-"`
  17883. }
  17884. func (s *NodeTemplate) MarshalJSON() ([]byte, error) {
  17885. type NoMethod NodeTemplate
  17886. raw := NoMethod(*s)
  17887. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17888. }
  17889. type NodeTemplateAggregatedList struct {
  17890. // Id: [Output Only] Unique identifier for the resource; defined by the
  17891. // server.
  17892. Id string `json:"id,omitempty"`
  17893. // Items: A list of NodeTemplatesScopedList resources.
  17894. Items map[string]NodeTemplatesScopedList `json:"items,omitempty"`
  17895. // Kind: [Output Only] Type of resource.Always
  17896. // compute#nodeTemplateAggregatedList for aggregated lists of node
  17897. // templates.
  17898. Kind string `json:"kind,omitempty"`
  17899. // NextPageToken: [Output Only] This token allows you to get the next
  17900. // page of results for list requests. If the number of results is larger
  17901. // than maxResults, use the nextPageToken as a value for the query
  17902. // parameter pageToken in the next list request. Subsequent list
  17903. // requests will have their own nextPageToken to continue paging through
  17904. // the results.
  17905. NextPageToken string `json:"nextPageToken,omitempty"`
  17906. // SelfLink: [Output Only] Server-defined URL for this resource.
  17907. SelfLink string `json:"selfLink,omitempty"`
  17908. // Warning: [Output Only] Informational warning message.
  17909. Warning *NodeTemplateAggregatedListWarning `json:"warning,omitempty"`
  17910. // ServerResponse contains the HTTP response code and headers from the
  17911. // server.
  17912. googleapi.ServerResponse `json:"-"`
  17913. // ForceSendFields is a list of field names (e.g. "Id") to
  17914. // unconditionally include in API requests. By default, fields with
  17915. // empty values are omitted from API requests. However, any non-pointer,
  17916. // non-interface field appearing in ForceSendFields will be sent to the
  17917. // server regardless of whether the field is empty or not. This may be
  17918. // used to include empty fields in Patch requests.
  17919. ForceSendFields []string `json:"-"`
  17920. // NullFields is a list of field names (e.g. "Id") to include in API
  17921. // requests with the JSON null value. By default, fields with empty
  17922. // values are omitted from API requests. However, any field with an
  17923. // empty value appearing in NullFields will be sent to the server as
  17924. // null. It is an error if a field in this list has a non-empty value.
  17925. // This may be used to include null fields in Patch requests.
  17926. NullFields []string `json:"-"`
  17927. }
  17928. func (s *NodeTemplateAggregatedList) MarshalJSON() ([]byte, error) {
  17929. type NoMethod NodeTemplateAggregatedList
  17930. raw := NoMethod(*s)
  17931. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17932. }
  17933. // NodeTemplateAggregatedListWarning: [Output Only] Informational
  17934. // warning message.
  17935. type NodeTemplateAggregatedListWarning struct {
  17936. // Code: [Output Only] A warning code, if applicable. For example,
  17937. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  17938. // the response.
  17939. //
  17940. // Possible values:
  17941. // "CLEANUP_FAILED"
  17942. // "DEPRECATED_RESOURCE_USED"
  17943. // "DEPRECATED_TYPE_USED"
  17944. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  17945. // "EXPERIMENTAL_TYPE_USED"
  17946. // "EXTERNAL_API_WARNING"
  17947. // "FIELD_VALUE_OVERRIDEN"
  17948. // "INJECTED_KERNELS_DEPRECATED"
  17949. // "MISSING_TYPE_DEPENDENCY"
  17950. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  17951. // "NEXT_HOP_CANNOT_IP_FORWARD"
  17952. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  17953. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  17954. // "NEXT_HOP_NOT_RUNNING"
  17955. // "NOT_CRITICAL_ERROR"
  17956. // "NO_RESULTS_ON_PAGE"
  17957. // "REQUIRED_TOS_AGREEMENT"
  17958. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  17959. // "RESOURCE_NOT_DELETED"
  17960. // "SCHEMA_VALIDATION_IGNORED"
  17961. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  17962. // "UNDECLARED_PROPERTIES"
  17963. // "UNREACHABLE"
  17964. Code string `json:"code,omitempty"`
  17965. // Data: [Output Only] Metadata about this warning in key: value format.
  17966. // For example:
  17967. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  17968. Data []*NodeTemplateAggregatedListWarningData `json:"data,omitempty"`
  17969. // Message: [Output Only] A human-readable description of the warning
  17970. // code.
  17971. Message string `json:"message,omitempty"`
  17972. // ForceSendFields is a list of field names (e.g. "Code") to
  17973. // unconditionally include in API requests. By default, fields with
  17974. // empty values are omitted from API requests. However, any non-pointer,
  17975. // non-interface field appearing in ForceSendFields will be sent to the
  17976. // server regardless of whether the field is empty or not. This may be
  17977. // used to include empty fields in Patch requests.
  17978. ForceSendFields []string `json:"-"`
  17979. // NullFields is a list of field names (e.g. "Code") to include in API
  17980. // requests with the JSON null value. By default, fields with empty
  17981. // values are omitted from API requests. However, any field with an
  17982. // empty value appearing in NullFields will be sent to the server as
  17983. // null. It is an error if a field in this list has a non-empty value.
  17984. // This may be used to include null fields in Patch requests.
  17985. NullFields []string `json:"-"`
  17986. }
  17987. func (s *NodeTemplateAggregatedListWarning) MarshalJSON() ([]byte, error) {
  17988. type NoMethod NodeTemplateAggregatedListWarning
  17989. raw := NoMethod(*s)
  17990. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17991. }
  17992. type NodeTemplateAggregatedListWarningData struct {
  17993. // Key: [Output Only] A key that provides more detail on the warning
  17994. // being returned. For example, for warnings where there are no results
  17995. // in a list request for a particular zone, this key might be scope and
  17996. // the key value might be the zone name. Other examples might be a key
  17997. // indicating a deprecated resource and a suggested replacement, or a
  17998. // warning about invalid network settings (for example, if an instance
  17999. // attempts to perform IP forwarding but is not enabled for IP
  18000. // forwarding).
  18001. Key string `json:"key,omitempty"`
  18002. // Value: [Output Only] A warning data value corresponding to the key.
  18003. Value string `json:"value,omitempty"`
  18004. // ForceSendFields is a list of field names (e.g. "Key") to
  18005. // unconditionally include in API requests. By default, fields with
  18006. // empty values are omitted from API requests. However, any non-pointer,
  18007. // non-interface field appearing in ForceSendFields will be sent to the
  18008. // server regardless of whether the field is empty or not. This may be
  18009. // used to include empty fields in Patch requests.
  18010. ForceSendFields []string `json:"-"`
  18011. // NullFields is a list of field names (e.g. "Key") to include in API
  18012. // requests with the JSON null value. By default, fields with empty
  18013. // values are omitted from API requests. However, any field with an
  18014. // empty value appearing in NullFields will be sent to the server as
  18015. // null. It is an error if a field in this list has a non-empty value.
  18016. // This may be used to include null fields in Patch requests.
  18017. NullFields []string `json:"-"`
  18018. }
  18019. func (s *NodeTemplateAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  18020. type NoMethod NodeTemplateAggregatedListWarningData
  18021. raw := NoMethod(*s)
  18022. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18023. }
  18024. // NodeTemplateList: Contains a list of node templates.
  18025. type NodeTemplateList struct {
  18026. // Id: [Output Only] Unique identifier for the resource; defined by the
  18027. // server.
  18028. Id string `json:"id,omitempty"`
  18029. // Items: A list of NodeTemplate resources.
  18030. Items []*NodeTemplate `json:"items,omitempty"`
  18031. // Kind: [Output Only] Type of resource.Always compute#nodeTemplateList
  18032. // for lists of node templates.
  18033. Kind string `json:"kind,omitempty"`
  18034. // NextPageToken: [Output Only] This token allows you to get the next
  18035. // page of results for list requests. If the number of results is larger
  18036. // than maxResults, use the nextPageToken as a value for the query
  18037. // parameter pageToken in the next list request. Subsequent list
  18038. // requests will have their own nextPageToken to continue paging through
  18039. // the results.
  18040. NextPageToken string `json:"nextPageToken,omitempty"`
  18041. // SelfLink: [Output Only] Server-defined URL for this resource.
  18042. SelfLink string `json:"selfLink,omitempty"`
  18043. // Warning: [Output Only] Informational warning message.
  18044. Warning *NodeTemplateListWarning `json:"warning,omitempty"`
  18045. // ServerResponse contains the HTTP response code and headers from the
  18046. // server.
  18047. googleapi.ServerResponse `json:"-"`
  18048. // ForceSendFields is a list of field names (e.g. "Id") to
  18049. // unconditionally include in API requests. By default, fields with
  18050. // empty values are omitted from API requests. However, any non-pointer,
  18051. // non-interface field appearing in ForceSendFields will be sent to the
  18052. // server regardless of whether the field is empty or not. This may be
  18053. // used to include empty fields in Patch requests.
  18054. ForceSendFields []string `json:"-"`
  18055. // NullFields is a list of field names (e.g. "Id") to include in API
  18056. // requests with the JSON null value. By default, fields with empty
  18057. // values are omitted from API requests. However, any field with an
  18058. // empty value appearing in NullFields will be sent to the server as
  18059. // null. It is an error if a field in this list has a non-empty value.
  18060. // This may be used to include null fields in Patch requests.
  18061. NullFields []string `json:"-"`
  18062. }
  18063. func (s *NodeTemplateList) MarshalJSON() ([]byte, error) {
  18064. type NoMethod NodeTemplateList
  18065. raw := NoMethod(*s)
  18066. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18067. }
  18068. // NodeTemplateListWarning: [Output Only] Informational warning message.
  18069. type NodeTemplateListWarning struct {
  18070. // Code: [Output Only] A warning code, if applicable. For example,
  18071. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  18072. // the response.
  18073. //
  18074. // Possible values:
  18075. // "CLEANUP_FAILED"
  18076. // "DEPRECATED_RESOURCE_USED"
  18077. // "DEPRECATED_TYPE_USED"
  18078. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  18079. // "EXPERIMENTAL_TYPE_USED"
  18080. // "EXTERNAL_API_WARNING"
  18081. // "FIELD_VALUE_OVERRIDEN"
  18082. // "INJECTED_KERNELS_DEPRECATED"
  18083. // "MISSING_TYPE_DEPENDENCY"
  18084. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  18085. // "NEXT_HOP_CANNOT_IP_FORWARD"
  18086. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  18087. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  18088. // "NEXT_HOP_NOT_RUNNING"
  18089. // "NOT_CRITICAL_ERROR"
  18090. // "NO_RESULTS_ON_PAGE"
  18091. // "REQUIRED_TOS_AGREEMENT"
  18092. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  18093. // "RESOURCE_NOT_DELETED"
  18094. // "SCHEMA_VALIDATION_IGNORED"
  18095. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  18096. // "UNDECLARED_PROPERTIES"
  18097. // "UNREACHABLE"
  18098. Code string `json:"code,omitempty"`
  18099. // Data: [Output Only] Metadata about this warning in key: value format.
  18100. // For example:
  18101. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  18102. Data []*NodeTemplateListWarningData `json:"data,omitempty"`
  18103. // Message: [Output Only] A human-readable description of the warning
  18104. // code.
  18105. Message string `json:"message,omitempty"`
  18106. // ForceSendFields is a list of field names (e.g. "Code") to
  18107. // unconditionally include in API requests. By default, fields with
  18108. // empty values are omitted from API requests. However, any non-pointer,
  18109. // non-interface field appearing in ForceSendFields will be sent to the
  18110. // server regardless of whether the field is empty or not. This may be
  18111. // used to include empty fields in Patch requests.
  18112. ForceSendFields []string `json:"-"`
  18113. // NullFields is a list of field names (e.g. "Code") to include in API
  18114. // requests with the JSON null value. By default, fields with empty
  18115. // values are omitted from API requests. However, any field with an
  18116. // empty value appearing in NullFields will be sent to the server as
  18117. // null. It is an error if a field in this list has a non-empty value.
  18118. // This may be used to include null fields in Patch requests.
  18119. NullFields []string `json:"-"`
  18120. }
  18121. func (s *NodeTemplateListWarning) MarshalJSON() ([]byte, error) {
  18122. type NoMethod NodeTemplateListWarning
  18123. raw := NoMethod(*s)
  18124. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18125. }
  18126. type NodeTemplateListWarningData struct {
  18127. // Key: [Output Only] A key that provides more detail on the warning
  18128. // being returned. For example, for warnings where there are no results
  18129. // in a list request for a particular zone, this key might be scope and
  18130. // the key value might be the zone name. Other examples might be a key
  18131. // indicating a deprecated resource and a suggested replacement, or a
  18132. // warning about invalid network settings (for example, if an instance
  18133. // attempts to perform IP forwarding but is not enabled for IP
  18134. // forwarding).
  18135. Key string `json:"key,omitempty"`
  18136. // Value: [Output Only] A warning data value corresponding to the key.
  18137. Value string `json:"value,omitempty"`
  18138. // ForceSendFields is a list of field names (e.g. "Key") to
  18139. // unconditionally include in API requests. By default, fields with
  18140. // empty values are omitted from API requests. However, any non-pointer,
  18141. // non-interface field appearing in ForceSendFields will be sent to the
  18142. // server regardless of whether the field is empty or not. This may be
  18143. // used to include empty fields in Patch requests.
  18144. ForceSendFields []string `json:"-"`
  18145. // NullFields is a list of field names (e.g. "Key") to include in API
  18146. // requests with the JSON null value. By default, fields with empty
  18147. // values are omitted from API requests. However, any field with an
  18148. // empty value appearing in NullFields will be sent to the server as
  18149. // null. It is an error if a field in this list has a non-empty value.
  18150. // This may be used to include null fields in Patch requests.
  18151. NullFields []string `json:"-"`
  18152. }
  18153. func (s *NodeTemplateListWarningData) MarshalJSON() ([]byte, error) {
  18154. type NoMethod NodeTemplateListWarningData
  18155. raw := NoMethod(*s)
  18156. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18157. }
  18158. type NodeTemplateNodeTypeFlexibility struct {
  18159. Cpus string `json:"cpus,omitempty"`
  18160. LocalSsd string `json:"localSsd,omitempty"`
  18161. Memory string `json:"memory,omitempty"`
  18162. // ForceSendFields is a list of field names (e.g. "Cpus") to
  18163. // unconditionally include in API requests. By default, fields with
  18164. // empty values are omitted from API requests. However, any non-pointer,
  18165. // non-interface field appearing in ForceSendFields will be sent to the
  18166. // server regardless of whether the field is empty or not. This may be
  18167. // used to include empty fields in Patch requests.
  18168. ForceSendFields []string `json:"-"`
  18169. // NullFields is a list of field names (e.g. "Cpus") to include in API
  18170. // requests with the JSON null value. By default, fields with empty
  18171. // values are omitted from API requests. However, any field with an
  18172. // empty value appearing in NullFields will be sent to the server as
  18173. // null. It is an error if a field in this list has a non-empty value.
  18174. // This may be used to include null fields in Patch requests.
  18175. NullFields []string `json:"-"`
  18176. }
  18177. func (s *NodeTemplateNodeTypeFlexibility) MarshalJSON() ([]byte, error) {
  18178. type NoMethod NodeTemplateNodeTypeFlexibility
  18179. raw := NoMethod(*s)
  18180. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18181. }
  18182. type NodeTemplatesScopedList struct {
  18183. // NodeTemplates: [Output Only] A list of node templates contained in
  18184. // this scope.
  18185. NodeTemplates []*NodeTemplate `json:"nodeTemplates,omitempty"`
  18186. // Warning: [Output Only] An informational warning that appears when the
  18187. // node templates list is empty.
  18188. Warning *NodeTemplatesScopedListWarning `json:"warning,omitempty"`
  18189. // ForceSendFields is a list of field names (e.g. "NodeTemplates") to
  18190. // unconditionally include in API requests. By default, fields with
  18191. // empty values are omitted from API requests. However, any non-pointer,
  18192. // non-interface field appearing in ForceSendFields will be sent to the
  18193. // server regardless of whether the field is empty or not. This may be
  18194. // used to include empty fields in Patch requests.
  18195. ForceSendFields []string `json:"-"`
  18196. // NullFields is a list of field names (e.g. "NodeTemplates") to include
  18197. // in API requests with the JSON null value. By default, fields with
  18198. // empty values are omitted from API requests. However, any field with
  18199. // an empty value appearing in NullFields will be sent to the server as
  18200. // null. It is an error if a field in this list has a non-empty value.
  18201. // This may be used to include null fields in Patch requests.
  18202. NullFields []string `json:"-"`
  18203. }
  18204. func (s *NodeTemplatesScopedList) MarshalJSON() ([]byte, error) {
  18205. type NoMethod NodeTemplatesScopedList
  18206. raw := NoMethod(*s)
  18207. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18208. }
  18209. // NodeTemplatesScopedListWarning: [Output Only] An informational
  18210. // warning that appears when the node templates list is empty.
  18211. type NodeTemplatesScopedListWarning struct {
  18212. // Code: [Output Only] A warning code, if applicable. For example,
  18213. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  18214. // the response.
  18215. //
  18216. // Possible values:
  18217. // "CLEANUP_FAILED"
  18218. // "DEPRECATED_RESOURCE_USED"
  18219. // "DEPRECATED_TYPE_USED"
  18220. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  18221. // "EXPERIMENTAL_TYPE_USED"
  18222. // "EXTERNAL_API_WARNING"
  18223. // "FIELD_VALUE_OVERRIDEN"
  18224. // "INJECTED_KERNELS_DEPRECATED"
  18225. // "MISSING_TYPE_DEPENDENCY"
  18226. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  18227. // "NEXT_HOP_CANNOT_IP_FORWARD"
  18228. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  18229. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  18230. // "NEXT_HOP_NOT_RUNNING"
  18231. // "NOT_CRITICAL_ERROR"
  18232. // "NO_RESULTS_ON_PAGE"
  18233. // "REQUIRED_TOS_AGREEMENT"
  18234. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  18235. // "RESOURCE_NOT_DELETED"
  18236. // "SCHEMA_VALIDATION_IGNORED"
  18237. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  18238. // "UNDECLARED_PROPERTIES"
  18239. // "UNREACHABLE"
  18240. Code string `json:"code,omitempty"`
  18241. // Data: [Output Only] Metadata about this warning in key: value format.
  18242. // For example:
  18243. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  18244. Data []*NodeTemplatesScopedListWarningData `json:"data,omitempty"`
  18245. // Message: [Output Only] A human-readable description of the warning
  18246. // code.
  18247. Message string `json:"message,omitempty"`
  18248. // ForceSendFields is a list of field names (e.g. "Code") to
  18249. // unconditionally include in API requests. By default, fields with
  18250. // empty values are omitted from API requests. However, any non-pointer,
  18251. // non-interface field appearing in ForceSendFields will be sent to the
  18252. // server regardless of whether the field is empty or not. This may be
  18253. // used to include empty fields in Patch requests.
  18254. ForceSendFields []string `json:"-"`
  18255. // NullFields is a list of field names (e.g. "Code") to include in API
  18256. // requests with the JSON null value. By default, fields with empty
  18257. // values are omitted from API requests. However, any field with an
  18258. // empty value appearing in NullFields will be sent to the server as
  18259. // null. It is an error if a field in this list has a non-empty value.
  18260. // This may be used to include null fields in Patch requests.
  18261. NullFields []string `json:"-"`
  18262. }
  18263. func (s *NodeTemplatesScopedListWarning) MarshalJSON() ([]byte, error) {
  18264. type NoMethod NodeTemplatesScopedListWarning
  18265. raw := NoMethod(*s)
  18266. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18267. }
  18268. type NodeTemplatesScopedListWarningData struct {
  18269. // Key: [Output Only] A key that provides more detail on the warning
  18270. // being returned. For example, for warnings where there are no results
  18271. // in a list request for a particular zone, this key might be scope and
  18272. // the key value might be the zone name. Other examples might be a key
  18273. // indicating a deprecated resource and a suggested replacement, or a
  18274. // warning about invalid network settings (for example, if an instance
  18275. // attempts to perform IP forwarding but is not enabled for IP
  18276. // forwarding).
  18277. Key string `json:"key,omitempty"`
  18278. // Value: [Output Only] A warning data value corresponding to the key.
  18279. Value string `json:"value,omitempty"`
  18280. // ForceSendFields is a list of field names (e.g. "Key") to
  18281. // unconditionally include in API requests. By default, fields with
  18282. // empty values are omitted from API requests. However, any non-pointer,
  18283. // non-interface field appearing in ForceSendFields will be sent to the
  18284. // server regardless of whether the field is empty or not. This may be
  18285. // used to include empty fields in Patch requests.
  18286. ForceSendFields []string `json:"-"`
  18287. // NullFields is a list of field names (e.g. "Key") to include in API
  18288. // requests with the JSON null value. By default, fields with empty
  18289. // values are omitted from API requests. However, any field with an
  18290. // empty value appearing in NullFields will be sent to the server as
  18291. // null. It is an error if a field in this list has a non-empty value.
  18292. // This may be used to include null fields in Patch requests.
  18293. NullFields []string `json:"-"`
  18294. }
  18295. func (s *NodeTemplatesScopedListWarningData) MarshalJSON() ([]byte, error) {
  18296. type NoMethod NodeTemplatesScopedListWarningData
  18297. raw := NoMethod(*s)
  18298. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18299. }
  18300. // NodeType: A Node Type resource.
  18301. type NodeType struct {
  18302. // CpuPlatform: [Output Only] The CPU platform used by this node type.
  18303. CpuPlatform string `json:"cpuPlatform,omitempty"`
  18304. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  18305. // format.
  18306. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  18307. // Deprecated: [Output Only] The deprecation status associated with this
  18308. // node type.
  18309. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  18310. // Description: [Output Only] An optional textual description of the
  18311. // resource.
  18312. Description string `json:"description,omitempty"`
  18313. // GuestCpus: [Output Only] The number of virtual CPUs that are
  18314. // available to the node type.
  18315. GuestCpus int64 `json:"guestCpus,omitempty"`
  18316. // Id: [Output Only] The unique identifier for the resource. This
  18317. // identifier is defined by the server.
  18318. Id uint64 `json:"id,omitempty,string"`
  18319. // Kind: [Output Only] The type of the resource. Always compute#nodeType
  18320. // for node types.
  18321. Kind string `json:"kind,omitempty"`
  18322. // LocalSsdGb: [Output Only] Local SSD available to the node type,
  18323. // defined in GB.
  18324. LocalSsdGb int64 `json:"localSsdGb,omitempty"`
  18325. // MemoryMb: [Output Only] The amount of physical memory available to
  18326. // the node type, defined in MB.
  18327. MemoryMb int64 `json:"memoryMb,omitempty"`
  18328. // Name: [Output Only] Name of the resource.
  18329. Name string `json:"name,omitempty"`
  18330. // SelfLink: [Output Only] Server-defined URL for the resource.
  18331. SelfLink string `json:"selfLink,omitempty"`
  18332. // Zone: [Output Only] The name of the zone where the node type resides,
  18333. // such as us-central1-a.
  18334. Zone string `json:"zone,omitempty"`
  18335. // ServerResponse contains the HTTP response code and headers from the
  18336. // server.
  18337. googleapi.ServerResponse `json:"-"`
  18338. // ForceSendFields is a list of field names (e.g. "CpuPlatform") to
  18339. // unconditionally include in API requests. By default, fields with
  18340. // empty values are omitted from API requests. However, any non-pointer,
  18341. // non-interface field appearing in ForceSendFields will be sent to the
  18342. // server regardless of whether the field is empty or not. This may be
  18343. // used to include empty fields in Patch requests.
  18344. ForceSendFields []string `json:"-"`
  18345. // NullFields is a list of field names (e.g. "CpuPlatform") to include
  18346. // in API requests with the JSON null value. By default, fields with
  18347. // empty values are omitted from API requests. However, any field with
  18348. // an empty value appearing in NullFields will be sent to the server as
  18349. // null. It is an error if a field in this list has a non-empty value.
  18350. // This may be used to include null fields in Patch requests.
  18351. NullFields []string `json:"-"`
  18352. }
  18353. func (s *NodeType) MarshalJSON() ([]byte, error) {
  18354. type NoMethod NodeType
  18355. raw := NoMethod(*s)
  18356. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18357. }
  18358. type NodeTypeAggregatedList struct {
  18359. // Id: [Output Only] Unique identifier for the resource; defined by the
  18360. // server.
  18361. Id string `json:"id,omitempty"`
  18362. // Items: A list of NodeTypesScopedList resources.
  18363. Items map[string]NodeTypesScopedList `json:"items,omitempty"`
  18364. // Kind: [Output Only] Type of resource.Always
  18365. // compute#nodeTypeAggregatedList for aggregated lists of node types.
  18366. Kind string `json:"kind,omitempty"`
  18367. // NextPageToken: [Output Only] This token allows you to get the next
  18368. // page of results for list requests. If the number of results is larger
  18369. // than maxResults, use the nextPageToken as a value for the query
  18370. // parameter pageToken in the next list request. Subsequent list
  18371. // requests will have their own nextPageToken to continue paging through
  18372. // the results.
  18373. NextPageToken string `json:"nextPageToken,omitempty"`
  18374. // SelfLink: [Output Only] Server-defined URL for this resource.
  18375. SelfLink string `json:"selfLink,omitempty"`
  18376. // Warning: [Output Only] Informational warning message.
  18377. Warning *NodeTypeAggregatedListWarning `json:"warning,omitempty"`
  18378. // ServerResponse contains the HTTP response code and headers from the
  18379. // server.
  18380. googleapi.ServerResponse `json:"-"`
  18381. // ForceSendFields is a list of field names (e.g. "Id") to
  18382. // unconditionally include in API requests. By default, fields with
  18383. // empty values are omitted from API requests. However, any non-pointer,
  18384. // non-interface field appearing in ForceSendFields will be sent to the
  18385. // server regardless of whether the field is empty or not. This may be
  18386. // used to include empty fields in Patch requests.
  18387. ForceSendFields []string `json:"-"`
  18388. // NullFields is a list of field names (e.g. "Id") to include in API
  18389. // requests with the JSON null value. By default, fields with empty
  18390. // values are omitted from API requests. However, any field with an
  18391. // empty value appearing in NullFields will be sent to the server as
  18392. // null. It is an error if a field in this list has a non-empty value.
  18393. // This may be used to include null fields in Patch requests.
  18394. NullFields []string `json:"-"`
  18395. }
  18396. func (s *NodeTypeAggregatedList) MarshalJSON() ([]byte, error) {
  18397. type NoMethod NodeTypeAggregatedList
  18398. raw := NoMethod(*s)
  18399. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18400. }
  18401. // NodeTypeAggregatedListWarning: [Output Only] Informational warning
  18402. // message.
  18403. type NodeTypeAggregatedListWarning struct {
  18404. // Code: [Output Only] A warning code, if applicable. For example,
  18405. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  18406. // the response.
  18407. //
  18408. // Possible values:
  18409. // "CLEANUP_FAILED"
  18410. // "DEPRECATED_RESOURCE_USED"
  18411. // "DEPRECATED_TYPE_USED"
  18412. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  18413. // "EXPERIMENTAL_TYPE_USED"
  18414. // "EXTERNAL_API_WARNING"
  18415. // "FIELD_VALUE_OVERRIDEN"
  18416. // "INJECTED_KERNELS_DEPRECATED"
  18417. // "MISSING_TYPE_DEPENDENCY"
  18418. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  18419. // "NEXT_HOP_CANNOT_IP_FORWARD"
  18420. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  18421. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  18422. // "NEXT_HOP_NOT_RUNNING"
  18423. // "NOT_CRITICAL_ERROR"
  18424. // "NO_RESULTS_ON_PAGE"
  18425. // "REQUIRED_TOS_AGREEMENT"
  18426. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  18427. // "RESOURCE_NOT_DELETED"
  18428. // "SCHEMA_VALIDATION_IGNORED"
  18429. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  18430. // "UNDECLARED_PROPERTIES"
  18431. // "UNREACHABLE"
  18432. Code string `json:"code,omitempty"`
  18433. // Data: [Output Only] Metadata about this warning in key: value format.
  18434. // For example:
  18435. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  18436. Data []*NodeTypeAggregatedListWarningData `json:"data,omitempty"`
  18437. // Message: [Output Only] A human-readable description of the warning
  18438. // code.
  18439. Message string `json:"message,omitempty"`
  18440. // ForceSendFields is a list of field names (e.g. "Code") to
  18441. // unconditionally include in API requests. By default, fields with
  18442. // empty values are omitted from API requests. However, any non-pointer,
  18443. // non-interface field appearing in ForceSendFields will be sent to the
  18444. // server regardless of whether the field is empty or not. This may be
  18445. // used to include empty fields in Patch requests.
  18446. ForceSendFields []string `json:"-"`
  18447. // NullFields is a list of field names (e.g. "Code") to include in API
  18448. // requests with the JSON null value. By default, fields with empty
  18449. // values are omitted from API requests. However, any field with an
  18450. // empty value appearing in NullFields will be sent to the server as
  18451. // null. It is an error if a field in this list has a non-empty value.
  18452. // This may be used to include null fields in Patch requests.
  18453. NullFields []string `json:"-"`
  18454. }
  18455. func (s *NodeTypeAggregatedListWarning) MarshalJSON() ([]byte, error) {
  18456. type NoMethod NodeTypeAggregatedListWarning
  18457. raw := NoMethod(*s)
  18458. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18459. }
  18460. type NodeTypeAggregatedListWarningData struct {
  18461. // Key: [Output Only] A key that provides more detail on the warning
  18462. // being returned. For example, for warnings where there are no results
  18463. // in a list request for a particular zone, this key might be scope and
  18464. // the key value might be the zone name. Other examples might be a key
  18465. // indicating a deprecated resource and a suggested replacement, or a
  18466. // warning about invalid network settings (for example, if an instance
  18467. // attempts to perform IP forwarding but is not enabled for IP
  18468. // forwarding).
  18469. Key string `json:"key,omitempty"`
  18470. // Value: [Output Only] A warning data value corresponding to the key.
  18471. Value string `json:"value,omitempty"`
  18472. // ForceSendFields is a list of field names (e.g. "Key") to
  18473. // unconditionally include in API requests. By default, fields with
  18474. // empty values are omitted from API requests. However, any non-pointer,
  18475. // non-interface field appearing in ForceSendFields will be sent to the
  18476. // server regardless of whether the field is empty or not. This may be
  18477. // used to include empty fields in Patch requests.
  18478. ForceSendFields []string `json:"-"`
  18479. // NullFields is a list of field names (e.g. "Key") to include in API
  18480. // requests with the JSON null value. By default, fields with empty
  18481. // values are omitted from API requests. However, any field with an
  18482. // empty value appearing in NullFields will be sent to the server as
  18483. // null. It is an error if a field in this list has a non-empty value.
  18484. // This may be used to include null fields in Patch requests.
  18485. NullFields []string `json:"-"`
  18486. }
  18487. func (s *NodeTypeAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  18488. type NoMethod NodeTypeAggregatedListWarningData
  18489. raw := NoMethod(*s)
  18490. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18491. }
  18492. // NodeTypeList: Contains a list of node types.
  18493. type NodeTypeList struct {
  18494. // Id: [Output Only] Unique identifier for the resource; defined by the
  18495. // server.
  18496. Id string `json:"id,omitempty"`
  18497. // Items: A list of NodeType resources.
  18498. Items []*NodeType `json:"items,omitempty"`
  18499. // Kind: [Output Only] Type of resource.Always compute#nodeTypeList for
  18500. // lists of node types.
  18501. Kind string `json:"kind,omitempty"`
  18502. // NextPageToken: [Output Only] This token allows you to get the next
  18503. // page of results for list requests. If the number of results is larger
  18504. // than maxResults, use the nextPageToken as a value for the query
  18505. // parameter pageToken in the next list request. Subsequent list
  18506. // requests will have their own nextPageToken to continue paging through
  18507. // the results.
  18508. NextPageToken string `json:"nextPageToken,omitempty"`
  18509. // SelfLink: [Output Only] Server-defined URL for this resource.
  18510. SelfLink string `json:"selfLink,omitempty"`
  18511. // Warning: [Output Only] Informational warning message.
  18512. Warning *NodeTypeListWarning `json:"warning,omitempty"`
  18513. // ServerResponse contains the HTTP response code and headers from the
  18514. // server.
  18515. googleapi.ServerResponse `json:"-"`
  18516. // ForceSendFields is a list of field names (e.g. "Id") to
  18517. // unconditionally include in API requests. By default, fields with
  18518. // empty values are omitted from API requests. However, any non-pointer,
  18519. // non-interface field appearing in ForceSendFields will be sent to the
  18520. // server regardless of whether the field is empty or not. This may be
  18521. // used to include empty fields in Patch requests.
  18522. ForceSendFields []string `json:"-"`
  18523. // NullFields is a list of field names (e.g. "Id") to include in API
  18524. // requests with the JSON null value. By default, fields with empty
  18525. // values are omitted from API requests. However, any field with an
  18526. // empty value appearing in NullFields will be sent to the server as
  18527. // null. It is an error if a field in this list has a non-empty value.
  18528. // This may be used to include null fields in Patch requests.
  18529. NullFields []string `json:"-"`
  18530. }
  18531. func (s *NodeTypeList) MarshalJSON() ([]byte, error) {
  18532. type NoMethod NodeTypeList
  18533. raw := NoMethod(*s)
  18534. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18535. }
  18536. // NodeTypeListWarning: [Output Only] Informational warning message.
  18537. type NodeTypeListWarning struct {
  18538. // Code: [Output Only] A warning code, if applicable. For example,
  18539. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  18540. // the response.
  18541. //
  18542. // Possible values:
  18543. // "CLEANUP_FAILED"
  18544. // "DEPRECATED_RESOURCE_USED"
  18545. // "DEPRECATED_TYPE_USED"
  18546. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  18547. // "EXPERIMENTAL_TYPE_USED"
  18548. // "EXTERNAL_API_WARNING"
  18549. // "FIELD_VALUE_OVERRIDEN"
  18550. // "INJECTED_KERNELS_DEPRECATED"
  18551. // "MISSING_TYPE_DEPENDENCY"
  18552. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  18553. // "NEXT_HOP_CANNOT_IP_FORWARD"
  18554. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  18555. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  18556. // "NEXT_HOP_NOT_RUNNING"
  18557. // "NOT_CRITICAL_ERROR"
  18558. // "NO_RESULTS_ON_PAGE"
  18559. // "REQUIRED_TOS_AGREEMENT"
  18560. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  18561. // "RESOURCE_NOT_DELETED"
  18562. // "SCHEMA_VALIDATION_IGNORED"
  18563. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  18564. // "UNDECLARED_PROPERTIES"
  18565. // "UNREACHABLE"
  18566. Code string `json:"code,omitempty"`
  18567. // Data: [Output Only] Metadata about this warning in key: value format.
  18568. // For example:
  18569. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  18570. Data []*NodeTypeListWarningData `json:"data,omitempty"`
  18571. // Message: [Output Only] A human-readable description of the warning
  18572. // code.
  18573. Message string `json:"message,omitempty"`
  18574. // ForceSendFields is a list of field names (e.g. "Code") to
  18575. // unconditionally include in API requests. By default, fields with
  18576. // empty values are omitted from API requests. However, any non-pointer,
  18577. // non-interface field appearing in ForceSendFields will be sent to the
  18578. // server regardless of whether the field is empty or not. This may be
  18579. // used to include empty fields in Patch requests.
  18580. ForceSendFields []string `json:"-"`
  18581. // NullFields is a list of field names (e.g. "Code") to include in API
  18582. // requests with the JSON null value. By default, fields with empty
  18583. // values are omitted from API requests. However, any field with an
  18584. // empty value appearing in NullFields will be sent to the server as
  18585. // null. It is an error if a field in this list has a non-empty value.
  18586. // This may be used to include null fields in Patch requests.
  18587. NullFields []string `json:"-"`
  18588. }
  18589. func (s *NodeTypeListWarning) MarshalJSON() ([]byte, error) {
  18590. type NoMethod NodeTypeListWarning
  18591. raw := NoMethod(*s)
  18592. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18593. }
  18594. type NodeTypeListWarningData struct {
  18595. // Key: [Output Only] A key that provides more detail on the warning
  18596. // being returned. For example, for warnings where there are no results
  18597. // in a list request for a particular zone, this key might be scope and
  18598. // the key value might be the zone name. Other examples might be a key
  18599. // indicating a deprecated resource and a suggested replacement, or a
  18600. // warning about invalid network settings (for example, if an instance
  18601. // attempts to perform IP forwarding but is not enabled for IP
  18602. // forwarding).
  18603. Key string `json:"key,omitempty"`
  18604. // Value: [Output Only] A warning data value corresponding to the key.
  18605. Value string `json:"value,omitempty"`
  18606. // ForceSendFields is a list of field names (e.g. "Key") to
  18607. // unconditionally include in API requests. By default, fields with
  18608. // empty values are omitted from API requests. However, any non-pointer,
  18609. // non-interface field appearing in ForceSendFields will be sent to the
  18610. // server regardless of whether the field is empty or not. This may be
  18611. // used to include empty fields in Patch requests.
  18612. ForceSendFields []string `json:"-"`
  18613. // NullFields is a list of field names (e.g. "Key") to include in API
  18614. // requests with the JSON null value. By default, fields with empty
  18615. // values are omitted from API requests. However, any field with an
  18616. // empty value appearing in NullFields will be sent to the server as
  18617. // null. It is an error if a field in this list has a non-empty value.
  18618. // This may be used to include null fields in Patch requests.
  18619. NullFields []string `json:"-"`
  18620. }
  18621. func (s *NodeTypeListWarningData) MarshalJSON() ([]byte, error) {
  18622. type NoMethod NodeTypeListWarningData
  18623. raw := NoMethod(*s)
  18624. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18625. }
  18626. type NodeTypesScopedList struct {
  18627. // NodeTypes: [Output Only] A list of node types contained in this
  18628. // scope.
  18629. NodeTypes []*NodeType `json:"nodeTypes,omitempty"`
  18630. // Warning: [Output Only] An informational warning that appears when the
  18631. // node types list is empty.
  18632. Warning *NodeTypesScopedListWarning `json:"warning,omitempty"`
  18633. // ForceSendFields is a list of field names (e.g. "NodeTypes") to
  18634. // unconditionally include in API requests. By default, fields with
  18635. // empty values are omitted from API requests. However, any non-pointer,
  18636. // non-interface field appearing in ForceSendFields will be sent to the
  18637. // server regardless of whether the field is empty or not. This may be
  18638. // used to include empty fields in Patch requests.
  18639. ForceSendFields []string `json:"-"`
  18640. // NullFields is a list of field names (e.g. "NodeTypes") to include in
  18641. // API requests with the JSON null value. By default, fields with empty
  18642. // values are omitted from API requests. However, any field with an
  18643. // empty value appearing in NullFields will be sent to the server as
  18644. // null. It is an error if a field in this list has a non-empty value.
  18645. // This may be used to include null fields in Patch requests.
  18646. NullFields []string `json:"-"`
  18647. }
  18648. func (s *NodeTypesScopedList) MarshalJSON() ([]byte, error) {
  18649. type NoMethod NodeTypesScopedList
  18650. raw := NoMethod(*s)
  18651. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18652. }
  18653. // NodeTypesScopedListWarning: [Output Only] An informational warning
  18654. // that appears when the node types list is empty.
  18655. type NodeTypesScopedListWarning struct {
  18656. // Code: [Output Only] A warning code, if applicable. For example,
  18657. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  18658. // the response.
  18659. //
  18660. // Possible values:
  18661. // "CLEANUP_FAILED"
  18662. // "DEPRECATED_RESOURCE_USED"
  18663. // "DEPRECATED_TYPE_USED"
  18664. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  18665. // "EXPERIMENTAL_TYPE_USED"
  18666. // "EXTERNAL_API_WARNING"
  18667. // "FIELD_VALUE_OVERRIDEN"
  18668. // "INJECTED_KERNELS_DEPRECATED"
  18669. // "MISSING_TYPE_DEPENDENCY"
  18670. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  18671. // "NEXT_HOP_CANNOT_IP_FORWARD"
  18672. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  18673. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  18674. // "NEXT_HOP_NOT_RUNNING"
  18675. // "NOT_CRITICAL_ERROR"
  18676. // "NO_RESULTS_ON_PAGE"
  18677. // "REQUIRED_TOS_AGREEMENT"
  18678. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  18679. // "RESOURCE_NOT_DELETED"
  18680. // "SCHEMA_VALIDATION_IGNORED"
  18681. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  18682. // "UNDECLARED_PROPERTIES"
  18683. // "UNREACHABLE"
  18684. Code string `json:"code,omitempty"`
  18685. // Data: [Output Only] Metadata about this warning in key: value format.
  18686. // For example:
  18687. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  18688. Data []*NodeTypesScopedListWarningData `json:"data,omitempty"`
  18689. // Message: [Output Only] A human-readable description of the warning
  18690. // code.
  18691. Message string `json:"message,omitempty"`
  18692. // ForceSendFields is a list of field names (e.g. "Code") to
  18693. // unconditionally include in API requests. By default, fields with
  18694. // empty values are omitted from API requests. However, any non-pointer,
  18695. // non-interface field appearing in ForceSendFields will be sent to the
  18696. // server regardless of whether the field is empty or not. This may be
  18697. // used to include empty fields in Patch requests.
  18698. ForceSendFields []string `json:"-"`
  18699. // NullFields is a list of field names (e.g. "Code") to include in API
  18700. // requests with the JSON null value. By default, fields with empty
  18701. // values are omitted from API requests. However, any field with an
  18702. // empty value appearing in NullFields will be sent to the server as
  18703. // null. It is an error if a field in this list has a non-empty value.
  18704. // This may be used to include null fields in Patch requests.
  18705. NullFields []string `json:"-"`
  18706. }
  18707. func (s *NodeTypesScopedListWarning) MarshalJSON() ([]byte, error) {
  18708. type NoMethod NodeTypesScopedListWarning
  18709. raw := NoMethod(*s)
  18710. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18711. }
  18712. type NodeTypesScopedListWarningData struct {
  18713. // Key: [Output Only] A key that provides more detail on the warning
  18714. // being returned. For example, for warnings where there are no results
  18715. // in a list request for a particular zone, this key might be scope and
  18716. // the key value might be the zone name. Other examples might be a key
  18717. // indicating a deprecated resource and a suggested replacement, or a
  18718. // warning about invalid network settings (for example, if an instance
  18719. // attempts to perform IP forwarding but is not enabled for IP
  18720. // forwarding).
  18721. Key string `json:"key,omitempty"`
  18722. // Value: [Output Only] A warning data value corresponding to the key.
  18723. Value string `json:"value,omitempty"`
  18724. // ForceSendFields is a list of field names (e.g. "Key") to
  18725. // unconditionally include in API requests. By default, fields with
  18726. // empty values are omitted from API requests. However, any non-pointer,
  18727. // non-interface field appearing in ForceSendFields will be sent to the
  18728. // server regardless of whether the field is empty or not. This may be
  18729. // used to include empty fields in Patch requests.
  18730. ForceSendFields []string `json:"-"`
  18731. // NullFields is a list of field names (e.g. "Key") to include in API
  18732. // requests with the JSON null value. By default, fields with empty
  18733. // values are omitted from API requests. However, any field with an
  18734. // empty value appearing in NullFields will be sent to the server as
  18735. // null. It is an error if a field in this list has a non-empty value.
  18736. // This may be used to include null fields in Patch requests.
  18737. NullFields []string `json:"-"`
  18738. }
  18739. func (s *NodeTypesScopedListWarningData) MarshalJSON() ([]byte, error) {
  18740. type NoMethod NodeTypesScopedListWarningData
  18741. raw := NoMethod(*s)
  18742. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18743. }
  18744. // Operation: An Operation resource, used to manage asynchronous API
  18745. // requests. (== resource_for v1.globalOperations ==) (== resource_for
  18746. // beta.globalOperations ==) (== resource_for v1.regionOperations ==)
  18747. // (== resource_for beta.regionOperations ==) (== resource_for
  18748. // v1.zoneOperations ==) (== resource_for beta.zoneOperations ==)
  18749. type Operation struct {
  18750. // ClientOperationId: [Output Only] The value of `requestId` if you
  18751. // provided it in the request. Not present otherwise.
  18752. ClientOperationId string `json:"clientOperationId,omitempty"`
  18753. // CreationTimestamp: [Deprecated] This field is deprecated.
  18754. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  18755. // Description: [Output Only] A textual description of the operation,
  18756. // which is set when the operation is created.
  18757. Description string `json:"description,omitempty"`
  18758. // EndTime: [Output Only] The time that this operation was completed.
  18759. // This value is in RFC3339 text format.
  18760. EndTime string `json:"endTime,omitempty"`
  18761. // Error: [Output Only] If errors are generated during processing of the
  18762. // operation, this field will be populated.
  18763. Error *OperationError `json:"error,omitempty"`
  18764. // HttpErrorMessage: [Output Only] If the operation fails, this field
  18765. // contains the HTTP error message that was returned, such as NOT FOUND.
  18766. HttpErrorMessage string `json:"httpErrorMessage,omitempty"`
  18767. // HttpErrorStatusCode: [Output Only] If the operation fails, this field
  18768. // contains the HTTP error status code that was returned. For example, a
  18769. // 404 means the resource was not found.
  18770. HttpErrorStatusCode int64 `json:"httpErrorStatusCode,omitempty"`
  18771. // Id: [Output Only] The unique identifier for the resource. This
  18772. // identifier is defined by the server.
  18773. Id uint64 `json:"id,omitempty,string"`
  18774. // InsertTime: [Output Only] The time that this operation was requested.
  18775. // This value is in RFC3339 text format.
  18776. InsertTime string `json:"insertTime,omitempty"`
  18777. // Kind: [Output Only] Type of the resource. Always compute#operation
  18778. // for Operation resources.
  18779. Kind string `json:"kind,omitempty"`
  18780. // Name: [Output Only] Name of the resource.
  18781. Name string `json:"name,omitempty"`
  18782. // OperationType: [Output Only] The type of operation, such as insert,
  18783. // update, or delete, and so on.
  18784. OperationType string `json:"operationType,omitempty"`
  18785. // Progress: [Output Only] An optional progress indicator that ranges
  18786. // from 0 to 100. There is no requirement that this be linear or support
  18787. // any granularity of operations. This should not be used to guess when
  18788. // the operation will be complete. This number should monotonically
  18789. // increase as the operation progresses.
  18790. Progress int64 `json:"progress,omitempty"`
  18791. // Region: [Output Only] The URL of the region where the operation
  18792. // resides. Only available when performing regional operations. You must
  18793. // specify this field as part of the HTTP request URL. It is not
  18794. // settable as a field in the request body.
  18795. Region string `json:"region,omitempty"`
  18796. // SelfLink: [Output Only] Server-defined URL for the resource.
  18797. SelfLink string `json:"selfLink,omitempty"`
  18798. // StartTime: [Output Only] The time that this operation was started by
  18799. // the server. This value is in RFC3339 text format.
  18800. StartTime string `json:"startTime,omitempty"`
  18801. // Status: [Output Only] The status of the operation, which can be one
  18802. // of the following: PENDING, RUNNING, or DONE.
  18803. //
  18804. // Possible values:
  18805. // "DONE"
  18806. // "PENDING"
  18807. // "RUNNING"
  18808. Status string `json:"status,omitempty"`
  18809. // StatusMessage: [Output Only] An optional textual description of the
  18810. // current status of the operation.
  18811. StatusMessage string `json:"statusMessage,omitempty"`
  18812. // TargetId: [Output Only] The unique target ID, which identifies a
  18813. // specific incarnation of the target resource.
  18814. TargetId uint64 `json:"targetId,omitempty,string"`
  18815. // TargetLink: [Output Only] The URL of the resource that the operation
  18816. // modifies. For operations related to creating a snapshot, this points
  18817. // to the persistent disk that the snapshot was created from.
  18818. TargetLink string `json:"targetLink,omitempty"`
  18819. // User: [Output Only] User who requested the operation, for example:
  18820. // user@example.com.
  18821. User string `json:"user,omitempty"`
  18822. // Warnings: [Output Only] If warning messages are generated during
  18823. // processing of the operation, this field will be populated.
  18824. Warnings []*OperationWarnings `json:"warnings,omitempty"`
  18825. // Zone: [Output Only] The URL of the zone where the operation resides.
  18826. // Only available when performing per-zone operations. You must specify
  18827. // this field as part of the HTTP request URL. It is not settable as a
  18828. // field in the request body.
  18829. Zone string `json:"zone,omitempty"`
  18830. // ServerResponse contains the HTTP response code and headers from the
  18831. // server.
  18832. googleapi.ServerResponse `json:"-"`
  18833. // ForceSendFields is a list of field names (e.g. "ClientOperationId")
  18834. // to unconditionally include in API requests. By default, fields with
  18835. // empty values are omitted from API requests. However, any non-pointer,
  18836. // non-interface field appearing in ForceSendFields will be sent to the
  18837. // server regardless of whether the field is empty or not. This may be
  18838. // used to include empty fields in Patch requests.
  18839. ForceSendFields []string `json:"-"`
  18840. // NullFields is a list of field names (e.g. "ClientOperationId") to
  18841. // include in API requests with the JSON null value. By default, fields
  18842. // with empty values are omitted from API requests. However, any field
  18843. // with an empty value appearing in NullFields will be sent to the
  18844. // server as null. It is an error if a field in this list has a
  18845. // non-empty value. This may be used to include null fields in Patch
  18846. // requests.
  18847. NullFields []string `json:"-"`
  18848. }
  18849. func (s *Operation) MarshalJSON() ([]byte, error) {
  18850. type NoMethod Operation
  18851. raw := NoMethod(*s)
  18852. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18853. }
  18854. // OperationError: [Output Only] If errors are generated during
  18855. // processing of the operation, this field will be populated.
  18856. type OperationError struct {
  18857. // Errors: [Output Only] The array of errors encountered while
  18858. // processing this operation.
  18859. Errors []*OperationErrorErrors `json:"errors,omitempty"`
  18860. // ForceSendFields is a list of field names (e.g. "Errors") to
  18861. // unconditionally include in API requests. By default, fields with
  18862. // empty values are omitted from API requests. However, any non-pointer,
  18863. // non-interface field appearing in ForceSendFields will be sent to the
  18864. // server regardless of whether the field is empty or not. This may be
  18865. // used to include empty fields in Patch requests.
  18866. ForceSendFields []string `json:"-"`
  18867. // NullFields is a list of field names (e.g. "Errors") to include in API
  18868. // requests with the JSON null value. By default, fields with empty
  18869. // values are omitted from API requests. However, any field with an
  18870. // empty value appearing in NullFields will be sent to the server as
  18871. // null. It is an error if a field in this list has a non-empty value.
  18872. // This may be used to include null fields in Patch requests.
  18873. NullFields []string `json:"-"`
  18874. }
  18875. func (s *OperationError) MarshalJSON() ([]byte, error) {
  18876. type NoMethod OperationError
  18877. raw := NoMethod(*s)
  18878. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18879. }
  18880. type OperationErrorErrors struct {
  18881. // Code: [Output Only] The error type identifier for this error.
  18882. Code string `json:"code,omitempty"`
  18883. // Location: [Output Only] Indicates the field in the request that
  18884. // caused the error. This property is optional.
  18885. Location string `json:"location,omitempty"`
  18886. // Message: [Output Only] An optional, human-readable error message.
  18887. Message string `json:"message,omitempty"`
  18888. // ForceSendFields is a list of field names (e.g. "Code") to
  18889. // unconditionally include in API requests. By default, fields with
  18890. // empty values are omitted from API requests. However, any non-pointer,
  18891. // non-interface field appearing in ForceSendFields will be sent to the
  18892. // server regardless of whether the field is empty or not. This may be
  18893. // used to include empty fields in Patch requests.
  18894. ForceSendFields []string `json:"-"`
  18895. // NullFields is a list of field names (e.g. "Code") to include in API
  18896. // requests with the JSON null value. By default, fields with empty
  18897. // values are omitted from API requests. However, any field with an
  18898. // empty value appearing in NullFields will be sent to the server as
  18899. // null. It is an error if a field in this list has a non-empty value.
  18900. // This may be used to include null fields in Patch requests.
  18901. NullFields []string `json:"-"`
  18902. }
  18903. func (s *OperationErrorErrors) MarshalJSON() ([]byte, error) {
  18904. type NoMethod OperationErrorErrors
  18905. raw := NoMethod(*s)
  18906. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18907. }
  18908. type OperationWarnings struct {
  18909. // Code: [Output Only] A warning code, if applicable. For example,
  18910. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  18911. // the response.
  18912. //
  18913. // Possible values:
  18914. // "CLEANUP_FAILED"
  18915. // "DEPRECATED_RESOURCE_USED"
  18916. // "DEPRECATED_TYPE_USED"
  18917. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  18918. // "EXPERIMENTAL_TYPE_USED"
  18919. // "EXTERNAL_API_WARNING"
  18920. // "FIELD_VALUE_OVERRIDEN"
  18921. // "INJECTED_KERNELS_DEPRECATED"
  18922. // "MISSING_TYPE_DEPENDENCY"
  18923. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  18924. // "NEXT_HOP_CANNOT_IP_FORWARD"
  18925. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  18926. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  18927. // "NEXT_HOP_NOT_RUNNING"
  18928. // "NOT_CRITICAL_ERROR"
  18929. // "NO_RESULTS_ON_PAGE"
  18930. // "REQUIRED_TOS_AGREEMENT"
  18931. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  18932. // "RESOURCE_NOT_DELETED"
  18933. // "SCHEMA_VALIDATION_IGNORED"
  18934. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  18935. // "UNDECLARED_PROPERTIES"
  18936. // "UNREACHABLE"
  18937. Code string `json:"code,omitempty"`
  18938. // Data: [Output Only] Metadata about this warning in key: value format.
  18939. // For example:
  18940. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  18941. Data []*OperationWarningsData `json:"data,omitempty"`
  18942. // Message: [Output Only] A human-readable description of the warning
  18943. // code.
  18944. Message string `json:"message,omitempty"`
  18945. // ForceSendFields is a list of field names (e.g. "Code") to
  18946. // unconditionally include in API requests. By default, fields with
  18947. // empty values are omitted from API requests. However, any non-pointer,
  18948. // non-interface field appearing in ForceSendFields will be sent to the
  18949. // server regardless of whether the field is empty or not. This may be
  18950. // used to include empty fields in Patch requests.
  18951. ForceSendFields []string `json:"-"`
  18952. // NullFields is a list of field names (e.g. "Code") to include in API
  18953. // requests with the JSON null value. By default, fields with empty
  18954. // values are omitted from API requests. However, any field with an
  18955. // empty value appearing in NullFields will be sent to the server as
  18956. // null. It is an error if a field in this list has a non-empty value.
  18957. // This may be used to include null fields in Patch requests.
  18958. NullFields []string `json:"-"`
  18959. }
  18960. func (s *OperationWarnings) MarshalJSON() ([]byte, error) {
  18961. type NoMethod OperationWarnings
  18962. raw := NoMethod(*s)
  18963. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18964. }
  18965. type OperationWarningsData struct {
  18966. // Key: [Output Only] A key that provides more detail on the warning
  18967. // being returned. For example, for warnings where there are no results
  18968. // in a list request for a particular zone, this key might be scope and
  18969. // the key value might be the zone name. Other examples might be a key
  18970. // indicating a deprecated resource and a suggested replacement, or a
  18971. // warning about invalid network settings (for example, if an instance
  18972. // attempts to perform IP forwarding but is not enabled for IP
  18973. // forwarding).
  18974. Key string `json:"key,omitempty"`
  18975. // Value: [Output Only] A warning data value corresponding to the key.
  18976. Value string `json:"value,omitempty"`
  18977. // ForceSendFields is a list of field names (e.g. "Key") to
  18978. // unconditionally include in API requests. By default, fields with
  18979. // empty values are omitted from API requests. However, any non-pointer,
  18980. // non-interface field appearing in ForceSendFields will be sent to the
  18981. // server regardless of whether the field is empty or not. This may be
  18982. // used to include empty fields in Patch requests.
  18983. ForceSendFields []string `json:"-"`
  18984. // NullFields is a list of field names (e.g. "Key") to include in API
  18985. // requests with the JSON null value. By default, fields with empty
  18986. // values are omitted from API requests. However, any field with an
  18987. // empty value appearing in NullFields will be sent to the server as
  18988. // null. It is an error if a field in this list has a non-empty value.
  18989. // This may be used to include null fields in Patch requests.
  18990. NullFields []string `json:"-"`
  18991. }
  18992. func (s *OperationWarningsData) MarshalJSON() ([]byte, error) {
  18993. type NoMethod OperationWarningsData
  18994. raw := NoMethod(*s)
  18995. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18996. }
  18997. type OperationAggregatedList struct {
  18998. // Id: [Output Only] The unique identifier for the resource. This
  18999. // identifier is defined by the server.
  19000. Id string `json:"id,omitempty"`
  19001. // Items: [Output Only] A map of scoped operation lists.
  19002. Items map[string]OperationsScopedList `json:"items,omitempty"`
  19003. // Kind: [Output Only] Type of resource. Always
  19004. // compute#operationAggregatedList for aggregated lists of operations.
  19005. Kind string `json:"kind,omitempty"`
  19006. // NextPageToken: [Output Only] This token allows you to get the next
  19007. // page of results for list requests. If the number of results is larger
  19008. // than maxResults, use the nextPageToken as a value for the query
  19009. // parameter pageToken in the next list request. Subsequent list
  19010. // requests will have their own nextPageToken to continue paging through
  19011. // the results.
  19012. NextPageToken string `json:"nextPageToken,omitempty"`
  19013. // SelfLink: [Output Only] Server-defined URL for this resource.
  19014. SelfLink string `json:"selfLink,omitempty"`
  19015. // Warning: [Output Only] Informational warning message.
  19016. Warning *OperationAggregatedListWarning `json:"warning,omitempty"`
  19017. // ServerResponse contains the HTTP response code and headers from the
  19018. // server.
  19019. googleapi.ServerResponse `json:"-"`
  19020. // ForceSendFields is a list of field names (e.g. "Id") to
  19021. // unconditionally include in API requests. By default, fields with
  19022. // empty values are omitted from API requests. However, any non-pointer,
  19023. // non-interface field appearing in ForceSendFields will be sent to the
  19024. // server regardless of whether the field is empty or not. This may be
  19025. // used to include empty fields in Patch requests.
  19026. ForceSendFields []string `json:"-"`
  19027. // NullFields is a list of field names (e.g. "Id") to include in API
  19028. // requests with the JSON null value. By default, fields with empty
  19029. // values are omitted from API requests. However, any field with an
  19030. // empty value appearing in NullFields will be sent to the server as
  19031. // null. It is an error if a field in this list has a non-empty value.
  19032. // This may be used to include null fields in Patch requests.
  19033. NullFields []string `json:"-"`
  19034. }
  19035. func (s *OperationAggregatedList) MarshalJSON() ([]byte, error) {
  19036. type NoMethod OperationAggregatedList
  19037. raw := NoMethod(*s)
  19038. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19039. }
  19040. // OperationAggregatedListWarning: [Output Only] Informational warning
  19041. // message.
  19042. type OperationAggregatedListWarning struct {
  19043. // Code: [Output Only] A warning code, if applicable. For example,
  19044. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  19045. // the response.
  19046. //
  19047. // Possible values:
  19048. // "CLEANUP_FAILED"
  19049. // "DEPRECATED_RESOURCE_USED"
  19050. // "DEPRECATED_TYPE_USED"
  19051. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  19052. // "EXPERIMENTAL_TYPE_USED"
  19053. // "EXTERNAL_API_WARNING"
  19054. // "FIELD_VALUE_OVERRIDEN"
  19055. // "INJECTED_KERNELS_DEPRECATED"
  19056. // "MISSING_TYPE_DEPENDENCY"
  19057. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  19058. // "NEXT_HOP_CANNOT_IP_FORWARD"
  19059. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  19060. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  19061. // "NEXT_HOP_NOT_RUNNING"
  19062. // "NOT_CRITICAL_ERROR"
  19063. // "NO_RESULTS_ON_PAGE"
  19064. // "REQUIRED_TOS_AGREEMENT"
  19065. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  19066. // "RESOURCE_NOT_DELETED"
  19067. // "SCHEMA_VALIDATION_IGNORED"
  19068. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  19069. // "UNDECLARED_PROPERTIES"
  19070. // "UNREACHABLE"
  19071. Code string `json:"code,omitempty"`
  19072. // Data: [Output Only] Metadata about this warning in key: value format.
  19073. // For example:
  19074. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  19075. Data []*OperationAggregatedListWarningData `json:"data,omitempty"`
  19076. // Message: [Output Only] A human-readable description of the warning
  19077. // code.
  19078. Message string `json:"message,omitempty"`
  19079. // ForceSendFields is a list of field names (e.g. "Code") to
  19080. // unconditionally include in API requests. By default, fields with
  19081. // empty values are omitted from API requests. However, any non-pointer,
  19082. // non-interface field appearing in ForceSendFields will be sent to the
  19083. // server regardless of whether the field is empty or not. This may be
  19084. // used to include empty fields in Patch requests.
  19085. ForceSendFields []string `json:"-"`
  19086. // NullFields is a list of field names (e.g. "Code") to include in API
  19087. // requests with the JSON null value. By default, fields with empty
  19088. // values are omitted from API requests. However, any field with an
  19089. // empty value appearing in NullFields will be sent to the server as
  19090. // null. It is an error if a field in this list has a non-empty value.
  19091. // This may be used to include null fields in Patch requests.
  19092. NullFields []string `json:"-"`
  19093. }
  19094. func (s *OperationAggregatedListWarning) MarshalJSON() ([]byte, error) {
  19095. type NoMethod OperationAggregatedListWarning
  19096. raw := NoMethod(*s)
  19097. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19098. }
  19099. type OperationAggregatedListWarningData struct {
  19100. // Key: [Output Only] A key that provides more detail on the warning
  19101. // being returned. For example, for warnings where there are no results
  19102. // in a list request for a particular zone, this key might be scope and
  19103. // the key value might be the zone name. Other examples might be a key
  19104. // indicating a deprecated resource and a suggested replacement, or a
  19105. // warning about invalid network settings (for example, if an instance
  19106. // attempts to perform IP forwarding but is not enabled for IP
  19107. // forwarding).
  19108. Key string `json:"key,omitempty"`
  19109. // Value: [Output Only] A warning data value corresponding to the key.
  19110. Value string `json:"value,omitempty"`
  19111. // ForceSendFields is a list of field names (e.g. "Key") to
  19112. // unconditionally include in API requests. By default, fields with
  19113. // empty values are omitted from API requests. However, any non-pointer,
  19114. // non-interface field appearing in ForceSendFields will be sent to the
  19115. // server regardless of whether the field is empty or not. This may be
  19116. // used to include empty fields in Patch requests.
  19117. ForceSendFields []string `json:"-"`
  19118. // NullFields is a list of field names (e.g. "Key") to include in API
  19119. // requests with the JSON null value. By default, fields with empty
  19120. // values are omitted from API requests. However, any field with an
  19121. // empty value appearing in NullFields will be sent to the server as
  19122. // null. It is an error if a field in this list has a non-empty value.
  19123. // This may be used to include null fields in Patch requests.
  19124. NullFields []string `json:"-"`
  19125. }
  19126. func (s *OperationAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  19127. type NoMethod OperationAggregatedListWarningData
  19128. raw := NoMethod(*s)
  19129. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19130. }
  19131. // OperationList: Contains a list of Operation resources.
  19132. type OperationList struct {
  19133. // Id: [Output Only] The unique identifier for the resource. This
  19134. // identifier is defined by the server.
  19135. Id string `json:"id,omitempty"`
  19136. // Items: [Output Only] A list of Operation resources.
  19137. Items []*Operation `json:"items,omitempty"`
  19138. // Kind: [Output Only] Type of resource. Always compute#operations for
  19139. // Operations resource.
  19140. Kind string `json:"kind,omitempty"`
  19141. // NextPageToken: [Output Only] This token allows you to get the next
  19142. // page of results for list requests. If the number of results is larger
  19143. // than maxResults, use the nextPageToken as a value for the query
  19144. // parameter pageToken in the next list request. Subsequent list
  19145. // requests will have their own nextPageToken to continue paging through
  19146. // the results.
  19147. NextPageToken string `json:"nextPageToken,omitempty"`
  19148. // SelfLink: [Output Only] Server-defined URL for this resource.
  19149. SelfLink string `json:"selfLink,omitempty"`
  19150. // Warning: [Output Only] Informational warning message.
  19151. Warning *OperationListWarning `json:"warning,omitempty"`
  19152. // ServerResponse contains the HTTP response code and headers from the
  19153. // server.
  19154. googleapi.ServerResponse `json:"-"`
  19155. // ForceSendFields is a list of field names (e.g. "Id") to
  19156. // unconditionally include in API requests. By default, fields with
  19157. // empty values are omitted from API requests. However, any non-pointer,
  19158. // non-interface field appearing in ForceSendFields will be sent to the
  19159. // server regardless of whether the field is empty or not. This may be
  19160. // used to include empty fields in Patch requests.
  19161. ForceSendFields []string `json:"-"`
  19162. // NullFields is a list of field names (e.g. "Id") to include in API
  19163. // requests with the JSON null value. By default, fields with empty
  19164. // values are omitted from API requests. However, any field with an
  19165. // empty value appearing in NullFields will be sent to the server as
  19166. // null. It is an error if a field in this list has a non-empty value.
  19167. // This may be used to include null fields in Patch requests.
  19168. NullFields []string `json:"-"`
  19169. }
  19170. func (s *OperationList) MarshalJSON() ([]byte, error) {
  19171. type NoMethod OperationList
  19172. raw := NoMethod(*s)
  19173. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19174. }
  19175. // OperationListWarning: [Output Only] Informational warning message.
  19176. type OperationListWarning struct {
  19177. // Code: [Output Only] A warning code, if applicable. For example,
  19178. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  19179. // the response.
  19180. //
  19181. // Possible values:
  19182. // "CLEANUP_FAILED"
  19183. // "DEPRECATED_RESOURCE_USED"
  19184. // "DEPRECATED_TYPE_USED"
  19185. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  19186. // "EXPERIMENTAL_TYPE_USED"
  19187. // "EXTERNAL_API_WARNING"
  19188. // "FIELD_VALUE_OVERRIDEN"
  19189. // "INJECTED_KERNELS_DEPRECATED"
  19190. // "MISSING_TYPE_DEPENDENCY"
  19191. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  19192. // "NEXT_HOP_CANNOT_IP_FORWARD"
  19193. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  19194. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  19195. // "NEXT_HOP_NOT_RUNNING"
  19196. // "NOT_CRITICAL_ERROR"
  19197. // "NO_RESULTS_ON_PAGE"
  19198. // "REQUIRED_TOS_AGREEMENT"
  19199. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  19200. // "RESOURCE_NOT_DELETED"
  19201. // "SCHEMA_VALIDATION_IGNORED"
  19202. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  19203. // "UNDECLARED_PROPERTIES"
  19204. // "UNREACHABLE"
  19205. Code string `json:"code,omitempty"`
  19206. // Data: [Output Only] Metadata about this warning in key: value format.
  19207. // For example:
  19208. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  19209. Data []*OperationListWarningData `json:"data,omitempty"`
  19210. // Message: [Output Only] A human-readable description of the warning
  19211. // code.
  19212. Message string `json:"message,omitempty"`
  19213. // ForceSendFields is a list of field names (e.g. "Code") to
  19214. // unconditionally include in API requests. By default, fields with
  19215. // empty values are omitted from API requests. However, any non-pointer,
  19216. // non-interface field appearing in ForceSendFields will be sent to the
  19217. // server regardless of whether the field is empty or not. This may be
  19218. // used to include empty fields in Patch requests.
  19219. ForceSendFields []string `json:"-"`
  19220. // NullFields is a list of field names (e.g. "Code") to include in API
  19221. // requests with the JSON null value. By default, fields with empty
  19222. // values are omitted from API requests. However, any field with an
  19223. // empty value appearing in NullFields will be sent to the server as
  19224. // null. It is an error if a field in this list has a non-empty value.
  19225. // This may be used to include null fields in Patch requests.
  19226. NullFields []string `json:"-"`
  19227. }
  19228. func (s *OperationListWarning) MarshalJSON() ([]byte, error) {
  19229. type NoMethod OperationListWarning
  19230. raw := NoMethod(*s)
  19231. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19232. }
  19233. type OperationListWarningData struct {
  19234. // Key: [Output Only] A key that provides more detail on the warning
  19235. // being returned. For example, for warnings where there are no results
  19236. // in a list request for a particular zone, this key might be scope and
  19237. // the key value might be the zone name. Other examples might be a key
  19238. // indicating a deprecated resource and a suggested replacement, or a
  19239. // warning about invalid network settings (for example, if an instance
  19240. // attempts to perform IP forwarding but is not enabled for IP
  19241. // forwarding).
  19242. Key string `json:"key,omitempty"`
  19243. // Value: [Output Only] A warning data value corresponding to the key.
  19244. Value string `json:"value,omitempty"`
  19245. // ForceSendFields is a list of field names (e.g. "Key") to
  19246. // unconditionally include in API requests. By default, fields with
  19247. // empty values are omitted from API requests. However, any non-pointer,
  19248. // non-interface field appearing in ForceSendFields will be sent to the
  19249. // server regardless of whether the field is empty or not. This may be
  19250. // used to include empty fields in Patch requests.
  19251. ForceSendFields []string `json:"-"`
  19252. // NullFields is a list of field names (e.g. "Key") to include in API
  19253. // requests with the JSON null value. By default, fields with empty
  19254. // values are omitted from API requests. However, any field with an
  19255. // empty value appearing in NullFields will be sent to the server as
  19256. // null. It is an error if a field in this list has a non-empty value.
  19257. // This may be used to include null fields in Patch requests.
  19258. NullFields []string `json:"-"`
  19259. }
  19260. func (s *OperationListWarningData) MarshalJSON() ([]byte, error) {
  19261. type NoMethod OperationListWarningData
  19262. raw := NoMethod(*s)
  19263. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19264. }
  19265. type OperationsScopedList struct {
  19266. // Operations: [Output Only] A list of operations contained in this
  19267. // scope.
  19268. Operations []*Operation `json:"operations,omitempty"`
  19269. // Warning: [Output Only] Informational warning which replaces the list
  19270. // of operations when the list is empty.
  19271. Warning *OperationsScopedListWarning `json:"warning,omitempty"`
  19272. // ForceSendFields is a list of field names (e.g. "Operations") to
  19273. // unconditionally include in API requests. By default, fields with
  19274. // empty values are omitted from API requests. However, any non-pointer,
  19275. // non-interface field appearing in ForceSendFields will be sent to the
  19276. // server regardless of whether the field is empty or not. This may be
  19277. // used to include empty fields in Patch requests.
  19278. ForceSendFields []string `json:"-"`
  19279. // NullFields is a list of field names (e.g. "Operations") to include in
  19280. // API requests with the JSON null value. By default, fields with empty
  19281. // values are omitted from API requests. However, any field with an
  19282. // empty value appearing in NullFields will be sent to the server as
  19283. // null. It is an error if a field in this list has a non-empty value.
  19284. // This may be used to include null fields in Patch requests.
  19285. NullFields []string `json:"-"`
  19286. }
  19287. func (s *OperationsScopedList) MarshalJSON() ([]byte, error) {
  19288. type NoMethod OperationsScopedList
  19289. raw := NoMethod(*s)
  19290. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19291. }
  19292. // OperationsScopedListWarning: [Output Only] Informational warning
  19293. // which replaces the list of operations when the list is empty.
  19294. type OperationsScopedListWarning struct {
  19295. // Code: [Output Only] A warning code, if applicable. For example,
  19296. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  19297. // the response.
  19298. //
  19299. // Possible values:
  19300. // "CLEANUP_FAILED"
  19301. // "DEPRECATED_RESOURCE_USED"
  19302. // "DEPRECATED_TYPE_USED"
  19303. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  19304. // "EXPERIMENTAL_TYPE_USED"
  19305. // "EXTERNAL_API_WARNING"
  19306. // "FIELD_VALUE_OVERRIDEN"
  19307. // "INJECTED_KERNELS_DEPRECATED"
  19308. // "MISSING_TYPE_DEPENDENCY"
  19309. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  19310. // "NEXT_HOP_CANNOT_IP_FORWARD"
  19311. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  19312. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  19313. // "NEXT_HOP_NOT_RUNNING"
  19314. // "NOT_CRITICAL_ERROR"
  19315. // "NO_RESULTS_ON_PAGE"
  19316. // "REQUIRED_TOS_AGREEMENT"
  19317. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  19318. // "RESOURCE_NOT_DELETED"
  19319. // "SCHEMA_VALIDATION_IGNORED"
  19320. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  19321. // "UNDECLARED_PROPERTIES"
  19322. // "UNREACHABLE"
  19323. Code string `json:"code,omitempty"`
  19324. // Data: [Output Only] Metadata about this warning in key: value format.
  19325. // For example:
  19326. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  19327. Data []*OperationsScopedListWarningData `json:"data,omitempty"`
  19328. // Message: [Output Only] A human-readable description of the warning
  19329. // code.
  19330. Message string `json:"message,omitempty"`
  19331. // ForceSendFields is a list of field names (e.g. "Code") to
  19332. // unconditionally include in API requests. By default, fields with
  19333. // empty values are omitted from API requests. However, any non-pointer,
  19334. // non-interface field appearing in ForceSendFields will be sent to the
  19335. // server regardless of whether the field is empty or not. This may be
  19336. // used to include empty fields in Patch requests.
  19337. ForceSendFields []string `json:"-"`
  19338. // NullFields is a list of field names (e.g. "Code") to include in API
  19339. // requests with the JSON null value. By default, fields with empty
  19340. // values are omitted from API requests. However, any field with an
  19341. // empty value appearing in NullFields will be sent to the server as
  19342. // null. It is an error if a field in this list has a non-empty value.
  19343. // This may be used to include null fields in Patch requests.
  19344. NullFields []string `json:"-"`
  19345. }
  19346. func (s *OperationsScopedListWarning) MarshalJSON() ([]byte, error) {
  19347. type NoMethod OperationsScopedListWarning
  19348. raw := NoMethod(*s)
  19349. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19350. }
  19351. type OperationsScopedListWarningData struct {
  19352. // Key: [Output Only] A key that provides more detail on the warning
  19353. // being returned. For example, for warnings where there are no results
  19354. // in a list request for a particular zone, this key might be scope and
  19355. // the key value might be the zone name. Other examples might be a key
  19356. // indicating a deprecated resource and a suggested replacement, or a
  19357. // warning about invalid network settings (for example, if an instance
  19358. // attempts to perform IP forwarding but is not enabled for IP
  19359. // forwarding).
  19360. Key string `json:"key,omitempty"`
  19361. // Value: [Output Only] A warning data value corresponding to the key.
  19362. Value string `json:"value,omitempty"`
  19363. // ForceSendFields is a list of field names (e.g. "Key") to
  19364. // unconditionally include in API requests. By default, fields with
  19365. // empty values are omitted from API requests. However, any non-pointer,
  19366. // non-interface field appearing in ForceSendFields will be sent to the
  19367. // server regardless of whether the field is empty or not. This may be
  19368. // used to include empty fields in Patch requests.
  19369. ForceSendFields []string `json:"-"`
  19370. // NullFields is a list of field names (e.g. "Key") to include in API
  19371. // requests with the JSON null value. By default, fields with empty
  19372. // values are omitted from API requests. However, any field with an
  19373. // empty value appearing in NullFields will be sent to the server as
  19374. // null. It is an error if a field in this list has a non-empty value.
  19375. // This may be used to include null fields in Patch requests.
  19376. NullFields []string `json:"-"`
  19377. }
  19378. func (s *OperationsScopedListWarningData) MarshalJSON() ([]byte, error) {
  19379. type NoMethod OperationsScopedListWarningData
  19380. raw := NoMethod(*s)
  19381. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19382. }
  19383. // PathMatcher: A matcher for the path portion of the URL. The
  19384. // BackendService from the longest-matched rule will serve the URL. If
  19385. // no rule was matched, the default service will be used.
  19386. type PathMatcher struct {
  19387. // DefaultService: The full or partial URL to the BackendService
  19388. // resource. This will be used if none of the pathRules defined by this
  19389. // PathMatcher is matched by the URL's path portion. For example, the
  19390. // following are all valid URLs to a BackendService resource:
  19391. // -
  19392. // https://www.googleapis.com/compute/v1/projects/project/global/backendServices/backendService
  19393. // - compute/v1/projects/project/global/backendServices/backendService
  19394. //
  19395. // - global/backendServices/backendService
  19396. DefaultService string `json:"defaultService,omitempty"`
  19397. // Description: An optional description of this resource. Provide this
  19398. // property when you create the resource.
  19399. Description string `json:"description,omitempty"`
  19400. // Name: The name to which this PathMatcher is referred by the HostRule.
  19401. Name string `json:"name,omitempty"`
  19402. // PathRules: The list of path rules.
  19403. PathRules []*PathRule `json:"pathRules,omitempty"`
  19404. // ForceSendFields is a list of field names (e.g. "DefaultService") to
  19405. // unconditionally include in API requests. By default, fields with
  19406. // empty values are omitted from API requests. However, any non-pointer,
  19407. // non-interface field appearing in ForceSendFields will be sent to the
  19408. // server regardless of whether the field is empty or not. This may be
  19409. // used to include empty fields in Patch requests.
  19410. ForceSendFields []string `json:"-"`
  19411. // NullFields is a list of field names (e.g. "DefaultService") to
  19412. // include in API requests with the JSON null value. By default, fields
  19413. // with empty values are omitted from API requests. However, any field
  19414. // with an empty value appearing in NullFields will be sent to the
  19415. // server as null. It is an error if a field in this list has a
  19416. // non-empty value. This may be used to include null fields in Patch
  19417. // requests.
  19418. NullFields []string `json:"-"`
  19419. }
  19420. func (s *PathMatcher) MarshalJSON() ([]byte, error) {
  19421. type NoMethod PathMatcher
  19422. raw := NoMethod(*s)
  19423. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19424. }
  19425. // PathRule: A path-matching rule for a URL. If matched, will use the
  19426. // specified BackendService to handle the traffic arriving at this URL.
  19427. type PathRule struct {
  19428. // Paths: The list of path patterns to match. Each must start with / and
  19429. // the only place a * is allowed is at the end following a /. The string
  19430. // fed to the path matcher does not include any text after the first ?
  19431. // or #, and those chars are not allowed here.
  19432. Paths []string `json:"paths,omitempty"`
  19433. // Service: The URL of the BackendService resource if this rule is
  19434. // matched.
  19435. Service string `json:"service,omitempty"`
  19436. // ForceSendFields is a list of field names (e.g. "Paths") to
  19437. // unconditionally include in API requests. By default, fields with
  19438. // empty values are omitted from API requests. However, any non-pointer,
  19439. // non-interface field appearing in ForceSendFields will be sent to the
  19440. // server regardless of whether the field is empty or not. This may be
  19441. // used to include empty fields in Patch requests.
  19442. ForceSendFields []string `json:"-"`
  19443. // NullFields is a list of field names (e.g. "Paths") to include in API
  19444. // requests with the JSON null value. By default, fields with empty
  19445. // values are omitted from API requests. However, any field with an
  19446. // empty value appearing in NullFields will be sent to the server as
  19447. // null. It is an error if a field in this list has a non-empty value.
  19448. // This may be used to include null fields in Patch requests.
  19449. NullFields []string `json:"-"`
  19450. }
  19451. func (s *PathRule) MarshalJSON() ([]byte, error) {
  19452. type NoMethod PathRule
  19453. raw := NoMethod(*s)
  19454. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19455. }
  19456. type PerInstanceConfig struct {
  19457. // Fingerprint: Fingerprint of this per-instance config. This field may
  19458. // be used in optimistic locking. It will be ignored when inserting a
  19459. // per-instance config. An up-to-date fingerprint must be provided in
  19460. // order to update an existing per-instance config or the field needs to
  19461. // be unset.
  19462. Fingerprint string `json:"fingerprint,omitempty"`
  19463. // Instance: The URL of the instance. Serves as a merge key during
  19464. // UpdatePerInstanceConfigs operation, i.e. if per-instance config with
  19465. // the same instance URL exists then it will be updated, otherwise a new
  19466. // one will be created.
  19467. Instance string `json:"instance,omitempty"`
  19468. Override *ManagedInstanceOverride `json:"override,omitempty"`
  19469. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  19470. // unconditionally include in API requests. By default, fields with
  19471. // empty values are omitted from API requests. However, any non-pointer,
  19472. // non-interface field appearing in ForceSendFields will be sent to the
  19473. // server regardless of whether the field is empty or not. This may be
  19474. // used to include empty fields in Patch requests.
  19475. ForceSendFields []string `json:"-"`
  19476. // NullFields is a list of field names (e.g. "Fingerprint") to include
  19477. // in API requests with the JSON null value. By default, fields with
  19478. // empty values are omitted from API requests. However, any field with
  19479. // an empty value appearing in NullFields will be sent to the server as
  19480. // null. It is an error if a field in this list has a non-empty value.
  19481. // This may be used to include null fields in Patch requests.
  19482. NullFields []string `json:"-"`
  19483. }
  19484. func (s *PerInstanceConfig) MarshalJSON() ([]byte, error) {
  19485. type NoMethod PerInstanceConfig
  19486. raw := NoMethod(*s)
  19487. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19488. }
  19489. // Policy: Defines an Identity and Access Management (IAM) policy. It is
  19490. // used to specify access control policies for Cloud Platform
  19491. // resources.
  19492. //
  19493. //
  19494. //
  19495. // A `Policy` consists of a list of `bindings`. A `binding` binds a list
  19496. // of `members` to a `role`, where the members can be user accounts,
  19497. // Google groups, Google domains, and service accounts. A `role` is a
  19498. // named list of permissions defined by IAM.
  19499. //
  19500. // **JSON Example**
  19501. //
  19502. // { "bindings": [ { "role": "roles/owner", "members": [
  19503. // "user:mike@example.com", "group:admins@example.com",
  19504. // "domain:google.com",
  19505. // "serviceAccount:my-other-app@appspot.gserviceaccount.com" ] }, {
  19506. // "role": "roles/viewer", "members": ["user:sean@example.com"] } ]
  19507. // }
  19508. //
  19509. // **YAML Example**
  19510. //
  19511. // bindings: - members: - user:mike@example.com -
  19512. // group:admins@example.com - domain:google.com -
  19513. // serviceAccount:my-other-app@appspot.gserviceaccount.com role:
  19514. // roles/owner - members: - user:sean@example.com role:
  19515. // roles/viewer
  19516. //
  19517. //
  19518. //
  19519. // For a description of IAM and its features, see the [IAM developer's
  19520. // guide](https://cloud.google.com/iam/docs).
  19521. type Policy struct {
  19522. // AuditConfigs: Specifies cloud audit logging configuration for this
  19523. // policy.
  19524. AuditConfigs []*AuditConfig `json:"auditConfigs,omitempty"`
  19525. // Bindings: Associates a list of `members` to a `role`. `bindings` with
  19526. // no members will result in an error.
  19527. Bindings []*Binding `json:"bindings,omitempty"`
  19528. // Etag: `etag` is used for optimistic concurrency control as a way to
  19529. // help prevent simultaneous updates of a policy from overwriting each
  19530. // other. It is strongly suggested that systems make use of the `etag`
  19531. // in the read-modify-write cycle to perform policy updates in order to
  19532. // avoid race conditions: An `etag` is returned in the response to
  19533. // `getIamPolicy`, and systems are expected to put that etag in the
  19534. // request to `setIamPolicy` to ensure that their change will be applied
  19535. // to the same version of the policy.
  19536. //
  19537. // If no `etag` is provided in the call to `setIamPolicy`, then the
  19538. // existing policy is overwritten blindly.
  19539. Etag string `json:"etag,omitempty"`
  19540. IamOwned bool `json:"iamOwned,omitempty"`
  19541. // Rules: If more than one rule is specified, the rules are applied in
  19542. // the following manner: - All matching LOG rules are always applied. -
  19543. // If any DENY/DENY_WITH_LOG rule matches, permission is denied. Logging
  19544. // will be applied if one or more matching rule requires logging. -
  19545. // Otherwise, if any ALLOW/ALLOW_WITH_LOG rule matches, permission is
  19546. // granted. Logging will be applied if one or more matching rule
  19547. // requires logging. - Otherwise, if no rule applies, permission is
  19548. // denied.
  19549. Rules []*Rule `json:"rules,omitempty"`
  19550. // Version: Deprecated.
  19551. Version int64 `json:"version,omitempty"`
  19552. // ServerResponse contains the HTTP response code and headers from the
  19553. // server.
  19554. googleapi.ServerResponse `json:"-"`
  19555. // ForceSendFields is a list of field names (e.g. "AuditConfigs") to
  19556. // unconditionally include in API requests. By default, fields with
  19557. // empty values are omitted from API requests. However, any non-pointer,
  19558. // non-interface field appearing in ForceSendFields will be sent to the
  19559. // server regardless of whether the field is empty or not. This may be
  19560. // used to include empty fields in Patch requests.
  19561. ForceSendFields []string `json:"-"`
  19562. // NullFields is a list of field names (e.g. "AuditConfigs") to include
  19563. // in API requests with the JSON null value. By default, fields with
  19564. // empty values are omitted from API requests. However, any field with
  19565. // an empty value appearing in NullFields will be sent to the server as
  19566. // null. It is an error if a field in this list has a non-empty value.
  19567. // This may be used to include null fields in Patch requests.
  19568. NullFields []string `json:"-"`
  19569. }
  19570. func (s *Policy) MarshalJSON() ([]byte, error) {
  19571. type NoMethod Policy
  19572. raw := NoMethod(*s)
  19573. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19574. }
  19575. type PreconfiguredWafSet struct {
  19576. // ExpressionSets: List of entities that are currently supported for WAF
  19577. // rules.
  19578. ExpressionSets []*WafExpressionSet `json:"expressionSets,omitempty"`
  19579. // ForceSendFields is a list of field names (e.g. "ExpressionSets") to
  19580. // unconditionally include in API requests. By default, fields with
  19581. // empty values are omitted from API requests. However, any non-pointer,
  19582. // non-interface field appearing in ForceSendFields will be sent to the
  19583. // server regardless of whether the field is empty or not. This may be
  19584. // used to include empty fields in Patch requests.
  19585. ForceSendFields []string `json:"-"`
  19586. // NullFields is a list of field names (e.g. "ExpressionSets") to
  19587. // include in API requests with the JSON null value. By default, fields
  19588. // with empty values are omitted from API requests. However, any field
  19589. // with an empty value appearing in NullFields will be sent to the
  19590. // server as null. It is an error if a field in this list has a
  19591. // non-empty value. This may be used to include null fields in Patch
  19592. // requests.
  19593. NullFields []string `json:"-"`
  19594. }
  19595. func (s *PreconfiguredWafSet) MarshalJSON() ([]byte, error) {
  19596. type NoMethod PreconfiguredWafSet
  19597. raw := NoMethod(*s)
  19598. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19599. }
  19600. // Project: A Project resource. For an overview of projects, see Cloud
  19601. // Platform Resource Hierarchy. (== resource_for v1.projects ==) (==
  19602. // resource_for beta.projects ==)
  19603. type Project struct {
  19604. // CommonInstanceMetadata: Metadata key/value pairs available to all
  19605. // instances contained in this project. See Custom metadata for more
  19606. // information.
  19607. CommonInstanceMetadata *Metadata `json:"commonInstanceMetadata,omitempty"`
  19608. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  19609. // format.
  19610. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  19611. // DefaultNetworkTier: This signifies the default network tier used for
  19612. // configuring resources of the project and can only take the following
  19613. // values: PREMIUM, STANDARD. Initially the default network tier is
  19614. // PREMIUM.
  19615. //
  19616. // Possible values:
  19617. // "PREMIUM"
  19618. // "SELECT"
  19619. // "STANDARD"
  19620. DefaultNetworkTier string `json:"defaultNetworkTier,omitempty"`
  19621. // DefaultServiceAccount: [Output Only] Default service account used by
  19622. // VMs running in this project.
  19623. DefaultServiceAccount string `json:"defaultServiceAccount,omitempty"`
  19624. // Description: An optional textual description of the resource.
  19625. Description string `json:"description,omitempty"`
  19626. // EnabledFeatures: Restricted features enabled for use on this project.
  19627. EnabledFeatures []string `json:"enabledFeatures,omitempty"`
  19628. // Id: [Output Only] The unique identifier for the resource. This
  19629. // identifier is defined by the server. This is not the project ID, and
  19630. // is just a unique ID used by Compute Engine to identify resources.
  19631. Id uint64 `json:"id,omitempty,string"`
  19632. // Kind: [Output Only] Type of the resource. Always compute#project for
  19633. // projects.
  19634. Kind string `json:"kind,omitempty"`
  19635. // Name: The project ID. For example: my-example-project. Use the
  19636. // project ID to make requests to Compute Engine.
  19637. Name string `json:"name,omitempty"`
  19638. // Quotas: [Output Only] Quotas assigned to this project.
  19639. Quotas []*Quota `json:"quotas,omitempty"`
  19640. // SelfLink: [Output Only] Server-defined URL for the resource.
  19641. SelfLink string `json:"selfLink,omitempty"`
  19642. // UsageExportLocation: The naming prefix for daily usage reports and
  19643. // the Google Cloud Storage bucket where they are stored.
  19644. UsageExportLocation *UsageExportLocation `json:"usageExportLocation,omitempty"`
  19645. // XpnProjectStatus: [Output Only] The role this project has in a shared
  19646. // VPC configuration. Currently only HOST projects are differentiated.
  19647. //
  19648. // Possible values:
  19649. // "HOST"
  19650. // "UNSPECIFIED_XPN_PROJECT_STATUS"
  19651. XpnProjectStatus string `json:"xpnProjectStatus,omitempty"`
  19652. // ServerResponse contains the HTTP response code and headers from the
  19653. // server.
  19654. googleapi.ServerResponse `json:"-"`
  19655. // ForceSendFields is a list of field names (e.g.
  19656. // "CommonInstanceMetadata") to unconditionally include in API requests.
  19657. // By default, fields with empty values are omitted from API requests.
  19658. // However, any non-pointer, non-interface field appearing in
  19659. // ForceSendFields will be sent to the server regardless of whether the
  19660. // field is empty or not. This may be used to include empty fields in
  19661. // Patch requests.
  19662. ForceSendFields []string `json:"-"`
  19663. // NullFields is a list of field names (e.g. "CommonInstanceMetadata")
  19664. // to include in API requests with the JSON null value. By default,
  19665. // fields with empty values are omitted from API requests. However, any
  19666. // field with an empty value appearing in NullFields will be sent to the
  19667. // server as null. It is an error if a field in this list has a
  19668. // non-empty value. This may be used to include null fields in Patch
  19669. // requests.
  19670. NullFields []string `json:"-"`
  19671. }
  19672. func (s *Project) MarshalJSON() ([]byte, error) {
  19673. type NoMethod Project
  19674. raw := NoMethod(*s)
  19675. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19676. }
  19677. type ProjectsDisableXpnResourceRequest struct {
  19678. // XpnResource: Service resource (a.k.a service project) ID.
  19679. XpnResource *XpnResourceId `json:"xpnResource,omitempty"`
  19680. // ForceSendFields is a list of field names (e.g. "XpnResource") to
  19681. // unconditionally include in API requests. By default, fields with
  19682. // empty values are omitted from API requests. However, any non-pointer,
  19683. // non-interface field appearing in ForceSendFields will be sent to the
  19684. // server regardless of whether the field is empty or not. This may be
  19685. // used to include empty fields in Patch requests.
  19686. ForceSendFields []string `json:"-"`
  19687. // NullFields is a list of field names (e.g. "XpnResource") to include
  19688. // in API requests with the JSON null value. By default, fields with
  19689. // empty values are omitted from API requests. However, any field with
  19690. // an empty value appearing in NullFields will be sent to the server as
  19691. // null. It is an error if a field in this list has a non-empty value.
  19692. // This may be used to include null fields in Patch requests.
  19693. NullFields []string `json:"-"`
  19694. }
  19695. func (s *ProjectsDisableXpnResourceRequest) MarshalJSON() ([]byte, error) {
  19696. type NoMethod ProjectsDisableXpnResourceRequest
  19697. raw := NoMethod(*s)
  19698. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19699. }
  19700. type ProjectsEnableXpnResourceRequest struct {
  19701. // XpnResource: Service resource (a.k.a service project) ID.
  19702. XpnResource *XpnResourceId `json:"xpnResource,omitempty"`
  19703. // ForceSendFields is a list of field names (e.g. "XpnResource") to
  19704. // unconditionally include in API requests. By default, fields with
  19705. // empty values are omitted from API requests. However, any non-pointer,
  19706. // non-interface field appearing in ForceSendFields will be sent to the
  19707. // server regardless of whether the field is empty or not. This may be
  19708. // used to include empty fields in Patch requests.
  19709. ForceSendFields []string `json:"-"`
  19710. // NullFields is a list of field names (e.g. "XpnResource") to include
  19711. // in API requests with the JSON null value. By default, fields with
  19712. // empty values are omitted from API requests. However, any field with
  19713. // an empty value appearing in NullFields will be sent to the server as
  19714. // null. It is an error if a field in this list has a non-empty value.
  19715. // This may be used to include null fields in Patch requests.
  19716. NullFields []string `json:"-"`
  19717. }
  19718. func (s *ProjectsEnableXpnResourceRequest) MarshalJSON() ([]byte, error) {
  19719. type NoMethod ProjectsEnableXpnResourceRequest
  19720. raw := NoMethod(*s)
  19721. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19722. }
  19723. type ProjectsGetXpnResources struct {
  19724. // Kind: [Output Only] Type of resource. Always
  19725. // compute#projectsGetXpnResources for lists of service resources (a.k.a
  19726. // service projects)
  19727. Kind string `json:"kind,omitempty"`
  19728. // NextPageToken: [Output Only] This token allows you to get the next
  19729. // page of results for list requests. If the number of results is larger
  19730. // than maxResults, use the nextPageToken as a value for the query
  19731. // parameter pageToken in the next list request. Subsequent list
  19732. // requests will have their own nextPageToken to continue paging through
  19733. // the results.
  19734. NextPageToken string `json:"nextPageToken,omitempty"`
  19735. // Resources: Service resources (a.k.a service projects) attached to
  19736. // this project as their shared VPC host.
  19737. Resources []*XpnResourceId `json:"resources,omitempty"`
  19738. // ServerResponse contains the HTTP response code and headers from the
  19739. // server.
  19740. googleapi.ServerResponse `json:"-"`
  19741. // ForceSendFields is a list of field names (e.g. "Kind") to
  19742. // unconditionally include in API requests. By default, fields with
  19743. // empty values are omitted from API requests. However, any non-pointer,
  19744. // non-interface field appearing in ForceSendFields will be sent to the
  19745. // server regardless of whether the field is empty or not. This may be
  19746. // used to include empty fields in Patch requests.
  19747. ForceSendFields []string `json:"-"`
  19748. // NullFields is a list of field names (e.g. "Kind") to include in API
  19749. // requests with the JSON null value. By default, fields with empty
  19750. // values are omitted from API requests. However, any field with an
  19751. // empty value appearing in NullFields will be sent to the server as
  19752. // null. It is an error if a field in this list has a non-empty value.
  19753. // This may be used to include null fields in Patch requests.
  19754. NullFields []string `json:"-"`
  19755. }
  19756. func (s *ProjectsGetXpnResources) MarshalJSON() ([]byte, error) {
  19757. type NoMethod ProjectsGetXpnResources
  19758. raw := NoMethod(*s)
  19759. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19760. }
  19761. type ProjectsListXpnHostsRequest struct {
  19762. // Organization: Optional organization ID managed by Cloud Resource
  19763. // Manager, for which to list shared VPC host projects. If not
  19764. // specified, the organization will be inferred from the project.
  19765. Organization string `json:"organization,omitempty"`
  19766. // ForceSendFields is a list of field names (e.g. "Organization") to
  19767. // unconditionally include in API requests. By default, fields with
  19768. // empty values are omitted from API requests. However, any non-pointer,
  19769. // non-interface field appearing in ForceSendFields will be sent to the
  19770. // server regardless of whether the field is empty or not. This may be
  19771. // used to include empty fields in Patch requests.
  19772. ForceSendFields []string `json:"-"`
  19773. // NullFields is a list of field names (e.g. "Organization") to include
  19774. // in API requests with the JSON null value. By default, fields with
  19775. // empty values are omitted from API requests. However, any field with
  19776. // an empty value appearing in NullFields will be sent to the server as
  19777. // null. It is an error if a field in this list has a non-empty value.
  19778. // This may be used to include null fields in Patch requests.
  19779. NullFields []string `json:"-"`
  19780. }
  19781. func (s *ProjectsListXpnHostsRequest) MarshalJSON() ([]byte, error) {
  19782. type NoMethod ProjectsListXpnHostsRequest
  19783. raw := NoMethod(*s)
  19784. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19785. }
  19786. type ProjectsSetDefaultNetworkTierRequest struct {
  19787. // NetworkTier: Default network tier to be set.
  19788. //
  19789. // Possible values:
  19790. // "PREMIUM"
  19791. // "SELECT"
  19792. // "STANDARD"
  19793. NetworkTier string `json:"networkTier,omitempty"`
  19794. // ForceSendFields is a list of field names (e.g. "NetworkTier") to
  19795. // unconditionally include in API requests. By default, fields with
  19796. // empty values are omitted from API requests. However, any non-pointer,
  19797. // non-interface field appearing in ForceSendFields will be sent to the
  19798. // server regardless of whether the field is empty or not. This may be
  19799. // used to include empty fields in Patch requests.
  19800. ForceSendFields []string `json:"-"`
  19801. // NullFields is a list of field names (e.g. "NetworkTier") to include
  19802. // in API requests with the JSON null value. By default, fields with
  19803. // empty values are omitted from API requests. However, any field with
  19804. // an empty value appearing in NullFields will be sent to the server as
  19805. // null. It is an error if a field in this list has a non-empty value.
  19806. // This may be used to include null fields in Patch requests.
  19807. NullFields []string `json:"-"`
  19808. }
  19809. func (s *ProjectsSetDefaultNetworkTierRequest) MarshalJSON() ([]byte, error) {
  19810. type NoMethod ProjectsSetDefaultNetworkTierRequest
  19811. raw := NoMethod(*s)
  19812. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19813. }
  19814. type ProjectsSetDefaultServiceAccountRequest struct {
  19815. // Email: Email address of the service account.
  19816. Email string `json:"email,omitempty"`
  19817. // ForceSendFields is a list of field names (e.g. "Email") to
  19818. // unconditionally include in API requests. By default, fields with
  19819. // empty values are omitted from API requests. However, any non-pointer,
  19820. // non-interface field appearing in ForceSendFields will be sent to the
  19821. // server regardless of whether the field is empty or not. This may be
  19822. // used to include empty fields in Patch requests.
  19823. ForceSendFields []string `json:"-"`
  19824. // NullFields is a list of field names (e.g. "Email") to include in API
  19825. // requests with the JSON null value. By default, fields with empty
  19826. // values are omitted from API requests. However, any field with an
  19827. // empty value appearing in NullFields will be sent to the server as
  19828. // null. It is an error if a field in this list has a non-empty value.
  19829. // This may be used to include null fields in Patch requests.
  19830. NullFields []string `json:"-"`
  19831. }
  19832. func (s *ProjectsSetDefaultServiceAccountRequest) MarshalJSON() ([]byte, error) {
  19833. type NoMethod ProjectsSetDefaultServiceAccountRequest
  19834. raw := NoMethod(*s)
  19835. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19836. }
  19837. // Quota: A quotas entry.
  19838. type Quota struct {
  19839. // Limit: [Output Only] Quota limit for this metric.
  19840. Limit float64 `json:"limit,omitempty"`
  19841. // Metric: [Output Only] Name of the quota metric.
  19842. //
  19843. // Possible values:
  19844. // "AMD_S9300_GPUS"
  19845. // "AUTOSCALERS"
  19846. // "BACKEND_BUCKETS"
  19847. // "BACKEND_SERVICES"
  19848. // "COMMITMENTS"
  19849. // "CPUS"
  19850. // "CPUS_ALL_REGIONS"
  19851. // "DISKS_TOTAL_GB"
  19852. // "FIREWALLS"
  19853. // "FORWARDING_RULES"
  19854. // "HEALTH_CHECKS"
  19855. // "IMAGES"
  19856. // "INSTANCES"
  19857. // "INSTANCE_GROUPS"
  19858. // "INSTANCE_GROUP_MANAGERS"
  19859. // "INSTANCE_TEMPLATES"
  19860. // "INTERCONNECTS"
  19861. // "INTERCONNECT_ATTACHMENTS_PER_REGION"
  19862. // "INTERCONNECT_ATTACHMENTS_TOTAL_MBPS"
  19863. // "INTERNAL_ADDRESSES"
  19864. // "IN_USE_ADDRESSES"
  19865. // "IN_USE_MAINTENANCE_WINDOWS"
  19866. // "LOCAL_SSD_TOTAL_GB"
  19867. // "NETWORKS"
  19868. // "NETWORK_ENDPOINT_GROUPS"
  19869. // "NVIDIA_K80_GPUS"
  19870. // "NVIDIA_P100_GPUS"
  19871. // "NVIDIA_P100_VWS_GPUS"
  19872. // "NVIDIA_V100_GPUS"
  19873. // "PREEMPTIBLE_CPUS"
  19874. // "PREEMPTIBLE_LOCAL_SSD_GB"
  19875. // "PREEMPTIBLE_NVIDIA_K80_GPUS"
  19876. // "PREEMPTIBLE_NVIDIA_P100_GPUS"
  19877. // "PREEMPTIBLE_NVIDIA_V100_GPUS"
  19878. // "PRIVATE_V6_ACCESS_SUBNETWORKS"
  19879. // "REGIONAL_AUTOSCALERS"
  19880. // "REGIONAL_INSTANCE_GROUP_MANAGERS"
  19881. // "RESOURCE_POLICIES"
  19882. // "ROUTERS"
  19883. // "ROUTES"
  19884. // "SECURITY_POLICIES"
  19885. // "SECURITY_POLICY_RULES"
  19886. // "SNAPSHOTS"
  19887. // "SSD_TOTAL_GB"
  19888. // "SSL_CERTIFICATES"
  19889. // "STATIC_ADDRESSES"
  19890. // "SUBNETWORKS"
  19891. // "TARGET_HTTPS_PROXIES"
  19892. // "TARGET_HTTP_PROXIES"
  19893. // "TARGET_INSTANCES"
  19894. // "TARGET_POOLS"
  19895. // "TARGET_SSL_PROXIES"
  19896. // "TARGET_TCP_PROXIES"
  19897. // "TARGET_VPN_GATEWAYS"
  19898. // "URL_MAPS"
  19899. // "VPN_TUNNELS"
  19900. Metric string `json:"metric,omitempty"`
  19901. // Usage: [Output Only] Current usage of this metric.
  19902. Usage float64 `json:"usage,omitempty"`
  19903. // ForceSendFields is a list of field names (e.g. "Limit") to
  19904. // unconditionally include in API requests. By default, fields with
  19905. // empty values are omitted from API requests. However, any non-pointer,
  19906. // non-interface field appearing in ForceSendFields will be sent to the
  19907. // server regardless of whether the field is empty or not. This may be
  19908. // used to include empty fields in Patch requests.
  19909. ForceSendFields []string `json:"-"`
  19910. // NullFields is a list of field names (e.g. "Limit") to include in API
  19911. // requests with the JSON null value. By default, fields with empty
  19912. // values are omitted from API requests. However, any field with an
  19913. // empty value appearing in NullFields will be sent to the server as
  19914. // null. It is an error if a field in this list has a non-empty value.
  19915. // This may be used to include null fields in Patch requests.
  19916. NullFields []string `json:"-"`
  19917. }
  19918. func (s *Quota) MarshalJSON() ([]byte, error) {
  19919. type NoMethod Quota
  19920. raw := NoMethod(*s)
  19921. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19922. }
  19923. func (s *Quota) UnmarshalJSON(data []byte) error {
  19924. type NoMethod Quota
  19925. var s1 struct {
  19926. Limit gensupport.JSONFloat64 `json:"limit"`
  19927. Usage gensupport.JSONFloat64 `json:"usage"`
  19928. *NoMethod
  19929. }
  19930. s1.NoMethod = (*NoMethod)(s)
  19931. if err := json.Unmarshal(data, &s1); err != nil {
  19932. return err
  19933. }
  19934. s.Limit = float64(s1.Limit)
  19935. s.Usage = float64(s1.Usage)
  19936. return nil
  19937. }
  19938. // Reference: Represents a reference to a resource.
  19939. type Reference struct {
  19940. // Kind: [Output Only] Type of the resource. Always compute#reference
  19941. // for references.
  19942. Kind string `json:"kind,omitempty"`
  19943. // ReferenceType: A description of the reference type with no implied
  19944. // semantics. Possible values include:
  19945. // - MEMBER_OF
  19946. ReferenceType string `json:"referenceType,omitempty"`
  19947. // Referrer: URL of the resource which refers to the target.
  19948. Referrer string `json:"referrer,omitempty"`
  19949. // Target: URL of the resource to which this reference points.
  19950. Target string `json:"target,omitempty"`
  19951. // ForceSendFields is a list of field names (e.g. "Kind") to
  19952. // unconditionally include in API requests. By default, fields with
  19953. // empty values are omitted from API requests. However, any non-pointer,
  19954. // non-interface field appearing in ForceSendFields will be sent to the
  19955. // server regardless of whether the field is empty or not. This may be
  19956. // used to include empty fields in Patch requests.
  19957. ForceSendFields []string `json:"-"`
  19958. // NullFields is a list of field names (e.g. "Kind") to include in API
  19959. // requests with the JSON null value. By default, fields with empty
  19960. // values are omitted from API requests. However, any field with an
  19961. // empty value appearing in NullFields will be sent to the server as
  19962. // null. It is an error if a field in this list has a non-empty value.
  19963. // This may be used to include null fields in Patch requests.
  19964. NullFields []string `json:"-"`
  19965. }
  19966. func (s *Reference) MarshalJSON() ([]byte, error) {
  19967. type NoMethod Reference
  19968. raw := NoMethod(*s)
  19969. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19970. }
  19971. // Region: Region resource. (== resource_for beta.regions ==) (==
  19972. // resource_for v1.regions ==)
  19973. type Region struct {
  19974. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  19975. // format.
  19976. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  19977. // Deprecated: [Output Only] The deprecation status associated with this
  19978. // region.
  19979. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  19980. // Description: [Output Only] Textual description of the resource.
  19981. Description string `json:"description,omitempty"`
  19982. // Id: [Output Only] The unique identifier for the resource. This
  19983. // identifier is defined by the server.
  19984. Id uint64 `json:"id,omitempty,string"`
  19985. // Kind: [Output Only] Type of the resource. Always compute#region for
  19986. // regions.
  19987. Kind string `json:"kind,omitempty"`
  19988. // Name: [Output Only] Name of the resource.
  19989. Name string `json:"name,omitempty"`
  19990. // Quotas: [Output Only] Quotas assigned to this region.
  19991. Quotas []*Quota `json:"quotas,omitempty"`
  19992. // SelfLink: [Output Only] Server-defined URL for the resource.
  19993. SelfLink string `json:"selfLink,omitempty"`
  19994. // Status: [Output Only] Status of the region, either UP or DOWN.
  19995. //
  19996. // Possible values:
  19997. // "DOWN"
  19998. // "UP"
  19999. Status string `json:"status,omitempty"`
  20000. // Zones: [Output Only] A list of zones available in this region, in the
  20001. // form of resource URLs.
  20002. Zones []string `json:"zones,omitempty"`
  20003. // ServerResponse contains the HTTP response code and headers from the
  20004. // server.
  20005. googleapi.ServerResponse `json:"-"`
  20006. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  20007. // to unconditionally include in API requests. By default, fields with
  20008. // empty values are omitted from API requests. However, any non-pointer,
  20009. // non-interface field appearing in ForceSendFields will be sent to the
  20010. // server regardless of whether the field is empty or not. This may be
  20011. // used to include empty fields in Patch requests.
  20012. ForceSendFields []string `json:"-"`
  20013. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  20014. // include in API requests with the JSON null value. By default, fields
  20015. // with empty values are omitted from API requests. However, any field
  20016. // with an empty value appearing in NullFields will be sent to the
  20017. // server as null. It is an error if a field in this list has a
  20018. // non-empty value. This may be used to include null fields in Patch
  20019. // requests.
  20020. NullFields []string `json:"-"`
  20021. }
  20022. func (s *Region) MarshalJSON() ([]byte, error) {
  20023. type NoMethod Region
  20024. raw := NoMethod(*s)
  20025. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20026. }
  20027. // RegionAutoscalerList: Contains a list of autoscalers.
  20028. type RegionAutoscalerList struct {
  20029. // Id: [Output Only] Unique identifier for the resource; defined by the
  20030. // server.
  20031. Id string `json:"id,omitempty"`
  20032. // Items: A list of Autoscaler resources.
  20033. Items []*Autoscaler `json:"items,omitempty"`
  20034. // Kind: Type of resource.
  20035. Kind string `json:"kind,omitempty"`
  20036. // NextPageToken: [Output Only] This token allows you to get the next
  20037. // page of results for list requests. If the number of results is larger
  20038. // than maxResults, use the nextPageToken as a value for the query
  20039. // parameter pageToken in the next list request. Subsequent list
  20040. // requests will have their own nextPageToken to continue paging through
  20041. // the results.
  20042. NextPageToken string `json:"nextPageToken,omitempty"`
  20043. // SelfLink: [Output Only] Server-defined URL for this resource.
  20044. SelfLink string `json:"selfLink,omitempty"`
  20045. // Warning: [Output Only] Informational warning message.
  20046. Warning *RegionAutoscalerListWarning `json:"warning,omitempty"`
  20047. // ServerResponse contains the HTTP response code and headers from the
  20048. // server.
  20049. googleapi.ServerResponse `json:"-"`
  20050. // ForceSendFields is a list of field names (e.g. "Id") to
  20051. // unconditionally include in API requests. By default, fields with
  20052. // empty values are omitted from API requests. However, any non-pointer,
  20053. // non-interface field appearing in ForceSendFields will be sent to the
  20054. // server regardless of whether the field is empty or not. This may be
  20055. // used to include empty fields in Patch requests.
  20056. ForceSendFields []string `json:"-"`
  20057. // NullFields is a list of field names (e.g. "Id") to include in API
  20058. // requests with the JSON null value. By default, fields with empty
  20059. // values are omitted from API requests. However, any field with an
  20060. // empty value appearing in NullFields will be sent to the server as
  20061. // null. It is an error if a field in this list has a non-empty value.
  20062. // This may be used to include null fields in Patch requests.
  20063. NullFields []string `json:"-"`
  20064. }
  20065. func (s *RegionAutoscalerList) MarshalJSON() ([]byte, error) {
  20066. type NoMethod RegionAutoscalerList
  20067. raw := NoMethod(*s)
  20068. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20069. }
  20070. // RegionAutoscalerListWarning: [Output Only] Informational warning
  20071. // message.
  20072. type RegionAutoscalerListWarning struct {
  20073. // Code: [Output Only] A warning code, if applicable. For example,
  20074. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  20075. // the response.
  20076. //
  20077. // Possible values:
  20078. // "CLEANUP_FAILED"
  20079. // "DEPRECATED_RESOURCE_USED"
  20080. // "DEPRECATED_TYPE_USED"
  20081. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  20082. // "EXPERIMENTAL_TYPE_USED"
  20083. // "EXTERNAL_API_WARNING"
  20084. // "FIELD_VALUE_OVERRIDEN"
  20085. // "INJECTED_KERNELS_DEPRECATED"
  20086. // "MISSING_TYPE_DEPENDENCY"
  20087. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  20088. // "NEXT_HOP_CANNOT_IP_FORWARD"
  20089. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  20090. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  20091. // "NEXT_HOP_NOT_RUNNING"
  20092. // "NOT_CRITICAL_ERROR"
  20093. // "NO_RESULTS_ON_PAGE"
  20094. // "REQUIRED_TOS_AGREEMENT"
  20095. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  20096. // "RESOURCE_NOT_DELETED"
  20097. // "SCHEMA_VALIDATION_IGNORED"
  20098. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  20099. // "UNDECLARED_PROPERTIES"
  20100. // "UNREACHABLE"
  20101. Code string `json:"code,omitempty"`
  20102. // Data: [Output Only] Metadata about this warning in key: value format.
  20103. // For example:
  20104. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  20105. Data []*RegionAutoscalerListWarningData `json:"data,omitempty"`
  20106. // Message: [Output Only] A human-readable description of the warning
  20107. // code.
  20108. Message string `json:"message,omitempty"`
  20109. // ForceSendFields is a list of field names (e.g. "Code") to
  20110. // unconditionally include in API requests. By default, fields with
  20111. // empty values are omitted from API requests. However, any non-pointer,
  20112. // non-interface field appearing in ForceSendFields will be sent to the
  20113. // server regardless of whether the field is empty or not. This may be
  20114. // used to include empty fields in Patch requests.
  20115. ForceSendFields []string `json:"-"`
  20116. // NullFields is a list of field names (e.g. "Code") to include in API
  20117. // requests with the JSON null value. By default, fields with empty
  20118. // values are omitted from API requests. However, any field with an
  20119. // empty value appearing in NullFields will be sent to the server as
  20120. // null. It is an error if a field in this list has a non-empty value.
  20121. // This may be used to include null fields in Patch requests.
  20122. NullFields []string `json:"-"`
  20123. }
  20124. func (s *RegionAutoscalerListWarning) MarshalJSON() ([]byte, error) {
  20125. type NoMethod RegionAutoscalerListWarning
  20126. raw := NoMethod(*s)
  20127. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20128. }
  20129. type RegionAutoscalerListWarningData struct {
  20130. // Key: [Output Only] A key that provides more detail on the warning
  20131. // being returned. For example, for warnings where there are no results
  20132. // in a list request for a particular zone, this key might be scope and
  20133. // the key value might be the zone name. Other examples might be a key
  20134. // indicating a deprecated resource and a suggested replacement, or a
  20135. // warning about invalid network settings (for example, if an instance
  20136. // attempts to perform IP forwarding but is not enabled for IP
  20137. // forwarding).
  20138. Key string `json:"key,omitempty"`
  20139. // Value: [Output Only] A warning data value corresponding to the key.
  20140. Value string `json:"value,omitempty"`
  20141. // ForceSendFields is a list of field names (e.g. "Key") to
  20142. // unconditionally include in API requests. By default, fields with
  20143. // empty values are omitted from API requests. However, any non-pointer,
  20144. // non-interface field appearing in ForceSendFields will be sent to the
  20145. // server regardless of whether the field is empty or not. This may be
  20146. // used to include empty fields in Patch requests.
  20147. ForceSendFields []string `json:"-"`
  20148. // NullFields is a list of field names (e.g. "Key") to include in API
  20149. // requests with the JSON null value. By default, fields with empty
  20150. // values are omitted from API requests. However, any field with an
  20151. // empty value appearing in NullFields will be sent to the server as
  20152. // null. It is an error if a field in this list has a non-empty value.
  20153. // This may be used to include null fields in Patch requests.
  20154. NullFields []string `json:"-"`
  20155. }
  20156. func (s *RegionAutoscalerListWarningData) MarshalJSON() ([]byte, error) {
  20157. type NoMethod RegionAutoscalerListWarningData
  20158. raw := NoMethod(*s)
  20159. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20160. }
  20161. type RegionDiskTypeList struct {
  20162. // Id: [Output Only] Unique identifier for the resource; defined by the
  20163. // server.
  20164. Id string `json:"id,omitempty"`
  20165. // Items: A list of DiskType resources.
  20166. Items []*DiskType `json:"items,omitempty"`
  20167. // Kind: [Output Only] Type of resource. Always
  20168. // compute#regionDiskTypeList for region disk types.
  20169. Kind string `json:"kind,omitempty"`
  20170. // NextPageToken: [Output Only] This token allows you to get the next
  20171. // page of results for list requests. If the number of results is larger
  20172. // than maxResults, use the nextPageToken as a value for the query
  20173. // parameter pageToken in the next list request. Subsequent list
  20174. // requests will have their own nextPageToken to continue paging through
  20175. // the results.
  20176. NextPageToken string `json:"nextPageToken,omitempty"`
  20177. // SelfLink: [Output Only] Server-defined URL for this resource.
  20178. SelfLink string `json:"selfLink,omitempty"`
  20179. // Warning: [Output Only] Informational warning message.
  20180. Warning *RegionDiskTypeListWarning `json:"warning,omitempty"`
  20181. // ServerResponse contains the HTTP response code and headers from the
  20182. // server.
  20183. googleapi.ServerResponse `json:"-"`
  20184. // ForceSendFields is a list of field names (e.g. "Id") to
  20185. // unconditionally include in API requests. By default, fields with
  20186. // empty values are omitted from API requests. However, any non-pointer,
  20187. // non-interface field appearing in ForceSendFields will be sent to the
  20188. // server regardless of whether the field is empty or not. This may be
  20189. // used to include empty fields in Patch requests.
  20190. ForceSendFields []string `json:"-"`
  20191. // NullFields is a list of field names (e.g. "Id") to include in API
  20192. // requests with the JSON null value. By default, fields with empty
  20193. // values are omitted from API requests. However, any field with an
  20194. // empty value appearing in NullFields will be sent to the server as
  20195. // null. It is an error if a field in this list has a non-empty value.
  20196. // This may be used to include null fields in Patch requests.
  20197. NullFields []string `json:"-"`
  20198. }
  20199. func (s *RegionDiskTypeList) MarshalJSON() ([]byte, error) {
  20200. type NoMethod RegionDiskTypeList
  20201. raw := NoMethod(*s)
  20202. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20203. }
  20204. // RegionDiskTypeListWarning: [Output Only] Informational warning
  20205. // message.
  20206. type RegionDiskTypeListWarning struct {
  20207. // Code: [Output Only] A warning code, if applicable. For example,
  20208. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  20209. // the response.
  20210. //
  20211. // Possible values:
  20212. // "CLEANUP_FAILED"
  20213. // "DEPRECATED_RESOURCE_USED"
  20214. // "DEPRECATED_TYPE_USED"
  20215. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  20216. // "EXPERIMENTAL_TYPE_USED"
  20217. // "EXTERNAL_API_WARNING"
  20218. // "FIELD_VALUE_OVERRIDEN"
  20219. // "INJECTED_KERNELS_DEPRECATED"
  20220. // "MISSING_TYPE_DEPENDENCY"
  20221. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  20222. // "NEXT_HOP_CANNOT_IP_FORWARD"
  20223. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  20224. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  20225. // "NEXT_HOP_NOT_RUNNING"
  20226. // "NOT_CRITICAL_ERROR"
  20227. // "NO_RESULTS_ON_PAGE"
  20228. // "REQUIRED_TOS_AGREEMENT"
  20229. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  20230. // "RESOURCE_NOT_DELETED"
  20231. // "SCHEMA_VALIDATION_IGNORED"
  20232. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  20233. // "UNDECLARED_PROPERTIES"
  20234. // "UNREACHABLE"
  20235. Code string `json:"code,omitempty"`
  20236. // Data: [Output Only] Metadata about this warning in key: value format.
  20237. // For example:
  20238. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  20239. Data []*RegionDiskTypeListWarningData `json:"data,omitempty"`
  20240. // Message: [Output Only] A human-readable description of the warning
  20241. // code.
  20242. Message string `json:"message,omitempty"`
  20243. // ForceSendFields is a list of field names (e.g. "Code") to
  20244. // unconditionally include in API requests. By default, fields with
  20245. // empty values are omitted from API requests. However, any non-pointer,
  20246. // non-interface field appearing in ForceSendFields will be sent to the
  20247. // server regardless of whether the field is empty or not. This may be
  20248. // used to include empty fields in Patch requests.
  20249. ForceSendFields []string `json:"-"`
  20250. // NullFields is a list of field names (e.g. "Code") to include in API
  20251. // requests with the JSON null value. By default, fields with empty
  20252. // values are omitted from API requests. However, any field with an
  20253. // empty value appearing in NullFields will be sent to the server as
  20254. // null. It is an error if a field in this list has a non-empty value.
  20255. // This may be used to include null fields in Patch requests.
  20256. NullFields []string `json:"-"`
  20257. }
  20258. func (s *RegionDiskTypeListWarning) MarshalJSON() ([]byte, error) {
  20259. type NoMethod RegionDiskTypeListWarning
  20260. raw := NoMethod(*s)
  20261. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20262. }
  20263. type RegionDiskTypeListWarningData struct {
  20264. // Key: [Output Only] A key that provides more detail on the warning
  20265. // being returned. For example, for warnings where there are no results
  20266. // in a list request for a particular zone, this key might be scope and
  20267. // the key value might be the zone name. Other examples might be a key
  20268. // indicating a deprecated resource and a suggested replacement, or a
  20269. // warning about invalid network settings (for example, if an instance
  20270. // attempts to perform IP forwarding but is not enabled for IP
  20271. // forwarding).
  20272. Key string `json:"key,omitempty"`
  20273. // Value: [Output Only] A warning data value corresponding to the key.
  20274. Value string `json:"value,omitempty"`
  20275. // ForceSendFields is a list of field names (e.g. "Key") to
  20276. // unconditionally include in API requests. By default, fields with
  20277. // empty values are omitted from API requests. However, any non-pointer,
  20278. // non-interface field appearing in ForceSendFields will be sent to the
  20279. // server regardless of whether the field is empty or not. This may be
  20280. // used to include empty fields in Patch requests.
  20281. ForceSendFields []string `json:"-"`
  20282. // NullFields is a list of field names (e.g. "Key") to include in API
  20283. // requests with the JSON null value. By default, fields with empty
  20284. // values are omitted from API requests. However, any field with an
  20285. // empty value appearing in NullFields will be sent to the server as
  20286. // null. It is an error if a field in this list has a non-empty value.
  20287. // This may be used to include null fields in Patch requests.
  20288. NullFields []string `json:"-"`
  20289. }
  20290. func (s *RegionDiskTypeListWarningData) MarshalJSON() ([]byte, error) {
  20291. type NoMethod RegionDiskTypeListWarningData
  20292. raw := NoMethod(*s)
  20293. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20294. }
  20295. type RegionDisksResizeRequest struct {
  20296. // SizeGb: The new size of the regional persistent disk, which is
  20297. // specified in GB.
  20298. SizeGb int64 `json:"sizeGb,omitempty,string"`
  20299. // ForceSendFields is a list of field names (e.g. "SizeGb") to
  20300. // unconditionally include in API requests. By default, fields with
  20301. // empty values are omitted from API requests. However, any non-pointer,
  20302. // non-interface field appearing in ForceSendFields will be sent to the
  20303. // server regardless of whether the field is empty or not. This may be
  20304. // used to include empty fields in Patch requests.
  20305. ForceSendFields []string `json:"-"`
  20306. // NullFields is a list of field names (e.g. "SizeGb") to include in API
  20307. // requests with the JSON null value. By default, fields with empty
  20308. // values are omitted from API requests. However, any field with an
  20309. // empty value appearing in NullFields will be sent to the server as
  20310. // null. It is an error if a field in this list has a non-empty value.
  20311. // This may be used to include null fields in Patch requests.
  20312. NullFields []string `json:"-"`
  20313. }
  20314. func (s *RegionDisksResizeRequest) MarshalJSON() ([]byte, error) {
  20315. type NoMethod RegionDisksResizeRequest
  20316. raw := NoMethod(*s)
  20317. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20318. }
  20319. // RegionInstanceGroupList: Contains a list of InstanceGroup resources.
  20320. type RegionInstanceGroupList struct {
  20321. // Id: [Output Only] Unique identifier for the resource; defined by the
  20322. // server.
  20323. Id string `json:"id,omitempty"`
  20324. // Items: A list of InstanceGroup resources.
  20325. Items []*InstanceGroup `json:"items,omitempty"`
  20326. // Kind: The resource type.
  20327. Kind string `json:"kind,omitempty"`
  20328. // NextPageToken: [Output Only] This token allows you to get the next
  20329. // page of results for list requests. If the number of results is larger
  20330. // than maxResults, use the nextPageToken as a value for the query
  20331. // parameter pageToken in the next list request. Subsequent list
  20332. // requests will have their own nextPageToken to continue paging through
  20333. // the results.
  20334. NextPageToken string `json:"nextPageToken,omitempty"`
  20335. // SelfLink: [Output Only] Server-defined URL for this resource.
  20336. SelfLink string `json:"selfLink,omitempty"`
  20337. // Warning: [Output Only] Informational warning message.
  20338. Warning *RegionInstanceGroupListWarning `json:"warning,omitempty"`
  20339. // ServerResponse contains the HTTP response code and headers from the
  20340. // server.
  20341. googleapi.ServerResponse `json:"-"`
  20342. // ForceSendFields is a list of field names (e.g. "Id") to
  20343. // unconditionally include in API requests. By default, fields with
  20344. // empty values are omitted from API requests. However, any non-pointer,
  20345. // non-interface field appearing in ForceSendFields will be sent to the
  20346. // server regardless of whether the field is empty or not. This may be
  20347. // used to include empty fields in Patch requests.
  20348. ForceSendFields []string `json:"-"`
  20349. // NullFields is a list of field names (e.g. "Id") to include in API
  20350. // requests with the JSON null value. By default, fields with empty
  20351. // values are omitted from API requests. However, any field with an
  20352. // empty value appearing in NullFields will be sent to the server as
  20353. // null. It is an error if a field in this list has a non-empty value.
  20354. // This may be used to include null fields in Patch requests.
  20355. NullFields []string `json:"-"`
  20356. }
  20357. func (s *RegionInstanceGroupList) MarshalJSON() ([]byte, error) {
  20358. type NoMethod RegionInstanceGroupList
  20359. raw := NoMethod(*s)
  20360. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20361. }
  20362. // RegionInstanceGroupListWarning: [Output Only] Informational warning
  20363. // message.
  20364. type RegionInstanceGroupListWarning struct {
  20365. // Code: [Output Only] A warning code, if applicable. For example,
  20366. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  20367. // the response.
  20368. //
  20369. // Possible values:
  20370. // "CLEANUP_FAILED"
  20371. // "DEPRECATED_RESOURCE_USED"
  20372. // "DEPRECATED_TYPE_USED"
  20373. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  20374. // "EXPERIMENTAL_TYPE_USED"
  20375. // "EXTERNAL_API_WARNING"
  20376. // "FIELD_VALUE_OVERRIDEN"
  20377. // "INJECTED_KERNELS_DEPRECATED"
  20378. // "MISSING_TYPE_DEPENDENCY"
  20379. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  20380. // "NEXT_HOP_CANNOT_IP_FORWARD"
  20381. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  20382. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  20383. // "NEXT_HOP_NOT_RUNNING"
  20384. // "NOT_CRITICAL_ERROR"
  20385. // "NO_RESULTS_ON_PAGE"
  20386. // "REQUIRED_TOS_AGREEMENT"
  20387. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  20388. // "RESOURCE_NOT_DELETED"
  20389. // "SCHEMA_VALIDATION_IGNORED"
  20390. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  20391. // "UNDECLARED_PROPERTIES"
  20392. // "UNREACHABLE"
  20393. Code string `json:"code,omitempty"`
  20394. // Data: [Output Only] Metadata about this warning in key: value format.
  20395. // For example:
  20396. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  20397. Data []*RegionInstanceGroupListWarningData `json:"data,omitempty"`
  20398. // Message: [Output Only] A human-readable description of the warning
  20399. // code.
  20400. Message string `json:"message,omitempty"`
  20401. // ForceSendFields is a list of field names (e.g. "Code") to
  20402. // unconditionally include in API requests. By default, fields with
  20403. // empty values are omitted from API requests. However, any non-pointer,
  20404. // non-interface field appearing in ForceSendFields will be sent to the
  20405. // server regardless of whether the field is empty or not. This may be
  20406. // used to include empty fields in Patch requests.
  20407. ForceSendFields []string `json:"-"`
  20408. // NullFields is a list of field names (e.g. "Code") to include in API
  20409. // requests with the JSON null value. By default, fields with empty
  20410. // values are omitted from API requests. However, any field with an
  20411. // empty value appearing in NullFields will be sent to the server as
  20412. // null. It is an error if a field in this list has a non-empty value.
  20413. // This may be used to include null fields in Patch requests.
  20414. NullFields []string `json:"-"`
  20415. }
  20416. func (s *RegionInstanceGroupListWarning) MarshalJSON() ([]byte, error) {
  20417. type NoMethod RegionInstanceGroupListWarning
  20418. raw := NoMethod(*s)
  20419. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20420. }
  20421. type RegionInstanceGroupListWarningData struct {
  20422. // Key: [Output Only] A key that provides more detail on the warning
  20423. // being returned. For example, for warnings where there are no results
  20424. // in a list request for a particular zone, this key might be scope and
  20425. // the key value might be the zone name. Other examples might be a key
  20426. // indicating a deprecated resource and a suggested replacement, or a
  20427. // warning about invalid network settings (for example, if an instance
  20428. // attempts to perform IP forwarding but is not enabled for IP
  20429. // forwarding).
  20430. Key string `json:"key,omitempty"`
  20431. // Value: [Output Only] A warning data value corresponding to the key.
  20432. Value string `json:"value,omitempty"`
  20433. // ForceSendFields is a list of field names (e.g. "Key") to
  20434. // unconditionally include in API requests. By default, fields with
  20435. // empty values are omitted from API requests. However, any non-pointer,
  20436. // non-interface field appearing in ForceSendFields will be sent to the
  20437. // server regardless of whether the field is empty or not. This may be
  20438. // used to include empty fields in Patch requests.
  20439. ForceSendFields []string `json:"-"`
  20440. // NullFields is a list of field names (e.g. "Key") to include in API
  20441. // requests with the JSON null value. By default, fields with empty
  20442. // values are omitted from API requests. However, any field with an
  20443. // empty value appearing in NullFields will be sent to the server as
  20444. // null. It is an error if a field in this list has a non-empty value.
  20445. // This may be used to include null fields in Patch requests.
  20446. NullFields []string `json:"-"`
  20447. }
  20448. func (s *RegionInstanceGroupListWarningData) MarshalJSON() ([]byte, error) {
  20449. type NoMethod RegionInstanceGroupListWarningData
  20450. raw := NoMethod(*s)
  20451. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20452. }
  20453. // RegionInstanceGroupManagerDeleteInstanceConfigReq:
  20454. // RegionInstanceGroupManagers.deletePerInstanceConfigs
  20455. type RegionInstanceGroupManagerDeleteInstanceConfigReq struct {
  20456. // Instances: The list of instances for which we want to delete
  20457. // per-instance configs on this managed instance group.
  20458. Instances []string `json:"instances,omitempty"`
  20459. // ForceSendFields is a list of field names (e.g. "Instances") to
  20460. // unconditionally include in API requests. By default, fields with
  20461. // empty values are omitted from API requests. However, any non-pointer,
  20462. // non-interface field appearing in ForceSendFields will be sent to the
  20463. // server regardless of whether the field is empty or not. This may be
  20464. // used to include empty fields in Patch requests.
  20465. ForceSendFields []string `json:"-"`
  20466. // NullFields is a list of field names (e.g. "Instances") to include in
  20467. // API requests with the JSON null value. By default, fields with empty
  20468. // values are omitted from API requests. However, any field with an
  20469. // empty value appearing in NullFields will be sent to the server as
  20470. // null. It is an error if a field in this list has a non-empty value.
  20471. // This may be used to include null fields in Patch requests.
  20472. NullFields []string `json:"-"`
  20473. }
  20474. func (s *RegionInstanceGroupManagerDeleteInstanceConfigReq) MarshalJSON() ([]byte, error) {
  20475. type NoMethod RegionInstanceGroupManagerDeleteInstanceConfigReq
  20476. raw := NoMethod(*s)
  20477. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20478. }
  20479. // RegionInstanceGroupManagerList: Contains a list of managed instance
  20480. // groups.
  20481. type RegionInstanceGroupManagerList struct {
  20482. // Id: [Output Only] Unique identifier for the resource; defined by the
  20483. // server.
  20484. Id string `json:"id,omitempty"`
  20485. // Items: A list of InstanceGroupManager resources.
  20486. Items []*InstanceGroupManager `json:"items,omitempty"`
  20487. // Kind: [Output Only] The resource type, which is always
  20488. // compute#instanceGroupManagerList for a list of managed instance
  20489. // groups that exist in th regional scope.
  20490. Kind string `json:"kind,omitempty"`
  20491. // NextPageToken: [Output Only] This token allows you to get the next
  20492. // page of results for list requests. If the number of results is larger
  20493. // than maxResults, use the nextPageToken as a value for the query
  20494. // parameter pageToken in the next list request. Subsequent list
  20495. // requests will have their own nextPageToken to continue paging through
  20496. // the results.
  20497. NextPageToken string `json:"nextPageToken,omitempty"`
  20498. // SelfLink: [Output Only] Server-defined URL for this resource.
  20499. SelfLink string `json:"selfLink,omitempty"`
  20500. // Warning: [Output Only] Informational warning message.
  20501. Warning *RegionInstanceGroupManagerListWarning `json:"warning,omitempty"`
  20502. // ServerResponse contains the HTTP response code and headers from the
  20503. // server.
  20504. googleapi.ServerResponse `json:"-"`
  20505. // ForceSendFields is a list of field names (e.g. "Id") to
  20506. // unconditionally include in API requests. By default, fields with
  20507. // empty values are omitted from API requests. However, any non-pointer,
  20508. // non-interface field appearing in ForceSendFields will be sent to the
  20509. // server regardless of whether the field is empty or not. This may be
  20510. // used to include empty fields in Patch requests.
  20511. ForceSendFields []string `json:"-"`
  20512. // NullFields is a list of field names (e.g. "Id") to include in API
  20513. // requests with the JSON null value. By default, fields with empty
  20514. // values are omitted from API requests. However, any field with an
  20515. // empty value appearing in NullFields will be sent to the server as
  20516. // null. It is an error if a field in this list has a non-empty value.
  20517. // This may be used to include null fields in Patch requests.
  20518. NullFields []string `json:"-"`
  20519. }
  20520. func (s *RegionInstanceGroupManagerList) MarshalJSON() ([]byte, error) {
  20521. type NoMethod RegionInstanceGroupManagerList
  20522. raw := NoMethod(*s)
  20523. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20524. }
  20525. // RegionInstanceGroupManagerListWarning: [Output Only] Informational
  20526. // warning message.
  20527. type RegionInstanceGroupManagerListWarning struct {
  20528. // Code: [Output Only] A warning code, if applicable. For example,
  20529. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  20530. // the response.
  20531. //
  20532. // Possible values:
  20533. // "CLEANUP_FAILED"
  20534. // "DEPRECATED_RESOURCE_USED"
  20535. // "DEPRECATED_TYPE_USED"
  20536. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  20537. // "EXPERIMENTAL_TYPE_USED"
  20538. // "EXTERNAL_API_WARNING"
  20539. // "FIELD_VALUE_OVERRIDEN"
  20540. // "INJECTED_KERNELS_DEPRECATED"
  20541. // "MISSING_TYPE_DEPENDENCY"
  20542. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  20543. // "NEXT_HOP_CANNOT_IP_FORWARD"
  20544. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  20545. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  20546. // "NEXT_HOP_NOT_RUNNING"
  20547. // "NOT_CRITICAL_ERROR"
  20548. // "NO_RESULTS_ON_PAGE"
  20549. // "REQUIRED_TOS_AGREEMENT"
  20550. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  20551. // "RESOURCE_NOT_DELETED"
  20552. // "SCHEMA_VALIDATION_IGNORED"
  20553. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  20554. // "UNDECLARED_PROPERTIES"
  20555. // "UNREACHABLE"
  20556. Code string `json:"code,omitempty"`
  20557. // Data: [Output Only] Metadata about this warning in key: value format.
  20558. // For example:
  20559. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  20560. Data []*RegionInstanceGroupManagerListWarningData `json:"data,omitempty"`
  20561. // Message: [Output Only] A human-readable description of the warning
  20562. // code.
  20563. Message string `json:"message,omitempty"`
  20564. // ForceSendFields is a list of field names (e.g. "Code") to
  20565. // unconditionally include in API requests. By default, fields with
  20566. // empty values are omitted from API requests. However, any non-pointer,
  20567. // non-interface field appearing in ForceSendFields will be sent to the
  20568. // server regardless of whether the field is empty or not. This may be
  20569. // used to include empty fields in Patch requests.
  20570. ForceSendFields []string `json:"-"`
  20571. // NullFields is a list of field names (e.g. "Code") to include in API
  20572. // requests with the JSON null value. By default, fields with empty
  20573. // values are omitted from API requests. However, any field with an
  20574. // empty value appearing in NullFields will be sent to the server as
  20575. // null. It is an error if a field in this list has a non-empty value.
  20576. // This may be used to include null fields in Patch requests.
  20577. NullFields []string `json:"-"`
  20578. }
  20579. func (s *RegionInstanceGroupManagerListWarning) MarshalJSON() ([]byte, error) {
  20580. type NoMethod RegionInstanceGroupManagerListWarning
  20581. raw := NoMethod(*s)
  20582. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20583. }
  20584. type RegionInstanceGroupManagerListWarningData struct {
  20585. // Key: [Output Only] A key that provides more detail on the warning
  20586. // being returned. For example, for warnings where there are no results
  20587. // in a list request for a particular zone, this key might be scope and
  20588. // the key value might be the zone name. Other examples might be a key
  20589. // indicating a deprecated resource and a suggested replacement, or a
  20590. // warning about invalid network settings (for example, if an instance
  20591. // attempts to perform IP forwarding but is not enabled for IP
  20592. // forwarding).
  20593. Key string `json:"key,omitempty"`
  20594. // Value: [Output Only] A warning data value corresponding to the key.
  20595. Value string `json:"value,omitempty"`
  20596. // ForceSendFields is a list of field names (e.g. "Key") to
  20597. // unconditionally include in API requests. By default, fields with
  20598. // empty values are omitted from API requests. However, any non-pointer,
  20599. // non-interface field appearing in ForceSendFields will be sent to the
  20600. // server regardless of whether the field is empty or not. This may be
  20601. // used to include empty fields in Patch requests.
  20602. ForceSendFields []string `json:"-"`
  20603. // NullFields is a list of field names (e.g. "Key") to include in API
  20604. // requests with the JSON null value. By default, fields with empty
  20605. // values are omitted from API requests. However, any field with an
  20606. // empty value appearing in NullFields will be sent to the server as
  20607. // null. It is an error if a field in this list has a non-empty value.
  20608. // This may be used to include null fields in Patch requests.
  20609. NullFields []string `json:"-"`
  20610. }
  20611. func (s *RegionInstanceGroupManagerListWarningData) MarshalJSON() ([]byte, error) {
  20612. type NoMethod RegionInstanceGroupManagerListWarningData
  20613. raw := NoMethod(*s)
  20614. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20615. }
  20616. // RegionInstanceGroupManagerUpdateInstanceConfigReq:
  20617. // RegionInstanceGroupManagers.updatePerInstanceConfigs
  20618. type RegionInstanceGroupManagerUpdateInstanceConfigReq struct {
  20619. // PerInstanceConfigs: The list of per-instance configs to insert or
  20620. // patch on this managed instance group.
  20621. PerInstanceConfigs []*PerInstanceConfig `json:"perInstanceConfigs,omitempty"`
  20622. // ForceSendFields is a list of field names (e.g. "PerInstanceConfigs")
  20623. // to unconditionally include in API requests. By default, fields with
  20624. // empty values are omitted from API requests. However, any non-pointer,
  20625. // non-interface field appearing in ForceSendFields will be sent to the
  20626. // server regardless of whether the field is empty or not. This may be
  20627. // used to include empty fields in Patch requests.
  20628. ForceSendFields []string `json:"-"`
  20629. // NullFields is a list of field names (e.g. "PerInstanceConfigs") to
  20630. // include in API requests with the JSON null value. By default, fields
  20631. // with empty values are omitted from API requests. However, any field
  20632. // with an empty value appearing in NullFields will be sent to the
  20633. // server as null. It is an error if a field in this list has a
  20634. // non-empty value. This may be used to include null fields in Patch
  20635. // requests.
  20636. NullFields []string `json:"-"`
  20637. }
  20638. func (s *RegionInstanceGroupManagerUpdateInstanceConfigReq) MarshalJSON() ([]byte, error) {
  20639. type NoMethod RegionInstanceGroupManagerUpdateInstanceConfigReq
  20640. raw := NoMethod(*s)
  20641. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20642. }
  20643. type RegionInstanceGroupManagersAbandonInstancesRequest struct {
  20644. // Instances: The URLs of one or more instances to abandon. This can be
  20645. // a full URL or a partial URL, such as
  20646. // zones/[ZONE]/instances/[INSTANCE_NAME].
  20647. Instances []string `json:"instances,omitempty"`
  20648. // ForceSendFields is a list of field names (e.g. "Instances") to
  20649. // unconditionally include in API requests. By default, fields with
  20650. // empty values are omitted from API requests. However, any non-pointer,
  20651. // non-interface field appearing in ForceSendFields will be sent to the
  20652. // server regardless of whether the field is empty or not. This may be
  20653. // used to include empty fields in Patch requests.
  20654. ForceSendFields []string `json:"-"`
  20655. // NullFields is a list of field names (e.g. "Instances") to include in
  20656. // API requests with the JSON null value. By default, fields with empty
  20657. // values are omitted from API requests. However, any field with an
  20658. // empty value appearing in NullFields will be sent to the server as
  20659. // null. It is an error if a field in this list has a non-empty value.
  20660. // This may be used to include null fields in Patch requests.
  20661. NullFields []string `json:"-"`
  20662. }
  20663. func (s *RegionInstanceGroupManagersAbandonInstancesRequest) MarshalJSON() ([]byte, error) {
  20664. type NoMethod RegionInstanceGroupManagersAbandonInstancesRequest
  20665. raw := NoMethod(*s)
  20666. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20667. }
  20668. // RegionInstanceGroupManagersApplyUpdatesRequest:
  20669. // InstanceGroupManagers.applyUpdatesToInstances
  20670. type RegionInstanceGroupManagersApplyUpdatesRequest struct {
  20671. // Instances: The list of instances for which we want to apply changes
  20672. // on this managed instance group.
  20673. Instances []string `json:"instances,omitempty"`
  20674. // MaximalAction: The maximal action that should be perfomed on the
  20675. // instances. By default REPLACE.
  20676. //
  20677. // Possible values:
  20678. // "NONE"
  20679. // "REFRESH"
  20680. // "REPLACE"
  20681. // "RESTART"
  20682. MaximalAction string `json:"maximalAction,omitempty"`
  20683. // MinimalAction: The minimal action that should be perfomed on the
  20684. // instances. By default NONE.
  20685. //
  20686. // Possible values:
  20687. // "NONE"
  20688. // "REFRESH"
  20689. // "REPLACE"
  20690. // "RESTART"
  20691. MinimalAction string `json:"minimalAction,omitempty"`
  20692. // ForceSendFields is a list of field names (e.g. "Instances") to
  20693. // unconditionally include in API requests. By default, fields with
  20694. // empty values are omitted from API requests. However, any non-pointer,
  20695. // non-interface field appearing in ForceSendFields will be sent to the
  20696. // server regardless of whether the field is empty or not. This may be
  20697. // used to include empty fields in Patch requests.
  20698. ForceSendFields []string `json:"-"`
  20699. // NullFields is a list of field names (e.g. "Instances") to include in
  20700. // API requests with the JSON null value. By default, fields with empty
  20701. // values are omitted from API requests. However, any field with an
  20702. // empty value appearing in NullFields will be sent to the server as
  20703. // null. It is an error if a field in this list has a non-empty value.
  20704. // This may be used to include null fields in Patch requests.
  20705. NullFields []string `json:"-"`
  20706. }
  20707. func (s *RegionInstanceGroupManagersApplyUpdatesRequest) MarshalJSON() ([]byte, error) {
  20708. type NoMethod RegionInstanceGroupManagersApplyUpdatesRequest
  20709. raw := NoMethod(*s)
  20710. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20711. }
  20712. type RegionInstanceGroupManagersDeleteInstancesRequest struct {
  20713. // Instances: The URLs of one or more instances to delete. This can be a
  20714. // full URL or a partial URL, such as
  20715. // zones/[ZONE]/instances/[INSTANCE_NAME].
  20716. Instances []string `json:"instances,omitempty"`
  20717. // ForceSendFields is a list of field names (e.g. "Instances") to
  20718. // unconditionally include in API requests. By default, fields with
  20719. // empty values are omitted from API requests. However, any non-pointer,
  20720. // non-interface field appearing in ForceSendFields will be sent to the
  20721. // server regardless of whether the field is empty or not. This may be
  20722. // used to include empty fields in Patch requests.
  20723. ForceSendFields []string `json:"-"`
  20724. // NullFields is a list of field names (e.g. "Instances") to include in
  20725. // API requests with the JSON null value. By default, fields with empty
  20726. // values are omitted from API requests. However, any field with an
  20727. // empty value appearing in NullFields will be sent to the server as
  20728. // null. It is an error if a field in this list has a non-empty value.
  20729. // This may be used to include null fields in Patch requests.
  20730. NullFields []string `json:"-"`
  20731. }
  20732. func (s *RegionInstanceGroupManagersDeleteInstancesRequest) MarshalJSON() ([]byte, error) {
  20733. type NoMethod RegionInstanceGroupManagersDeleteInstancesRequest
  20734. raw := NoMethod(*s)
  20735. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20736. }
  20737. type RegionInstanceGroupManagersListInstanceConfigsResp struct {
  20738. // Items: [Output Only] The list of PerInstanceConfig.
  20739. Items []*PerInstanceConfig `json:"items,omitempty"`
  20740. // NextPageToken: [Output Only] This token allows you to get the next
  20741. // page of results for list requests. If the number of results is larger
  20742. // than maxResults, use the nextPageToken as a value for the query
  20743. // parameter pageToken in the next list request. Subsequent list
  20744. // requests will have their own nextPageToken to continue paging through
  20745. // the results.
  20746. NextPageToken string `json:"nextPageToken,omitempty"`
  20747. // Warning: [Output Only] Informational warning message.
  20748. Warning *RegionInstanceGroupManagersListInstanceConfigsRespWarning `json:"warning,omitempty"`
  20749. // ServerResponse contains the HTTP response code and headers from the
  20750. // server.
  20751. googleapi.ServerResponse `json:"-"`
  20752. // ForceSendFields is a list of field names (e.g. "Items") to
  20753. // unconditionally include in API requests. By default, fields with
  20754. // empty values are omitted from API requests. However, any non-pointer,
  20755. // non-interface field appearing in ForceSendFields will be sent to the
  20756. // server regardless of whether the field is empty or not. This may be
  20757. // used to include empty fields in Patch requests.
  20758. ForceSendFields []string `json:"-"`
  20759. // NullFields is a list of field names (e.g. "Items") to include in API
  20760. // requests with the JSON null value. By default, fields with empty
  20761. // values are omitted from API requests. However, any field with an
  20762. // empty value appearing in NullFields will be sent to the server as
  20763. // null. It is an error if a field in this list has a non-empty value.
  20764. // This may be used to include null fields in Patch requests.
  20765. NullFields []string `json:"-"`
  20766. }
  20767. func (s *RegionInstanceGroupManagersListInstanceConfigsResp) MarshalJSON() ([]byte, error) {
  20768. type NoMethod RegionInstanceGroupManagersListInstanceConfigsResp
  20769. raw := NoMethod(*s)
  20770. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20771. }
  20772. // RegionInstanceGroupManagersListInstanceConfigsRespWarning: [Output
  20773. // Only] Informational warning message.
  20774. type RegionInstanceGroupManagersListInstanceConfigsRespWarning struct {
  20775. // Code: [Output Only] A warning code, if applicable. For example,
  20776. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  20777. // the response.
  20778. //
  20779. // Possible values:
  20780. // "CLEANUP_FAILED"
  20781. // "DEPRECATED_RESOURCE_USED"
  20782. // "DEPRECATED_TYPE_USED"
  20783. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  20784. // "EXPERIMENTAL_TYPE_USED"
  20785. // "EXTERNAL_API_WARNING"
  20786. // "FIELD_VALUE_OVERRIDEN"
  20787. // "INJECTED_KERNELS_DEPRECATED"
  20788. // "MISSING_TYPE_DEPENDENCY"
  20789. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  20790. // "NEXT_HOP_CANNOT_IP_FORWARD"
  20791. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  20792. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  20793. // "NEXT_HOP_NOT_RUNNING"
  20794. // "NOT_CRITICAL_ERROR"
  20795. // "NO_RESULTS_ON_PAGE"
  20796. // "REQUIRED_TOS_AGREEMENT"
  20797. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  20798. // "RESOURCE_NOT_DELETED"
  20799. // "SCHEMA_VALIDATION_IGNORED"
  20800. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  20801. // "UNDECLARED_PROPERTIES"
  20802. // "UNREACHABLE"
  20803. Code string `json:"code,omitempty"`
  20804. // Data: [Output Only] Metadata about this warning in key: value format.
  20805. // For example:
  20806. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  20807. Data []*RegionInstanceGroupManagersListInstanceConfigsRespWarningData `json:"data,omitempty"`
  20808. // Message: [Output Only] A human-readable description of the warning
  20809. // code.
  20810. Message string `json:"message,omitempty"`
  20811. // ForceSendFields is a list of field names (e.g. "Code") to
  20812. // unconditionally include in API requests. By default, fields with
  20813. // empty values are omitted from API requests. However, any non-pointer,
  20814. // non-interface field appearing in ForceSendFields will be sent to the
  20815. // server regardless of whether the field is empty or not. This may be
  20816. // used to include empty fields in Patch requests.
  20817. ForceSendFields []string `json:"-"`
  20818. // NullFields is a list of field names (e.g. "Code") to include in API
  20819. // requests with the JSON null value. By default, fields with empty
  20820. // values are omitted from API requests. However, any field with an
  20821. // empty value appearing in NullFields will be sent to the server as
  20822. // null. It is an error if a field in this list has a non-empty value.
  20823. // This may be used to include null fields in Patch requests.
  20824. NullFields []string `json:"-"`
  20825. }
  20826. func (s *RegionInstanceGroupManagersListInstanceConfigsRespWarning) MarshalJSON() ([]byte, error) {
  20827. type NoMethod RegionInstanceGroupManagersListInstanceConfigsRespWarning
  20828. raw := NoMethod(*s)
  20829. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20830. }
  20831. type RegionInstanceGroupManagersListInstanceConfigsRespWarningData struct {
  20832. // Key: [Output Only] A key that provides more detail on the warning
  20833. // being returned. For example, for warnings where there are no results
  20834. // in a list request for a particular zone, this key might be scope and
  20835. // the key value might be the zone name. Other examples might be a key
  20836. // indicating a deprecated resource and a suggested replacement, or a
  20837. // warning about invalid network settings (for example, if an instance
  20838. // attempts to perform IP forwarding but is not enabled for IP
  20839. // forwarding).
  20840. Key string `json:"key,omitempty"`
  20841. // Value: [Output Only] A warning data value corresponding to the key.
  20842. Value string `json:"value,omitempty"`
  20843. // ForceSendFields is a list of field names (e.g. "Key") to
  20844. // unconditionally include in API requests. By default, fields with
  20845. // empty values are omitted from API requests. However, any non-pointer,
  20846. // non-interface field appearing in ForceSendFields will be sent to the
  20847. // server regardless of whether the field is empty or not. This may be
  20848. // used to include empty fields in Patch requests.
  20849. ForceSendFields []string `json:"-"`
  20850. // NullFields is a list of field names (e.g. "Key") to include in API
  20851. // requests with the JSON null value. By default, fields with empty
  20852. // values are omitted from API requests. However, any field with an
  20853. // empty value appearing in NullFields will be sent to the server as
  20854. // null. It is an error if a field in this list has a non-empty value.
  20855. // This may be used to include null fields in Patch requests.
  20856. NullFields []string `json:"-"`
  20857. }
  20858. func (s *RegionInstanceGroupManagersListInstanceConfigsRespWarningData) MarshalJSON() ([]byte, error) {
  20859. type NoMethod RegionInstanceGroupManagersListInstanceConfigsRespWarningData
  20860. raw := NoMethod(*s)
  20861. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20862. }
  20863. type RegionInstanceGroupManagersListInstancesResponse struct {
  20864. // ManagedInstances: A list of managed instances.
  20865. ManagedInstances []*ManagedInstance `json:"managedInstances,omitempty"`
  20866. // NextPageToken: [Output Only] This token allows you to get the next
  20867. // page of results for list requests. If the number of results is larger
  20868. // than maxResults, use the nextPageToken as a value for the query
  20869. // parameter pageToken in the next list request. Subsequent list
  20870. // requests will have their own nextPageToken to continue paging through
  20871. // the results.
  20872. NextPageToken string `json:"nextPageToken,omitempty"`
  20873. // ServerResponse contains the HTTP response code and headers from the
  20874. // server.
  20875. googleapi.ServerResponse `json:"-"`
  20876. // ForceSendFields is a list of field names (e.g. "ManagedInstances") to
  20877. // unconditionally include in API requests. By default, fields with
  20878. // empty values are omitted from API requests. However, any non-pointer,
  20879. // non-interface field appearing in ForceSendFields will be sent to the
  20880. // server regardless of whether the field is empty or not. This may be
  20881. // used to include empty fields in Patch requests.
  20882. ForceSendFields []string `json:"-"`
  20883. // NullFields is a list of field names (e.g. "ManagedInstances") to
  20884. // include in API requests with the JSON null value. By default, fields
  20885. // with empty values are omitted from API requests. However, any field
  20886. // with an empty value appearing in NullFields will be sent to the
  20887. // server as null. It is an error if a field in this list has a
  20888. // non-empty value. This may be used to include null fields in Patch
  20889. // requests.
  20890. NullFields []string `json:"-"`
  20891. }
  20892. func (s *RegionInstanceGroupManagersListInstancesResponse) MarshalJSON() ([]byte, error) {
  20893. type NoMethod RegionInstanceGroupManagersListInstancesResponse
  20894. raw := NoMethod(*s)
  20895. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20896. }
  20897. type RegionInstanceGroupManagersRecreateRequest struct {
  20898. // Instances: The URLs of one or more instances to recreate. This can be
  20899. // a full URL or a partial URL, such as
  20900. // zones/[ZONE]/instances/[INSTANCE_NAME].
  20901. Instances []string `json:"instances,omitempty"`
  20902. // ForceSendFields is a list of field names (e.g. "Instances") to
  20903. // unconditionally include in API requests. By default, fields with
  20904. // empty values are omitted from API requests. However, any non-pointer,
  20905. // non-interface field appearing in ForceSendFields will be sent to the
  20906. // server regardless of whether the field is empty or not. This may be
  20907. // used to include empty fields in Patch requests.
  20908. ForceSendFields []string `json:"-"`
  20909. // NullFields is a list of field names (e.g. "Instances") to include in
  20910. // API requests with the JSON null value. By default, fields with empty
  20911. // values are omitted from API requests. However, any field with an
  20912. // empty value appearing in NullFields will be sent to the server as
  20913. // null. It is an error if a field in this list has a non-empty value.
  20914. // This may be used to include null fields in Patch requests.
  20915. NullFields []string `json:"-"`
  20916. }
  20917. func (s *RegionInstanceGroupManagersRecreateRequest) MarshalJSON() ([]byte, error) {
  20918. type NoMethod RegionInstanceGroupManagersRecreateRequest
  20919. raw := NoMethod(*s)
  20920. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20921. }
  20922. type RegionInstanceGroupManagersSetAutoHealingRequest struct {
  20923. AutoHealingPolicies []*InstanceGroupManagerAutoHealingPolicy `json:"autoHealingPolicies,omitempty"`
  20924. // ForceSendFields is a list of field names (e.g. "AutoHealingPolicies")
  20925. // to unconditionally include in API requests. By default, fields with
  20926. // empty values are omitted from API requests. However, any non-pointer,
  20927. // non-interface field appearing in ForceSendFields will be sent to the
  20928. // server regardless of whether the field is empty or not. This may be
  20929. // used to include empty fields in Patch requests.
  20930. ForceSendFields []string `json:"-"`
  20931. // NullFields is a list of field names (e.g. "AutoHealingPolicies") to
  20932. // include in API requests with the JSON null value. By default, fields
  20933. // with empty values are omitted from API requests. However, any field
  20934. // with an empty value appearing in NullFields will be sent to the
  20935. // server as null. It is an error if a field in this list has a
  20936. // non-empty value. This may be used to include null fields in Patch
  20937. // requests.
  20938. NullFields []string `json:"-"`
  20939. }
  20940. func (s *RegionInstanceGroupManagersSetAutoHealingRequest) MarshalJSON() ([]byte, error) {
  20941. type NoMethod RegionInstanceGroupManagersSetAutoHealingRequest
  20942. raw := NoMethod(*s)
  20943. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20944. }
  20945. type RegionInstanceGroupManagersSetTargetPoolsRequest struct {
  20946. // Fingerprint: Fingerprint of the target pools information, which is a
  20947. // hash of the contents. This field is used for optimistic locking when
  20948. // you update the target pool entries. This field is optional.
  20949. Fingerprint string `json:"fingerprint,omitempty"`
  20950. // TargetPools: The URL of all TargetPool resources to which instances
  20951. // in the instanceGroup field are added. The target pools automatically
  20952. // apply to all of the instances in the managed instance group.
  20953. TargetPools []string `json:"targetPools,omitempty"`
  20954. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  20955. // unconditionally include in API requests. By default, fields with
  20956. // empty values are omitted from API requests. However, any non-pointer,
  20957. // non-interface field appearing in ForceSendFields will be sent to the
  20958. // server regardless of whether the field is empty or not. This may be
  20959. // used to include empty fields in Patch requests.
  20960. ForceSendFields []string `json:"-"`
  20961. // NullFields is a list of field names (e.g. "Fingerprint") to include
  20962. // in API requests with the JSON null value. By default, fields with
  20963. // empty values are omitted from API requests. However, any field with
  20964. // an empty value appearing in NullFields will be sent to the server as
  20965. // null. It is an error if a field in this list has a non-empty value.
  20966. // This may be used to include null fields in Patch requests.
  20967. NullFields []string `json:"-"`
  20968. }
  20969. func (s *RegionInstanceGroupManagersSetTargetPoolsRequest) MarshalJSON() ([]byte, error) {
  20970. type NoMethod RegionInstanceGroupManagersSetTargetPoolsRequest
  20971. raw := NoMethod(*s)
  20972. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20973. }
  20974. type RegionInstanceGroupManagersSetTemplateRequest struct {
  20975. // InstanceTemplate: URL of the InstanceTemplate resource from which all
  20976. // new instances will be created.
  20977. InstanceTemplate string `json:"instanceTemplate,omitempty"`
  20978. // ForceSendFields is a list of field names (e.g. "InstanceTemplate") to
  20979. // unconditionally include in API requests. By default, fields with
  20980. // empty values are omitted from API requests. However, any non-pointer,
  20981. // non-interface field appearing in ForceSendFields will be sent to the
  20982. // server regardless of whether the field is empty or not. This may be
  20983. // used to include empty fields in Patch requests.
  20984. ForceSendFields []string `json:"-"`
  20985. // NullFields is a list of field names (e.g. "InstanceTemplate") to
  20986. // include in API requests with the JSON null value. By default, fields
  20987. // with empty values are omitted from API requests. However, any field
  20988. // with an empty value appearing in NullFields will be sent to the
  20989. // server as null. It is an error if a field in this list has a
  20990. // non-empty value. This may be used to include null fields in Patch
  20991. // requests.
  20992. NullFields []string `json:"-"`
  20993. }
  20994. func (s *RegionInstanceGroupManagersSetTemplateRequest) MarshalJSON() ([]byte, error) {
  20995. type NoMethod RegionInstanceGroupManagersSetTemplateRequest
  20996. raw := NoMethod(*s)
  20997. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20998. }
  20999. type RegionInstanceGroupsListInstances struct {
  21000. // Id: [Output Only] Unique identifier for the resource; defined by the
  21001. // server.
  21002. Id string `json:"id,omitempty"`
  21003. // Items: A list of InstanceWithNamedPorts resources.
  21004. Items []*InstanceWithNamedPorts `json:"items,omitempty"`
  21005. // Kind: The resource type.
  21006. Kind string `json:"kind,omitempty"`
  21007. // NextPageToken: [Output Only] This token allows you to get the next
  21008. // page of results for list requests. If the number of results is larger
  21009. // than maxResults, use the nextPageToken as a value for the query
  21010. // parameter pageToken in the next list request. Subsequent list
  21011. // requests will have their own nextPageToken to continue paging through
  21012. // the results.
  21013. NextPageToken string `json:"nextPageToken,omitempty"`
  21014. // SelfLink: [Output Only] Server-defined URL for this resource.
  21015. SelfLink string `json:"selfLink,omitempty"`
  21016. // Warning: [Output Only] Informational warning message.
  21017. Warning *RegionInstanceGroupsListInstancesWarning `json:"warning,omitempty"`
  21018. // ServerResponse contains the HTTP response code and headers from the
  21019. // server.
  21020. googleapi.ServerResponse `json:"-"`
  21021. // ForceSendFields is a list of field names (e.g. "Id") to
  21022. // unconditionally include in API requests. By default, fields with
  21023. // empty values are omitted from API requests. However, any non-pointer,
  21024. // non-interface field appearing in ForceSendFields will be sent to the
  21025. // server regardless of whether the field is empty or not. This may be
  21026. // used to include empty fields in Patch requests.
  21027. ForceSendFields []string `json:"-"`
  21028. // NullFields is a list of field names (e.g. "Id") to include in API
  21029. // requests with the JSON null value. By default, fields with empty
  21030. // values are omitted from API requests. However, any field with an
  21031. // empty value appearing in NullFields will be sent to the server as
  21032. // null. It is an error if a field in this list has a non-empty value.
  21033. // This may be used to include null fields in Patch requests.
  21034. NullFields []string `json:"-"`
  21035. }
  21036. func (s *RegionInstanceGroupsListInstances) MarshalJSON() ([]byte, error) {
  21037. type NoMethod RegionInstanceGroupsListInstances
  21038. raw := NoMethod(*s)
  21039. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21040. }
  21041. // RegionInstanceGroupsListInstancesWarning: [Output Only] Informational
  21042. // warning message.
  21043. type RegionInstanceGroupsListInstancesWarning struct {
  21044. // Code: [Output Only] A warning code, if applicable. For example,
  21045. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  21046. // the response.
  21047. //
  21048. // Possible values:
  21049. // "CLEANUP_FAILED"
  21050. // "DEPRECATED_RESOURCE_USED"
  21051. // "DEPRECATED_TYPE_USED"
  21052. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  21053. // "EXPERIMENTAL_TYPE_USED"
  21054. // "EXTERNAL_API_WARNING"
  21055. // "FIELD_VALUE_OVERRIDEN"
  21056. // "INJECTED_KERNELS_DEPRECATED"
  21057. // "MISSING_TYPE_DEPENDENCY"
  21058. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  21059. // "NEXT_HOP_CANNOT_IP_FORWARD"
  21060. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  21061. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  21062. // "NEXT_HOP_NOT_RUNNING"
  21063. // "NOT_CRITICAL_ERROR"
  21064. // "NO_RESULTS_ON_PAGE"
  21065. // "REQUIRED_TOS_AGREEMENT"
  21066. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  21067. // "RESOURCE_NOT_DELETED"
  21068. // "SCHEMA_VALIDATION_IGNORED"
  21069. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  21070. // "UNDECLARED_PROPERTIES"
  21071. // "UNREACHABLE"
  21072. Code string `json:"code,omitempty"`
  21073. // Data: [Output Only] Metadata about this warning in key: value format.
  21074. // For example:
  21075. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  21076. Data []*RegionInstanceGroupsListInstancesWarningData `json:"data,omitempty"`
  21077. // Message: [Output Only] A human-readable description of the warning
  21078. // code.
  21079. Message string `json:"message,omitempty"`
  21080. // ForceSendFields is a list of field names (e.g. "Code") to
  21081. // unconditionally include in API requests. By default, fields with
  21082. // empty values are omitted from API requests. However, any non-pointer,
  21083. // non-interface field appearing in ForceSendFields will be sent to the
  21084. // server regardless of whether the field is empty or not. This may be
  21085. // used to include empty fields in Patch requests.
  21086. ForceSendFields []string `json:"-"`
  21087. // NullFields is a list of field names (e.g. "Code") to include in API
  21088. // requests with the JSON null value. By default, fields with empty
  21089. // values are omitted from API requests. However, any field with an
  21090. // empty value appearing in NullFields will be sent to the server as
  21091. // null. It is an error if a field in this list has a non-empty value.
  21092. // This may be used to include null fields in Patch requests.
  21093. NullFields []string `json:"-"`
  21094. }
  21095. func (s *RegionInstanceGroupsListInstancesWarning) MarshalJSON() ([]byte, error) {
  21096. type NoMethod RegionInstanceGroupsListInstancesWarning
  21097. raw := NoMethod(*s)
  21098. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21099. }
  21100. type RegionInstanceGroupsListInstancesWarningData struct {
  21101. // Key: [Output Only] A key that provides more detail on the warning
  21102. // being returned. For example, for warnings where there are no results
  21103. // in a list request for a particular zone, this key might be scope and
  21104. // the key value might be the zone name. Other examples might be a key
  21105. // indicating a deprecated resource and a suggested replacement, or a
  21106. // warning about invalid network settings (for example, if an instance
  21107. // attempts to perform IP forwarding but is not enabled for IP
  21108. // forwarding).
  21109. Key string `json:"key,omitempty"`
  21110. // Value: [Output Only] A warning data value corresponding to the key.
  21111. Value string `json:"value,omitempty"`
  21112. // ForceSendFields is a list of field names (e.g. "Key") to
  21113. // unconditionally include in API requests. By default, fields with
  21114. // empty values are omitted from API requests. However, any non-pointer,
  21115. // non-interface field appearing in ForceSendFields will be sent to the
  21116. // server regardless of whether the field is empty or not. This may be
  21117. // used to include empty fields in Patch requests.
  21118. ForceSendFields []string `json:"-"`
  21119. // NullFields is a list of field names (e.g. "Key") to include in API
  21120. // requests with the JSON null value. By default, fields with empty
  21121. // values are omitted from API requests. However, any field with an
  21122. // empty value appearing in NullFields will be sent to the server as
  21123. // null. It is an error if a field in this list has a non-empty value.
  21124. // This may be used to include null fields in Patch requests.
  21125. NullFields []string `json:"-"`
  21126. }
  21127. func (s *RegionInstanceGroupsListInstancesWarningData) MarshalJSON() ([]byte, error) {
  21128. type NoMethod RegionInstanceGroupsListInstancesWarningData
  21129. raw := NoMethod(*s)
  21130. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21131. }
  21132. type RegionInstanceGroupsListInstancesRequest struct {
  21133. // InstanceState: Instances in which state should be returned. Valid
  21134. // options are: 'ALL', 'RUNNING'. By default, it lists all instances.
  21135. //
  21136. // Possible values:
  21137. // "ALL"
  21138. // "RUNNING"
  21139. InstanceState string `json:"instanceState,omitempty"`
  21140. // PortName: Name of port user is interested in. It is optional. If it
  21141. // is set, only information about this ports will be returned. If it is
  21142. // not set, all the named ports will be returned. Always lists all
  21143. // instances.
  21144. PortName string `json:"portName,omitempty"`
  21145. // ForceSendFields is a list of field names (e.g. "InstanceState") to
  21146. // unconditionally include in API requests. By default, fields with
  21147. // empty values are omitted from API requests. However, any non-pointer,
  21148. // non-interface field appearing in ForceSendFields will be sent to the
  21149. // server regardless of whether the field is empty or not. This may be
  21150. // used to include empty fields in Patch requests.
  21151. ForceSendFields []string `json:"-"`
  21152. // NullFields is a list of field names (e.g. "InstanceState") to include
  21153. // in API requests with the JSON null value. By default, fields with
  21154. // empty values are omitted from API requests. However, any field with
  21155. // an empty value appearing in NullFields will be sent to the server as
  21156. // null. It is an error if a field in this list has a non-empty value.
  21157. // This may be used to include null fields in Patch requests.
  21158. NullFields []string `json:"-"`
  21159. }
  21160. func (s *RegionInstanceGroupsListInstancesRequest) MarshalJSON() ([]byte, error) {
  21161. type NoMethod RegionInstanceGroupsListInstancesRequest
  21162. raw := NoMethod(*s)
  21163. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21164. }
  21165. type RegionInstanceGroupsSetNamedPortsRequest struct {
  21166. // Fingerprint: The fingerprint of the named ports information for this
  21167. // instance group. Use this optional property to prevent conflicts when
  21168. // multiple users change the named ports settings concurrently. Obtain
  21169. // the fingerprint with the instanceGroups.get method. Then, include the
  21170. // fingerprint in your request to ensure that you do not overwrite
  21171. // changes that were applied from another concurrent request.
  21172. Fingerprint string `json:"fingerprint,omitempty"`
  21173. // NamedPorts: The list of named ports to set for this instance group.
  21174. NamedPorts []*NamedPort `json:"namedPorts,omitempty"`
  21175. // ForceSendFields is a list of field names (e.g. "Fingerprint") 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. "Fingerprint") to include
  21183. // in API requests with the JSON null value. By default, fields with
  21184. // empty values are omitted from API requests. However, any field with
  21185. // an 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 *RegionInstanceGroupsSetNamedPortsRequest) MarshalJSON() ([]byte, error) {
  21191. type NoMethod RegionInstanceGroupsSetNamedPortsRequest
  21192. raw := NoMethod(*s)
  21193. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21194. }
  21195. // RegionList: Contains a list of region resources.
  21196. type RegionList struct {
  21197. // Id: [Output Only] Unique identifier for the resource; defined by the
  21198. // server.
  21199. Id string `json:"id,omitempty"`
  21200. // Items: A list of Region resources.
  21201. Items []*Region `json:"items,omitempty"`
  21202. // Kind: [Output Only] Type of resource. Always compute#regionList for
  21203. // lists of regions.
  21204. Kind string `json:"kind,omitempty"`
  21205. // NextPageToken: [Output Only] This token allows you to get the next
  21206. // page of results for list requests. If the number of results is larger
  21207. // than maxResults, use the nextPageToken as a value for the query
  21208. // parameter pageToken in the next list request. Subsequent list
  21209. // requests will have their own nextPageToken to continue paging through
  21210. // the results.
  21211. NextPageToken string `json:"nextPageToken,omitempty"`
  21212. // SelfLink: [Output Only] Server-defined URL for this resource.
  21213. SelfLink string `json:"selfLink,omitempty"`
  21214. // Warning: [Output Only] Informational warning message.
  21215. Warning *RegionListWarning `json:"warning,omitempty"`
  21216. // ServerResponse contains the HTTP response code and headers from the
  21217. // server.
  21218. googleapi.ServerResponse `json:"-"`
  21219. // ForceSendFields is a list of field names (e.g. "Id") to
  21220. // unconditionally include in API requests. By default, fields with
  21221. // empty values are omitted from API requests. However, any non-pointer,
  21222. // non-interface field appearing in ForceSendFields will be sent to the
  21223. // server regardless of whether the field is empty or not. This may be
  21224. // used to include empty fields in Patch requests.
  21225. ForceSendFields []string `json:"-"`
  21226. // NullFields is a list of field names (e.g. "Id") to include in API
  21227. // requests with the JSON null value. By default, fields with empty
  21228. // values are omitted from API requests. However, any field with an
  21229. // empty value appearing in NullFields will be sent to the server as
  21230. // null. It is an error if a field in this list has a non-empty value.
  21231. // This may be used to include null fields in Patch requests.
  21232. NullFields []string `json:"-"`
  21233. }
  21234. func (s *RegionList) MarshalJSON() ([]byte, error) {
  21235. type NoMethod RegionList
  21236. raw := NoMethod(*s)
  21237. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21238. }
  21239. // RegionListWarning: [Output Only] Informational warning message.
  21240. type RegionListWarning struct {
  21241. // Code: [Output Only] A warning code, if applicable. For example,
  21242. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  21243. // the response.
  21244. //
  21245. // Possible values:
  21246. // "CLEANUP_FAILED"
  21247. // "DEPRECATED_RESOURCE_USED"
  21248. // "DEPRECATED_TYPE_USED"
  21249. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  21250. // "EXPERIMENTAL_TYPE_USED"
  21251. // "EXTERNAL_API_WARNING"
  21252. // "FIELD_VALUE_OVERRIDEN"
  21253. // "INJECTED_KERNELS_DEPRECATED"
  21254. // "MISSING_TYPE_DEPENDENCY"
  21255. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  21256. // "NEXT_HOP_CANNOT_IP_FORWARD"
  21257. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  21258. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  21259. // "NEXT_HOP_NOT_RUNNING"
  21260. // "NOT_CRITICAL_ERROR"
  21261. // "NO_RESULTS_ON_PAGE"
  21262. // "REQUIRED_TOS_AGREEMENT"
  21263. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  21264. // "RESOURCE_NOT_DELETED"
  21265. // "SCHEMA_VALIDATION_IGNORED"
  21266. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  21267. // "UNDECLARED_PROPERTIES"
  21268. // "UNREACHABLE"
  21269. Code string `json:"code,omitempty"`
  21270. // Data: [Output Only] Metadata about this warning in key: value format.
  21271. // For example:
  21272. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  21273. Data []*RegionListWarningData `json:"data,omitempty"`
  21274. // Message: [Output Only] A human-readable description of the warning
  21275. // code.
  21276. Message string `json:"message,omitempty"`
  21277. // ForceSendFields is a list of field names (e.g. "Code") to
  21278. // unconditionally include in API requests. By default, fields with
  21279. // empty values are omitted from API requests. However, any non-pointer,
  21280. // non-interface field appearing in ForceSendFields will be sent to the
  21281. // server regardless of whether the field is empty or not. This may be
  21282. // used to include empty fields in Patch requests.
  21283. ForceSendFields []string `json:"-"`
  21284. // NullFields is a list of field names (e.g. "Code") to include in API
  21285. // requests with the JSON null value. By default, fields with empty
  21286. // values are omitted from API requests. However, any field with an
  21287. // empty value appearing in NullFields will be sent to the server as
  21288. // null. It is an error if a field in this list has a non-empty value.
  21289. // This may be used to include null fields in Patch requests.
  21290. NullFields []string `json:"-"`
  21291. }
  21292. func (s *RegionListWarning) MarshalJSON() ([]byte, error) {
  21293. type NoMethod RegionListWarning
  21294. raw := NoMethod(*s)
  21295. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21296. }
  21297. type RegionListWarningData struct {
  21298. // Key: [Output Only] A key that provides more detail on the warning
  21299. // being returned. For example, for warnings where there are no results
  21300. // in a list request for a particular zone, this key might be scope and
  21301. // the key value might be the zone name. Other examples might be a key
  21302. // indicating a deprecated resource and a suggested replacement, or a
  21303. // warning about invalid network settings (for example, if an instance
  21304. // attempts to perform IP forwarding but is not enabled for IP
  21305. // forwarding).
  21306. Key string `json:"key,omitempty"`
  21307. // Value: [Output Only] A warning data value corresponding to the key.
  21308. Value string `json:"value,omitempty"`
  21309. // ForceSendFields is a list of field names (e.g. "Key") to
  21310. // unconditionally include in API requests. By default, fields with
  21311. // empty values are omitted from API requests. However, any non-pointer,
  21312. // non-interface field appearing in ForceSendFields will be sent to the
  21313. // server regardless of whether the field is empty or not. This may be
  21314. // used to include empty fields in Patch requests.
  21315. ForceSendFields []string `json:"-"`
  21316. // NullFields is a list of field names (e.g. "Key") to include in API
  21317. // requests with the JSON null value. By default, fields with empty
  21318. // values are omitted from API requests. However, any field with an
  21319. // empty value appearing in NullFields will be sent to the server as
  21320. // null. It is an error if a field in this list has a non-empty value.
  21321. // This may be used to include null fields in Patch requests.
  21322. NullFields []string `json:"-"`
  21323. }
  21324. func (s *RegionListWarningData) MarshalJSON() ([]byte, error) {
  21325. type NoMethod RegionListWarningData
  21326. raw := NoMethod(*s)
  21327. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21328. }
  21329. type RegionSetLabelsRequest struct {
  21330. // LabelFingerprint: The fingerprint of the previous set of labels for
  21331. // this resource, used to detect conflicts. The fingerprint is initially
  21332. // generated by Compute Engine and changes after every request to modify
  21333. // or update labels. You must always provide an up-to-date fingerprint
  21334. // hash in order to update or change labels. Make a get() request to the
  21335. // resource to get the latest fingerprint.
  21336. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  21337. // Labels: The labels to set for this resource.
  21338. Labels map[string]string `json:"labels,omitempty"`
  21339. // ForceSendFields is a list of field names (e.g. "LabelFingerprint") to
  21340. // unconditionally include in API requests. By default, fields with
  21341. // empty values are omitted from API requests. However, any non-pointer,
  21342. // non-interface field appearing in ForceSendFields will be sent to the
  21343. // server regardless of whether the field is empty or not. This may be
  21344. // used to include empty fields in Patch requests.
  21345. ForceSendFields []string `json:"-"`
  21346. // NullFields is a list of field names (e.g. "LabelFingerprint") to
  21347. // include in API requests with the JSON null value. By default, fields
  21348. // with empty values are omitted from API requests. However, any field
  21349. // with an empty value appearing in NullFields will be sent to the
  21350. // server as null. It is an error if a field in this list has a
  21351. // non-empty value. This may be used to include null fields in Patch
  21352. // requests.
  21353. NullFields []string `json:"-"`
  21354. }
  21355. func (s *RegionSetLabelsRequest) MarshalJSON() ([]byte, error) {
  21356. type NoMethod RegionSetLabelsRequest
  21357. raw := NoMethod(*s)
  21358. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21359. }
  21360. type RegionSetPolicyRequest struct {
  21361. // Bindings: Flatten Policy to create a backwacd compatible wire-format.
  21362. // Deprecated. Use 'policy' to specify bindings.
  21363. Bindings []*Binding `json:"bindings,omitempty"`
  21364. // Etag: Flatten Policy to create a backward compatible wire-format.
  21365. // Deprecated. Use 'policy' to specify the etag.
  21366. Etag string `json:"etag,omitempty"`
  21367. // Policy: REQUIRED: The complete policy to be applied to the
  21368. // 'resource'. The size of the policy is limited to a few 10s of KB. An
  21369. // empty policy is in general a valid policy but certain services (like
  21370. // Projects) might reject them.
  21371. Policy *Policy `json:"policy,omitempty"`
  21372. // ForceSendFields is a list of field names (e.g. "Bindings") 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. "Bindings") to include in
  21380. // API 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 *RegionSetPolicyRequest) MarshalJSON() ([]byte, error) {
  21388. type NoMethod RegionSetPolicyRequest
  21389. raw := NoMethod(*s)
  21390. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21391. }
  21392. type RegionUrlMapsValidateRequest struct {
  21393. // Resource: Content of the UrlMap to be validated.
  21394. Resource *UrlMap `json:"resource,omitempty"`
  21395. // ForceSendFields is a list of field names (e.g. "Resource") to
  21396. // unconditionally include in API requests. By default, fields with
  21397. // empty values are omitted from API requests. However, any non-pointer,
  21398. // non-interface field appearing in ForceSendFields will be sent to the
  21399. // server regardless of whether the field is empty or not. This may be
  21400. // used to include empty fields in Patch requests.
  21401. ForceSendFields []string `json:"-"`
  21402. // NullFields is a list of field names (e.g. "Resource") to include in
  21403. // API requests with the JSON null value. By default, fields with empty
  21404. // values are omitted from API requests. However, any field with an
  21405. // empty value appearing in NullFields will be sent to the server as
  21406. // null. It is an error if a field in this list has a non-empty value.
  21407. // This may be used to include null fields in Patch requests.
  21408. NullFields []string `json:"-"`
  21409. }
  21410. func (s *RegionUrlMapsValidateRequest) MarshalJSON() ([]byte, error) {
  21411. type NoMethod RegionUrlMapsValidateRequest
  21412. raw := NoMethod(*s)
  21413. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21414. }
  21415. // ResourceCommitment: Commitment for a particular resource (a
  21416. // Commitment is composed of one or more of these).
  21417. type ResourceCommitment struct {
  21418. // Amount: The amount of the resource purchased (in a type-dependent
  21419. // unit, such as bytes). For vCPUs, this can just be an integer. For
  21420. // memory, this must be provided in MB. Memory must be a multiple of 256
  21421. // MB, with up to 6.5GB of memory per every vCPU.
  21422. Amount int64 `json:"amount,omitempty,string"`
  21423. // Type: Type of resource for which this commitment applies. Possible
  21424. // values are VCPU and MEMORY
  21425. //
  21426. // Possible values:
  21427. // "LOCAL_SSD"
  21428. // "MEMORY"
  21429. // "UNSPECIFIED"
  21430. // "VCPU"
  21431. Type string `json:"type,omitempty"`
  21432. // ForceSendFields is a list of field names (e.g. "Amount") to
  21433. // unconditionally include in API requests. By default, fields with
  21434. // empty values are omitted from API requests. However, any non-pointer,
  21435. // non-interface field appearing in ForceSendFields will be sent to the
  21436. // server regardless of whether the field is empty or not. This may be
  21437. // used to include empty fields in Patch requests.
  21438. ForceSendFields []string `json:"-"`
  21439. // NullFields is a list of field names (e.g. "Amount") to include in API
  21440. // requests with the JSON null value. By default, fields with empty
  21441. // values are omitted from API requests. However, any field with an
  21442. // empty value appearing in NullFields will be sent to the server as
  21443. // null. It is an error if a field in this list has a non-empty value.
  21444. // This may be used to include null fields in Patch requests.
  21445. NullFields []string `json:"-"`
  21446. }
  21447. func (s *ResourceCommitment) MarshalJSON() ([]byte, error) {
  21448. type NoMethod ResourceCommitment
  21449. raw := NoMethod(*s)
  21450. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21451. }
  21452. type ResourceGroupReference struct {
  21453. // Group: A URI referencing one of the instance groups listed in the
  21454. // backend service.
  21455. Group string `json:"group,omitempty"`
  21456. // ForceSendFields is a list of field names (e.g. "Group") to
  21457. // unconditionally include in API requests. By default, fields with
  21458. // empty values are omitted from API requests. However, any non-pointer,
  21459. // non-interface field appearing in ForceSendFields will be sent to the
  21460. // server regardless of whether the field is empty or not. This may be
  21461. // used to include empty fields in Patch requests.
  21462. ForceSendFields []string `json:"-"`
  21463. // NullFields is a list of field names (e.g. "Group") to include in API
  21464. // requests with the JSON null value. By default, fields with empty
  21465. // values are omitted from API requests. However, any field with an
  21466. // empty value appearing in NullFields will be sent to the server as
  21467. // null. It is an error if a field in this list has a non-empty value.
  21468. // This may be used to include null fields in Patch requests.
  21469. NullFields []string `json:"-"`
  21470. }
  21471. func (s *ResourceGroupReference) MarshalJSON() ([]byte, error) {
  21472. type NoMethod ResourceGroupReference
  21473. raw := NoMethod(*s)
  21474. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21475. }
  21476. type ResourcePoliciesList struct {
  21477. Etag string `json:"etag,omitempty"`
  21478. // Id: [Output Only] The unique identifier for the resource. This
  21479. // identifier is defined by the server.
  21480. Id string `json:"id,omitempty"`
  21481. // Items: [Output Only] A list of ResourcePolicy resources.
  21482. Items []*ResourcePolicy `json:"items,omitempty"`
  21483. // Kind: [Output Only] Type of resource.Always
  21484. // compute#resourcePoliciesList for listsof resourcePolicies
  21485. Kind string `json:"kind,omitempty"`
  21486. // NextPageToken: [Output Only] This token allows you to get the next
  21487. // page of results for list requests. If the number of results is larger
  21488. // than maxResults, use the nextPageToken as a value for the query
  21489. // parameter pageToken in the next list request. Subsequent list
  21490. // requests will have their own nextPageToken to continue paging through
  21491. // the results.
  21492. NextPageToken string `json:"nextPageToken,omitempty"`
  21493. // SelfLink: [Output Only] Server-defined URL for this resource.
  21494. SelfLink string `json:"selfLink,omitempty"`
  21495. // Warning: [Output Only] Informational warning message.
  21496. Warning *ResourcePoliciesListWarning `json:"warning,omitempty"`
  21497. // ServerResponse contains the HTTP response code and headers from the
  21498. // server.
  21499. googleapi.ServerResponse `json:"-"`
  21500. // ForceSendFields is a list of field names (e.g. "Etag") 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. "Etag") to include in API
  21508. // 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 *ResourcePoliciesList) MarshalJSON() ([]byte, error) {
  21516. type NoMethod ResourcePoliciesList
  21517. raw := NoMethod(*s)
  21518. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21519. }
  21520. // ResourcePoliciesListWarning: [Output Only] Informational warning
  21521. // message.
  21522. type ResourcePoliciesListWarning struct {
  21523. // Code: [Output Only] A warning code, if applicable. For example,
  21524. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  21525. // the response.
  21526. //
  21527. // Possible values:
  21528. // "CLEANUP_FAILED"
  21529. // "DEPRECATED_RESOURCE_USED"
  21530. // "DEPRECATED_TYPE_USED"
  21531. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  21532. // "EXPERIMENTAL_TYPE_USED"
  21533. // "EXTERNAL_API_WARNING"
  21534. // "FIELD_VALUE_OVERRIDEN"
  21535. // "INJECTED_KERNELS_DEPRECATED"
  21536. // "MISSING_TYPE_DEPENDENCY"
  21537. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  21538. // "NEXT_HOP_CANNOT_IP_FORWARD"
  21539. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  21540. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  21541. // "NEXT_HOP_NOT_RUNNING"
  21542. // "NOT_CRITICAL_ERROR"
  21543. // "NO_RESULTS_ON_PAGE"
  21544. // "REQUIRED_TOS_AGREEMENT"
  21545. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  21546. // "RESOURCE_NOT_DELETED"
  21547. // "SCHEMA_VALIDATION_IGNORED"
  21548. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  21549. // "UNDECLARED_PROPERTIES"
  21550. // "UNREACHABLE"
  21551. Code string `json:"code,omitempty"`
  21552. // Data: [Output Only] Metadata about this warning in key: value format.
  21553. // For example:
  21554. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  21555. Data []*ResourcePoliciesListWarningData `json:"data,omitempty"`
  21556. // Message: [Output Only] A human-readable description of the warning
  21557. // code.
  21558. Message string `json:"message,omitempty"`
  21559. // ForceSendFields is a list of field names (e.g. "Code") to
  21560. // unconditionally include in API requests. By default, fields with
  21561. // empty values are omitted from API requests. However, any non-pointer,
  21562. // non-interface field appearing in ForceSendFields will be sent to the
  21563. // server regardless of whether the field is empty or not. This may be
  21564. // used to include empty fields in Patch requests.
  21565. ForceSendFields []string `json:"-"`
  21566. // NullFields is a list of field names (e.g. "Code") to include in API
  21567. // requests with the JSON null value. By default, fields with empty
  21568. // values are omitted from API requests. However, any field with an
  21569. // empty value appearing in NullFields will be sent to the server as
  21570. // null. It is an error if a field in this list has a non-empty value.
  21571. // This may be used to include null fields in Patch requests.
  21572. NullFields []string `json:"-"`
  21573. }
  21574. func (s *ResourcePoliciesListWarning) MarshalJSON() ([]byte, error) {
  21575. type NoMethod ResourcePoliciesListWarning
  21576. raw := NoMethod(*s)
  21577. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21578. }
  21579. type ResourcePoliciesListWarningData struct {
  21580. // Key: [Output Only] A key that provides more detail on the warning
  21581. // being returned. For example, for warnings where there are no results
  21582. // in a list request for a particular zone, this key might be scope and
  21583. // the key value might be the zone name. Other examples might be a key
  21584. // indicating a deprecated resource and a suggested replacement, or a
  21585. // warning about invalid network settings (for example, if an instance
  21586. // attempts to perform IP forwarding but is not enabled for IP
  21587. // forwarding).
  21588. Key string `json:"key,omitempty"`
  21589. // Value: [Output Only] A warning data value corresponding to the key.
  21590. Value string `json:"value,omitempty"`
  21591. // ForceSendFields is a list of field names (e.g. "Key") to
  21592. // unconditionally include in API requests. By default, fields with
  21593. // empty values are omitted from API requests. However, any non-pointer,
  21594. // non-interface field appearing in ForceSendFields will be sent to the
  21595. // server regardless of whether the field is empty or not. This may be
  21596. // used to include empty fields in Patch requests.
  21597. ForceSendFields []string `json:"-"`
  21598. // NullFields is a list of field names (e.g. "Key") to include in API
  21599. // requests with the JSON null value. By default, fields with empty
  21600. // values are omitted from API requests. However, any field with an
  21601. // empty value appearing in NullFields will be sent to the server as
  21602. // null. It is an error if a field in this list has a non-empty value.
  21603. // This may be used to include null fields in Patch requests.
  21604. NullFields []string `json:"-"`
  21605. }
  21606. func (s *ResourcePoliciesListWarningData) MarshalJSON() ([]byte, error) {
  21607. type NoMethod ResourcePoliciesListWarningData
  21608. raw := NoMethod(*s)
  21609. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21610. }
  21611. type ResourcePoliciesScopedList struct {
  21612. // ResourcePolicies: A list of resourcePolicies contained in this scope.
  21613. ResourcePolicies []*ResourcePolicy `json:"resourcePolicies,omitempty"`
  21614. // Warning: Informational warning which replaces the list of
  21615. // resourcePolicies when the list is empty.
  21616. Warning *ResourcePoliciesScopedListWarning `json:"warning,omitempty"`
  21617. // ForceSendFields is a list of field names (e.g. "ResourcePolicies") to
  21618. // unconditionally include in API requests. By default, fields with
  21619. // empty values are omitted from API requests. However, any non-pointer,
  21620. // non-interface field appearing in ForceSendFields will be sent to the
  21621. // server regardless of whether the field is empty or not. This may be
  21622. // used to include empty fields in Patch requests.
  21623. ForceSendFields []string `json:"-"`
  21624. // NullFields is a list of field names (e.g. "ResourcePolicies") to
  21625. // include in API requests with the JSON null value. By default, fields
  21626. // with empty values are omitted from API requests. However, any field
  21627. // with an empty value appearing in NullFields will be sent to the
  21628. // server as null. It is an error if a field in this list has a
  21629. // non-empty value. This may be used to include null fields in Patch
  21630. // requests.
  21631. NullFields []string `json:"-"`
  21632. }
  21633. func (s *ResourcePoliciesScopedList) MarshalJSON() ([]byte, error) {
  21634. type NoMethod ResourcePoliciesScopedList
  21635. raw := NoMethod(*s)
  21636. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21637. }
  21638. // ResourcePoliciesScopedListWarning: Informational warning which
  21639. // replaces the list of resourcePolicies when the list is empty.
  21640. type ResourcePoliciesScopedListWarning struct {
  21641. // Code: [Output Only] A warning code, if applicable. For example,
  21642. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  21643. // the response.
  21644. //
  21645. // Possible values:
  21646. // "CLEANUP_FAILED"
  21647. // "DEPRECATED_RESOURCE_USED"
  21648. // "DEPRECATED_TYPE_USED"
  21649. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  21650. // "EXPERIMENTAL_TYPE_USED"
  21651. // "EXTERNAL_API_WARNING"
  21652. // "FIELD_VALUE_OVERRIDEN"
  21653. // "INJECTED_KERNELS_DEPRECATED"
  21654. // "MISSING_TYPE_DEPENDENCY"
  21655. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  21656. // "NEXT_HOP_CANNOT_IP_FORWARD"
  21657. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  21658. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  21659. // "NEXT_HOP_NOT_RUNNING"
  21660. // "NOT_CRITICAL_ERROR"
  21661. // "NO_RESULTS_ON_PAGE"
  21662. // "REQUIRED_TOS_AGREEMENT"
  21663. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  21664. // "RESOURCE_NOT_DELETED"
  21665. // "SCHEMA_VALIDATION_IGNORED"
  21666. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  21667. // "UNDECLARED_PROPERTIES"
  21668. // "UNREACHABLE"
  21669. Code string `json:"code,omitempty"`
  21670. // Data: [Output Only] Metadata about this warning in key: value format.
  21671. // For example:
  21672. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  21673. Data []*ResourcePoliciesScopedListWarningData `json:"data,omitempty"`
  21674. // Message: [Output Only] A human-readable description of the warning
  21675. // code.
  21676. Message string `json:"message,omitempty"`
  21677. // ForceSendFields is a list of field names (e.g. "Code") to
  21678. // unconditionally include in API requests. By default, fields with
  21679. // empty values are omitted from API requests. However, any non-pointer,
  21680. // non-interface field appearing in ForceSendFields will be sent to the
  21681. // server regardless of whether the field is empty or not. This may be
  21682. // used to include empty fields in Patch requests.
  21683. ForceSendFields []string `json:"-"`
  21684. // NullFields is a list of field names (e.g. "Code") to include in API
  21685. // requests with the JSON null value. By default, fields with empty
  21686. // values are omitted from API requests. However, any field with an
  21687. // empty value appearing in NullFields will be sent to the server as
  21688. // null. It is an error if a field in this list has a non-empty value.
  21689. // This may be used to include null fields in Patch requests.
  21690. NullFields []string `json:"-"`
  21691. }
  21692. func (s *ResourcePoliciesScopedListWarning) MarshalJSON() ([]byte, error) {
  21693. type NoMethod ResourcePoliciesScopedListWarning
  21694. raw := NoMethod(*s)
  21695. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21696. }
  21697. type ResourcePoliciesScopedListWarningData struct {
  21698. // Key: [Output Only] A key that provides more detail on the warning
  21699. // being returned. For example, for warnings where there are no results
  21700. // in a list request for a particular zone, this key might be scope and
  21701. // the key value might be the zone name. Other examples might be a key
  21702. // indicating a deprecated resource and a suggested replacement, or a
  21703. // warning about invalid network settings (for example, if an instance
  21704. // attempts to perform IP forwarding but is not enabled for IP
  21705. // forwarding).
  21706. Key string `json:"key,omitempty"`
  21707. // Value: [Output Only] A warning data value corresponding to the key.
  21708. Value string `json:"value,omitempty"`
  21709. // ForceSendFields is a list of field names (e.g. "Key") to
  21710. // unconditionally include in API requests. By default, fields with
  21711. // empty values are omitted from API requests. However, any non-pointer,
  21712. // non-interface field appearing in ForceSendFields will be sent to the
  21713. // server regardless of whether the field is empty or not. This may be
  21714. // used to include empty fields in Patch requests.
  21715. ForceSendFields []string `json:"-"`
  21716. // NullFields is a list of field names (e.g. "Key") to include in API
  21717. // requests with the JSON null value. By default, fields with empty
  21718. // values are omitted from API requests. However, any field with an
  21719. // empty value appearing in NullFields will be sent to the server as
  21720. // null. It is an error if a field in this list has a non-empty value.
  21721. // This may be used to include null fields in Patch requests.
  21722. NullFields []string `json:"-"`
  21723. }
  21724. func (s *ResourcePoliciesScopedListWarningData) MarshalJSON() ([]byte, error) {
  21725. type NoMethod ResourcePoliciesScopedListWarningData
  21726. raw := NoMethod(*s)
  21727. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21728. }
  21729. type ResourcePolicy struct {
  21730. // BackupSchedulePolicy: Resource policy for persistent disks for
  21731. // creating snapshots.
  21732. BackupSchedulePolicy *ResourcePolicyBackupSchedulePolicy `json:"backupSchedulePolicy,omitempty"`
  21733. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  21734. // format.
  21735. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  21736. Description string `json:"description,omitempty"`
  21737. // Id: [Output Only] The unique identifier for the resource. This
  21738. // identifier is defined by the server.
  21739. Id uint64 `json:"id,omitempty,string"`
  21740. // Kind: [Output Only] Type of the resource. Always
  21741. // compute#resource_policies for resource policies.
  21742. Kind string `json:"kind,omitempty"`
  21743. // Name: The name of the resource, provided by the client when initially
  21744. // creating the resource. The resource name must be 1-63 characters
  21745. // long, and comply with RFC1035. Specifically, the name must be 1-63
  21746. // characters long and match the regular expression
  21747. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  21748. // a lowercase letter, and all following characters must be a dash,
  21749. // lowercase letter, or digit, except the last character, which cannot
  21750. // be a dash.
  21751. Name string `json:"name,omitempty"`
  21752. Region string `json:"region,omitempty"`
  21753. // SelfLink: [Output Only] Server-defined fully-qualified URL for this
  21754. // resource.
  21755. SelfLink string `json:"selfLink,omitempty"`
  21756. // VmMaintenancePolicy: Resource policy applicable to VMs for
  21757. // infrastructure maintenance.
  21758. VmMaintenancePolicy *ResourcePolicyVmMaintenancePolicy `json:"vmMaintenancePolicy,omitempty"`
  21759. // ServerResponse contains the HTTP response code and headers from the
  21760. // server.
  21761. googleapi.ServerResponse `json:"-"`
  21762. // ForceSendFields is a list of field names (e.g.
  21763. // "BackupSchedulePolicy") to unconditionally include in API requests.
  21764. // By default, fields with empty values are omitted from API requests.
  21765. // However, any non-pointer, non-interface field appearing in
  21766. // ForceSendFields will be sent to the server regardless of whether the
  21767. // field is empty or not. This may be used to include empty fields in
  21768. // Patch requests.
  21769. ForceSendFields []string `json:"-"`
  21770. // NullFields is a list of field names (e.g. "BackupSchedulePolicy") to
  21771. // include in API requests with the JSON null value. By default, fields
  21772. // with empty values are omitted from API requests. However, any field
  21773. // with an empty value appearing in NullFields will be sent to the
  21774. // server as null. It is an error if a field in this list has a
  21775. // non-empty value. This may be used to include null fields in Patch
  21776. // requests.
  21777. NullFields []string `json:"-"`
  21778. }
  21779. func (s *ResourcePolicy) MarshalJSON() ([]byte, error) {
  21780. type NoMethod ResourcePolicy
  21781. raw := NoMethod(*s)
  21782. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21783. }
  21784. // ResourcePolicyAggregatedList: Contains a list of resourcePolicies.
  21785. type ResourcePolicyAggregatedList struct {
  21786. Etag string `json:"etag,omitempty"`
  21787. // Id: [Output Only] Unique identifier for the resource; defined by the
  21788. // server.
  21789. Id string `json:"id,omitempty"`
  21790. // Items: A list of ResourcePolicy resources.
  21791. Items map[string]ResourcePoliciesScopedList `json:"items,omitempty"`
  21792. // Kind: Type of resource.
  21793. Kind string `json:"kind,omitempty"`
  21794. // NextPageToken: [Output Only] This token allows you to get the next
  21795. // page of results for list requests. If the number of results is larger
  21796. // than maxResults, use the nextPageToken as a value for the query
  21797. // parameter pageToken in the next list request. Subsequent list
  21798. // requests will have their own nextPageToken to continue paging through
  21799. // the results.
  21800. NextPageToken string `json:"nextPageToken,omitempty"`
  21801. // SelfLink: [Output Only] Server-defined URL for this resource.
  21802. SelfLink string `json:"selfLink,omitempty"`
  21803. // Warning: [Output Only] Informational warning message.
  21804. Warning *ResourcePolicyAggregatedListWarning `json:"warning,omitempty"`
  21805. // ServerResponse contains the HTTP response code and headers from the
  21806. // server.
  21807. googleapi.ServerResponse `json:"-"`
  21808. // ForceSendFields is a list of field names (e.g. "Etag") to
  21809. // unconditionally include in API requests. By default, fields with
  21810. // empty values are omitted from API requests. However, any non-pointer,
  21811. // non-interface field appearing in ForceSendFields will be sent to the
  21812. // server regardless of whether the field is empty or not. This may be
  21813. // used to include empty fields in Patch requests.
  21814. ForceSendFields []string `json:"-"`
  21815. // NullFields is a list of field names (e.g. "Etag") to include in API
  21816. // requests with the JSON null value. By default, fields with empty
  21817. // values are omitted from API requests. However, any field with an
  21818. // empty value appearing in NullFields will be sent to the server as
  21819. // null. It is an error if a field in this list has a non-empty value.
  21820. // This may be used to include null fields in Patch requests.
  21821. NullFields []string `json:"-"`
  21822. }
  21823. func (s *ResourcePolicyAggregatedList) MarshalJSON() ([]byte, error) {
  21824. type NoMethod ResourcePolicyAggregatedList
  21825. raw := NoMethod(*s)
  21826. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21827. }
  21828. // ResourcePolicyAggregatedListWarning: [Output Only] Informational
  21829. // warning message.
  21830. type ResourcePolicyAggregatedListWarning struct {
  21831. // Code: [Output Only] A warning code, if applicable. For example,
  21832. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  21833. // the response.
  21834. //
  21835. // Possible values:
  21836. // "CLEANUP_FAILED"
  21837. // "DEPRECATED_RESOURCE_USED"
  21838. // "DEPRECATED_TYPE_USED"
  21839. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  21840. // "EXPERIMENTAL_TYPE_USED"
  21841. // "EXTERNAL_API_WARNING"
  21842. // "FIELD_VALUE_OVERRIDEN"
  21843. // "INJECTED_KERNELS_DEPRECATED"
  21844. // "MISSING_TYPE_DEPENDENCY"
  21845. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  21846. // "NEXT_HOP_CANNOT_IP_FORWARD"
  21847. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  21848. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  21849. // "NEXT_HOP_NOT_RUNNING"
  21850. // "NOT_CRITICAL_ERROR"
  21851. // "NO_RESULTS_ON_PAGE"
  21852. // "REQUIRED_TOS_AGREEMENT"
  21853. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  21854. // "RESOURCE_NOT_DELETED"
  21855. // "SCHEMA_VALIDATION_IGNORED"
  21856. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  21857. // "UNDECLARED_PROPERTIES"
  21858. // "UNREACHABLE"
  21859. Code string `json:"code,omitempty"`
  21860. // Data: [Output Only] Metadata about this warning in key: value format.
  21861. // For example:
  21862. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  21863. Data []*ResourcePolicyAggregatedListWarningData `json:"data,omitempty"`
  21864. // Message: [Output Only] A human-readable description of the warning
  21865. // code.
  21866. Message string `json:"message,omitempty"`
  21867. // ForceSendFields is a list of field names (e.g. "Code") to
  21868. // unconditionally include in API requests. By default, fields with
  21869. // empty values are omitted from API requests. However, any non-pointer,
  21870. // non-interface field appearing in ForceSendFields will be sent to the
  21871. // server regardless of whether the field is empty or not. This may be
  21872. // used to include empty fields in Patch requests.
  21873. ForceSendFields []string `json:"-"`
  21874. // NullFields is a list of field names (e.g. "Code") to include in API
  21875. // requests with the JSON null value. By default, fields with empty
  21876. // values are omitted from API requests. However, any field with an
  21877. // empty value appearing in NullFields will be sent to the server as
  21878. // null. It is an error if a field in this list has a non-empty value.
  21879. // This may be used to include null fields in Patch requests.
  21880. NullFields []string `json:"-"`
  21881. }
  21882. func (s *ResourcePolicyAggregatedListWarning) MarshalJSON() ([]byte, error) {
  21883. type NoMethod ResourcePolicyAggregatedListWarning
  21884. raw := NoMethod(*s)
  21885. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21886. }
  21887. type ResourcePolicyAggregatedListWarningData struct {
  21888. // Key: [Output Only] A key that provides more detail on the warning
  21889. // being returned. For example, for warnings where there are no results
  21890. // in a list request for a particular zone, this key might be scope and
  21891. // the key value might be the zone name. Other examples might be a key
  21892. // indicating a deprecated resource and a suggested replacement, or a
  21893. // warning about invalid network settings (for example, if an instance
  21894. // attempts to perform IP forwarding but is not enabled for IP
  21895. // forwarding).
  21896. Key string `json:"key,omitempty"`
  21897. // Value: [Output Only] A warning data value corresponding to the key.
  21898. Value string `json:"value,omitempty"`
  21899. // ForceSendFields is a list of field names (e.g. "Key") to
  21900. // unconditionally include in API requests. By default, fields with
  21901. // empty values are omitted from API requests. However, any non-pointer,
  21902. // non-interface field appearing in ForceSendFields will be sent to the
  21903. // server regardless of whether the field is empty or not. This may be
  21904. // used to include empty fields in Patch requests.
  21905. ForceSendFields []string `json:"-"`
  21906. // NullFields is a list of field names (e.g. "Key") to include in API
  21907. // requests with the JSON null value. By default, fields with empty
  21908. // values are omitted from API requests. However, any field with an
  21909. // empty value appearing in NullFields will be sent to the server as
  21910. // null. It is an error if a field in this list has a non-empty value.
  21911. // This may be used to include null fields in Patch requests.
  21912. NullFields []string `json:"-"`
  21913. }
  21914. func (s *ResourcePolicyAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  21915. type NoMethod ResourcePolicyAggregatedListWarningData
  21916. raw := NoMethod(*s)
  21917. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21918. }
  21919. // ResourcePolicyBackupSchedulePolicy: A backup schedule policy
  21920. // specifies when and how frequently snapshots are to be created for the
  21921. // target disk. Also specifies how many and how long these automatically
  21922. // created snapshot should be retained.
  21923. type ResourcePolicyBackupSchedulePolicy struct {
  21924. // RetentionPolicy: Retention policy applied to snapshots created by
  21925. // this resource policy.
  21926. RetentionPolicy *ResourcePolicyBackupSchedulePolicyRetentionPolicy `json:"retentionPolicy,omitempty"`
  21927. // Schedule: A Vm Maintenance Policy specifies what kind of
  21928. // infrastructure maintenance we are allowed to perform on this VM and
  21929. // when. Schedule that is applied to disks covered by this policy.
  21930. Schedule *ResourcePolicyBackupSchedulePolicySchedule `json:"schedule,omitempty"`
  21931. // SnapshotProperties: Properties with which snapshots are created such
  21932. // as lables, encryption keys.
  21933. SnapshotProperties *ResourcePolicyBackupSchedulePolicySnapshotProperties `json:"snapshotProperties,omitempty"`
  21934. // ForceSendFields is a list of field names (e.g. "RetentionPolicy") to
  21935. // unconditionally include in API requests. By default, fields with
  21936. // empty values are omitted from API requests. However, any non-pointer,
  21937. // non-interface field appearing in ForceSendFields will be sent to the
  21938. // server regardless of whether the field is empty or not. This may be
  21939. // used to include empty fields in Patch requests.
  21940. ForceSendFields []string `json:"-"`
  21941. // NullFields is a list of field names (e.g. "RetentionPolicy") to
  21942. // include in API requests with the JSON null value. By default, fields
  21943. // with empty values are omitted from API requests. However, any field
  21944. // with an empty value appearing in NullFields will be sent to the
  21945. // server as null. It is an error if a field in this list has a
  21946. // non-empty value. This may be used to include null fields in Patch
  21947. // requests.
  21948. NullFields []string `json:"-"`
  21949. }
  21950. func (s *ResourcePolicyBackupSchedulePolicy) MarshalJSON() ([]byte, error) {
  21951. type NoMethod ResourcePolicyBackupSchedulePolicy
  21952. raw := NoMethod(*s)
  21953. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21954. }
  21955. // ResourcePolicyBackupSchedulePolicyRetentionPolicy: Policy for
  21956. // retention of automatically created snapshots.
  21957. type ResourcePolicyBackupSchedulePolicyRetentionPolicy struct {
  21958. // MaxRetentionDays: Maximum age of the snapshot that is allowed to be
  21959. // kept.
  21960. MaxRetentionDays int64 `json:"maxRetentionDays,omitempty"`
  21961. // ForceSendFields is a list of field names (e.g. "MaxRetentionDays") to
  21962. // unconditionally include in API requests. By default, fields with
  21963. // empty values are omitted from API requests. However, any non-pointer,
  21964. // non-interface field appearing in ForceSendFields will be sent to the
  21965. // server regardless of whether the field is empty or not. This may be
  21966. // used to include empty fields in Patch requests.
  21967. ForceSendFields []string `json:"-"`
  21968. // NullFields is a list of field names (e.g. "MaxRetentionDays") to
  21969. // include in API requests with the JSON null value. By default, fields
  21970. // with empty values are omitted from API requests. However, any field
  21971. // with an empty value appearing in NullFields will be sent to the
  21972. // server as null. It is an error if a field in this list has a
  21973. // non-empty value. This may be used to include null fields in Patch
  21974. // requests.
  21975. NullFields []string `json:"-"`
  21976. }
  21977. func (s *ResourcePolicyBackupSchedulePolicyRetentionPolicy) MarshalJSON() ([]byte, error) {
  21978. type NoMethod ResourcePolicyBackupSchedulePolicyRetentionPolicy
  21979. raw := NoMethod(*s)
  21980. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21981. }
  21982. // ResourcePolicyBackupSchedulePolicySchedule: A schedule for disks
  21983. // where the schedueled operations are performed.
  21984. type ResourcePolicyBackupSchedulePolicySchedule struct {
  21985. DailySchedule *ResourcePolicyDailyCycle `json:"dailySchedule,omitempty"`
  21986. HourlySchedule *ResourcePolicyHourlyCycle `json:"hourlySchedule,omitempty"`
  21987. WeeklySchedule *ResourcePolicyWeeklyCycle `json:"weeklySchedule,omitempty"`
  21988. // ForceSendFields is a list of field names (e.g. "DailySchedule") to
  21989. // unconditionally include in API requests. By default, fields with
  21990. // empty values are omitted from API requests. However, any non-pointer,
  21991. // non-interface field appearing in ForceSendFields will be sent to the
  21992. // server regardless of whether the field is empty or not. This may be
  21993. // used to include empty fields in Patch requests.
  21994. ForceSendFields []string `json:"-"`
  21995. // NullFields is a list of field names (e.g. "DailySchedule") to include
  21996. // in API requests with the JSON null value. By default, fields with
  21997. // empty values are omitted from API requests. However, any field with
  21998. // an empty value appearing in NullFields will be sent to the server as
  21999. // null. It is an error if a field in this list has a non-empty value.
  22000. // This may be used to include null fields in Patch requests.
  22001. NullFields []string `json:"-"`
  22002. }
  22003. func (s *ResourcePolicyBackupSchedulePolicySchedule) MarshalJSON() ([]byte, error) {
  22004. type NoMethod ResourcePolicyBackupSchedulePolicySchedule
  22005. raw := NoMethod(*s)
  22006. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22007. }
  22008. // ResourcePolicyBackupSchedulePolicySnapshotProperties: Specified
  22009. // snapshot properties for automatic snapshots created by this policy.
  22010. type ResourcePolicyBackupSchedulePolicySnapshotProperties struct {
  22011. // GuestFlush: Indication to perform a ?guest aware? snapshot.
  22012. GuestFlush bool `json:"guestFlush,omitempty"`
  22013. // Labels: Labels to apply to automatic snapshots. These can be later
  22014. // modified by the setLabels method. Label values may be empty.
  22015. Labels map[string]string `json:"labels,omitempty"`
  22016. // ForceSendFields is a list of field names (e.g. "GuestFlush") to
  22017. // unconditionally include in API requests. By default, fields with
  22018. // empty values are omitted from API requests. However, any non-pointer,
  22019. // non-interface field appearing in ForceSendFields will be sent to the
  22020. // server regardless of whether the field is empty or not. This may be
  22021. // used to include empty fields in Patch requests.
  22022. ForceSendFields []string `json:"-"`
  22023. // NullFields is a list of field names (e.g. "GuestFlush") to include in
  22024. // API requests with the JSON null value. By default, fields with empty
  22025. // values are omitted from API requests. However, any field with an
  22026. // empty value appearing in NullFields will be sent to the server as
  22027. // null. It is an error if a field in this list has a non-empty value.
  22028. // This may be used to include null fields in Patch requests.
  22029. NullFields []string `json:"-"`
  22030. }
  22031. func (s *ResourcePolicyBackupSchedulePolicySnapshotProperties) MarshalJSON() ([]byte, error) {
  22032. type NoMethod ResourcePolicyBackupSchedulePolicySnapshotProperties
  22033. raw := NoMethod(*s)
  22034. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22035. }
  22036. // ResourcePolicyDailyCycle: Time window specified for daily operations.
  22037. type ResourcePolicyDailyCycle struct {
  22038. // DaysInCycle: Allows to define schedule that runs every nth day of the
  22039. // month.
  22040. DaysInCycle int64 `json:"daysInCycle,omitempty"`
  22041. // Duration: [Output only] Duration of the time window, automatically
  22042. // chosen to be smallest possible in the given scenario.
  22043. Duration string `json:"duration,omitempty"`
  22044. // StartTime: Time within the window to start the operations. It must be
  22045. // in format "HH:MM?, where HH : [00-23] and MM : [00-59] GMT.
  22046. StartTime string `json:"startTime,omitempty"`
  22047. // ForceSendFields is a list of field names (e.g. "DaysInCycle") to
  22048. // unconditionally include in API requests. By default, fields with
  22049. // empty values are omitted from API requests. However, any non-pointer,
  22050. // non-interface field appearing in ForceSendFields will be sent to the
  22051. // server regardless of whether the field is empty or not. This may be
  22052. // used to include empty fields in Patch requests.
  22053. ForceSendFields []string `json:"-"`
  22054. // NullFields is a list of field names (e.g. "DaysInCycle") to include
  22055. // in API requests with the JSON null value. By default, fields with
  22056. // empty values are omitted from API requests. However, any field with
  22057. // an empty value appearing in NullFields will be sent to the server as
  22058. // null. It is an error if a field in this list has a non-empty value.
  22059. // This may be used to include null fields in Patch requests.
  22060. NullFields []string `json:"-"`
  22061. }
  22062. func (s *ResourcePolicyDailyCycle) MarshalJSON() ([]byte, error) {
  22063. type NoMethod ResourcePolicyDailyCycle
  22064. raw := NoMethod(*s)
  22065. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22066. }
  22067. // ResourcePolicyHourlyCycle: Time window specified for hourly
  22068. // operations.
  22069. type ResourcePolicyHourlyCycle struct {
  22070. // Duration: [Output only] Duration of the time window, automatically
  22071. // chosen to be smallest possible in the given scenario.
  22072. Duration string `json:"duration,omitempty"`
  22073. // HoursInCycle: Allows to define schedule that runs every nth hour.
  22074. HoursInCycle int64 `json:"hoursInCycle,omitempty"`
  22075. // StartTime: Time within the window to start the operations. It must be
  22076. // in format "HH:MM?, where HH : [00-23] and MM : [00-59] GMT.
  22077. StartTime string `json:"startTime,omitempty"`
  22078. // ForceSendFields is a list of field names (e.g. "Duration") to
  22079. // unconditionally include in API requests. By default, fields with
  22080. // empty values are omitted from API requests. However, any non-pointer,
  22081. // non-interface field appearing in ForceSendFields will be sent to the
  22082. // server regardless of whether the field is empty or not. This may be
  22083. // used to include empty fields in Patch requests.
  22084. ForceSendFields []string `json:"-"`
  22085. // NullFields is a list of field names (e.g. "Duration") to include in
  22086. // API requests with the JSON null value. By default, fields with empty
  22087. // values are omitted from API requests. However, any field with an
  22088. // empty value appearing in NullFields will be sent to the server as
  22089. // null. It is an error if a field in this list has a non-empty value.
  22090. // This may be used to include null fields in Patch requests.
  22091. NullFields []string `json:"-"`
  22092. }
  22093. func (s *ResourcePolicyHourlyCycle) MarshalJSON() ([]byte, error) {
  22094. type NoMethod ResourcePolicyHourlyCycle
  22095. raw := NoMethod(*s)
  22096. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22097. }
  22098. type ResourcePolicyVmMaintenancePolicy struct {
  22099. // MaintenanceEnvironment: A hint about the environment this VM belongs
  22100. // to (production vs develoment)
  22101. //
  22102. // Possible values:
  22103. // "DEVELOPMENT"
  22104. // "MAINTENANCE_ENVIRONMENT_UNSPECIFIED"
  22105. // "PRODUCTION"
  22106. MaintenanceEnvironment string `json:"maintenanceEnvironment,omitempty"`
  22107. // MaintenanceWindow: Maintenance windows that are applied to VMs
  22108. // covered by this policy.
  22109. MaintenanceWindow *ResourcePolicyVmMaintenancePolicyMaintenanceWindow `json:"maintenanceWindow,omitempty"`
  22110. // ForceSendFields is a list of field names (e.g.
  22111. // "MaintenanceEnvironment") to unconditionally include in API requests.
  22112. // By default, fields with empty values are omitted from API requests.
  22113. // However, any non-pointer, non-interface field appearing in
  22114. // ForceSendFields will be sent to the server regardless of whether the
  22115. // field is empty or not. This may be used to include empty fields in
  22116. // Patch requests.
  22117. ForceSendFields []string `json:"-"`
  22118. // NullFields is a list of field names (e.g. "MaintenanceEnvironment")
  22119. // to include in API requests with the JSON null value. By default,
  22120. // fields with empty values are omitted from API requests. However, any
  22121. // field with an empty value appearing in NullFields will be sent to the
  22122. // server as null. It is an error if a field in this list has a
  22123. // non-empty value. This may be used to include null fields in Patch
  22124. // requests.
  22125. NullFields []string `json:"-"`
  22126. }
  22127. func (s *ResourcePolicyVmMaintenancePolicy) MarshalJSON() ([]byte, error) {
  22128. type NoMethod ResourcePolicyVmMaintenancePolicy
  22129. raw := NoMethod(*s)
  22130. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22131. }
  22132. // ResourcePolicyVmMaintenancePolicyMaintenanceWindow: A maintenance
  22133. // window for VMs. When set, we restrict our maintenance operations to
  22134. // this window.
  22135. type ResourcePolicyVmMaintenancePolicyMaintenanceWindow struct {
  22136. DailyMaintenanceWindow *ResourcePolicyDailyCycle `json:"dailyMaintenanceWindow,omitempty"`
  22137. WeeklyMaintenanceWindow *ResourcePolicyWeeklyCycle `json:"weeklyMaintenanceWindow,omitempty"`
  22138. // ForceSendFields is a list of field names (e.g.
  22139. // "DailyMaintenanceWindow") to unconditionally include in API requests.
  22140. // By default, fields with empty values are omitted from API requests.
  22141. // However, any non-pointer, non-interface field appearing in
  22142. // ForceSendFields will be sent to the server regardless of whether the
  22143. // field is empty or not. This may be used to include empty fields in
  22144. // Patch requests.
  22145. ForceSendFields []string `json:"-"`
  22146. // NullFields is a list of field names (e.g. "DailyMaintenanceWindow")
  22147. // to include in API requests with the JSON null value. By default,
  22148. // fields with empty values are omitted from API requests. However, any
  22149. // field with an empty value appearing in NullFields will be sent to the
  22150. // server as null. It is an error if a field in this list has a
  22151. // non-empty value. This may be used to include null fields in Patch
  22152. // requests.
  22153. NullFields []string `json:"-"`
  22154. }
  22155. func (s *ResourcePolicyVmMaintenancePolicyMaintenanceWindow) MarshalJSON() ([]byte, error) {
  22156. type NoMethod ResourcePolicyVmMaintenancePolicyMaintenanceWindow
  22157. raw := NoMethod(*s)
  22158. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22159. }
  22160. // ResourcePolicyWeeklyCycle: Time window specified for weekly
  22161. // operations.
  22162. type ResourcePolicyWeeklyCycle struct {
  22163. // DayOfWeeks: Up to 7 intervals/windows, one for each day of the week.
  22164. DayOfWeeks []*ResourcePolicyWeeklyCycleDayOfWeek `json:"dayOfWeeks,omitempty"`
  22165. // ForceSendFields is a list of field names (e.g. "DayOfWeeks") to
  22166. // unconditionally include in API requests. By default, fields with
  22167. // empty values are omitted from API requests. However, any non-pointer,
  22168. // non-interface field appearing in ForceSendFields will be sent to the
  22169. // server regardless of whether the field is empty or not. This may be
  22170. // used to include empty fields in Patch requests.
  22171. ForceSendFields []string `json:"-"`
  22172. // NullFields is a list of field names (e.g. "DayOfWeeks") to include in
  22173. // API requests with the JSON null value. By default, fields with empty
  22174. // values are omitted from API requests. However, any field with an
  22175. // empty value appearing in NullFields will be sent to the server as
  22176. // null. It is an error if a field in this list has a non-empty value.
  22177. // This may be used to include null fields in Patch requests.
  22178. NullFields []string `json:"-"`
  22179. }
  22180. func (s *ResourcePolicyWeeklyCycle) MarshalJSON() ([]byte, error) {
  22181. type NoMethod ResourcePolicyWeeklyCycle
  22182. raw := NoMethod(*s)
  22183. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22184. }
  22185. type ResourcePolicyWeeklyCycleDayOfWeek struct {
  22186. // Day: Allows to define schedule that runs specified day of the week.
  22187. //
  22188. // Possible values:
  22189. // "FRIDAY"
  22190. // "INVALID"
  22191. // "MONDAY"
  22192. // "SATURDAY"
  22193. // "SUNDAY"
  22194. // "THURSDAY"
  22195. // "TUESDAY"
  22196. // "WEDNESDAY"
  22197. Day string `json:"day,omitempty"`
  22198. // Duration: [Output only] Duration of the time window, automatically
  22199. // chosen to be smallest possible in the given scenario.
  22200. Duration string `json:"duration,omitempty"`
  22201. // StartTime: Time within the window to start the operations. It must be
  22202. // in format "HH:MM?, where HH : [00-23] and MM : [00-59] GMT.
  22203. StartTime string `json:"startTime,omitempty"`
  22204. // ForceSendFields is a list of field names (e.g. "Day") to
  22205. // unconditionally include in API requests. By default, fields with
  22206. // empty values are omitted from API requests. However, any non-pointer,
  22207. // non-interface field appearing in ForceSendFields will be sent to the
  22208. // server regardless of whether the field is empty or not. This may be
  22209. // used to include empty fields in Patch requests.
  22210. ForceSendFields []string `json:"-"`
  22211. // NullFields is a list of field names (e.g. "Day") to include in API
  22212. // requests with the JSON null value. By default, fields with empty
  22213. // values are omitted from API requests. However, any field with an
  22214. // empty value appearing in NullFields will be sent to the server as
  22215. // null. It is an error if a field in this list has a non-empty value.
  22216. // This may be used to include null fields in Patch requests.
  22217. NullFields []string `json:"-"`
  22218. }
  22219. func (s *ResourcePolicyWeeklyCycleDayOfWeek) MarshalJSON() ([]byte, error) {
  22220. type NoMethod ResourcePolicyWeeklyCycleDayOfWeek
  22221. raw := NoMethod(*s)
  22222. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22223. }
  22224. // Route: Represents a Route resource. A route specifies how certain
  22225. // packets should be handled by the network. Routes are associated with
  22226. // instances by tags and the set of routes for a particular instance is
  22227. // called its routing table.
  22228. //
  22229. // For each packet leaving an instance, the system searches that
  22230. // instance's routing table for a single best matching route. Routes
  22231. // match packets by destination IP address, preferring smaller or more
  22232. // specific ranges over larger ones. If there is a tie, the system
  22233. // selects the route with the smallest priority value. If there is still
  22234. // a tie, it uses the layer three and four packet headers to select just
  22235. // one of the remaining matching routes. The packet is then forwarded as
  22236. // specified by the nextHop field of the winning route - either to
  22237. // another instance destination, an instance gateway, or a Google
  22238. // Compute Engine-operated gateway.
  22239. //
  22240. // Packets that do not match any route in the sending instance's routing
  22241. // table are dropped. (== resource_for beta.routes ==) (== resource_for
  22242. // v1.routes ==)
  22243. type Route struct {
  22244. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  22245. // format.
  22246. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  22247. // Description: An optional description of this resource. Provide this
  22248. // property when you create the resource.
  22249. Description string `json:"description,omitempty"`
  22250. // DestRange: The destination range of outgoing packets that this route
  22251. // applies to. Only IPv4 is supported.
  22252. DestRange string `json:"destRange,omitempty"`
  22253. // Id: [Output Only] The unique identifier for the resource. This
  22254. // identifier is defined by the server.
  22255. Id uint64 `json:"id,omitempty,string"`
  22256. // Kind: [Output Only] Type of this resource. Always compute#routes for
  22257. // Route resources.
  22258. Kind string `json:"kind,omitempty"`
  22259. // Name: Name of the resource. Provided by the client when the resource
  22260. // is created. The name must be 1-63 characters long, and comply with
  22261. // RFC1035. Specifically, the name must be 1-63 characters long and
  22262. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  22263. // the first character must be a lowercase letter, and all following
  22264. // characters must be a dash, lowercase letter, or digit, except the
  22265. // last character, which cannot be a dash.
  22266. Name string `json:"name,omitempty"`
  22267. // Network: Fully-qualified URL of the network that this route applies
  22268. // to.
  22269. Network string `json:"network,omitempty"`
  22270. // NextHopGateway: The URL to a gateway that should handle matching
  22271. // packets. You can only specify the internet gateway using a full or
  22272. // partial valid URL:
  22273. // projects/<project-id>/global/gateways/default-internet-gateway
  22274. NextHopGateway string `json:"nextHopGateway,omitempty"`
  22275. // NextHopIlb: The URL to a forwarding rule of type
  22276. // loadBalancingScheme=INTERNAL that should handle matching packets. You
  22277. // can only specify the forwarding rule as a partial or full URL. For
  22278. // example, the following are all valid URLs:
  22279. // -
  22280. // https://www.googleapis.com/compute/v1/projects/project/regions/region/forwardingRules/forwardingRule
  22281. // - regions/region/forwardingRules/forwardingRule Note that this can
  22282. // only be used when the destination_range is a public (non-RFC 1918) IP
  22283. // CIDR range.
  22284. NextHopIlb string `json:"nextHopIlb,omitempty"`
  22285. // NextHopInstance: The URL to an instance that should handle matching
  22286. // packets. You can specify this as a full or partial URL. For
  22287. // example:
  22288. // https://www.googleapis.com/compute/v1/projects/project/zones/
  22289. // zone/instances/
  22290. NextHopInstance string `json:"nextHopInstance,omitempty"`
  22291. // NextHopIp: The network IP address of an instance that should handle
  22292. // matching packets. Only IPv4 is supported.
  22293. NextHopIp string `json:"nextHopIp,omitempty"`
  22294. // NextHopNetwork: The URL of the local network if it should handle
  22295. // matching packets.
  22296. NextHopNetwork string `json:"nextHopNetwork,omitempty"`
  22297. // NextHopPeering: [Output Only] The network peering name that should
  22298. // handle matching packets, which should conform to RFC1035.
  22299. NextHopPeering string `json:"nextHopPeering,omitempty"`
  22300. // NextHopVpnTunnel: The URL to a VpnTunnel that should handle matching
  22301. // packets.
  22302. NextHopVpnTunnel string `json:"nextHopVpnTunnel,omitempty"`
  22303. // Priority: The priority of this route. Priority is used to break ties
  22304. // in cases where there is more than one matching route of equal prefix
  22305. // length. In the case of two routes with equal prefix length, the one
  22306. // with the lowest-numbered priority value wins. Default value is 1000.
  22307. // Valid range is 0 through 65535.
  22308. Priority int64 `json:"priority,omitempty"`
  22309. // SelfLink: [Output Only] Server-defined fully-qualified URL for this
  22310. // resource.
  22311. SelfLink string `json:"selfLink,omitempty"`
  22312. // Tags: A list of instance tags to which this route applies.
  22313. Tags []string `json:"tags,omitempty"`
  22314. // Warnings: [Output Only] If potential misconfigurations are detected
  22315. // for this route, this field will be populated with warning messages.
  22316. Warnings []*RouteWarnings `json:"warnings,omitempty"`
  22317. // ServerResponse contains the HTTP response code and headers from the
  22318. // server.
  22319. googleapi.ServerResponse `json:"-"`
  22320. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  22321. // to unconditionally include in API requests. By default, fields with
  22322. // empty values are omitted from API requests. However, any non-pointer,
  22323. // non-interface field appearing in ForceSendFields will be sent to the
  22324. // server regardless of whether the field is empty or not. This may be
  22325. // used to include empty fields in Patch requests.
  22326. ForceSendFields []string `json:"-"`
  22327. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  22328. // include in API requests with the JSON null value. By default, fields
  22329. // with empty values are omitted from API requests. However, any field
  22330. // with an empty value appearing in NullFields will be sent to the
  22331. // server as null. It is an error if a field in this list has a
  22332. // non-empty value. This may be used to include null fields in Patch
  22333. // requests.
  22334. NullFields []string `json:"-"`
  22335. }
  22336. func (s *Route) MarshalJSON() ([]byte, error) {
  22337. type NoMethod Route
  22338. raw := NoMethod(*s)
  22339. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22340. }
  22341. type RouteWarnings struct {
  22342. // Code: [Output Only] A warning code, if applicable. For example,
  22343. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  22344. // the response.
  22345. //
  22346. // Possible values:
  22347. // "CLEANUP_FAILED"
  22348. // "DEPRECATED_RESOURCE_USED"
  22349. // "DEPRECATED_TYPE_USED"
  22350. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  22351. // "EXPERIMENTAL_TYPE_USED"
  22352. // "EXTERNAL_API_WARNING"
  22353. // "FIELD_VALUE_OVERRIDEN"
  22354. // "INJECTED_KERNELS_DEPRECATED"
  22355. // "MISSING_TYPE_DEPENDENCY"
  22356. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  22357. // "NEXT_HOP_CANNOT_IP_FORWARD"
  22358. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  22359. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  22360. // "NEXT_HOP_NOT_RUNNING"
  22361. // "NOT_CRITICAL_ERROR"
  22362. // "NO_RESULTS_ON_PAGE"
  22363. // "REQUIRED_TOS_AGREEMENT"
  22364. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  22365. // "RESOURCE_NOT_DELETED"
  22366. // "SCHEMA_VALIDATION_IGNORED"
  22367. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  22368. // "UNDECLARED_PROPERTIES"
  22369. // "UNREACHABLE"
  22370. Code string `json:"code,omitempty"`
  22371. // Data: [Output Only] Metadata about this warning in key: value format.
  22372. // For example:
  22373. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  22374. Data []*RouteWarningsData `json:"data,omitempty"`
  22375. // Message: [Output Only] A human-readable description of the warning
  22376. // code.
  22377. Message string `json:"message,omitempty"`
  22378. // ForceSendFields is a list of field names (e.g. "Code") to
  22379. // unconditionally include in API requests. By default, fields with
  22380. // empty values are omitted from API requests. However, any non-pointer,
  22381. // non-interface field appearing in ForceSendFields will be sent to the
  22382. // server regardless of whether the field is empty or not. This may be
  22383. // used to include empty fields in Patch requests.
  22384. ForceSendFields []string `json:"-"`
  22385. // NullFields is a list of field names (e.g. "Code") to include in API
  22386. // requests with the JSON null value. By default, fields with empty
  22387. // values are omitted from API requests. However, any field with an
  22388. // empty value appearing in NullFields will be sent to the server as
  22389. // null. It is an error if a field in this list has a non-empty value.
  22390. // This may be used to include null fields in Patch requests.
  22391. NullFields []string `json:"-"`
  22392. }
  22393. func (s *RouteWarnings) MarshalJSON() ([]byte, error) {
  22394. type NoMethod RouteWarnings
  22395. raw := NoMethod(*s)
  22396. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22397. }
  22398. type RouteWarningsData struct {
  22399. // Key: [Output Only] A key that provides more detail on the warning
  22400. // being returned. For example, for warnings where there are no results
  22401. // in a list request for a particular zone, this key might be scope and
  22402. // the key value might be the zone name. Other examples might be a key
  22403. // indicating a deprecated resource and a suggested replacement, or a
  22404. // warning about invalid network settings (for example, if an instance
  22405. // attempts to perform IP forwarding but is not enabled for IP
  22406. // forwarding).
  22407. Key string `json:"key,omitempty"`
  22408. // Value: [Output Only] A warning data value corresponding to the key.
  22409. Value string `json:"value,omitempty"`
  22410. // ForceSendFields is a list of field names (e.g. "Key") to
  22411. // unconditionally include in API requests. By default, fields with
  22412. // empty values are omitted from API requests. However, any non-pointer,
  22413. // non-interface field appearing in ForceSendFields will be sent to the
  22414. // server regardless of whether the field is empty or not. This may be
  22415. // used to include empty fields in Patch requests.
  22416. ForceSendFields []string `json:"-"`
  22417. // NullFields is a list of field names (e.g. "Key") to include in API
  22418. // requests with the JSON null value. By default, fields with empty
  22419. // values are omitted from API requests. However, any field with an
  22420. // empty value appearing in NullFields will be sent to the server as
  22421. // null. It is an error if a field in this list has a non-empty value.
  22422. // This may be used to include null fields in Patch requests.
  22423. NullFields []string `json:"-"`
  22424. }
  22425. func (s *RouteWarningsData) MarshalJSON() ([]byte, error) {
  22426. type NoMethod RouteWarningsData
  22427. raw := NoMethod(*s)
  22428. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22429. }
  22430. // RouteList: Contains a list of Route resources.
  22431. type RouteList struct {
  22432. // Id: [Output Only] Unique identifier for the resource; defined by the
  22433. // server.
  22434. Id string `json:"id,omitempty"`
  22435. // Items: A list of Route resources.
  22436. Items []*Route `json:"items,omitempty"`
  22437. // Kind: Type of resource.
  22438. Kind string `json:"kind,omitempty"`
  22439. // NextPageToken: [Output Only] This token allows you to get the next
  22440. // page of results for list requests. If the number of results is larger
  22441. // than maxResults, use the nextPageToken as a value for the query
  22442. // parameter pageToken in the next list request. Subsequent list
  22443. // requests will have their own nextPageToken to continue paging through
  22444. // the results.
  22445. NextPageToken string `json:"nextPageToken,omitempty"`
  22446. // SelfLink: [Output Only] Server-defined URL for this resource.
  22447. SelfLink string `json:"selfLink,omitempty"`
  22448. // Warning: [Output Only] Informational warning message.
  22449. Warning *RouteListWarning `json:"warning,omitempty"`
  22450. // ServerResponse contains the HTTP response code and headers from the
  22451. // server.
  22452. googleapi.ServerResponse `json:"-"`
  22453. // ForceSendFields is a list of field names (e.g. "Id") to
  22454. // unconditionally include in API requests. By default, fields with
  22455. // empty values are omitted from API requests. However, any non-pointer,
  22456. // non-interface field appearing in ForceSendFields will be sent to the
  22457. // server regardless of whether the field is empty or not. This may be
  22458. // used to include empty fields in Patch requests.
  22459. ForceSendFields []string `json:"-"`
  22460. // NullFields is a list of field names (e.g. "Id") to include in API
  22461. // requests with the JSON null value. By default, fields with empty
  22462. // values are omitted from API requests. However, any field with an
  22463. // empty value appearing in NullFields will be sent to the server as
  22464. // null. It is an error if a field in this list has a non-empty value.
  22465. // This may be used to include null fields in Patch requests.
  22466. NullFields []string `json:"-"`
  22467. }
  22468. func (s *RouteList) MarshalJSON() ([]byte, error) {
  22469. type NoMethod RouteList
  22470. raw := NoMethod(*s)
  22471. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22472. }
  22473. // RouteListWarning: [Output Only] Informational warning message.
  22474. type RouteListWarning struct {
  22475. // Code: [Output Only] A warning code, if applicable. For example,
  22476. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  22477. // the response.
  22478. //
  22479. // Possible values:
  22480. // "CLEANUP_FAILED"
  22481. // "DEPRECATED_RESOURCE_USED"
  22482. // "DEPRECATED_TYPE_USED"
  22483. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  22484. // "EXPERIMENTAL_TYPE_USED"
  22485. // "EXTERNAL_API_WARNING"
  22486. // "FIELD_VALUE_OVERRIDEN"
  22487. // "INJECTED_KERNELS_DEPRECATED"
  22488. // "MISSING_TYPE_DEPENDENCY"
  22489. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  22490. // "NEXT_HOP_CANNOT_IP_FORWARD"
  22491. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  22492. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  22493. // "NEXT_HOP_NOT_RUNNING"
  22494. // "NOT_CRITICAL_ERROR"
  22495. // "NO_RESULTS_ON_PAGE"
  22496. // "REQUIRED_TOS_AGREEMENT"
  22497. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  22498. // "RESOURCE_NOT_DELETED"
  22499. // "SCHEMA_VALIDATION_IGNORED"
  22500. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  22501. // "UNDECLARED_PROPERTIES"
  22502. // "UNREACHABLE"
  22503. Code string `json:"code,omitempty"`
  22504. // Data: [Output Only] Metadata about this warning in key: value format.
  22505. // For example:
  22506. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  22507. Data []*RouteListWarningData `json:"data,omitempty"`
  22508. // Message: [Output Only] A human-readable description of the warning
  22509. // code.
  22510. Message string `json:"message,omitempty"`
  22511. // ForceSendFields is a list of field names (e.g. "Code") to
  22512. // unconditionally include in API requests. By default, fields with
  22513. // empty values are omitted from API requests. However, any non-pointer,
  22514. // non-interface field appearing in ForceSendFields will be sent to the
  22515. // server regardless of whether the field is empty or not. This may be
  22516. // used to include empty fields in Patch requests.
  22517. ForceSendFields []string `json:"-"`
  22518. // NullFields is a list of field names (e.g. "Code") to include in API
  22519. // requests with the JSON null value. By default, fields with empty
  22520. // values are omitted from API requests. However, any field with an
  22521. // empty value appearing in NullFields will be sent to the server as
  22522. // null. It is an error if a field in this list has a non-empty value.
  22523. // This may be used to include null fields in Patch requests.
  22524. NullFields []string `json:"-"`
  22525. }
  22526. func (s *RouteListWarning) MarshalJSON() ([]byte, error) {
  22527. type NoMethod RouteListWarning
  22528. raw := NoMethod(*s)
  22529. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22530. }
  22531. type RouteListWarningData struct {
  22532. // Key: [Output Only] A key that provides more detail on the warning
  22533. // being returned. For example, for warnings where there are no results
  22534. // in a list request for a particular zone, this key might be scope and
  22535. // the key value might be the zone name. Other examples might be a key
  22536. // indicating a deprecated resource and a suggested replacement, or a
  22537. // warning about invalid network settings (for example, if an instance
  22538. // attempts to perform IP forwarding but is not enabled for IP
  22539. // forwarding).
  22540. Key string `json:"key,omitempty"`
  22541. // Value: [Output Only] A warning data value corresponding to the key.
  22542. Value string `json:"value,omitempty"`
  22543. // ForceSendFields is a list of field names (e.g. "Key") to
  22544. // unconditionally include in API requests. By default, fields with
  22545. // empty values are omitted from API requests. However, any non-pointer,
  22546. // non-interface field appearing in ForceSendFields will be sent to the
  22547. // server regardless of whether the field is empty or not. This may be
  22548. // used to include empty fields in Patch requests.
  22549. ForceSendFields []string `json:"-"`
  22550. // NullFields is a list of field names (e.g. "Key") to include in API
  22551. // requests with the JSON null value. By default, fields with empty
  22552. // values are omitted from API requests. However, any field with an
  22553. // empty value appearing in NullFields will be sent to the server as
  22554. // null. It is an error if a field in this list has a non-empty value.
  22555. // This may be used to include null fields in Patch requests.
  22556. NullFields []string `json:"-"`
  22557. }
  22558. func (s *RouteListWarningData) MarshalJSON() ([]byte, error) {
  22559. type NoMethod RouteListWarningData
  22560. raw := NoMethod(*s)
  22561. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22562. }
  22563. // Router: Router resource.
  22564. type Router struct {
  22565. // Bgp: BGP information specific to this router.
  22566. Bgp *RouterBgp `json:"bgp,omitempty"`
  22567. // BgpPeers: BGP information that needs to be configured into the
  22568. // routing stack to establish the BGP peering. It must specify peer ASN
  22569. // and either interface name, IP, or peer IP. Please refer to RFC4273.
  22570. BgpPeers []*RouterBgpPeer `json:"bgpPeers,omitempty"`
  22571. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  22572. // format.
  22573. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  22574. // Description: An optional description of this resource. Provide this
  22575. // property when you create the resource.
  22576. Description string `json:"description,omitempty"`
  22577. // Id: [Output Only] The unique identifier for the resource. This
  22578. // identifier is defined by the server.
  22579. Id uint64 `json:"id,omitempty,string"`
  22580. // Interfaces: Router interfaces. Each interface requires either one
  22581. // linked resource (e.g. linkedVpnTunnel), or IP address and IP address
  22582. // range (e.g. ipRange), or both.
  22583. Interfaces []*RouterInterface `json:"interfaces,omitempty"`
  22584. // Kind: [Output Only] Type of resource. Always compute#router for
  22585. // routers.
  22586. Kind string `json:"kind,omitempty"`
  22587. // Name: Name of the resource. Provided by the client when the resource
  22588. // is created. The name must be 1-63 characters long, and comply with
  22589. // RFC1035. Specifically, the name must be 1-63 characters long and
  22590. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  22591. // the first character must be a lowercase letter, and all following
  22592. // characters must be a dash, lowercase letter, or digit, except the
  22593. // last character, which cannot be a dash.
  22594. Name string `json:"name,omitempty"`
  22595. // Nats: A list of Nat services created in this router.
  22596. Nats []*RouterNat `json:"nats,omitempty"`
  22597. // Network: URI of the network to which this router belongs.
  22598. Network string `json:"network,omitempty"`
  22599. // Region: [Output Only] URI of the region where the router resides. You
  22600. // must specify this field as part of the HTTP request URL. It is not
  22601. // settable as a field in the request body.
  22602. Region string `json:"region,omitempty"`
  22603. // SelfLink: [Output Only] Server-defined URL for the resource.
  22604. SelfLink string `json:"selfLink,omitempty"`
  22605. // ServerResponse contains the HTTP response code and headers from the
  22606. // server.
  22607. googleapi.ServerResponse `json:"-"`
  22608. // ForceSendFields is a list of field names (e.g. "Bgp") to
  22609. // unconditionally include in API requests. By default, fields with
  22610. // empty values are omitted from API requests. However, any non-pointer,
  22611. // non-interface field appearing in ForceSendFields will be sent to the
  22612. // server regardless of whether the field is empty or not. This may be
  22613. // used to include empty fields in Patch requests.
  22614. ForceSendFields []string `json:"-"`
  22615. // NullFields is a list of field names (e.g. "Bgp") to include in API
  22616. // requests with the JSON null value. By default, fields with empty
  22617. // values are omitted from API requests. However, any field with an
  22618. // empty value appearing in NullFields will be sent to the server as
  22619. // null. It is an error if a field in this list has a non-empty value.
  22620. // This may be used to include null fields in Patch requests.
  22621. NullFields []string `json:"-"`
  22622. }
  22623. func (s *Router) MarshalJSON() ([]byte, error) {
  22624. type NoMethod Router
  22625. raw := NoMethod(*s)
  22626. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22627. }
  22628. // RouterAdvertisedIpRange: Description-tagged IP ranges for the router
  22629. // to advertise.
  22630. type RouterAdvertisedIpRange struct {
  22631. // Description: User-specified description for the IP range.
  22632. Description string `json:"description,omitempty"`
  22633. // Range: The IP range to advertise. The value must be a CIDR-formatted
  22634. // string.
  22635. Range string `json:"range,omitempty"`
  22636. // ForceSendFields is a list of field names (e.g. "Description") to
  22637. // unconditionally include in API requests. By default, fields with
  22638. // empty values are omitted from API requests. However, any non-pointer,
  22639. // non-interface field appearing in ForceSendFields will be sent to the
  22640. // server regardless of whether the field is empty or not. This may be
  22641. // used to include empty fields in Patch requests.
  22642. ForceSendFields []string `json:"-"`
  22643. // NullFields is a list of field names (e.g. "Description") to include
  22644. // in API requests with the JSON null value. By default, fields with
  22645. // empty values are omitted from API requests. However, any field with
  22646. // an empty value appearing in NullFields will be sent to the server as
  22647. // null. It is an error if a field in this list has a non-empty value.
  22648. // This may be used to include null fields in Patch requests.
  22649. NullFields []string `json:"-"`
  22650. }
  22651. func (s *RouterAdvertisedIpRange) MarshalJSON() ([]byte, error) {
  22652. type NoMethod RouterAdvertisedIpRange
  22653. raw := NoMethod(*s)
  22654. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22655. }
  22656. // RouterAggregatedList: Contains a list of routers.
  22657. type RouterAggregatedList struct {
  22658. // Id: [Output Only] Unique identifier for the resource; defined by the
  22659. // server.
  22660. Id string `json:"id,omitempty"`
  22661. // Items: A list of Router resources.
  22662. Items map[string]RoutersScopedList `json:"items,omitempty"`
  22663. // Kind: Type of resource.
  22664. Kind string `json:"kind,omitempty"`
  22665. // NextPageToken: [Output Only] This token allows you to get the next
  22666. // page of results for list requests. If the number of results is larger
  22667. // than maxResults, use the nextPageToken as a value for the query
  22668. // parameter pageToken in the next list request. Subsequent list
  22669. // requests will have their own nextPageToken to continue paging through
  22670. // the results.
  22671. NextPageToken string `json:"nextPageToken,omitempty"`
  22672. // SelfLink: [Output Only] Server-defined URL for this resource.
  22673. SelfLink string `json:"selfLink,omitempty"`
  22674. // Warning: [Output Only] Informational warning message.
  22675. Warning *RouterAggregatedListWarning `json:"warning,omitempty"`
  22676. // ServerResponse contains the HTTP response code and headers from the
  22677. // server.
  22678. googleapi.ServerResponse `json:"-"`
  22679. // ForceSendFields is a list of field names (e.g. "Id") to
  22680. // unconditionally include in API requests. By default, fields with
  22681. // empty values are omitted from API requests. However, any non-pointer,
  22682. // non-interface field appearing in ForceSendFields will be sent to the
  22683. // server regardless of whether the field is empty or not. This may be
  22684. // used to include empty fields in Patch requests.
  22685. ForceSendFields []string `json:"-"`
  22686. // NullFields is a list of field names (e.g. "Id") to include in API
  22687. // requests with the JSON null value. By default, fields with empty
  22688. // values are omitted from API requests. However, any field with an
  22689. // empty value appearing in NullFields will be sent to the server as
  22690. // null. It is an error if a field in this list has a non-empty value.
  22691. // This may be used to include null fields in Patch requests.
  22692. NullFields []string `json:"-"`
  22693. }
  22694. func (s *RouterAggregatedList) MarshalJSON() ([]byte, error) {
  22695. type NoMethod RouterAggregatedList
  22696. raw := NoMethod(*s)
  22697. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22698. }
  22699. // RouterAggregatedListWarning: [Output Only] Informational warning
  22700. // message.
  22701. type RouterAggregatedListWarning struct {
  22702. // Code: [Output Only] A warning code, if applicable. For example,
  22703. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  22704. // the response.
  22705. //
  22706. // Possible values:
  22707. // "CLEANUP_FAILED"
  22708. // "DEPRECATED_RESOURCE_USED"
  22709. // "DEPRECATED_TYPE_USED"
  22710. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  22711. // "EXPERIMENTAL_TYPE_USED"
  22712. // "EXTERNAL_API_WARNING"
  22713. // "FIELD_VALUE_OVERRIDEN"
  22714. // "INJECTED_KERNELS_DEPRECATED"
  22715. // "MISSING_TYPE_DEPENDENCY"
  22716. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  22717. // "NEXT_HOP_CANNOT_IP_FORWARD"
  22718. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  22719. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  22720. // "NEXT_HOP_NOT_RUNNING"
  22721. // "NOT_CRITICAL_ERROR"
  22722. // "NO_RESULTS_ON_PAGE"
  22723. // "REQUIRED_TOS_AGREEMENT"
  22724. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  22725. // "RESOURCE_NOT_DELETED"
  22726. // "SCHEMA_VALIDATION_IGNORED"
  22727. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  22728. // "UNDECLARED_PROPERTIES"
  22729. // "UNREACHABLE"
  22730. Code string `json:"code,omitempty"`
  22731. // Data: [Output Only] Metadata about this warning in key: value format.
  22732. // For example:
  22733. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  22734. Data []*RouterAggregatedListWarningData `json:"data,omitempty"`
  22735. // Message: [Output Only] A human-readable description of the warning
  22736. // code.
  22737. Message string `json:"message,omitempty"`
  22738. // ForceSendFields is a list of field names (e.g. "Code") to
  22739. // unconditionally include in API requests. By default, fields with
  22740. // empty values are omitted from API requests. However, any non-pointer,
  22741. // non-interface field appearing in ForceSendFields will be sent to the
  22742. // server regardless of whether the field is empty or not. This may be
  22743. // used to include empty fields in Patch requests.
  22744. ForceSendFields []string `json:"-"`
  22745. // NullFields is a list of field names (e.g. "Code") to include in API
  22746. // requests with the JSON null value. By default, fields with empty
  22747. // values are omitted from API requests. However, any field with an
  22748. // empty value appearing in NullFields will be sent to the server as
  22749. // null. It is an error if a field in this list has a non-empty value.
  22750. // This may be used to include null fields in Patch requests.
  22751. NullFields []string `json:"-"`
  22752. }
  22753. func (s *RouterAggregatedListWarning) MarshalJSON() ([]byte, error) {
  22754. type NoMethod RouterAggregatedListWarning
  22755. raw := NoMethod(*s)
  22756. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22757. }
  22758. type RouterAggregatedListWarningData struct {
  22759. // Key: [Output Only] A key that provides more detail on the warning
  22760. // being returned. For example, for warnings where there are no results
  22761. // in a list request for a particular zone, this key might be scope and
  22762. // the key value might be the zone name. Other examples might be a key
  22763. // indicating a deprecated resource and a suggested replacement, or a
  22764. // warning about invalid network settings (for example, if an instance
  22765. // attempts to perform IP forwarding but is not enabled for IP
  22766. // forwarding).
  22767. Key string `json:"key,omitempty"`
  22768. // Value: [Output Only] A warning data value corresponding to the key.
  22769. Value string `json:"value,omitempty"`
  22770. // ForceSendFields is a list of field names (e.g. "Key") to
  22771. // unconditionally include in API requests. By default, fields with
  22772. // empty values are omitted from API requests. However, any non-pointer,
  22773. // non-interface field appearing in ForceSendFields will be sent to the
  22774. // server regardless of whether the field is empty or not. This may be
  22775. // used to include empty fields in Patch requests.
  22776. ForceSendFields []string `json:"-"`
  22777. // NullFields is a list of field names (e.g. "Key") to include in API
  22778. // requests with the JSON null value. By default, fields with empty
  22779. // values are omitted from API requests. However, any field with an
  22780. // empty value appearing in NullFields will be sent to the server as
  22781. // null. It is an error if a field in this list has a non-empty value.
  22782. // This may be used to include null fields in Patch requests.
  22783. NullFields []string `json:"-"`
  22784. }
  22785. func (s *RouterAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  22786. type NoMethod RouterAggregatedListWarningData
  22787. raw := NoMethod(*s)
  22788. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22789. }
  22790. type RouterBgp struct {
  22791. // AdvertiseMode: User-specified flag to indicate which mode to use for
  22792. // advertisement.
  22793. //
  22794. // Possible values:
  22795. // "CUSTOM"
  22796. // "DEFAULT"
  22797. AdvertiseMode string `json:"advertiseMode,omitempty"`
  22798. // AdvertisedGroups: User-specified list of prefix groups to advertise
  22799. // in custom mode. This field can only be populated if advertise_mode is
  22800. // CUSTOM and is advertised to all peers of the router. These groups
  22801. // will be advertised in addition to any specified prefixes. Leave this
  22802. // field blank to advertise no custom groups.
  22803. //
  22804. // Possible values:
  22805. // "ALL_SUBNETS"
  22806. AdvertisedGroups []string `json:"advertisedGroups,omitempty"`
  22807. // AdvertisedIpRanges: User-specified list of individual IP ranges to
  22808. // advertise in custom mode. This field can only be populated if
  22809. // advertise_mode is CUSTOM and is advertised to all peers of the
  22810. // router. These IP ranges will be advertised in addition to any
  22811. // specified groups. Leave this field blank to advertise no custom IP
  22812. // ranges.
  22813. AdvertisedIpRanges []*RouterAdvertisedIpRange `json:"advertisedIpRanges,omitempty"`
  22814. // Asn: Local BGP Autonomous System Number (ASN). Must be an RFC6996
  22815. // private ASN, either 16-bit or 32-bit. The value will be fixed for
  22816. // this router resource. All VPN tunnels that link to this router will
  22817. // have the same local ASN.
  22818. Asn int64 `json:"asn,omitempty"`
  22819. // ForceSendFields is a list of field names (e.g. "AdvertiseMode") to
  22820. // unconditionally include in API requests. By default, fields with
  22821. // empty values are omitted from API requests. However, any non-pointer,
  22822. // non-interface field appearing in ForceSendFields will be sent to the
  22823. // server regardless of whether the field is empty or not. This may be
  22824. // used to include empty fields in Patch requests.
  22825. ForceSendFields []string `json:"-"`
  22826. // NullFields is a list of field names (e.g. "AdvertiseMode") to include
  22827. // in API requests with the JSON null value. By default, fields with
  22828. // empty values are omitted from API requests. However, any field with
  22829. // an empty value appearing in NullFields will be sent to the server as
  22830. // null. It is an error if a field in this list has a non-empty value.
  22831. // This may be used to include null fields in Patch requests.
  22832. NullFields []string `json:"-"`
  22833. }
  22834. func (s *RouterBgp) MarshalJSON() ([]byte, error) {
  22835. type NoMethod RouterBgp
  22836. raw := NoMethod(*s)
  22837. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22838. }
  22839. type RouterBgpPeer struct {
  22840. // AdvertiseMode: User-specified flag to indicate which mode to use for
  22841. // advertisement.
  22842. //
  22843. // Possible values:
  22844. // "CUSTOM"
  22845. // "DEFAULT"
  22846. AdvertiseMode string `json:"advertiseMode,omitempty"`
  22847. // AdvertisedGroups: User-specified list of prefix groups to advertise
  22848. // in custom mode. This field can only be populated if advertise_mode is
  22849. // CUSTOM and overrides the list defined for the router (in Bgp
  22850. // message). These groups will be advertised in addition to any
  22851. // specified prefixes. Leave this field blank to advertise no custom
  22852. // groups.
  22853. //
  22854. // Possible values:
  22855. // "ALL_SUBNETS"
  22856. AdvertisedGroups []string `json:"advertisedGroups,omitempty"`
  22857. // AdvertisedIpRanges: User-specified list of individual IP ranges to
  22858. // advertise in custom mode. This field can only be populated if
  22859. // advertise_mode is CUSTOM and overrides the list defined for the
  22860. // router (in Bgp message). These IP ranges will be advertised in
  22861. // addition to any specified groups. Leave this field blank to advertise
  22862. // no custom IP ranges.
  22863. AdvertisedIpRanges []*RouterAdvertisedIpRange `json:"advertisedIpRanges,omitempty"`
  22864. // AdvertisedRoutePriority: The priority of routes advertised to this
  22865. // BGP peer. In the case where there is more than one matching route of
  22866. // maximum length, the routes with lowest priority value win.
  22867. AdvertisedRoutePriority int64 `json:"advertisedRoutePriority,omitempty"`
  22868. // InterfaceName: Name of the interface the BGP peer is associated with.
  22869. InterfaceName string `json:"interfaceName,omitempty"`
  22870. // IpAddress: IP address of the interface inside Google Cloud Platform.
  22871. // Only IPv4 is supported.
  22872. IpAddress string `json:"ipAddress,omitempty"`
  22873. // ManagementType: [Output Only] Type of how the resource/configuration
  22874. // of the BGP peer is managed. MANAGED_BY_USER is the default value;
  22875. // MANAGED_BY_ATTACHMENT represents an BGP peer that is automatically
  22876. // created for PARTNER interconnectAttachment, Google will automatically
  22877. // create/delete this type of BGP peer when the PARTNER
  22878. // interconnectAttachment is created/deleted.
  22879. //
  22880. // Possible values:
  22881. // "MANAGED_BY_ATTACHMENT"
  22882. // "MANAGED_BY_USER"
  22883. ManagementType string `json:"managementType,omitempty"`
  22884. // Name: Name of this BGP peer. The name must be 1-63 characters long
  22885. // and comply with RFC1035.
  22886. Name string `json:"name,omitempty"`
  22887. // PeerAsn: Peer BGP Autonomous System Number (ASN). For VPN use case,
  22888. // this value can be different for every tunnel.
  22889. PeerAsn int64 `json:"peerAsn,omitempty"`
  22890. // PeerIpAddress: IP address of the BGP interface outside Google cloud.
  22891. // Only IPv4 is supported.
  22892. PeerIpAddress string `json:"peerIpAddress,omitempty"`
  22893. // ForceSendFields is a list of field names (e.g. "AdvertiseMode") to
  22894. // unconditionally include in API requests. By default, fields with
  22895. // empty values are omitted from API requests. However, any non-pointer,
  22896. // non-interface field appearing in ForceSendFields will be sent to the
  22897. // server regardless of whether the field is empty or not. This may be
  22898. // used to include empty fields in Patch requests.
  22899. ForceSendFields []string `json:"-"`
  22900. // NullFields is a list of field names (e.g. "AdvertiseMode") to include
  22901. // in API requests with the JSON null value. By default, fields with
  22902. // empty values are omitted from API requests. However, any field with
  22903. // an empty value appearing in NullFields will be sent to the server as
  22904. // null. It is an error if a field in this list has a non-empty value.
  22905. // This may be used to include null fields in Patch requests.
  22906. NullFields []string `json:"-"`
  22907. }
  22908. func (s *RouterBgpPeer) MarshalJSON() ([]byte, error) {
  22909. type NoMethod RouterBgpPeer
  22910. raw := NoMethod(*s)
  22911. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22912. }
  22913. type RouterInterface struct {
  22914. // IpRange: IP address and range of the interface. The IP range must be
  22915. // in the RFC3927 link-local IP space. The value must be a
  22916. // CIDR-formatted string, for example: 169.254.0.1/30. NOTE: Do not
  22917. // truncate the address as it represents the IP address of the
  22918. // interface.
  22919. IpRange string `json:"ipRange,omitempty"`
  22920. // LinkedInterconnectAttachment: URI of the linked interconnect
  22921. // attachment. It must be in the same region as the router. Each
  22922. // interface can have at most one linked resource and it could either be
  22923. // a VPN Tunnel or an interconnect attachment.
  22924. LinkedInterconnectAttachment string `json:"linkedInterconnectAttachment,omitempty"`
  22925. // LinkedVpnTunnel: URI of the linked VPN tunnel. It must be in the same
  22926. // region as the router. Each interface can have at most one linked
  22927. // resource and it could either be a VPN Tunnel or an interconnect
  22928. // attachment.
  22929. LinkedVpnTunnel string `json:"linkedVpnTunnel,omitempty"`
  22930. // ManagementType: [Output Only] Type of how the resource/configuration
  22931. // of the interface is managed. MANAGED_BY_USER is the default value;
  22932. // MANAGED_BY_ATTACHMENT represents an interface that is automatically
  22933. // created for PARTNER type interconnectAttachment, Google will
  22934. // automatically create/update/delete this type of interface when the
  22935. // PARTNER interconnectAttachment is created/provisioned/deleted.
  22936. //
  22937. // Possible values:
  22938. // "MANAGED_BY_ATTACHMENT"
  22939. // "MANAGED_BY_USER"
  22940. ManagementType string `json:"managementType,omitempty"`
  22941. // Name: Name of this interface entry. The name must be 1-63 characters
  22942. // long and comply with RFC1035.
  22943. Name string `json:"name,omitempty"`
  22944. // ForceSendFields is a list of field names (e.g. "IpRange") to
  22945. // unconditionally include in API requests. By default, fields with
  22946. // empty values are omitted from API requests. However, any non-pointer,
  22947. // non-interface field appearing in ForceSendFields will be sent to the
  22948. // server regardless of whether the field is empty or not. This may be
  22949. // used to include empty fields in Patch requests.
  22950. ForceSendFields []string `json:"-"`
  22951. // NullFields is a list of field names (e.g. "IpRange") to include in
  22952. // API requests with the JSON null value. By default, fields with empty
  22953. // values are omitted from API requests. However, any field with an
  22954. // empty value appearing in NullFields will be sent to the server as
  22955. // null. It is an error if a field in this list has a non-empty value.
  22956. // This may be used to include null fields in Patch requests.
  22957. NullFields []string `json:"-"`
  22958. }
  22959. func (s *RouterInterface) MarshalJSON() ([]byte, error) {
  22960. type NoMethod RouterInterface
  22961. raw := NoMethod(*s)
  22962. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22963. }
  22964. // RouterList: Contains a list of Router resources.
  22965. type RouterList struct {
  22966. // Id: [Output Only] Unique identifier for the resource; defined by the
  22967. // server.
  22968. Id string `json:"id,omitempty"`
  22969. // Items: A list of Router resources.
  22970. Items []*Router `json:"items,omitempty"`
  22971. // Kind: [Output Only] Type of resource. Always compute#router for
  22972. // routers.
  22973. Kind string `json:"kind,omitempty"`
  22974. // NextPageToken: [Output Only] This token allows you to get the next
  22975. // page of results for list requests. If the number of results is larger
  22976. // than maxResults, use the nextPageToken as a value for the query
  22977. // parameter pageToken in the next list request. Subsequent list
  22978. // requests will have their own nextPageToken to continue paging through
  22979. // the results.
  22980. NextPageToken string `json:"nextPageToken,omitempty"`
  22981. // SelfLink: [Output Only] Server-defined URL for this resource.
  22982. SelfLink string `json:"selfLink,omitempty"`
  22983. // Warning: [Output Only] Informational warning message.
  22984. Warning *RouterListWarning `json:"warning,omitempty"`
  22985. // ServerResponse contains the HTTP response code and headers from the
  22986. // server.
  22987. googleapi.ServerResponse `json:"-"`
  22988. // ForceSendFields is a list of field names (e.g. "Id") to
  22989. // unconditionally include in API requests. By default, fields with
  22990. // empty values are omitted from API requests. However, any non-pointer,
  22991. // non-interface field appearing in ForceSendFields will be sent to the
  22992. // server regardless of whether the field is empty or not. This may be
  22993. // used to include empty fields in Patch requests.
  22994. ForceSendFields []string `json:"-"`
  22995. // NullFields is a list of field names (e.g. "Id") to include in API
  22996. // requests with the JSON null value. By default, fields with empty
  22997. // values are omitted from API requests. However, any field with an
  22998. // empty value appearing in NullFields will be sent to the server as
  22999. // null. It is an error if a field in this list has a non-empty value.
  23000. // This may be used to include null fields in Patch requests.
  23001. NullFields []string `json:"-"`
  23002. }
  23003. func (s *RouterList) MarshalJSON() ([]byte, error) {
  23004. type NoMethod RouterList
  23005. raw := NoMethod(*s)
  23006. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23007. }
  23008. // RouterListWarning: [Output Only] Informational warning message.
  23009. type RouterListWarning struct {
  23010. // Code: [Output Only] A warning code, if applicable. For example,
  23011. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  23012. // the response.
  23013. //
  23014. // Possible values:
  23015. // "CLEANUP_FAILED"
  23016. // "DEPRECATED_RESOURCE_USED"
  23017. // "DEPRECATED_TYPE_USED"
  23018. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  23019. // "EXPERIMENTAL_TYPE_USED"
  23020. // "EXTERNAL_API_WARNING"
  23021. // "FIELD_VALUE_OVERRIDEN"
  23022. // "INJECTED_KERNELS_DEPRECATED"
  23023. // "MISSING_TYPE_DEPENDENCY"
  23024. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  23025. // "NEXT_HOP_CANNOT_IP_FORWARD"
  23026. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  23027. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  23028. // "NEXT_HOP_NOT_RUNNING"
  23029. // "NOT_CRITICAL_ERROR"
  23030. // "NO_RESULTS_ON_PAGE"
  23031. // "REQUIRED_TOS_AGREEMENT"
  23032. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  23033. // "RESOURCE_NOT_DELETED"
  23034. // "SCHEMA_VALIDATION_IGNORED"
  23035. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  23036. // "UNDECLARED_PROPERTIES"
  23037. // "UNREACHABLE"
  23038. Code string `json:"code,omitempty"`
  23039. // Data: [Output Only] Metadata about this warning in key: value format.
  23040. // For example:
  23041. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  23042. Data []*RouterListWarningData `json:"data,omitempty"`
  23043. // Message: [Output Only] A human-readable description of the warning
  23044. // code.
  23045. Message string `json:"message,omitempty"`
  23046. // ForceSendFields is a list of field names (e.g. "Code") to
  23047. // unconditionally include in API requests. By default, fields with
  23048. // empty values are omitted from API requests. However, any non-pointer,
  23049. // non-interface field appearing in ForceSendFields will be sent to the
  23050. // server regardless of whether the field is empty or not. This may be
  23051. // used to include empty fields in Patch requests.
  23052. ForceSendFields []string `json:"-"`
  23053. // NullFields is a list of field names (e.g. "Code") to include in API
  23054. // requests with the JSON null value. By default, fields with empty
  23055. // values are omitted from API requests. However, any field with an
  23056. // empty value appearing in NullFields will be sent to the server as
  23057. // null. It is an error if a field in this list has a non-empty value.
  23058. // This may be used to include null fields in Patch requests.
  23059. NullFields []string `json:"-"`
  23060. }
  23061. func (s *RouterListWarning) MarshalJSON() ([]byte, error) {
  23062. type NoMethod RouterListWarning
  23063. raw := NoMethod(*s)
  23064. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23065. }
  23066. type RouterListWarningData struct {
  23067. // Key: [Output Only] A key that provides more detail on the warning
  23068. // being returned. For example, for warnings where there are no results
  23069. // in a list request for a particular zone, this key might be scope and
  23070. // the key value might be the zone name. Other examples might be a key
  23071. // indicating a deprecated resource and a suggested replacement, or a
  23072. // warning about invalid network settings (for example, if an instance
  23073. // attempts to perform IP forwarding but is not enabled for IP
  23074. // forwarding).
  23075. Key string `json:"key,omitempty"`
  23076. // Value: [Output Only] A warning data value corresponding to the key.
  23077. Value string `json:"value,omitempty"`
  23078. // ForceSendFields is a list of field names (e.g. "Key") to
  23079. // unconditionally include in API requests. By default, fields with
  23080. // empty values are omitted from API requests. However, any non-pointer,
  23081. // non-interface field appearing in ForceSendFields will be sent to the
  23082. // server regardless of whether the field is empty or not. This may be
  23083. // used to include empty fields in Patch requests.
  23084. ForceSendFields []string `json:"-"`
  23085. // NullFields is a list of field names (e.g. "Key") to include in API
  23086. // requests with the JSON null value. By default, fields with empty
  23087. // values are omitted from API requests. However, any field with an
  23088. // empty value appearing in NullFields will be sent to the server as
  23089. // null. It is an error if a field in this list has a non-empty value.
  23090. // This may be used to include null fields in Patch requests.
  23091. NullFields []string `json:"-"`
  23092. }
  23093. func (s *RouterListWarningData) MarshalJSON() ([]byte, error) {
  23094. type NoMethod RouterListWarningData
  23095. raw := NoMethod(*s)
  23096. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23097. }
  23098. // RouterNat: Represents a Nat resource. It enables the VMs within the
  23099. // specified subnetworks to access Internet without external IP
  23100. // addresses. It specifies a list of subnetworks (and the ranges within)
  23101. // that want to use NAT. Customers can also provide the external IPs
  23102. // that would be used for NAT. GCP would auto-allocate ephemeral IPs if
  23103. // no external IPs are provided.
  23104. type RouterNat struct {
  23105. // AutoAllocatedNatIps: [Output Only] A list of IPs allocated
  23106. // automatically by GCP for this Nat service. They will be raw IP
  23107. // strings like "179.12.26.133". They are ephemeral IPs allocated from
  23108. // the IP blocks managed by the NAT manager. This list can grow and
  23109. // shrink based on the number of VMs configured to use NAT.
  23110. AutoAllocatedNatIps []string `json:"autoAllocatedNatIps,omitempty"`
  23111. // IcmpIdleTimeoutSec: Timeout (in seconds) for ICMP connections.
  23112. // Defaults to 30s if not set.
  23113. IcmpIdleTimeoutSec int64 `json:"icmpIdleTimeoutSec,omitempty"`
  23114. // MinPortsPerVm: Minimum number of ports allocated to a VM from this
  23115. // NAT config. If not set, a default number of ports is allocated to a
  23116. // VM. This gets rounded up to the nearest power of 2. Eg. if the value
  23117. // of this field is 50, at least 64 ports will be allocated to a VM.
  23118. MinPortsPerVm int64 `json:"minPortsPerVm,omitempty"`
  23119. // Name: Unique name of this Nat service. The name must be 1-63
  23120. // characters long and comply with RFC1035.
  23121. Name string `json:"name,omitempty"`
  23122. // NatIpAllocateOption: Specify the NatIpAllocateOption. If it is
  23123. // AUTO_ONLY, then nat_ip should be empty.
  23124. //
  23125. // Possible values:
  23126. // "AUTO_ONLY"
  23127. // "MANUAL_ONLY"
  23128. NatIpAllocateOption string `json:"natIpAllocateOption,omitempty"`
  23129. // NatIps: A list of URLs of the IP resources used for this Nat service.
  23130. // These IPs must be valid static external IP addresses assigned to the
  23131. // project. max_length is subject to change post alpha.
  23132. NatIps []string `json:"natIps,omitempty"`
  23133. // SourceSubnetworkIpRangesToNat: Specify the Nat option. If this field
  23134. // contains ALL_SUBNETWORKS_ALL_IP_RANGES or
  23135. // ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, then there should not be any
  23136. // other Router.Nat section in any Router for this network in this
  23137. // region.
  23138. //
  23139. // Possible values:
  23140. // "ALL_SUBNETWORKS_ALL_IP_RANGES"
  23141. // "ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES"
  23142. // "LIST_OF_SUBNETWORKS"
  23143. SourceSubnetworkIpRangesToNat string `json:"sourceSubnetworkIpRangesToNat,omitempty"`
  23144. // Subnetworks: A list of Subnetwork resources whose traffic should be
  23145. // translated by NAT Gateway. It is used only when LIST_OF_SUBNETWORKS
  23146. // is selected for the SubnetworkIpRangeToNatOption above.
  23147. Subnetworks []*RouterNatSubnetworkToNat `json:"subnetworks,omitempty"`
  23148. // TcpEstablishedIdleTimeoutSec: Timeout (in seconds) for TCP
  23149. // established connections. Defaults to 1200s if not set.
  23150. TcpEstablishedIdleTimeoutSec int64 `json:"tcpEstablishedIdleTimeoutSec,omitempty"`
  23151. // TcpTransitoryIdleTimeoutSec: Timeout (in seconds) for TCP transitory
  23152. // connections. Defaults to 30s if not set.
  23153. TcpTransitoryIdleTimeoutSec int64 `json:"tcpTransitoryIdleTimeoutSec,omitempty"`
  23154. // UdpIdleTimeoutSec: Timeout (in seconds) for UDP connections. Defaults
  23155. // to 30s if not set.
  23156. UdpIdleTimeoutSec int64 `json:"udpIdleTimeoutSec,omitempty"`
  23157. // ForceSendFields is a list of field names (e.g. "AutoAllocatedNatIps")
  23158. // to unconditionally include in API requests. By default, fields with
  23159. // empty values are omitted from API requests. However, any non-pointer,
  23160. // non-interface field appearing in ForceSendFields will be sent to the
  23161. // server regardless of whether the field is empty or not. This may be
  23162. // used to include empty fields in Patch requests.
  23163. ForceSendFields []string `json:"-"`
  23164. // NullFields is a list of field names (e.g. "AutoAllocatedNatIps") to
  23165. // include in API requests with the JSON null value. By default, fields
  23166. // with empty values are omitted from API requests. However, any field
  23167. // with an empty value appearing in NullFields will be sent to the
  23168. // server as null. It is an error if a field in this list has a
  23169. // non-empty value. This may be used to include null fields in Patch
  23170. // requests.
  23171. NullFields []string `json:"-"`
  23172. }
  23173. func (s *RouterNat) MarshalJSON() ([]byte, error) {
  23174. type NoMethod RouterNat
  23175. raw := NoMethod(*s)
  23176. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23177. }
  23178. // RouterNatSubnetworkToNat: Defines the IP ranges that want to use NAT
  23179. // for a subnetwork.
  23180. type RouterNatSubnetworkToNat struct {
  23181. // Name: URL for the subnetwork resource to use NAT.
  23182. Name string `json:"name,omitempty"`
  23183. // SecondaryIpRangeNames: A list of the secondary ranges of the
  23184. // Subnetwork that are allowed to use NAT. This can be populated only if
  23185. // "LIST_OF_SECONDARY_IP_RANGES" is one of the values in
  23186. // source_ip_ranges_to_nat.
  23187. SecondaryIpRangeNames []string `json:"secondaryIpRangeNames,omitempty"`
  23188. // SourceIpRangesToNats: Specify the options for NAT ranges in the
  23189. // Subnetwork. All usages of single value are valid except
  23190. // NAT_IP_RANGE_OPTION_UNSPECIFIED. The only valid option with multiple
  23191. // values is: ["PRIMARY_IP_RANGE", "LIST_OF_SECONDARY_IP_RANGES"]
  23192. // Default: [ALL_IP_RANGES]
  23193. //
  23194. // Possible values:
  23195. // "ALL_IP_RANGES"
  23196. // "LIST_OF_SECONDARY_IP_RANGES"
  23197. // "PRIMARY_IP_RANGE"
  23198. SourceIpRangesToNats []string `json:"sourceIpRangesToNats,omitempty"`
  23199. // ForceSendFields is a list of field names (e.g. "Name") to
  23200. // unconditionally include in API requests. By default, fields with
  23201. // empty values are omitted from API requests. However, any non-pointer,
  23202. // non-interface field appearing in ForceSendFields will be sent to the
  23203. // server regardless of whether the field is empty or not. This may be
  23204. // used to include empty fields in Patch requests.
  23205. ForceSendFields []string `json:"-"`
  23206. // NullFields is a list of field names (e.g. "Name") to include in API
  23207. // requests with the JSON null value. By default, fields with empty
  23208. // values are omitted from API requests. However, any field with an
  23209. // empty value appearing in NullFields will be sent to the server as
  23210. // null. It is an error if a field in this list has a non-empty value.
  23211. // This may be used to include null fields in Patch requests.
  23212. NullFields []string `json:"-"`
  23213. }
  23214. func (s *RouterNatSubnetworkToNat) MarshalJSON() ([]byte, error) {
  23215. type NoMethod RouterNatSubnetworkToNat
  23216. raw := NoMethod(*s)
  23217. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23218. }
  23219. type RouterStatus struct {
  23220. // BestRoutes: Best routes for this router's network.
  23221. BestRoutes []*Route `json:"bestRoutes,omitempty"`
  23222. // BestRoutesForRouter: Best routes learned by this router.
  23223. BestRoutesForRouter []*Route `json:"bestRoutesForRouter,omitempty"`
  23224. BgpPeerStatus []*RouterStatusBgpPeerStatus `json:"bgpPeerStatus,omitempty"`
  23225. NatStatus []*RouterStatusNatStatus `json:"natStatus,omitempty"`
  23226. // Network: URI of the network to which this router belongs.
  23227. Network string `json:"network,omitempty"`
  23228. // ForceSendFields is a list of field names (e.g. "BestRoutes") to
  23229. // unconditionally include in API requests. By default, fields with
  23230. // empty values are omitted from API requests. However, any non-pointer,
  23231. // non-interface field appearing in ForceSendFields will be sent to the
  23232. // server regardless of whether the field is empty or not. This may be
  23233. // used to include empty fields in Patch requests.
  23234. ForceSendFields []string `json:"-"`
  23235. // NullFields is a list of field names (e.g. "BestRoutes") to include in
  23236. // API requests with the JSON null value. By default, fields with empty
  23237. // values are omitted from API requests. However, any field with an
  23238. // empty value appearing in NullFields will be sent to the server as
  23239. // null. It is an error if a field in this list has a non-empty value.
  23240. // This may be used to include null fields in Patch requests.
  23241. NullFields []string `json:"-"`
  23242. }
  23243. func (s *RouterStatus) MarshalJSON() ([]byte, error) {
  23244. type NoMethod RouterStatus
  23245. raw := NoMethod(*s)
  23246. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23247. }
  23248. type RouterStatusBgpPeerStatus struct {
  23249. // AdvertisedRoutes: Routes that were advertised to the remote BGP peer
  23250. AdvertisedRoutes []*Route `json:"advertisedRoutes,omitempty"`
  23251. // IpAddress: IP address of the local BGP interface.
  23252. IpAddress string `json:"ipAddress,omitempty"`
  23253. // LinkedVpnTunnel: URL of the VPN tunnel that this BGP peer controls.
  23254. LinkedVpnTunnel string `json:"linkedVpnTunnel,omitempty"`
  23255. // Name: Name of this BGP peer. Unique within the Routers resource.
  23256. Name string `json:"name,omitempty"`
  23257. // NumLearnedRoutes: Number of routes learned from the remote BGP Peer.
  23258. NumLearnedRoutes int64 `json:"numLearnedRoutes,omitempty"`
  23259. // PeerIpAddress: IP address of the remote BGP interface.
  23260. PeerIpAddress string `json:"peerIpAddress,omitempty"`
  23261. // State: BGP state as specified in RFC1771.
  23262. State string `json:"state,omitempty"`
  23263. // Status: Status of the BGP peer: {UP, DOWN}
  23264. //
  23265. // Possible values:
  23266. // "DOWN"
  23267. // "UNKNOWN"
  23268. // "UP"
  23269. Status string `json:"status,omitempty"`
  23270. // Uptime: Time this session has been up. Format: 14 years, 51 weeks, 6
  23271. // days, 23 hours, 59 minutes, 59 seconds
  23272. Uptime string `json:"uptime,omitempty"`
  23273. // UptimeSeconds: Time this session has been up, in seconds. Format: 145
  23274. UptimeSeconds string `json:"uptimeSeconds,omitempty"`
  23275. // ForceSendFields is a list of field names (e.g. "AdvertisedRoutes") to
  23276. // unconditionally include in API requests. By default, fields with
  23277. // empty values are omitted from API requests. However, any non-pointer,
  23278. // non-interface field appearing in ForceSendFields will be sent to the
  23279. // server regardless of whether the field is empty or not. This may be
  23280. // used to include empty fields in Patch requests.
  23281. ForceSendFields []string `json:"-"`
  23282. // NullFields is a list of field names (e.g. "AdvertisedRoutes") to
  23283. // include in API requests with the JSON null value. By default, fields
  23284. // with empty values are omitted from API requests. However, any field
  23285. // with an empty value appearing in NullFields will be sent to the
  23286. // server as null. It is an error if a field in this list has a
  23287. // non-empty value. This may be used to include null fields in Patch
  23288. // requests.
  23289. NullFields []string `json:"-"`
  23290. }
  23291. func (s *RouterStatusBgpPeerStatus) MarshalJSON() ([]byte, error) {
  23292. type NoMethod RouterStatusBgpPeerStatus
  23293. raw := NoMethod(*s)
  23294. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23295. }
  23296. // RouterStatusNatStatus: Status of a NAT contained in this router.
  23297. type RouterStatusNatStatus struct {
  23298. // AutoAllocatedNatIps: A list of IPs auto-allocated for NAT. Example:
  23299. // ["1.1.1.1", "129.2.16.89"]
  23300. AutoAllocatedNatIps []string `json:"autoAllocatedNatIps,omitempty"`
  23301. // MinExtraNatIpsNeeded: The number of extra IPs to allocate. This will
  23302. // be greater than 0 only if user-specified IPs are NOT enough to allow
  23303. // all configured VMs to use NAT. This value is meaningful only when
  23304. // auto-allocation of NAT IPs is *not* used.
  23305. MinExtraNatIpsNeeded int64 `json:"minExtraNatIpsNeeded,omitempty"`
  23306. // Name: Unique name of this NAT.
  23307. Name string `json:"name,omitempty"`
  23308. // NumVmEndpointsWithNatMappings: Number of VM endpoints (i.e., Nics)
  23309. // that can use NAT.
  23310. NumVmEndpointsWithNatMappings int64 `json:"numVmEndpointsWithNatMappings,omitempty"`
  23311. // UserAllocatedNatIpResources: A list of fully qualified URLs of
  23312. // reserved IP address resources.
  23313. UserAllocatedNatIpResources []string `json:"userAllocatedNatIpResources,omitempty"`
  23314. // UserAllocatedNatIps: A list of IPs user-allocated for NAT. They will
  23315. // be raw IP strings like "179.12.26.133".
  23316. UserAllocatedNatIps []string `json:"userAllocatedNatIps,omitempty"`
  23317. // ForceSendFields is a list of field names (e.g. "AutoAllocatedNatIps")
  23318. // to unconditionally include in API requests. By default, fields with
  23319. // empty values are omitted from API requests. However, any non-pointer,
  23320. // non-interface field appearing in ForceSendFields will be sent to the
  23321. // server regardless of whether the field is empty or not. This may be
  23322. // used to include empty fields in Patch requests.
  23323. ForceSendFields []string `json:"-"`
  23324. // NullFields is a list of field names (e.g. "AutoAllocatedNatIps") to
  23325. // include in API requests with the JSON null value. By default, fields
  23326. // with empty values are omitted from API requests. However, any field
  23327. // with an empty value appearing in NullFields will be sent to the
  23328. // server as null. It is an error if a field in this list has a
  23329. // non-empty value. This may be used to include null fields in Patch
  23330. // requests.
  23331. NullFields []string `json:"-"`
  23332. }
  23333. func (s *RouterStatusNatStatus) MarshalJSON() ([]byte, error) {
  23334. type NoMethod RouterStatusNatStatus
  23335. raw := NoMethod(*s)
  23336. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23337. }
  23338. type RouterStatusResponse struct {
  23339. // Kind: Type of resource.
  23340. Kind string `json:"kind,omitempty"`
  23341. Result *RouterStatus `json:"result,omitempty"`
  23342. // ServerResponse contains the HTTP response code and headers from the
  23343. // server.
  23344. googleapi.ServerResponse `json:"-"`
  23345. // ForceSendFields is a list of field names (e.g. "Kind") to
  23346. // unconditionally include in API requests. By default, fields with
  23347. // empty values are omitted from API requests. However, any non-pointer,
  23348. // non-interface field appearing in ForceSendFields will be sent to the
  23349. // server regardless of whether the field is empty or not. This may be
  23350. // used to include empty fields in Patch requests.
  23351. ForceSendFields []string `json:"-"`
  23352. // NullFields is a list of field names (e.g. "Kind") to include in API
  23353. // requests with the JSON null value. By default, fields with empty
  23354. // values are omitted from API requests. However, any field with an
  23355. // empty value appearing in NullFields will be sent to the server as
  23356. // null. It is an error if a field in this list has a non-empty value.
  23357. // This may be used to include null fields in Patch requests.
  23358. NullFields []string `json:"-"`
  23359. }
  23360. func (s *RouterStatusResponse) MarshalJSON() ([]byte, error) {
  23361. type NoMethod RouterStatusResponse
  23362. raw := NoMethod(*s)
  23363. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23364. }
  23365. type RoutersPreviewResponse struct {
  23366. // Resource: Preview of given router.
  23367. Resource *Router `json:"resource,omitempty"`
  23368. // ServerResponse contains the HTTP response code and headers from the
  23369. // server.
  23370. googleapi.ServerResponse `json:"-"`
  23371. // ForceSendFields is a list of field names (e.g. "Resource") to
  23372. // unconditionally include in API requests. By default, fields with
  23373. // empty values are omitted from API requests. However, any non-pointer,
  23374. // non-interface field appearing in ForceSendFields will be sent to the
  23375. // server regardless of whether the field is empty or not. This may be
  23376. // used to include empty fields in Patch requests.
  23377. ForceSendFields []string `json:"-"`
  23378. // NullFields is a list of field names (e.g. "Resource") to include in
  23379. // API requests with the JSON null value. By default, fields with empty
  23380. // values are omitted from API requests. However, any field with an
  23381. // empty value appearing in NullFields will be sent to the server as
  23382. // null. It is an error if a field in this list has a non-empty value.
  23383. // This may be used to include null fields in Patch requests.
  23384. NullFields []string `json:"-"`
  23385. }
  23386. func (s *RoutersPreviewResponse) MarshalJSON() ([]byte, error) {
  23387. type NoMethod RoutersPreviewResponse
  23388. raw := NoMethod(*s)
  23389. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23390. }
  23391. type RoutersScopedList struct {
  23392. // Routers: A list of routers contained in this scope.
  23393. Routers []*Router `json:"routers,omitempty"`
  23394. // Warning: Informational warning which replaces the list of routers
  23395. // when the list is empty.
  23396. Warning *RoutersScopedListWarning `json:"warning,omitempty"`
  23397. // ForceSendFields is a list of field names (e.g. "Routers") to
  23398. // unconditionally include in API requests. By default, fields with
  23399. // empty values are omitted from API requests. However, any non-pointer,
  23400. // non-interface field appearing in ForceSendFields will be sent to the
  23401. // server regardless of whether the field is empty or not. This may be
  23402. // used to include empty fields in Patch requests.
  23403. ForceSendFields []string `json:"-"`
  23404. // NullFields is a list of field names (e.g. "Routers") to include in
  23405. // API requests with the JSON null value. By default, fields with empty
  23406. // values are omitted from API requests. However, any field with an
  23407. // empty value appearing in NullFields will be sent to the server as
  23408. // null. It is an error if a field in this list has a non-empty value.
  23409. // This may be used to include null fields in Patch requests.
  23410. NullFields []string `json:"-"`
  23411. }
  23412. func (s *RoutersScopedList) MarshalJSON() ([]byte, error) {
  23413. type NoMethod RoutersScopedList
  23414. raw := NoMethod(*s)
  23415. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23416. }
  23417. // RoutersScopedListWarning: Informational warning which replaces the
  23418. // list of routers when the list is empty.
  23419. type RoutersScopedListWarning struct {
  23420. // Code: [Output Only] A warning code, if applicable. For example,
  23421. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  23422. // the response.
  23423. //
  23424. // Possible values:
  23425. // "CLEANUP_FAILED"
  23426. // "DEPRECATED_RESOURCE_USED"
  23427. // "DEPRECATED_TYPE_USED"
  23428. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  23429. // "EXPERIMENTAL_TYPE_USED"
  23430. // "EXTERNAL_API_WARNING"
  23431. // "FIELD_VALUE_OVERRIDEN"
  23432. // "INJECTED_KERNELS_DEPRECATED"
  23433. // "MISSING_TYPE_DEPENDENCY"
  23434. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  23435. // "NEXT_HOP_CANNOT_IP_FORWARD"
  23436. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  23437. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  23438. // "NEXT_HOP_NOT_RUNNING"
  23439. // "NOT_CRITICAL_ERROR"
  23440. // "NO_RESULTS_ON_PAGE"
  23441. // "REQUIRED_TOS_AGREEMENT"
  23442. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  23443. // "RESOURCE_NOT_DELETED"
  23444. // "SCHEMA_VALIDATION_IGNORED"
  23445. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  23446. // "UNDECLARED_PROPERTIES"
  23447. // "UNREACHABLE"
  23448. Code string `json:"code,omitempty"`
  23449. // Data: [Output Only] Metadata about this warning in key: value format.
  23450. // For example:
  23451. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  23452. Data []*RoutersScopedListWarningData `json:"data,omitempty"`
  23453. // Message: [Output Only] A human-readable description of the warning
  23454. // code.
  23455. Message string `json:"message,omitempty"`
  23456. // ForceSendFields is a list of field names (e.g. "Code") 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. "Code") 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 *RoutersScopedListWarning) MarshalJSON() ([]byte, error) {
  23472. type NoMethod RoutersScopedListWarning
  23473. raw := NoMethod(*s)
  23474. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23475. }
  23476. type RoutersScopedListWarningData struct {
  23477. // Key: [Output Only] A key that provides more detail on the warning
  23478. // being returned. For example, for warnings where there are no results
  23479. // in a list request for a particular zone, this key might be scope and
  23480. // the key value might be the zone name. Other examples might be a key
  23481. // indicating a deprecated resource and a suggested replacement, or a
  23482. // warning about invalid network settings (for example, if an instance
  23483. // attempts to perform IP forwarding but is not enabled for IP
  23484. // forwarding).
  23485. Key string `json:"key,omitempty"`
  23486. // Value: [Output Only] A warning data value corresponding to the key.
  23487. Value string `json:"value,omitempty"`
  23488. // ForceSendFields is a list of field names (e.g. "Key") to
  23489. // unconditionally include in API requests. By default, fields with
  23490. // empty values are omitted from API requests. However, any non-pointer,
  23491. // non-interface field appearing in ForceSendFields will be sent to the
  23492. // server regardless of whether the field is empty or not. This may be
  23493. // used to include empty fields in Patch requests.
  23494. ForceSendFields []string `json:"-"`
  23495. // NullFields is a list of field names (e.g. "Key") to include in API
  23496. // requests with the JSON null value. By default, fields with empty
  23497. // values are omitted from API requests. However, any field with an
  23498. // empty value appearing in NullFields will be sent to the server as
  23499. // null. It is an error if a field in this list has a non-empty value.
  23500. // This may be used to include null fields in Patch requests.
  23501. NullFields []string `json:"-"`
  23502. }
  23503. func (s *RoutersScopedListWarningData) MarshalJSON() ([]byte, error) {
  23504. type NoMethod RoutersScopedListWarningData
  23505. raw := NoMethod(*s)
  23506. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23507. }
  23508. // Rule: A rule to be applied in a Policy.
  23509. type Rule struct {
  23510. // Action: Required
  23511. //
  23512. // Possible values:
  23513. // "ALLOW"
  23514. // "ALLOW_WITH_LOG"
  23515. // "DENY"
  23516. // "DENY_WITH_LOG"
  23517. // "LOG"
  23518. // "NO_ACTION"
  23519. Action string `json:"action,omitempty"`
  23520. // Conditions: Additional restrictions that must be met. All conditions
  23521. // must pass for the rule to match.
  23522. Conditions []*Condition `json:"conditions,omitempty"`
  23523. // Description: Human-readable description of the rule.
  23524. Description string `json:"description,omitempty"`
  23525. // Ins: If one or more 'in' clauses are specified, the rule matches if
  23526. // the PRINCIPAL/AUTHORITY_SELECTOR is in at least one of these entries.
  23527. Ins []string `json:"ins,omitempty"`
  23528. // LogConfigs: The config returned to callers of
  23529. // tech.iam.IAM.CheckPolicy for any entries that match the LOG action.
  23530. LogConfigs []*LogConfig `json:"logConfigs,omitempty"`
  23531. // NotIns: If one or more 'not_in' clauses are specified, the rule
  23532. // matches if the PRINCIPAL/AUTHORITY_SELECTOR is in none of the
  23533. // entries.
  23534. NotIns []string `json:"notIns,omitempty"`
  23535. // Permissions: A permission is a string of form '..' (e.g.,
  23536. // 'storage.buckets.list'). A value of '*' matches all permissions, and
  23537. // a verb part of '*' (e.g., 'storage.buckets.*') matches all verbs.
  23538. Permissions []string `json:"permissions,omitempty"`
  23539. // ForceSendFields is a list of field names (e.g. "Action") to
  23540. // unconditionally include in API requests. By default, fields with
  23541. // empty values are omitted from API requests. However, any non-pointer,
  23542. // non-interface field appearing in ForceSendFields will be sent to the
  23543. // server regardless of whether the field is empty or not. This may be
  23544. // used to include empty fields in Patch requests.
  23545. ForceSendFields []string `json:"-"`
  23546. // NullFields is a list of field names (e.g. "Action") to include in API
  23547. // requests with the JSON null value. By default, fields with empty
  23548. // values are omitted from API requests. However, any field with an
  23549. // empty value appearing in NullFields will be sent to the server as
  23550. // null. It is an error if a field in this list has a non-empty value.
  23551. // This may be used to include null fields in Patch requests.
  23552. NullFields []string `json:"-"`
  23553. }
  23554. func (s *Rule) MarshalJSON() ([]byte, error) {
  23555. type NoMethod Rule
  23556. raw := NoMethod(*s)
  23557. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23558. }
  23559. type SSLHealthCheck struct {
  23560. // Port: The TCP port number for the health check request. The default
  23561. // value is 443. Valid values are 1 through 65535.
  23562. Port int64 `json:"port,omitempty"`
  23563. // PortName: Port name as defined in InstanceGroup#NamedPort#name. If
  23564. // both port and port_name are defined, port takes precedence.
  23565. PortName string `json:"portName,omitempty"`
  23566. // PortSpecification: Specifies how port is selected for health
  23567. // checking, can be one of following values:
  23568. // USE_FIXED_PORT: The port number in
  23569. // port
  23570. // is used for health checking.
  23571. // USE_NAMED_PORT: The
  23572. // portName
  23573. // is used for health checking.
  23574. // USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for
  23575. // each network endpoint is used for health checking. For other
  23576. // backends, the port or named port specified in the Backend Service is
  23577. // used for health checking.
  23578. //
  23579. //
  23580. // If not specified, SSL health check follows behavior specified
  23581. // in
  23582. // port
  23583. // and
  23584. // portName
  23585. // fields.
  23586. //
  23587. // Possible values:
  23588. // "USE_FIXED_PORT"
  23589. // "USE_NAMED_PORT"
  23590. // "USE_SERVING_PORT"
  23591. PortSpecification string `json:"portSpecification,omitempty"`
  23592. // ProxyHeader: Specifies the type of proxy header to append before
  23593. // sending data to the backend, either NONE or PROXY_V1. The default is
  23594. // NONE.
  23595. //
  23596. // Possible values:
  23597. // "NONE"
  23598. // "PROXY_V1"
  23599. ProxyHeader string `json:"proxyHeader,omitempty"`
  23600. // Request: The application data to send once the SSL connection has
  23601. // been established (default value is empty). If both request and
  23602. // response are empty, the connection establishment alone will indicate
  23603. // health. The request data can only be ASCII.
  23604. Request string `json:"request,omitempty"`
  23605. // Response: The bytes to match against the beginning of the response
  23606. // data. If left empty (the default value), any response will indicate
  23607. // health. The response data can only be ASCII.
  23608. Response string `json:"response,omitempty"`
  23609. // ForceSendFields is a list of field names (e.g. "Port") to
  23610. // unconditionally include in API requests. By default, fields with
  23611. // empty values are omitted from API requests. However, any non-pointer,
  23612. // non-interface field appearing in ForceSendFields will be sent to the
  23613. // server regardless of whether the field is empty or not. This may be
  23614. // used to include empty fields in Patch requests.
  23615. ForceSendFields []string `json:"-"`
  23616. // NullFields is a list of field names (e.g. "Port") to include in API
  23617. // requests with the JSON null value. By default, fields with empty
  23618. // values are omitted from API requests. However, any field with an
  23619. // empty value appearing in NullFields will be sent to the server as
  23620. // null. It is an error if a field in this list has a non-empty value.
  23621. // This may be used to include null fields in Patch requests.
  23622. NullFields []string `json:"-"`
  23623. }
  23624. func (s *SSLHealthCheck) MarshalJSON() ([]byte, error) {
  23625. type NoMethod SSLHealthCheck
  23626. raw := NoMethod(*s)
  23627. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23628. }
  23629. // Scheduling: Sets the scheduling options for an Instance.
  23630. type Scheduling struct {
  23631. // AutomaticRestart: Specifies whether the instance should be
  23632. // automatically restarted if it is terminated by Compute Engine (not
  23633. // terminated by a user). You can only set the automatic restart option
  23634. // for standard instances. Preemptible instances cannot be automatically
  23635. // restarted.
  23636. //
  23637. // By default, this is set to true so an instance is automatically
  23638. // restarted if it is terminated by Compute Engine.
  23639. AutomaticRestart *bool `json:"automaticRestart,omitempty"`
  23640. // NodeAffinities: A set of node affinity and anti-affinity.
  23641. NodeAffinities []*SchedulingNodeAffinity `json:"nodeAffinities,omitempty"`
  23642. // OnHostMaintenance: Defines the maintenance behavior for this
  23643. // instance. For standard instances, the default behavior is MIGRATE.
  23644. // For preemptible instances, the default and only possible behavior is
  23645. // TERMINATE. For more information, see Setting Instance Scheduling
  23646. // Options.
  23647. //
  23648. // Possible values:
  23649. // "MIGRATE"
  23650. // "TERMINATE"
  23651. OnHostMaintenance string `json:"onHostMaintenance,omitempty"`
  23652. // Preemptible: Defines whether the instance is preemptible. This can
  23653. // only be set during instance creation, it cannot be set or changed
  23654. // after the instance has been created.
  23655. Preemptible bool `json:"preemptible,omitempty"`
  23656. // ForceSendFields is a list of field names (e.g. "AutomaticRestart") to
  23657. // unconditionally include in API requests. By default, fields with
  23658. // empty values are omitted from API requests. However, any non-pointer,
  23659. // non-interface field appearing in ForceSendFields will be sent to the
  23660. // server regardless of whether the field is empty or not. This may be
  23661. // used to include empty fields in Patch requests.
  23662. ForceSendFields []string `json:"-"`
  23663. // NullFields is a list of field names (e.g. "AutomaticRestart") to
  23664. // include in API requests with the JSON null value. By default, fields
  23665. // with empty values are omitted from API requests. However, any field
  23666. // with an empty value appearing in NullFields will be sent to the
  23667. // server as null. It is an error if a field in this list has a
  23668. // non-empty value. This may be used to include null fields in Patch
  23669. // requests.
  23670. NullFields []string `json:"-"`
  23671. }
  23672. func (s *Scheduling) MarshalJSON() ([]byte, error) {
  23673. type NoMethod Scheduling
  23674. raw := NoMethod(*s)
  23675. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23676. }
  23677. // SchedulingNodeAffinity: Node Affinity: the configuration of desired
  23678. // nodes onto which this Instance could be scheduled.
  23679. type SchedulingNodeAffinity struct {
  23680. // Key: Corresponds to the label key of Node resource.
  23681. Key string `json:"key,omitempty"`
  23682. // Operator: Defines the operation of node selection.
  23683. //
  23684. // Possible values:
  23685. // "IN"
  23686. // "NOT_IN"
  23687. // "OPERATOR_UNSPECIFIED"
  23688. Operator string `json:"operator,omitempty"`
  23689. // Values: Corresponds to the label values of Node resource.
  23690. Values []string `json:"values,omitempty"`
  23691. // ForceSendFields is a list of field names (e.g. "Key") to
  23692. // unconditionally include in API requests. By default, fields with
  23693. // empty values are omitted from API requests. However, any non-pointer,
  23694. // non-interface field appearing in ForceSendFields will be sent to the
  23695. // server regardless of whether the field is empty or not. This may be
  23696. // used to include empty fields in Patch requests.
  23697. ForceSendFields []string `json:"-"`
  23698. // NullFields is a list of field names (e.g. "Key") to include in API
  23699. // requests with the JSON null value. By default, fields with empty
  23700. // values are omitted from API requests. However, any field with an
  23701. // empty value appearing in NullFields will be sent to the server as
  23702. // null. It is an error if a field in this list has a non-empty value.
  23703. // This may be used to include null fields in Patch requests.
  23704. NullFields []string `json:"-"`
  23705. }
  23706. func (s *SchedulingNodeAffinity) MarshalJSON() ([]byte, error) {
  23707. type NoMethod SchedulingNodeAffinity
  23708. raw := NoMethod(*s)
  23709. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23710. }
  23711. type SecurityPoliciesListPreconfiguredExpressionSetsResponse struct {
  23712. PreconfiguredExpressionSets *SecurityPoliciesWafConfig `json:"preconfiguredExpressionSets,omitempty"`
  23713. // ServerResponse contains the HTTP response code and headers from the
  23714. // server.
  23715. googleapi.ServerResponse `json:"-"`
  23716. // ForceSendFields is a list of field names (e.g.
  23717. // "PreconfiguredExpressionSets") to unconditionally include in API
  23718. // requests. By default, fields with empty values are omitted from API
  23719. // requests. However, any non-pointer, non-interface field appearing in
  23720. // ForceSendFields will be sent to the server regardless of whether the
  23721. // field is empty or not. This may be used to include empty fields in
  23722. // Patch requests.
  23723. ForceSendFields []string `json:"-"`
  23724. // NullFields is a list of field names (e.g.
  23725. // "PreconfiguredExpressionSets") to include in API requests with the
  23726. // JSON null value. By default, fields with empty values are omitted
  23727. // from API requests. However, any field with an empty value appearing
  23728. // in NullFields will be sent to the server as null. It is an error if a
  23729. // field in this list has a non-empty value. This may be used to include
  23730. // null fields in Patch requests.
  23731. NullFields []string `json:"-"`
  23732. }
  23733. func (s *SecurityPoliciesListPreconfiguredExpressionSetsResponse) MarshalJSON() ([]byte, error) {
  23734. type NoMethod SecurityPoliciesListPreconfiguredExpressionSetsResponse
  23735. raw := NoMethod(*s)
  23736. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23737. }
  23738. type SecurityPoliciesWafConfig struct {
  23739. WafRules *PreconfiguredWafSet `json:"wafRules,omitempty"`
  23740. // ForceSendFields is a list of field names (e.g. "WafRules") to
  23741. // unconditionally include in API requests. By default, fields with
  23742. // empty values are omitted from API requests. However, any non-pointer,
  23743. // non-interface field appearing in ForceSendFields will be sent to the
  23744. // server regardless of whether the field is empty or not. This may be
  23745. // used to include empty fields in Patch requests.
  23746. ForceSendFields []string `json:"-"`
  23747. // NullFields is a list of field names (e.g. "WafRules") to include in
  23748. // API requests with the JSON null value. By default, fields with empty
  23749. // values are omitted from API requests. However, any field with an
  23750. // empty value appearing in NullFields will be sent to the server as
  23751. // null. It is an error if a field in this list has a non-empty value.
  23752. // This may be used to include null fields in Patch requests.
  23753. NullFields []string `json:"-"`
  23754. }
  23755. func (s *SecurityPoliciesWafConfig) MarshalJSON() ([]byte, error) {
  23756. type NoMethod SecurityPoliciesWafConfig
  23757. raw := NoMethod(*s)
  23758. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23759. }
  23760. // SecurityPolicy: A security policy is comprised of one or more rules.
  23761. // It can also be associated with one or more 'targets'. Next available
  23762. // tag: 11
  23763. type SecurityPolicy struct {
  23764. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  23765. // format.
  23766. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  23767. // Description: An optional description of this resource. Provide this
  23768. // property when you create the resource.
  23769. Description string `json:"description,omitempty"`
  23770. // Fingerprint: Specifies a fingerprint for this resource, which is
  23771. // essentially a hash of the metadata's contents and used for optimistic
  23772. // locking. The fingerprint is initially generated by Compute Engine and
  23773. // changes after every request to modify or update metadata. You must
  23774. // always provide an up-to-date fingerprint hash in order to update or
  23775. // change metadata.
  23776. //
  23777. // To see the latest fingerprint, make get() request to the security
  23778. // policy.
  23779. Fingerprint string `json:"fingerprint,omitempty"`
  23780. // Id: [Output Only] The unique identifier for the resource. This
  23781. // identifier is defined by the server.
  23782. Id uint64 `json:"id,omitempty,string"`
  23783. // Kind: [Output only] Type of the resource. Always
  23784. // compute#securityPolicyfor security policies
  23785. Kind string `json:"kind,omitempty"`
  23786. // LabelFingerprint: A fingerprint for the labels being applied to this
  23787. // security policy, which is essentially a hash of the labels set used
  23788. // for optimistic locking. The fingerprint is initially generated by
  23789. // Compute Engine and changes after every request to modify or update
  23790. // labels. You must always provide an up-to-date fingerprint hash in
  23791. // order to update or change labels.
  23792. //
  23793. // To see the latest fingerprint, make get() request to the security
  23794. // policy.
  23795. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  23796. // Labels: Labels to apply to this security policy resource. These can
  23797. // be later modified by the setLabels method. Each label key/value must
  23798. // comply with RFC1035. Label values may be empty.
  23799. Labels map[string]string `json:"labels,omitempty"`
  23800. // Name: Name of the resource. Provided by the client when the resource
  23801. // is created. The name must be 1-63 characters long, and comply with
  23802. // RFC1035. Specifically, the name must be 1-63 characters long and
  23803. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  23804. // the first character must be a lowercase letter, and all following
  23805. // characters must be a dash, lowercase letter, or digit, except the
  23806. // last character, which cannot be a dash.
  23807. Name string `json:"name,omitempty"`
  23808. // Rules: A list of rules that belong to this policy. There must always
  23809. // be a default rule (rule with priority 2147483647 and match "*"). If
  23810. // no rules are provided when creating a security policy, a default rule
  23811. // with action "allow" will be added.
  23812. Rules []*SecurityPolicyRule `json:"rules,omitempty"`
  23813. // SelfLink: [Output Only] Server-defined URL for the resource.
  23814. SelfLink string `json:"selfLink,omitempty"`
  23815. // ServerResponse contains the HTTP response code and headers from the
  23816. // server.
  23817. googleapi.ServerResponse `json:"-"`
  23818. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  23819. // to unconditionally include in API requests. By default, fields with
  23820. // empty values are omitted from API requests. However, any non-pointer,
  23821. // non-interface field appearing in ForceSendFields will be sent to the
  23822. // server regardless of whether the field is empty or not. This may be
  23823. // used to include empty fields in Patch requests.
  23824. ForceSendFields []string `json:"-"`
  23825. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  23826. // include in API requests with the JSON null value. By default, fields
  23827. // with empty values are omitted from API requests. However, any field
  23828. // with an empty value appearing in NullFields will be sent to the
  23829. // server as null. It is an error if a field in this list has a
  23830. // non-empty value. This may be used to include null fields in Patch
  23831. // requests.
  23832. NullFields []string `json:"-"`
  23833. }
  23834. func (s *SecurityPolicy) MarshalJSON() ([]byte, error) {
  23835. type NoMethod SecurityPolicy
  23836. raw := NoMethod(*s)
  23837. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23838. }
  23839. type SecurityPolicyList struct {
  23840. // Id: [Output Only] Unique identifier for the resource; defined by the
  23841. // server.
  23842. Id string `json:"id,omitempty"`
  23843. // Items: A list of SecurityPolicy resources.
  23844. Items []*SecurityPolicy `json:"items,omitempty"`
  23845. // Kind: [Output Only] Type of resource. Always
  23846. // compute#securityPolicyList for listsof securityPolicies
  23847. Kind string `json:"kind,omitempty"`
  23848. // NextPageToken: [Output Only] This token allows you to get the next
  23849. // page of results for list requests. If the number of results is larger
  23850. // than maxResults, use the nextPageToken as a value for the query
  23851. // parameter pageToken in the next list request. Subsequent list
  23852. // requests will have their own nextPageToken to continue paging through
  23853. // the results.
  23854. NextPageToken string `json:"nextPageToken,omitempty"`
  23855. // Warning: [Output Only] Informational warning message.
  23856. Warning *SecurityPolicyListWarning `json:"warning,omitempty"`
  23857. // ServerResponse contains the HTTP response code and headers from the
  23858. // server.
  23859. googleapi.ServerResponse `json:"-"`
  23860. // ForceSendFields is a list of field names (e.g. "Id") to
  23861. // unconditionally include in API requests. By default, fields with
  23862. // empty values are omitted from API requests. However, any non-pointer,
  23863. // non-interface field appearing in ForceSendFields will be sent to the
  23864. // server regardless of whether the field is empty or not. This may be
  23865. // used to include empty fields in Patch requests.
  23866. ForceSendFields []string `json:"-"`
  23867. // NullFields is a list of field names (e.g. "Id") to include in API
  23868. // requests with the JSON null value. By default, fields with empty
  23869. // values are omitted from API requests. However, any field with an
  23870. // empty value appearing in NullFields will be sent to the server as
  23871. // null. It is an error if a field in this list has a non-empty value.
  23872. // This may be used to include null fields in Patch requests.
  23873. NullFields []string `json:"-"`
  23874. }
  23875. func (s *SecurityPolicyList) MarshalJSON() ([]byte, error) {
  23876. type NoMethod SecurityPolicyList
  23877. raw := NoMethod(*s)
  23878. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23879. }
  23880. // SecurityPolicyListWarning: [Output Only] Informational warning
  23881. // message.
  23882. type SecurityPolicyListWarning struct {
  23883. // Code: [Output Only] A warning code, if applicable. For example,
  23884. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  23885. // the response.
  23886. //
  23887. // Possible values:
  23888. // "CLEANUP_FAILED"
  23889. // "DEPRECATED_RESOURCE_USED"
  23890. // "DEPRECATED_TYPE_USED"
  23891. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  23892. // "EXPERIMENTAL_TYPE_USED"
  23893. // "EXTERNAL_API_WARNING"
  23894. // "FIELD_VALUE_OVERRIDEN"
  23895. // "INJECTED_KERNELS_DEPRECATED"
  23896. // "MISSING_TYPE_DEPENDENCY"
  23897. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  23898. // "NEXT_HOP_CANNOT_IP_FORWARD"
  23899. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  23900. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  23901. // "NEXT_HOP_NOT_RUNNING"
  23902. // "NOT_CRITICAL_ERROR"
  23903. // "NO_RESULTS_ON_PAGE"
  23904. // "REQUIRED_TOS_AGREEMENT"
  23905. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  23906. // "RESOURCE_NOT_DELETED"
  23907. // "SCHEMA_VALIDATION_IGNORED"
  23908. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  23909. // "UNDECLARED_PROPERTIES"
  23910. // "UNREACHABLE"
  23911. Code string `json:"code,omitempty"`
  23912. // Data: [Output Only] Metadata about this warning in key: value format.
  23913. // For example:
  23914. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  23915. Data []*SecurityPolicyListWarningData `json:"data,omitempty"`
  23916. // Message: [Output Only] A human-readable description of the warning
  23917. // code.
  23918. Message string `json:"message,omitempty"`
  23919. // ForceSendFields is a list of field names (e.g. "Code") to
  23920. // unconditionally include in API requests. By default, fields with
  23921. // empty values are omitted from API requests. However, any non-pointer,
  23922. // non-interface field appearing in ForceSendFields will be sent to the
  23923. // server regardless of whether the field is empty or not. This may be
  23924. // used to include empty fields in Patch requests.
  23925. ForceSendFields []string `json:"-"`
  23926. // NullFields is a list of field names (e.g. "Code") to include in API
  23927. // requests with the JSON null value. By default, fields with empty
  23928. // values are omitted from API requests. However, any field with an
  23929. // empty value appearing in NullFields will be sent to the server as
  23930. // null. It is an error if a field in this list has a non-empty value.
  23931. // This may be used to include null fields in Patch requests.
  23932. NullFields []string `json:"-"`
  23933. }
  23934. func (s *SecurityPolicyListWarning) MarshalJSON() ([]byte, error) {
  23935. type NoMethod SecurityPolicyListWarning
  23936. raw := NoMethod(*s)
  23937. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23938. }
  23939. type SecurityPolicyListWarningData struct {
  23940. // Key: [Output Only] A key that provides more detail on the warning
  23941. // being returned. For example, for warnings where there are no results
  23942. // in a list request for a particular zone, this key might be scope and
  23943. // the key value might be the zone name. Other examples might be a key
  23944. // indicating a deprecated resource and a suggested replacement, or a
  23945. // warning about invalid network settings (for example, if an instance
  23946. // attempts to perform IP forwarding but is not enabled for IP
  23947. // forwarding).
  23948. Key string `json:"key,omitempty"`
  23949. // Value: [Output Only] A warning data value corresponding to the key.
  23950. Value string `json:"value,omitempty"`
  23951. // ForceSendFields is a list of field names (e.g. "Key") to
  23952. // unconditionally include in API requests. By default, fields with
  23953. // empty values are omitted from API requests. However, any non-pointer,
  23954. // non-interface field appearing in ForceSendFields will be sent to the
  23955. // server regardless of whether the field is empty or not. This may be
  23956. // used to include empty fields in Patch requests.
  23957. ForceSendFields []string `json:"-"`
  23958. // NullFields is a list of field names (e.g. "Key") to include in API
  23959. // requests with the JSON null value. By default, fields with empty
  23960. // values are omitted from API requests. However, any field with an
  23961. // empty value appearing in NullFields will be sent to the server as
  23962. // null. It is an error if a field in this list has a non-empty value.
  23963. // This may be used to include null fields in Patch requests.
  23964. NullFields []string `json:"-"`
  23965. }
  23966. func (s *SecurityPolicyListWarningData) MarshalJSON() ([]byte, error) {
  23967. type NoMethod SecurityPolicyListWarningData
  23968. raw := NoMethod(*s)
  23969. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23970. }
  23971. type SecurityPolicyReference struct {
  23972. SecurityPolicy string `json:"securityPolicy,omitempty"`
  23973. // ForceSendFields is a list of field names (e.g. "SecurityPolicy") to
  23974. // unconditionally include in API requests. By default, fields with
  23975. // empty values are omitted from API requests. However, any non-pointer,
  23976. // non-interface field appearing in ForceSendFields will be sent to the
  23977. // server regardless of whether the field is empty or not. This may be
  23978. // used to include empty fields in Patch requests.
  23979. ForceSendFields []string `json:"-"`
  23980. // NullFields is a list of field names (e.g. "SecurityPolicy") to
  23981. // include in API requests with the JSON null value. By default, fields
  23982. // with empty values are omitted from API requests. However, any field
  23983. // with an empty value appearing in NullFields will be sent to the
  23984. // server as null. It is an error if a field in this list has a
  23985. // non-empty value. This may be used to include null fields in Patch
  23986. // requests.
  23987. NullFields []string `json:"-"`
  23988. }
  23989. func (s *SecurityPolicyReference) MarshalJSON() ([]byte, error) {
  23990. type NoMethod SecurityPolicyReference
  23991. raw := NoMethod(*s)
  23992. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23993. }
  23994. // SecurityPolicyRule: Represents a rule that describes one or more
  23995. // match conditions along with the action to be taken when traffic
  23996. // matches this condition (allow or deny).
  23997. type SecurityPolicyRule struct {
  23998. // Action: The Action to preform when the client connection triggers the
  23999. // rule. Can currently be either "allow" or "deny()" where valid values
  24000. // for status are 403, 404, and 502.
  24001. Action string `json:"action,omitempty"`
  24002. // Description: An optional description of this resource. Provide this
  24003. // property when you create the resource.
  24004. Description string `json:"description,omitempty"`
  24005. // Kind: [Output only] Type of the resource. Always
  24006. // compute#securityPolicyRule for security policy rules
  24007. Kind string `json:"kind,omitempty"`
  24008. // Match: A match condition that incoming traffic is evaluated against.
  24009. // If it evaluates to true, the corresponding ?action? is enforced.
  24010. Match *SecurityPolicyRuleMatcher `json:"match,omitempty"`
  24011. // Preview: If set to true, the specified action is not enforced.
  24012. Preview bool `json:"preview,omitempty"`
  24013. // Priority: An integer indicating the priority of a rule in the list.
  24014. // The priority must be a positive value between 0 and 2147483647. Rules
  24015. // are evaluated in the increasing order of priority.
  24016. Priority int64 `json:"priority,omitempty"`
  24017. // ServerResponse contains the HTTP response code and headers from the
  24018. // server.
  24019. googleapi.ServerResponse `json:"-"`
  24020. // ForceSendFields is a list of field names (e.g. "Action") to
  24021. // unconditionally include in API requests. By default, fields with
  24022. // empty values are omitted from API requests. However, any non-pointer,
  24023. // non-interface field appearing in ForceSendFields will be sent to the
  24024. // server regardless of whether the field is empty or not. This may be
  24025. // used to include empty fields in Patch requests.
  24026. ForceSendFields []string `json:"-"`
  24027. // NullFields is a list of field names (e.g. "Action") to include in API
  24028. // requests with the JSON null value. By default, fields with empty
  24029. // values are omitted from API requests. However, any field with an
  24030. // empty value appearing in NullFields will be sent to the server as
  24031. // null. It is an error if a field in this list has a non-empty value.
  24032. // This may be used to include null fields in Patch requests.
  24033. NullFields []string `json:"-"`
  24034. }
  24035. func (s *SecurityPolicyRule) MarshalJSON() ([]byte, error) {
  24036. type NoMethod SecurityPolicyRule
  24037. raw := NoMethod(*s)
  24038. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24039. }
  24040. // SecurityPolicyRuleMatcher: Represents a match condition that incoming
  24041. // traffic is evaluated against. Exactly one field must be specified.
  24042. type SecurityPolicyRuleMatcher struct {
  24043. // Config: The configuration options available when specifying
  24044. // versioned_expr. This field must be specified if versioned_expr is
  24045. // specified and cannot be specified if versioned_expr is not specified.
  24046. Config *SecurityPolicyRuleMatcherConfig `json:"config,omitempty"`
  24047. // Expr: User defined CEVAL expression. A CEVAL expression is used to
  24048. // specify match criteria such as origin.ip, source.region_code and
  24049. // contents in the request header.
  24050. Expr *Expr `json:"expr,omitempty"`
  24051. // SrcIpRanges: CIDR IP address range.
  24052. SrcIpRanges []string `json:"srcIpRanges,omitempty"`
  24053. // VersionedExpr: Preconfigured versioned expression. If this field is
  24054. // specified, config must also be specified. Available preconfigured
  24055. // expressions along with their requirements are: SRC_IPS_V1 - must
  24056. // specify the corresponding src_ip_range field in config.
  24057. //
  24058. // Possible values:
  24059. // "SRC_IPS_V1"
  24060. // "VERSIONED_EXPR_UNSPECIFIED"
  24061. VersionedExpr string `json:"versionedExpr,omitempty"`
  24062. // ForceSendFields is a list of field names (e.g. "Config") to
  24063. // unconditionally include in API requests. By default, fields with
  24064. // empty values are omitted from API requests. However, any non-pointer,
  24065. // non-interface field appearing in ForceSendFields will be sent to the
  24066. // server regardless of whether the field is empty or not. This may be
  24067. // used to include empty fields in Patch requests.
  24068. ForceSendFields []string `json:"-"`
  24069. // NullFields is a list of field names (e.g. "Config") to include in API
  24070. // requests with the JSON null value. By default, fields with empty
  24071. // values are omitted from API requests. However, any field with an
  24072. // empty value appearing in NullFields will be sent to the server as
  24073. // null. It is an error if a field in this list has a non-empty value.
  24074. // This may be used to include null fields in Patch requests.
  24075. NullFields []string `json:"-"`
  24076. }
  24077. func (s *SecurityPolicyRuleMatcher) MarshalJSON() ([]byte, error) {
  24078. type NoMethod SecurityPolicyRuleMatcher
  24079. raw := NoMethod(*s)
  24080. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24081. }
  24082. type SecurityPolicyRuleMatcherConfig struct {
  24083. // SrcIpRanges: CIDR IP address range.
  24084. SrcIpRanges []string `json:"srcIpRanges,omitempty"`
  24085. // ForceSendFields is a list of field names (e.g. "SrcIpRanges") to
  24086. // unconditionally include in API requests. By default, fields with
  24087. // empty values are omitted from API requests. However, any non-pointer,
  24088. // non-interface field appearing in ForceSendFields will be sent to the
  24089. // server regardless of whether the field is empty or not. This may be
  24090. // used to include empty fields in Patch requests.
  24091. ForceSendFields []string `json:"-"`
  24092. // NullFields is a list of field names (e.g. "SrcIpRanges") to include
  24093. // in API requests with the JSON null value. By default, fields with
  24094. // empty values are omitted from API requests. However, any field with
  24095. // an empty value appearing in NullFields will be sent to the server as
  24096. // null. It is an error if a field in this list has a non-empty value.
  24097. // This may be used to include null fields in Patch requests.
  24098. NullFields []string `json:"-"`
  24099. }
  24100. func (s *SecurityPolicyRuleMatcherConfig) MarshalJSON() ([]byte, error) {
  24101. type NoMethod SecurityPolicyRuleMatcherConfig
  24102. raw := NoMethod(*s)
  24103. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24104. }
  24105. // SerialPortOutput: An instance's serial console output.
  24106. type SerialPortOutput struct {
  24107. // Contents: [Output Only] The contents of the console output.
  24108. Contents string `json:"contents,omitempty"`
  24109. // Kind: [Output Only] Type of the resource. Always
  24110. // compute#serialPortOutput for serial port output.
  24111. Kind string `json:"kind,omitempty"`
  24112. // Next: [Output Only] The position of the next byte of content from the
  24113. // serial console output. Use this value in the next request as the
  24114. // start parameter.
  24115. Next int64 `json:"next,omitempty,string"`
  24116. // SelfLink: [Output Only] Server-defined URL for this resource.
  24117. SelfLink string `json:"selfLink,omitempty"`
  24118. // Start: The starting byte position of the output that was returned.
  24119. // This should match the start parameter sent with the request. If the
  24120. // serial console output exceeds the size of the buffer, older output
  24121. // will be overwritten by newer content and the start values will be
  24122. // mismatched.
  24123. Start int64 `json:"start,omitempty,string"`
  24124. // ServerResponse contains the HTTP response code and headers from the
  24125. // server.
  24126. googleapi.ServerResponse `json:"-"`
  24127. // ForceSendFields is a list of field names (e.g. "Contents") to
  24128. // unconditionally include in API requests. By default, fields with
  24129. // empty values are omitted from API requests. However, any non-pointer,
  24130. // non-interface field appearing in ForceSendFields will be sent to the
  24131. // server regardless of whether the field is empty or not. This may be
  24132. // used to include empty fields in Patch requests.
  24133. ForceSendFields []string `json:"-"`
  24134. // NullFields is a list of field names (e.g. "Contents") to include in
  24135. // API requests with the JSON null value. By default, fields with empty
  24136. // values are omitted from API requests. However, any field with an
  24137. // empty value appearing in NullFields will be sent to the server as
  24138. // null. It is an error if a field in this list has a non-empty value.
  24139. // This may be used to include null fields in Patch requests.
  24140. NullFields []string `json:"-"`
  24141. }
  24142. func (s *SerialPortOutput) MarshalJSON() ([]byte, error) {
  24143. type NoMethod SerialPortOutput
  24144. raw := NoMethod(*s)
  24145. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24146. }
  24147. // ServiceAccount: A service account.
  24148. type ServiceAccount struct {
  24149. // Email: Email address of the service account.
  24150. Email string `json:"email,omitempty"`
  24151. // Scopes: The list of scopes to be made available for this service
  24152. // account.
  24153. Scopes []string `json:"scopes,omitempty"`
  24154. // ForceSendFields is a list of field names (e.g. "Email") to
  24155. // unconditionally include in API requests. By default, fields with
  24156. // empty values are omitted from API requests. However, any non-pointer,
  24157. // non-interface field appearing in ForceSendFields will be sent to the
  24158. // server regardless of whether the field is empty or not. This may be
  24159. // used to include empty fields in Patch requests.
  24160. ForceSendFields []string `json:"-"`
  24161. // NullFields is a list of field names (e.g. "Email") to include in API
  24162. // requests with the JSON null value. By default, fields with empty
  24163. // values are omitted from API requests. However, any field with an
  24164. // empty value appearing in NullFields will be sent to the server as
  24165. // null. It is an error if a field in this list has a non-empty value.
  24166. // This may be used to include null fields in Patch requests.
  24167. NullFields []string `json:"-"`
  24168. }
  24169. func (s *ServiceAccount) MarshalJSON() ([]byte, error) {
  24170. type NoMethod ServiceAccount
  24171. raw := NoMethod(*s)
  24172. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24173. }
  24174. // ShieldedVmConfig: A set of Shielded VM options.
  24175. type ShieldedVmConfig struct {
  24176. // EnableIntegrityMonitoring: Defines whether the instance should have
  24177. // integrity monitoring enabled.
  24178. EnableIntegrityMonitoring bool `json:"enableIntegrityMonitoring,omitempty"`
  24179. // EnableSecureBoot: Defines whether the instance should have secure
  24180. // boot enabled.
  24181. EnableSecureBoot bool `json:"enableSecureBoot,omitempty"`
  24182. // EnableVtpm: Defines whether the instance should have the TPM enabled.
  24183. EnableVtpm bool `json:"enableVtpm,omitempty"`
  24184. // ForceSendFields is a list of field names (e.g.
  24185. // "EnableIntegrityMonitoring") to unconditionally include in API
  24186. // requests. By default, fields with empty values are omitted from API
  24187. // requests. However, any non-pointer, non-interface field appearing in
  24188. // ForceSendFields will be sent to the server regardless of whether the
  24189. // field is empty or not. This may be used to include empty fields in
  24190. // Patch requests.
  24191. ForceSendFields []string `json:"-"`
  24192. // NullFields is a list of field names (e.g.
  24193. // "EnableIntegrityMonitoring") to include in API requests with the JSON
  24194. // null value. By default, fields with empty values are omitted from API
  24195. // requests. However, any field with an empty value appearing in
  24196. // NullFields will be sent to the server as null. It is an error if a
  24197. // field in this list has a non-empty value. This may be used to include
  24198. // null fields in Patch requests.
  24199. NullFields []string `json:"-"`
  24200. }
  24201. func (s *ShieldedVmConfig) MarshalJSON() ([]byte, error) {
  24202. type NoMethod ShieldedVmConfig
  24203. raw := NoMethod(*s)
  24204. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24205. }
  24206. // ShieldedVmIntegrityPolicy: The policy describes how boot integrity
  24207. // measurements are evaluated.
  24208. type ShieldedVmIntegrityPolicy struct {
  24209. // UpdateAutoLearnPolicy: Triggers an auto relearn event: the integrity
  24210. // monitoring module copies existing guest measurements to the baseline.
  24211. UpdateAutoLearnPolicy bool `json:"updateAutoLearnPolicy,omitempty"`
  24212. // ForceSendFields is a list of field names (e.g.
  24213. // "UpdateAutoLearnPolicy") to unconditionally include in API requests.
  24214. // By default, fields with empty values are omitted from API requests.
  24215. // However, any non-pointer, non-interface field appearing in
  24216. // ForceSendFields will be sent to the server regardless of whether the
  24217. // field is empty or not. This may be used to include empty fields in
  24218. // Patch requests.
  24219. ForceSendFields []string `json:"-"`
  24220. // NullFields is a list of field names (e.g. "UpdateAutoLearnPolicy") to
  24221. // include in API requests with the JSON null value. By default, fields
  24222. // with empty values are omitted from API requests. However, any field
  24223. // with an empty value appearing in NullFields will be sent to the
  24224. // server as null. It is an error if a field in this list has a
  24225. // non-empty value. This may be used to include null fields in Patch
  24226. // requests.
  24227. NullFields []string `json:"-"`
  24228. }
  24229. func (s *ShieldedVmIntegrityPolicy) MarshalJSON() ([]byte, error) {
  24230. type NoMethod ShieldedVmIntegrityPolicy
  24231. raw := NoMethod(*s)
  24232. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24233. }
  24234. // SignedUrlKey: Represents a customer-supplied Signing Key used by
  24235. // Cloud CDN Signed URLs
  24236. type SignedUrlKey struct {
  24237. // KeyName: Name of the key. The name must be 1-63 characters long, and
  24238. // comply with RFC1035. Specifically, the name must be 1-63 characters
  24239. // long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?`
  24240. // which means the first character must be a lowercase letter, and all
  24241. // following characters must be a dash, lowercase letter, or digit,
  24242. // except the last character, which cannot be a dash.
  24243. KeyName string `json:"keyName,omitempty"`
  24244. // KeyValue: 128-bit key value used for signing the URL. The key value
  24245. // must be a valid RFC 4648 Section 5 base64url encoded string.
  24246. KeyValue string `json:"keyValue,omitempty"`
  24247. // ForceSendFields is a list of field names (e.g. "KeyName") to
  24248. // unconditionally include in API requests. By default, fields with
  24249. // empty values are omitted from API requests. However, any non-pointer,
  24250. // non-interface field appearing in ForceSendFields will be sent to the
  24251. // server regardless of whether the field is empty or not. This may be
  24252. // used to include empty fields in Patch requests.
  24253. ForceSendFields []string `json:"-"`
  24254. // NullFields is a list of field names (e.g. "KeyName") to include in
  24255. // API requests with the JSON null value. By default, fields with empty
  24256. // values are omitted from API requests. However, any field with an
  24257. // empty value appearing in NullFields will be sent to the server as
  24258. // null. It is an error if a field in this list has a non-empty value.
  24259. // This may be used to include null fields in Patch requests.
  24260. NullFields []string `json:"-"`
  24261. }
  24262. func (s *SignedUrlKey) MarshalJSON() ([]byte, error) {
  24263. type NoMethod SignedUrlKey
  24264. raw := NoMethod(*s)
  24265. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24266. }
  24267. // Snapshot: A persistent disk snapshot resource. (== resource_for
  24268. // beta.snapshots ==) (== resource_for v1.snapshots ==)
  24269. type Snapshot struct {
  24270. // AutoCreated: [Output Only] Set to true if snapshots are autoamtically
  24271. // by applying resource policy on the target disk.
  24272. AutoCreated bool `json:"autoCreated,omitempty"`
  24273. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  24274. // format.
  24275. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  24276. // Description: An optional description of this resource. Provide this
  24277. // property when you create the resource.
  24278. Description string `json:"description,omitempty"`
  24279. // DiskSizeGb: [Output Only] Size of the snapshot, specified in GB.
  24280. DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"`
  24281. // GuestOsFeatures: [Output Only] A list of features to enable on the
  24282. // guest operating system. Applicable only for bootable images. Read
  24283. // Enabling guest operating system features to see a list of available
  24284. // options.
  24285. GuestOsFeatures []*GuestOsFeature `json:"guestOsFeatures,omitempty"`
  24286. // Id: [Output Only] The unique identifier for the resource. This
  24287. // identifier is defined by the server.
  24288. Id uint64 `json:"id,omitempty,string"`
  24289. // Kind: [Output Only] Type of the resource. Always compute#snapshot for
  24290. // Snapshot resources.
  24291. Kind string `json:"kind,omitempty"`
  24292. // LabelFingerprint: A fingerprint for the labels being applied to this
  24293. // snapshot, which is essentially a hash of the labels set used for
  24294. // optimistic locking. The fingerprint is initially generated by Compute
  24295. // Engine and changes after every request to modify or update labels.
  24296. // You must always provide an up-to-date fingerprint hash in order to
  24297. // update or change labels.
  24298. //
  24299. // To see the latest fingerprint, make a get() request to retrieve a
  24300. // snapshot.
  24301. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  24302. // Labels: Labels to apply to this snapshot. These can be later modified
  24303. // by the setLabels method. Label values may be empty.
  24304. Labels map[string]string `json:"labels,omitempty"`
  24305. // LicenseCodes: [Output Only] Integer license codes indicating which
  24306. // licenses are attached to this snapshot.
  24307. LicenseCodes googleapi.Int64s `json:"licenseCodes,omitempty"`
  24308. // Licenses: [Output Only] A list of public visible licenses that apply
  24309. // to this snapshot. This can be because the original image had licenses
  24310. // attached (such as a Windows image).
  24311. Licenses []string `json:"licenses,omitempty"`
  24312. // Name: Name of the resource; provided by the client when the resource
  24313. // is created. The name must be 1-63 characters long, and comply with
  24314. // RFC1035. Specifically, the name must be 1-63 characters long and
  24315. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  24316. // the first character must be a lowercase letter, and all following
  24317. // characters must be a dash, lowercase letter, or digit, except the
  24318. // last character, which cannot be a dash.
  24319. Name string `json:"name,omitempty"`
  24320. // SelfLink: [Output Only] Server-defined URL for the resource.
  24321. SelfLink string `json:"selfLink,omitempty"`
  24322. // SnapshotEncryptionKey: Encrypts the snapshot using a
  24323. // customer-supplied encryption key.
  24324. //
  24325. // After you encrypt a snapshot using a customer-supplied key, you must
  24326. // provide the same key if you use the image later For example, you must
  24327. // provide the encryption key when you create a disk from the encrypted
  24328. // snapshot in a future request.
  24329. //
  24330. // Customer-supplied encryption keys do not protect access to metadata
  24331. // of the disk.
  24332. //
  24333. // If you do not provide an encryption key when creating the snapshot,
  24334. // then the snapshot will be encrypted using an automatically generated
  24335. // key and you do not need to provide a key to use the snapshot later.
  24336. SnapshotEncryptionKey *CustomerEncryptionKey `json:"snapshotEncryptionKey,omitempty"`
  24337. // SourceDisk: [Output Only] The source disk used to create this
  24338. // snapshot.
  24339. SourceDisk string `json:"sourceDisk,omitempty"`
  24340. // SourceDiskEncryptionKey: The customer-supplied encryption key of the
  24341. // source disk. Required if the source disk is protected by a
  24342. // customer-supplied encryption key.
  24343. SourceDiskEncryptionKey *CustomerEncryptionKey `json:"sourceDiskEncryptionKey,omitempty"`
  24344. // SourceDiskId: [Output Only] The ID value of the disk used to create
  24345. // this snapshot. This value may be used to determine whether the
  24346. // snapshot was taken from the current or a previous instance of a given
  24347. // disk name.
  24348. SourceDiskId string `json:"sourceDiskId,omitempty"`
  24349. // Status: [Output Only] The status of the snapshot. This can be
  24350. // CREATING, DELETING, FAILED, READY, or UPLOADING.
  24351. //
  24352. // Possible values:
  24353. // "CREATING"
  24354. // "DELETING"
  24355. // "FAILED"
  24356. // "READY"
  24357. // "UPLOADING"
  24358. Status string `json:"status,omitempty"`
  24359. // StorageBytes: [Output Only] A size of the storage used by the
  24360. // snapshot. As snapshots share storage, this number is expected to
  24361. // change with snapshot creation/deletion.
  24362. StorageBytes int64 `json:"storageBytes,omitempty,string"`
  24363. // StorageBytesStatus: [Output Only] An indicator whether storageBytes
  24364. // is in a stable state or it is being adjusted as a result of shared
  24365. // storage reallocation. This status can either be UPDATING, meaning the
  24366. // size of the snapshot is being updated, or UP_TO_DATE, meaning the
  24367. // size of the snapshot is up-to-date.
  24368. //
  24369. // Possible values:
  24370. // "UPDATING"
  24371. // "UP_TO_DATE"
  24372. StorageBytesStatus string `json:"storageBytesStatus,omitempty"`
  24373. // StorageLocations: GCS bucket storage location of the snapshot
  24374. // (regional or multi-regional).
  24375. StorageLocations []string `json:"storageLocations,omitempty"`
  24376. // ServerResponse contains the HTTP response code and headers from the
  24377. // server.
  24378. googleapi.ServerResponse `json:"-"`
  24379. // ForceSendFields is a list of field names (e.g. "AutoCreated") to
  24380. // unconditionally include in API requests. By default, fields with
  24381. // empty values are omitted from API requests. However, any non-pointer,
  24382. // non-interface field appearing in ForceSendFields will be sent to the
  24383. // server regardless of whether the field is empty or not. This may be
  24384. // used to include empty fields in Patch requests.
  24385. ForceSendFields []string `json:"-"`
  24386. // NullFields is a list of field names (e.g. "AutoCreated") to include
  24387. // in API requests with the JSON null value. By default, fields with
  24388. // empty values are omitted from API requests. However, any field with
  24389. // an empty value appearing in NullFields will be sent to the server as
  24390. // null. It is an error if a field in this list has a non-empty value.
  24391. // This may be used to include null fields in Patch requests.
  24392. NullFields []string `json:"-"`
  24393. }
  24394. func (s *Snapshot) MarshalJSON() ([]byte, error) {
  24395. type NoMethod Snapshot
  24396. raw := NoMethod(*s)
  24397. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24398. }
  24399. // SnapshotList: Contains a list of Snapshot resources.
  24400. type SnapshotList struct {
  24401. // Id: [Output Only] Unique identifier for the resource; defined by the
  24402. // server.
  24403. Id string `json:"id,omitempty"`
  24404. // Items: A list of Snapshot resources.
  24405. Items []*Snapshot `json:"items,omitempty"`
  24406. // Kind: Type of resource.
  24407. Kind string `json:"kind,omitempty"`
  24408. // NextPageToken: [Output Only] This token allows you to get the next
  24409. // page of results for list requests. If the number of results is larger
  24410. // than maxResults, use the nextPageToken as a value for the query
  24411. // parameter pageToken in the next list request. Subsequent list
  24412. // requests will have their own nextPageToken to continue paging through
  24413. // the results.
  24414. NextPageToken string `json:"nextPageToken,omitempty"`
  24415. // SelfLink: [Output Only] Server-defined URL for this resource.
  24416. SelfLink string `json:"selfLink,omitempty"`
  24417. // Warning: [Output Only] Informational warning message.
  24418. Warning *SnapshotListWarning `json:"warning,omitempty"`
  24419. // ServerResponse contains the HTTP response code and headers from the
  24420. // server.
  24421. googleapi.ServerResponse `json:"-"`
  24422. // ForceSendFields is a list of field names (e.g. "Id") to
  24423. // unconditionally include in API requests. By default, fields with
  24424. // empty values are omitted from API requests. However, any non-pointer,
  24425. // non-interface field appearing in ForceSendFields will be sent to the
  24426. // server regardless of whether the field is empty or not. This may be
  24427. // used to include empty fields in Patch requests.
  24428. ForceSendFields []string `json:"-"`
  24429. // NullFields is a list of field names (e.g. "Id") to include in API
  24430. // requests with the JSON null value. By default, fields with empty
  24431. // values are omitted from API requests. However, any field with an
  24432. // empty value appearing in NullFields will be sent to the server as
  24433. // null. It is an error if a field in this list has a non-empty value.
  24434. // This may be used to include null fields in Patch requests.
  24435. NullFields []string `json:"-"`
  24436. }
  24437. func (s *SnapshotList) MarshalJSON() ([]byte, error) {
  24438. type NoMethod SnapshotList
  24439. raw := NoMethod(*s)
  24440. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24441. }
  24442. // SnapshotListWarning: [Output Only] Informational warning message.
  24443. type SnapshotListWarning struct {
  24444. // Code: [Output Only] A warning code, if applicable. For example,
  24445. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  24446. // the response.
  24447. //
  24448. // Possible values:
  24449. // "CLEANUP_FAILED"
  24450. // "DEPRECATED_RESOURCE_USED"
  24451. // "DEPRECATED_TYPE_USED"
  24452. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  24453. // "EXPERIMENTAL_TYPE_USED"
  24454. // "EXTERNAL_API_WARNING"
  24455. // "FIELD_VALUE_OVERRIDEN"
  24456. // "INJECTED_KERNELS_DEPRECATED"
  24457. // "MISSING_TYPE_DEPENDENCY"
  24458. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  24459. // "NEXT_HOP_CANNOT_IP_FORWARD"
  24460. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  24461. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  24462. // "NEXT_HOP_NOT_RUNNING"
  24463. // "NOT_CRITICAL_ERROR"
  24464. // "NO_RESULTS_ON_PAGE"
  24465. // "REQUIRED_TOS_AGREEMENT"
  24466. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  24467. // "RESOURCE_NOT_DELETED"
  24468. // "SCHEMA_VALIDATION_IGNORED"
  24469. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  24470. // "UNDECLARED_PROPERTIES"
  24471. // "UNREACHABLE"
  24472. Code string `json:"code,omitempty"`
  24473. // Data: [Output Only] Metadata about this warning in key: value format.
  24474. // For example:
  24475. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  24476. Data []*SnapshotListWarningData `json:"data,omitempty"`
  24477. // Message: [Output Only] A human-readable description of the warning
  24478. // code.
  24479. Message string `json:"message,omitempty"`
  24480. // ForceSendFields is a list of field names (e.g. "Code") to
  24481. // unconditionally include in API requests. By default, fields with
  24482. // empty values are omitted from API requests. However, any non-pointer,
  24483. // non-interface field appearing in ForceSendFields will be sent to the
  24484. // server regardless of whether the field is empty or not. This may be
  24485. // used to include empty fields in Patch requests.
  24486. ForceSendFields []string `json:"-"`
  24487. // NullFields is a list of field names (e.g. "Code") to include in API
  24488. // requests with the JSON null value. By default, fields with empty
  24489. // values are omitted from API requests. However, any field with an
  24490. // empty value appearing in NullFields will be sent to the server as
  24491. // null. It is an error if a field in this list has a non-empty value.
  24492. // This may be used to include null fields in Patch requests.
  24493. NullFields []string `json:"-"`
  24494. }
  24495. func (s *SnapshotListWarning) MarshalJSON() ([]byte, error) {
  24496. type NoMethod SnapshotListWarning
  24497. raw := NoMethod(*s)
  24498. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24499. }
  24500. type SnapshotListWarningData struct {
  24501. // Key: [Output Only] A key that provides more detail on the warning
  24502. // being returned. For example, for warnings where there are no results
  24503. // in a list request for a particular zone, this key might be scope and
  24504. // the key value might be the zone name. Other examples might be a key
  24505. // indicating a deprecated resource and a suggested replacement, or a
  24506. // warning about invalid network settings (for example, if an instance
  24507. // attempts to perform IP forwarding but is not enabled for IP
  24508. // forwarding).
  24509. Key string `json:"key,omitempty"`
  24510. // Value: [Output Only] A warning data value corresponding to the key.
  24511. Value string `json:"value,omitempty"`
  24512. // ForceSendFields is a list of field names (e.g. "Key") to
  24513. // unconditionally include in API requests. By default, fields with
  24514. // empty values are omitted from API requests. However, any non-pointer,
  24515. // non-interface field appearing in ForceSendFields will be sent to the
  24516. // server regardless of whether the field is empty or not. This may be
  24517. // used to include empty fields in Patch requests.
  24518. ForceSendFields []string `json:"-"`
  24519. // NullFields is a list of field names (e.g. "Key") to include in API
  24520. // requests with the JSON null value. By default, fields with empty
  24521. // values are omitted from API requests. However, any field with an
  24522. // empty value appearing in NullFields will be sent to the server as
  24523. // null. It is an error if a field in this list has a non-empty value.
  24524. // This may be used to include null fields in Patch requests.
  24525. NullFields []string `json:"-"`
  24526. }
  24527. func (s *SnapshotListWarningData) MarshalJSON() ([]byte, error) {
  24528. type NoMethod SnapshotListWarningData
  24529. raw := NoMethod(*s)
  24530. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24531. }
  24532. // SourceInstanceParams: A specification of the parameters to use when
  24533. // creating the instance template from a source instance.
  24534. type SourceInstanceParams struct {
  24535. // DiskConfigs: Attached disks configuration. If not provided, defaults
  24536. // are applied: For boot disk and any other R/W disks, new custom images
  24537. // will be created from each disk. For read-only disks, they will be
  24538. // attached in read-only mode. Local SSD disks will be created as blank
  24539. // volumes.
  24540. DiskConfigs []*DiskInstantiationConfig `json:"diskConfigs,omitempty"`
  24541. // ForceSendFields is a list of field names (e.g. "DiskConfigs") to
  24542. // unconditionally include in API requests. By default, fields with
  24543. // empty values are omitted from API requests. However, any non-pointer,
  24544. // non-interface field appearing in ForceSendFields will be sent to the
  24545. // server regardless of whether the field is empty or not. This may be
  24546. // used to include empty fields in Patch requests.
  24547. ForceSendFields []string `json:"-"`
  24548. // NullFields is a list of field names (e.g. "DiskConfigs") to include
  24549. // in API requests with the JSON null value. By default, fields with
  24550. // empty values are omitted from API requests. However, any field with
  24551. // an empty value appearing in NullFields will be sent to the server as
  24552. // null. It is an error if a field in this list has a non-empty value.
  24553. // This may be used to include null fields in Patch requests.
  24554. NullFields []string `json:"-"`
  24555. }
  24556. func (s *SourceInstanceParams) MarshalJSON() ([]byte, error) {
  24557. type NoMethod SourceInstanceParams
  24558. raw := NoMethod(*s)
  24559. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24560. }
  24561. // SslCertificate: An SslCertificate resource. This resource provides a
  24562. // mechanism to upload an SSL key and certificate to the load balancer
  24563. // to serve secure connections from the user. (== resource_for
  24564. // beta.sslCertificates ==) (== resource_for v1.sslCertificates ==)
  24565. type SslCertificate struct {
  24566. // Certificate: A local certificate file. The certificate must be in PEM
  24567. // format. The certificate chain must be no greater than 5 certs long.
  24568. // The chain must include at least one intermediate cert.
  24569. Certificate string `json:"certificate,omitempty"`
  24570. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  24571. // format.
  24572. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  24573. // Description: An optional description of this resource. Provide this
  24574. // property when you create the resource.
  24575. Description string `json:"description,omitempty"`
  24576. // ExpireTime: [Output Only] Expire time of the certificate. RFC3339
  24577. ExpireTime string `json:"expireTime,omitempty"`
  24578. // Id: [Output Only] The unique identifier for the resource. This
  24579. // identifier is defined by the server.
  24580. Id uint64 `json:"id,omitempty,string"`
  24581. // Kind: [Output Only] Type of the resource. Always
  24582. // compute#sslCertificate for SSL certificates.
  24583. Kind string `json:"kind,omitempty"`
  24584. // Managed: Configuration and status of a managed SSL certificate.
  24585. Managed *SslCertificateManagedSslCertificate `json:"managed,omitempty"`
  24586. // Name: Name of the resource. Provided by the client when the resource
  24587. // is created. The name must be 1-63 characters long, and comply with
  24588. // RFC1035. Specifically, the name must be 1-63 characters long and
  24589. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  24590. // the first character must be a lowercase letter, and all following
  24591. // characters must be a dash, lowercase letter, or digit, except the
  24592. // last character, which cannot be a dash.
  24593. Name string `json:"name,omitempty"`
  24594. // PrivateKey: A write-only private key in PEM format. Only insert
  24595. // requests will include this field.
  24596. PrivateKey string `json:"privateKey,omitempty"`
  24597. // SelfLink: [Output only] Server-defined URL for the resource.
  24598. SelfLink string `json:"selfLink,omitempty"`
  24599. // SelfManaged: Configuration and status of a self-managed SSL
  24600. // certificate.
  24601. SelfManaged *SslCertificateSelfManagedSslCertificate `json:"selfManaged,omitempty"`
  24602. // SubjectAlternativeNames: [Output Only] Domains associated with the
  24603. // certificate via Subject Alternative Name.
  24604. SubjectAlternativeNames []string `json:"subjectAlternativeNames,omitempty"`
  24605. // Type: (Optional) Specifies the type of SSL certificate, either
  24606. // "SELF_MANAGED" or "MANAGED". If not specified, the certificate is
  24607. // self-managed and the fields certificate and private_key are used.
  24608. //
  24609. // Possible values:
  24610. // "MANAGED"
  24611. // "SELF_MANAGED"
  24612. // "TYPE_UNSPECIFIED"
  24613. Type string `json:"type,omitempty"`
  24614. // ServerResponse contains the HTTP response code and headers from the
  24615. // server.
  24616. googleapi.ServerResponse `json:"-"`
  24617. // ForceSendFields is a list of field names (e.g. "Certificate") to
  24618. // unconditionally include in API requests. By default, fields with
  24619. // empty values are omitted from API requests. However, any non-pointer,
  24620. // non-interface field appearing in ForceSendFields will be sent to the
  24621. // server regardless of whether the field is empty or not. This may be
  24622. // used to include empty fields in Patch requests.
  24623. ForceSendFields []string `json:"-"`
  24624. // NullFields is a list of field names (e.g. "Certificate") to include
  24625. // in API requests with the JSON null value. By default, fields with
  24626. // empty values are omitted from API requests. However, any field with
  24627. // an empty value appearing in NullFields will be sent to the server as
  24628. // null. It is an error if a field in this list has a non-empty value.
  24629. // This may be used to include null fields in Patch requests.
  24630. NullFields []string `json:"-"`
  24631. }
  24632. func (s *SslCertificate) MarshalJSON() ([]byte, error) {
  24633. type NoMethod SslCertificate
  24634. raw := NoMethod(*s)
  24635. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24636. }
  24637. // SslCertificateList: Contains a list of SslCertificate resources.
  24638. type SslCertificateList struct {
  24639. // Id: [Output Only] Unique identifier for the resource; defined by the
  24640. // server.
  24641. Id string `json:"id,omitempty"`
  24642. // Items: A list of SslCertificate resources.
  24643. Items []*SslCertificate `json:"items,omitempty"`
  24644. // Kind: Type of resource.
  24645. Kind string `json:"kind,omitempty"`
  24646. // NextPageToken: [Output Only] This token allows you to get the next
  24647. // page of results for list requests. If the number of results is larger
  24648. // than maxResults, use the nextPageToken as a value for the query
  24649. // parameter pageToken in the next list request. Subsequent list
  24650. // requests will have their own nextPageToken to continue paging through
  24651. // the results.
  24652. NextPageToken string `json:"nextPageToken,omitempty"`
  24653. // SelfLink: [Output Only] Server-defined URL for this resource.
  24654. SelfLink string `json:"selfLink,omitempty"`
  24655. // Warning: [Output Only] Informational warning message.
  24656. Warning *SslCertificateListWarning `json:"warning,omitempty"`
  24657. // ServerResponse contains the HTTP response code and headers from the
  24658. // server.
  24659. googleapi.ServerResponse `json:"-"`
  24660. // ForceSendFields is a list of field names (e.g. "Id") to
  24661. // unconditionally include in API requests. By default, fields with
  24662. // empty values are omitted from API requests. However, any non-pointer,
  24663. // non-interface field appearing in ForceSendFields will be sent to the
  24664. // server regardless of whether the field is empty or not. This may be
  24665. // used to include empty fields in Patch requests.
  24666. ForceSendFields []string `json:"-"`
  24667. // NullFields is a list of field names (e.g. "Id") to include in API
  24668. // requests with the JSON null value. By default, fields with empty
  24669. // values are omitted from API requests. However, any field with an
  24670. // empty value appearing in NullFields will be sent to the server as
  24671. // null. It is an error if a field in this list has a non-empty value.
  24672. // This may be used to include null fields in Patch requests.
  24673. NullFields []string `json:"-"`
  24674. }
  24675. func (s *SslCertificateList) MarshalJSON() ([]byte, error) {
  24676. type NoMethod SslCertificateList
  24677. raw := NoMethod(*s)
  24678. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24679. }
  24680. // SslCertificateListWarning: [Output Only] Informational warning
  24681. // message.
  24682. type SslCertificateListWarning struct {
  24683. // Code: [Output Only] A warning code, if applicable. For example,
  24684. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  24685. // the response.
  24686. //
  24687. // Possible values:
  24688. // "CLEANUP_FAILED"
  24689. // "DEPRECATED_RESOURCE_USED"
  24690. // "DEPRECATED_TYPE_USED"
  24691. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  24692. // "EXPERIMENTAL_TYPE_USED"
  24693. // "EXTERNAL_API_WARNING"
  24694. // "FIELD_VALUE_OVERRIDEN"
  24695. // "INJECTED_KERNELS_DEPRECATED"
  24696. // "MISSING_TYPE_DEPENDENCY"
  24697. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  24698. // "NEXT_HOP_CANNOT_IP_FORWARD"
  24699. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  24700. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  24701. // "NEXT_HOP_NOT_RUNNING"
  24702. // "NOT_CRITICAL_ERROR"
  24703. // "NO_RESULTS_ON_PAGE"
  24704. // "REQUIRED_TOS_AGREEMENT"
  24705. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  24706. // "RESOURCE_NOT_DELETED"
  24707. // "SCHEMA_VALIDATION_IGNORED"
  24708. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  24709. // "UNDECLARED_PROPERTIES"
  24710. // "UNREACHABLE"
  24711. Code string `json:"code,omitempty"`
  24712. // Data: [Output Only] Metadata about this warning in key: value format.
  24713. // For example:
  24714. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  24715. Data []*SslCertificateListWarningData `json:"data,omitempty"`
  24716. // Message: [Output Only] A human-readable description of the warning
  24717. // code.
  24718. Message string `json:"message,omitempty"`
  24719. // ForceSendFields is a list of field names (e.g. "Code") to
  24720. // unconditionally include in API requests. By default, fields with
  24721. // empty values are omitted from API requests. However, any non-pointer,
  24722. // non-interface field appearing in ForceSendFields will be sent to the
  24723. // server regardless of whether the field is empty or not. This may be
  24724. // used to include empty fields in Patch requests.
  24725. ForceSendFields []string `json:"-"`
  24726. // NullFields is a list of field names (e.g. "Code") to include in API
  24727. // requests with the JSON null value. By default, fields with empty
  24728. // values are omitted from API requests. However, any field with an
  24729. // empty value appearing in NullFields will be sent to the server as
  24730. // null. It is an error if a field in this list has a non-empty value.
  24731. // This may be used to include null fields in Patch requests.
  24732. NullFields []string `json:"-"`
  24733. }
  24734. func (s *SslCertificateListWarning) MarshalJSON() ([]byte, error) {
  24735. type NoMethod SslCertificateListWarning
  24736. raw := NoMethod(*s)
  24737. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24738. }
  24739. type SslCertificateListWarningData struct {
  24740. // Key: [Output Only] A key that provides more detail on the warning
  24741. // being returned. For example, for warnings where there are no results
  24742. // in a list request for a particular zone, this key might be scope and
  24743. // the key value might be the zone name. Other examples might be a key
  24744. // indicating a deprecated resource and a suggested replacement, or a
  24745. // warning about invalid network settings (for example, if an instance
  24746. // attempts to perform IP forwarding but is not enabled for IP
  24747. // forwarding).
  24748. Key string `json:"key,omitempty"`
  24749. // Value: [Output Only] A warning data value corresponding to the key.
  24750. Value string `json:"value,omitempty"`
  24751. // ForceSendFields is a list of field names (e.g. "Key") to
  24752. // unconditionally include in API requests. By default, fields with
  24753. // empty values are omitted from API requests. However, any non-pointer,
  24754. // non-interface field appearing in ForceSendFields will be sent to the
  24755. // server regardless of whether the field is empty or not. This may be
  24756. // used to include empty fields in Patch requests.
  24757. ForceSendFields []string `json:"-"`
  24758. // NullFields is a list of field names (e.g. "Key") to include in API
  24759. // requests with the JSON null value. By default, fields with empty
  24760. // values are omitted from API requests. However, any field with an
  24761. // empty value appearing in NullFields will be sent to the server as
  24762. // null. It is an error if a field in this list has a non-empty value.
  24763. // This may be used to include null fields in Patch requests.
  24764. NullFields []string `json:"-"`
  24765. }
  24766. func (s *SslCertificateListWarningData) MarshalJSON() ([]byte, error) {
  24767. type NoMethod SslCertificateListWarningData
  24768. raw := NoMethod(*s)
  24769. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24770. }
  24771. // SslCertificateManagedSslCertificate: Configuration and status of a
  24772. // managed SSL certificate.
  24773. type SslCertificateManagedSslCertificate struct {
  24774. // DomainStatus: [Output only] Detailed statuses of the domains
  24775. // specified for managed certificate resource.
  24776. DomainStatus map[string]string `json:"domainStatus,omitempty"`
  24777. // Domains: The domains for which a managed SSL certificate will be
  24778. // generated. Currently only single-domain certs are supported.
  24779. Domains []string `json:"domains,omitempty"`
  24780. // Status: [Output only] Status of the managed certificate resource.
  24781. //
  24782. // Possible values:
  24783. // "ACTIVE"
  24784. // "MANAGED_CERTIFICATE_STATUS_UNSPECIFIED"
  24785. // "PROVISIONING"
  24786. // "PROVISIONING_FAILED"
  24787. // "PROVISIONING_FAILED_PERMANENTLY"
  24788. // "RENEWAL_FAILED"
  24789. Status string `json:"status,omitempty"`
  24790. // ForceSendFields is a list of field names (e.g. "DomainStatus") to
  24791. // unconditionally include in API requests. By default, fields with
  24792. // empty values are omitted from API requests. However, any non-pointer,
  24793. // non-interface field appearing in ForceSendFields will be sent to the
  24794. // server regardless of whether the field is empty or not. This may be
  24795. // used to include empty fields in Patch requests.
  24796. ForceSendFields []string `json:"-"`
  24797. // NullFields is a list of field names (e.g. "DomainStatus") to include
  24798. // in API requests with the JSON null value. By default, fields with
  24799. // empty values are omitted from API requests. However, any field with
  24800. // an empty value appearing in NullFields will be sent to the server as
  24801. // null. It is an error if a field in this list has a non-empty value.
  24802. // This may be used to include null fields in Patch requests.
  24803. NullFields []string `json:"-"`
  24804. }
  24805. func (s *SslCertificateManagedSslCertificate) MarshalJSON() ([]byte, error) {
  24806. type NoMethod SslCertificateManagedSslCertificate
  24807. raw := NoMethod(*s)
  24808. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24809. }
  24810. // SslCertificateSelfManagedSslCertificate: Configuration and status of
  24811. // a self-managed SSL certificate.
  24812. type SslCertificateSelfManagedSslCertificate struct {
  24813. // Certificate: A local certificate file. The certificate must be in PEM
  24814. // format. The certificate chain must be no greater than 5 certs long.
  24815. // The chain must include at least one intermediate cert.
  24816. Certificate string `json:"certificate,omitempty"`
  24817. // PrivateKey: A write-only private key in PEM format. Only insert
  24818. // requests will include this field.
  24819. PrivateKey string `json:"privateKey,omitempty"`
  24820. // ForceSendFields is a list of field names (e.g. "Certificate") to
  24821. // unconditionally include in API requests. By default, fields with
  24822. // empty values are omitted from API requests. However, any non-pointer,
  24823. // non-interface field appearing in ForceSendFields will be sent to the
  24824. // server regardless of whether the field is empty or not. This may be
  24825. // used to include empty fields in Patch requests.
  24826. ForceSendFields []string `json:"-"`
  24827. // NullFields is a list of field names (e.g. "Certificate") to include
  24828. // in API requests with the JSON null value. By default, fields with
  24829. // empty values are omitted from API requests. However, any field with
  24830. // an empty value appearing in NullFields will be sent to the server as
  24831. // null. It is an error if a field in this list has a non-empty value.
  24832. // This may be used to include null fields in Patch requests.
  24833. NullFields []string `json:"-"`
  24834. }
  24835. func (s *SslCertificateSelfManagedSslCertificate) MarshalJSON() ([]byte, error) {
  24836. type NoMethod SslCertificateSelfManagedSslCertificate
  24837. raw := NoMethod(*s)
  24838. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24839. }
  24840. type SslPoliciesList struct {
  24841. // Id: [Output Only] Unique identifier for the resource; defined by the
  24842. // server.
  24843. Id string `json:"id,omitempty"`
  24844. // Items: A list of SslPolicy resources.
  24845. Items []*SslPolicy `json:"items,omitempty"`
  24846. // Kind: [Output Only] Type of the resource. Always
  24847. // compute#sslPoliciesList for lists of sslPolicies.
  24848. Kind string `json:"kind,omitempty"`
  24849. // NextPageToken: [Output Only] This token allows you to get the next
  24850. // page of results for list requests. If the number of results is larger
  24851. // than maxResults, use the nextPageToken as a value for the query
  24852. // parameter pageToken in the next list request. Subsequent list
  24853. // requests will have their own nextPageToken to continue paging through
  24854. // the results.
  24855. NextPageToken string `json:"nextPageToken,omitempty"`
  24856. // SelfLink: [Output Only] Server-defined URL for this resource.
  24857. SelfLink string `json:"selfLink,omitempty"`
  24858. // Warning: [Output Only] Informational warning message.
  24859. Warning *SslPoliciesListWarning `json:"warning,omitempty"`
  24860. // ServerResponse contains the HTTP response code and headers from the
  24861. // server.
  24862. googleapi.ServerResponse `json:"-"`
  24863. // ForceSendFields is a list of field names (e.g. "Id") to
  24864. // unconditionally include in API requests. By default, fields with
  24865. // empty values are omitted from API requests. However, any non-pointer,
  24866. // non-interface field appearing in ForceSendFields will be sent to the
  24867. // server regardless of whether the field is empty or not. This may be
  24868. // used to include empty fields in Patch requests.
  24869. ForceSendFields []string `json:"-"`
  24870. // NullFields is a list of field names (e.g. "Id") to include in API
  24871. // requests with the JSON null value. By default, fields with empty
  24872. // values are omitted from API requests. However, any field with an
  24873. // empty value appearing in NullFields will be sent to the server as
  24874. // null. It is an error if a field in this list has a non-empty value.
  24875. // This may be used to include null fields in Patch requests.
  24876. NullFields []string `json:"-"`
  24877. }
  24878. func (s *SslPoliciesList) MarshalJSON() ([]byte, error) {
  24879. type NoMethod SslPoliciesList
  24880. raw := NoMethod(*s)
  24881. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24882. }
  24883. // SslPoliciesListWarning: [Output Only] Informational warning message.
  24884. type SslPoliciesListWarning struct {
  24885. // Code: [Output Only] A warning code, if applicable. For example,
  24886. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  24887. // the response.
  24888. //
  24889. // Possible values:
  24890. // "CLEANUP_FAILED"
  24891. // "DEPRECATED_RESOURCE_USED"
  24892. // "DEPRECATED_TYPE_USED"
  24893. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  24894. // "EXPERIMENTAL_TYPE_USED"
  24895. // "EXTERNAL_API_WARNING"
  24896. // "FIELD_VALUE_OVERRIDEN"
  24897. // "INJECTED_KERNELS_DEPRECATED"
  24898. // "MISSING_TYPE_DEPENDENCY"
  24899. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  24900. // "NEXT_HOP_CANNOT_IP_FORWARD"
  24901. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  24902. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  24903. // "NEXT_HOP_NOT_RUNNING"
  24904. // "NOT_CRITICAL_ERROR"
  24905. // "NO_RESULTS_ON_PAGE"
  24906. // "REQUIRED_TOS_AGREEMENT"
  24907. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  24908. // "RESOURCE_NOT_DELETED"
  24909. // "SCHEMA_VALIDATION_IGNORED"
  24910. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  24911. // "UNDECLARED_PROPERTIES"
  24912. // "UNREACHABLE"
  24913. Code string `json:"code,omitempty"`
  24914. // Data: [Output Only] Metadata about this warning in key: value format.
  24915. // For example:
  24916. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  24917. Data []*SslPoliciesListWarningData `json:"data,omitempty"`
  24918. // Message: [Output Only] A human-readable description of the warning
  24919. // code.
  24920. Message string `json:"message,omitempty"`
  24921. // ForceSendFields is a list of field names (e.g. "Code") to
  24922. // unconditionally include in API requests. By default, fields with
  24923. // empty values are omitted from API requests. However, any non-pointer,
  24924. // non-interface field appearing in ForceSendFields will be sent to the
  24925. // server regardless of whether the field is empty or not. This may be
  24926. // used to include empty fields in Patch requests.
  24927. ForceSendFields []string `json:"-"`
  24928. // NullFields is a list of field names (e.g. "Code") to include in API
  24929. // requests with the JSON null value. By default, fields with empty
  24930. // values are omitted from API requests. However, any field with an
  24931. // empty value appearing in NullFields will be sent to the server as
  24932. // null. It is an error if a field in this list has a non-empty value.
  24933. // This may be used to include null fields in Patch requests.
  24934. NullFields []string `json:"-"`
  24935. }
  24936. func (s *SslPoliciesListWarning) MarshalJSON() ([]byte, error) {
  24937. type NoMethod SslPoliciesListWarning
  24938. raw := NoMethod(*s)
  24939. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24940. }
  24941. type SslPoliciesListWarningData struct {
  24942. // Key: [Output Only] A key that provides more detail on the warning
  24943. // being returned. For example, for warnings where there are no results
  24944. // in a list request for a particular zone, this key might be scope and
  24945. // the key value might be the zone name. Other examples might be a key
  24946. // indicating a deprecated resource and a suggested replacement, or a
  24947. // warning about invalid network settings (for example, if an instance
  24948. // attempts to perform IP forwarding but is not enabled for IP
  24949. // forwarding).
  24950. Key string `json:"key,omitempty"`
  24951. // Value: [Output Only] A warning data value corresponding to the key.
  24952. Value string `json:"value,omitempty"`
  24953. // ForceSendFields is a list of field names (e.g. "Key") to
  24954. // unconditionally include in API requests. By default, fields with
  24955. // empty values are omitted from API requests. However, any non-pointer,
  24956. // non-interface field appearing in ForceSendFields will be sent to the
  24957. // server regardless of whether the field is empty or not. This may be
  24958. // used to include empty fields in Patch requests.
  24959. ForceSendFields []string `json:"-"`
  24960. // NullFields is a list of field names (e.g. "Key") to include in API
  24961. // requests with the JSON null value. By default, fields with empty
  24962. // values are omitted from API requests. However, any field with an
  24963. // empty value appearing in NullFields will be sent to the server as
  24964. // null. It is an error if a field in this list has a non-empty value.
  24965. // This may be used to include null fields in Patch requests.
  24966. NullFields []string `json:"-"`
  24967. }
  24968. func (s *SslPoliciesListWarningData) MarshalJSON() ([]byte, error) {
  24969. type NoMethod SslPoliciesListWarningData
  24970. raw := NoMethod(*s)
  24971. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24972. }
  24973. type SslPoliciesListAvailableFeaturesResponse struct {
  24974. Features []string `json:"features,omitempty"`
  24975. // ServerResponse contains the HTTP response code and headers from the
  24976. // server.
  24977. googleapi.ServerResponse `json:"-"`
  24978. // ForceSendFields is a list of field names (e.g. "Features") to
  24979. // unconditionally include in API requests. By default, fields with
  24980. // empty values are omitted from API requests. However, any non-pointer,
  24981. // non-interface field appearing in ForceSendFields will be sent to the
  24982. // server regardless of whether the field is empty or not. This may be
  24983. // used to include empty fields in Patch requests.
  24984. ForceSendFields []string `json:"-"`
  24985. // NullFields is a list of field names (e.g. "Features") to include in
  24986. // API requests with the JSON null value. By default, fields with empty
  24987. // values are omitted from API requests. However, any field with an
  24988. // empty value appearing in NullFields will be sent to the server as
  24989. // null. It is an error if a field in this list has a non-empty value.
  24990. // This may be used to include null fields in Patch requests.
  24991. NullFields []string `json:"-"`
  24992. }
  24993. func (s *SslPoliciesListAvailableFeaturesResponse) MarshalJSON() ([]byte, error) {
  24994. type NoMethod SslPoliciesListAvailableFeaturesResponse
  24995. raw := NoMethod(*s)
  24996. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24997. }
  24998. // SslPolicy: A SSL policy specifies the server-side support for SSL
  24999. // features. This can be attached to a TargetHttpsProxy or a
  25000. // TargetSslProxy. This affects connections between clients and the
  25001. // HTTPS or SSL proxy load balancer. They do not affect the connection
  25002. // between the load balancers and the backends.
  25003. type SslPolicy struct {
  25004. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  25005. // format.
  25006. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  25007. // CustomFeatures: A list of features enabled when the selected profile
  25008. // is CUSTOM. The
  25009. // - method returns the set of features that can be specified in this
  25010. // list. This field must be empty if the profile is not CUSTOM.
  25011. CustomFeatures []string `json:"customFeatures,omitempty"`
  25012. // Description: An optional description of this resource. Provide this
  25013. // property when you create the resource.
  25014. Description string `json:"description,omitempty"`
  25015. // EnabledFeatures: [Output Only] The list of features enabled in the
  25016. // SSL policy.
  25017. EnabledFeatures []string `json:"enabledFeatures,omitempty"`
  25018. // Fingerprint: Fingerprint of this resource. A hash of the contents
  25019. // stored in this object. This field is used in optimistic locking. This
  25020. // field will be ignored when inserting a SslPolicy. An up-to-date
  25021. // fingerprint must be provided in order to update the SslPolicy.
  25022. Fingerprint string `json:"fingerprint,omitempty"`
  25023. // Id: [Output Only] The unique identifier for the resource. This
  25024. // identifier is defined by the server.
  25025. Id uint64 `json:"id,omitempty,string"`
  25026. // Kind: [Output only] Type of the resource. Always compute#sslPolicyfor
  25027. // SSL policies.
  25028. Kind string `json:"kind,omitempty"`
  25029. // MinTlsVersion: The minimum version of SSL protocol that can be used
  25030. // by the clients to establish a connection with the load balancer. This
  25031. // can be one of TLS_1_0, TLS_1_1, TLS_1_2.
  25032. //
  25033. // Possible values:
  25034. // "TLS_1_0"
  25035. // "TLS_1_1"
  25036. // "TLS_1_2"
  25037. MinTlsVersion string `json:"minTlsVersion,omitempty"`
  25038. // Name: Name of the resource. The name must be 1-63 characters long,
  25039. // and comply with RFC1035. Specifically, the name must be 1-63
  25040. // characters long and match the regular expression
  25041. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  25042. // a lowercase letter, and all following characters must be a dash,
  25043. // lowercase letter, or digit, except the last character, which cannot
  25044. // be a dash.
  25045. Name string `json:"name,omitempty"`
  25046. // Profile: Profile specifies the set of SSL features that can be used
  25047. // by the load balancer when negotiating SSL with clients. This can be
  25048. // one of COMPATIBLE, MODERN, RESTRICTED, or CUSTOM. If using CUSTOM,
  25049. // the set of SSL features to enable must be specified in the
  25050. // customFeatures field.
  25051. //
  25052. // Possible values:
  25053. // "COMPATIBLE"
  25054. // "CUSTOM"
  25055. // "MODERN"
  25056. // "RESTRICTED"
  25057. Profile string `json:"profile,omitempty"`
  25058. // SelfLink: [Output Only] Server-defined URL for the resource.
  25059. SelfLink string `json:"selfLink,omitempty"`
  25060. // Warnings: [Output Only] If potential misconfigurations are detected
  25061. // for this SSL policy, this field will be populated with warning
  25062. // messages.
  25063. Warnings []*SslPolicyWarnings `json:"warnings,omitempty"`
  25064. // ServerResponse contains the HTTP response code and headers from the
  25065. // server.
  25066. googleapi.ServerResponse `json:"-"`
  25067. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  25068. // to unconditionally include in API requests. By default, fields with
  25069. // empty values are omitted from API requests. However, any non-pointer,
  25070. // non-interface field appearing in ForceSendFields will be sent to the
  25071. // server regardless of whether the field is empty or not. This may be
  25072. // used to include empty fields in Patch requests.
  25073. ForceSendFields []string `json:"-"`
  25074. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  25075. // include in API requests with the JSON null value. By default, fields
  25076. // with empty values are omitted from API requests. However, any field
  25077. // with an empty value appearing in NullFields will be sent to the
  25078. // server as null. It is an error if a field in this list has a
  25079. // non-empty value. This may be used to include null fields in Patch
  25080. // requests.
  25081. NullFields []string `json:"-"`
  25082. }
  25083. func (s *SslPolicy) MarshalJSON() ([]byte, error) {
  25084. type NoMethod SslPolicy
  25085. raw := NoMethod(*s)
  25086. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25087. }
  25088. type SslPolicyWarnings struct {
  25089. // Code: [Output Only] A warning code, if applicable. For example,
  25090. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  25091. // the response.
  25092. //
  25093. // Possible values:
  25094. // "CLEANUP_FAILED"
  25095. // "DEPRECATED_RESOURCE_USED"
  25096. // "DEPRECATED_TYPE_USED"
  25097. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  25098. // "EXPERIMENTAL_TYPE_USED"
  25099. // "EXTERNAL_API_WARNING"
  25100. // "FIELD_VALUE_OVERRIDEN"
  25101. // "INJECTED_KERNELS_DEPRECATED"
  25102. // "MISSING_TYPE_DEPENDENCY"
  25103. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  25104. // "NEXT_HOP_CANNOT_IP_FORWARD"
  25105. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  25106. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  25107. // "NEXT_HOP_NOT_RUNNING"
  25108. // "NOT_CRITICAL_ERROR"
  25109. // "NO_RESULTS_ON_PAGE"
  25110. // "REQUIRED_TOS_AGREEMENT"
  25111. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  25112. // "RESOURCE_NOT_DELETED"
  25113. // "SCHEMA_VALIDATION_IGNORED"
  25114. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  25115. // "UNDECLARED_PROPERTIES"
  25116. // "UNREACHABLE"
  25117. Code string `json:"code,omitempty"`
  25118. // Data: [Output Only] Metadata about this warning in key: value format.
  25119. // For example:
  25120. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  25121. Data []*SslPolicyWarningsData `json:"data,omitempty"`
  25122. // Message: [Output Only] A human-readable description of the warning
  25123. // code.
  25124. Message string `json:"message,omitempty"`
  25125. // ForceSendFields is a list of field names (e.g. "Code") to
  25126. // unconditionally include in API requests. By default, fields with
  25127. // empty values are omitted from API requests. However, any non-pointer,
  25128. // non-interface field appearing in ForceSendFields will be sent to the
  25129. // server regardless of whether the field is empty or not. This may be
  25130. // used to include empty fields in Patch requests.
  25131. ForceSendFields []string `json:"-"`
  25132. // NullFields is a list of field names (e.g. "Code") to include in API
  25133. // requests with the JSON null value. By default, fields with empty
  25134. // values are omitted from API requests. However, any field with an
  25135. // empty value appearing in NullFields will be sent to the server as
  25136. // null. It is an error if a field in this list has a non-empty value.
  25137. // This may be used to include null fields in Patch requests.
  25138. NullFields []string `json:"-"`
  25139. }
  25140. func (s *SslPolicyWarnings) MarshalJSON() ([]byte, error) {
  25141. type NoMethod SslPolicyWarnings
  25142. raw := NoMethod(*s)
  25143. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25144. }
  25145. type SslPolicyWarningsData struct {
  25146. // Key: [Output Only] A key that provides more detail on the warning
  25147. // being returned. For example, for warnings where there are no results
  25148. // in a list request for a particular zone, this key might be scope and
  25149. // the key value might be the zone name. Other examples might be a key
  25150. // indicating a deprecated resource and a suggested replacement, or a
  25151. // warning about invalid network settings (for example, if an instance
  25152. // attempts to perform IP forwarding but is not enabled for IP
  25153. // forwarding).
  25154. Key string `json:"key,omitempty"`
  25155. // Value: [Output Only] A warning data value corresponding to the key.
  25156. Value string `json:"value,omitempty"`
  25157. // ForceSendFields is a list of field names (e.g. "Key") to
  25158. // unconditionally include in API requests. By default, fields with
  25159. // empty values are omitted from API requests. However, any non-pointer,
  25160. // non-interface field appearing in ForceSendFields will be sent to the
  25161. // server regardless of whether the field is empty or not. This may be
  25162. // used to include empty fields in Patch requests.
  25163. ForceSendFields []string `json:"-"`
  25164. // NullFields is a list of field names (e.g. "Key") to include in API
  25165. // requests with the JSON null value. By default, fields with empty
  25166. // values are omitted from API requests. However, any field with an
  25167. // empty value appearing in NullFields will be sent to the server as
  25168. // null. It is an error if a field in this list has a non-empty value.
  25169. // This may be used to include null fields in Patch requests.
  25170. NullFields []string `json:"-"`
  25171. }
  25172. func (s *SslPolicyWarningsData) MarshalJSON() ([]byte, error) {
  25173. type NoMethod SslPolicyWarningsData
  25174. raw := NoMethod(*s)
  25175. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25176. }
  25177. type SslPolicyReference struct {
  25178. // SslPolicy: URL of the SSL policy resource. Set this to empty string
  25179. // to clear any existing SSL policy associated with the target proxy
  25180. // resource.
  25181. SslPolicy string `json:"sslPolicy,omitempty"`
  25182. // ForceSendFields is a list of field names (e.g. "SslPolicy") to
  25183. // unconditionally include in API requests. By default, fields with
  25184. // empty values are omitted from API requests. However, any non-pointer,
  25185. // non-interface field appearing in ForceSendFields will be sent to the
  25186. // server regardless of whether the field is empty or not. This may be
  25187. // used to include empty fields in Patch requests.
  25188. ForceSendFields []string `json:"-"`
  25189. // NullFields is a list of field names (e.g. "SslPolicy") to include in
  25190. // API requests with the JSON null value. By default, fields with empty
  25191. // values are omitted from API requests. However, any field with an
  25192. // empty value appearing in NullFields will be sent to the server as
  25193. // null. It is an error if a field in this list has a non-empty value.
  25194. // This may be used to include null fields in Patch requests.
  25195. NullFields []string `json:"-"`
  25196. }
  25197. func (s *SslPolicyReference) MarshalJSON() ([]byte, error) {
  25198. type NoMethod SslPolicyReference
  25199. raw := NoMethod(*s)
  25200. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25201. }
  25202. type StatefulPolicy struct {
  25203. PreservedResources *StatefulPolicyPreservedResources `json:"preservedResources,omitempty"`
  25204. // ForceSendFields is a list of field names (e.g. "PreservedResources")
  25205. // to unconditionally include in API requests. By default, fields with
  25206. // empty values are omitted from API requests. However, any non-pointer,
  25207. // non-interface field appearing in ForceSendFields will be sent to the
  25208. // server regardless of whether the field is empty or not. This may be
  25209. // used to include empty fields in Patch requests.
  25210. ForceSendFields []string `json:"-"`
  25211. // NullFields is a list of field names (e.g. "PreservedResources") to
  25212. // include in API requests with the JSON null value. By default, fields
  25213. // with empty values are omitted from API requests. However, any field
  25214. // with an empty value appearing in NullFields will be sent to the
  25215. // server as null. It is an error if a field in this list has a
  25216. // non-empty value. This may be used to include null fields in Patch
  25217. // requests.
  25218. NullFields []string `json:"-"`
  25219. }
  25220. func (s *StatefulPolicy) MarshalJSON() ([]byte, error) {
  25221. type NoMethod StatefulPolicy
  25222. raw := NoMethod(*s)
  25223. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25224. }
  25225. type StatefulPolicyPreservedDisk struct {
  25226. // DeviceName: Device name of the disk to be preserved
  25227. DeviceName string `json:"deviceName,omitempty"`
  25228. // ForceSendFields is a list of field names (e.g. "DeviceName") to
  25229. // unconditionally include in API requests. By default, fields with
  25230. // empty values are omitted from API requests. However, any non-pointer,
  25231. // non-interface field appearing in ForceSendFields will be sent to the
  25232. // server regardless of whether the field is empty or not. This may be
  25233. // used to include empty fields in Patch requests.
  25234. ForceSendFields []string `json:"-"`
  25235. // NullFields is a list of field names (e.g. "DeviceName") to include in
  25236. // API requests with the JSON null value. By default, fields with empty
  25237. // values are omitted from API requests. However, any field with an
  25238. // empty value appearing in NullFields will be sent to the server as
  25239. // null. It is an error if a field in this list has a non-empty value.
  25240. // This may be used to include null fields in Patch requests.
  25241. NullFields []string `json:"-"`
  25242. }
  25243. func (s *StatefulPolicyPreservedDisk) MarshalJSON() ([]byte, error) {
  25244. type NoMethod StatefulPolicyPreservedDisk
  25245. raw := NoMethod(*s)
  25246. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25247. }
  25248. // StatefulPolicyPreservedResources: Configuration of all preserved
  25249. // resources.
  25250. type StatefulPolicyPreservedResources struct {
  25251. // Disks: Disks created on the instances that will be preserved on
  25252. // instance delete, resize down, etc.
  25253. Disks []*StatefulPolicyPreservedDisk `json:"disks,omitempty"`
  25254. // ForceSendFields is a list of field names (e.g. "Disks") to
  25255. // unconditionally include in API requests. By default, fields with
  25256. // empty values are omitted from API requests. However, any non-pointer,
  25257. // non-interface field appearing in ForceSendFields will be sent to the
  25258. // server regardless of whether the field is empty or not. This may be
  25259. // used to include empty fields in Patch requests.
  25260. ForceSendFields []string `json:"-"`
  25261. // NullFields is a list of field names (e.g. "Disks") to include in API
  25262. // requests with the JSON null value. By default, fields with empty
  25263. // values are omitted from API requests. However, any field with an
  25264. // empty value appearing in NullFields will be sent to the server as
  25265. // null. It is an error if a field in this list has a non-empty value.
  25266. // This may be used to include null fields in Patch requests.
  25267. NullFields []string `json:"-"`
  25268. }
  25269. func (s *StatefulPolicyPreservedResources) MarshalJSON() ([]byte, error) {
  25270. type NoMethod StatefulPolicyPreservedResources
  25271. raw := NoMethod(*s)
  25272. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25273. }
  25274. // Subnetwork: A Subnetwork resource. (== resource_for beta.subnetworks
  25275. // ==) (== resource_for v1.subnetworks ==)
  25276. type Subnetwork struct {
  25277. // AllowSubnetCidrRoutesOverlap: Whether this subnetwork can conflict
  25278. // with static routes. Setting this to true allows this subnetwork's
  25279. // primary and secondary ranges to conflict with routes that have
  25280. // already been configured on the corresponding network. Static routes
  25281. // will take precedence over the subnetwork route if the route prefix
  25282. // length is at least as large as the subnetwork prefix length.
  25283. //
  25284. // Also, packets destined to IPs within subnetwork may contain
  25285. // private/sensitive data and are prevented from leaving the virtual
  25286. // network. Setting this field to true will disable this feature.
  25287. //
  25288. // The default value is false and applies to all existing subnetworks
  25289. // and automatically created subnetworks.
  25290. //
  25291. // This field cannot be set to true at resource creation time.
  25292. AllowSubnetCidrRoutesOverlap bool `json:"allowSubnetCidrRoutesOverlap,omitempty"`
  25293. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  25294. // format.
  25295. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  25296. // Description: An optional description of this resource. Provide this
  25297. // property when you create the resource. This field can be set only at
  25298. // resource creation time.
  25299. Description string `json:"description,omitempty"`
  25300. // EnableFlowLogs: Whether to enable flow logging for this subnetwork.
  25301. EnableFlowLogs bool `json:"enableFlowLogs,omitempty"`
  25302. // EnablePrivateV6Access: Whether the VMs in this subnet can directly
  25303. // access Google services via internal IPv6 addresses. This field can be
  25304. // both set at resource creation time and updated using patch.
  25305. EnablePrivateV6Access bool `json:"enablePrivateV6Access,omitempty"`
  25306. // Fingerprint: Fingerprint of this resource. A hash of the contents
  25307. // stored in this object. This field is used in optimistic locking. This
  25308. // field will be ignored when inserting a Subnetwork. An up-to-date
  25309. // fingerprint must be provided in order to update the Subnetwork.
  25310. Fingerprint string `json:"fingerprint,omitempty"`
  25311. // GatewayAddress: [Output Only] The gateway address for default routes
  25312. // to reach destination addresses outside this subnetwork.
  25313. GatewayAddress string `json:"gatewayAddress,omitempty"`
  25314. // Id: [Output Only] The unique identifier for the resource. This
  25315. // identifier is defined by the server.
  25316. Id uint64 `json:"id,omitempty,string"`
  25317. // IpCidrRange: The range of internal addresses that are owned by this
  25318. // subnetwork. Provide this property when you create the subnetwork. For
  25319. // example, 10.0.0.0/8 or 192.168.0.0/16. Ranges must be unique and
  25320. // non-overlapping within a network. Only IPv4 is supported. This field
  25321. // can be set only at resource creation time.
  25322. IpCidrRange string `json:"ipCidrRange,omitempty"`
  25323. // Ipv6CidrRange: [Output Only] The range of internal IPv6 addresses
  25324. // that are owned by this subnetwork.
  25325. Ipv6CidrRange string `json:"ipv6CidrRange,omitempty"`
  25326. // Kind: [Output Only] Type of the resource. Always compute#subnetwork
  25327. // for Subnetwork resources.
  25328. Kind string `json:"kind,omitempty"`
  25329. // Name: The name of the resource, provided by the client when initially
  25330. // creating the resource. The name must be 1-63 characters long, and
  25331. // comply with RFC1035. Specifically, the name must be 1-63 characters
  25332. // long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?`
  25333. // which means the first character must be a lowercase letter, and all
  25334. // following characters must be a dash, lowercase letter, or digit,
  25335. // except the last character, which cannot be a dash.
  25336. Name string `json:"name,omitempty"`
  25337. // Network: The URL of the network to which this subnetwork belongs,
  25338. // provided by the client when initially creating the subnetwork. Only
  25339. // networks that are in the distributed mode can have subnetworks. This
  25340. // field can be set only at resource creation time.
  25341. Network string `json:"network,omitempty"`
  25342. // PrivateIpGoogleAccess: Whether the VMs in this subnet can access
  25343. // Google services without assigned external IP addresses. This field
  25344. // can be both set at resource creation time and updated using
  25345. // setPrivateIpGoogleAccess.
  25346. PrivateIpGoogleAccess bool `json:"privateIpGoogleAccess,omitempty"`
  25347. // Purpose: The purpose of the resource. This field can be either
  25348. // PRIVATE_RFC_1918 or INTERNAL_HTTPS_LOAD_BALANCER. A subnetwork with
  25349. // purpose set to INTERNAL_HTTPS_LOAD_BALANCER is a user-created
  25350. // subnetwork that is reserved for Internal HTTP(S) Load Balancing. If
  25351. // unspecified, the purpose defaults to PRIVATE_RFC_1918.
  25352. //
  25353. // Possible values:
  25354. // "INTERNAL_HTTPS_LOAD_BALANCER"
  25355. // "PRIVATE_RFC_1918"
  25356. Purpose string `json:"purpose,omitempty"`
  25357. // Region: URL of the region where the Subnetwork resides. This field
  25358. // can be set only at resource creation time.
  25359. Region string `json:"region,omitempty"`
  25360. // Role: The role of subnetwork. Currenly, this field is only used when
  25361. // purpose = INTERNAL_HTTPS_LOAD_BALANCER. The value can be set to
  25362. // ACTIVE or BACKUP. An ACTIVE subnetwork is one that is currently being
  25363. // used for Internal HTTP(S) Load Balancing. A BACKUP subnetwork is one
  25364. // that is ready to be promoted to ACTIVE or is currently draining.
  25365. //
  25366. // Possible values:
  25367. // "ACTIVE"
  25368. // "BACKUP"
  25369. Role string `json:"role,omitempty"`
  25370. // SecondaryIpRanges: An array of configurations for secondary IP ranges
  25371. // for VM instances contained in this subnetwork. The primary IP of such
  25372. // VM must belong to the primary ipCidrRange of the subnetwork. The
  25373. // alias IPs may belong to either primary or secondary ranges.
  25374. SecondaryIpRanges []*SubnetworkSecondaryRange `json:"secondaryIpRanges,omitempty"`
  25375. // SelfLink: [Output Only] Server-defined URL for the resource.
  25376. SelfLink string `json:"selfLink,omitempty"`
  25377. // ServerResponse contains the HTTP response code and headers from the
  25378. // server.
  25379. googleapi.ServerResponse `json:"-"`
  25380. // ForceSendFields is a list of field names (e.g.
  25381. // "AllowSubnetCidrRoutesOverlap") to unconditionally include in API
  25382. // requests. By default, fields with empty values are omitted from API
  25383. // requests. However, any non-pointer, non-interface field appearing in
  25384. // ForceSendFields will be sent to the server regardless of whether the
  25385. // field is empty or not. This may be used to include empty fields in
  25386. // Patch requests.
  25387. ForceSendFields []string `json:"-"`
  25388. // NullFields is a list of field names (e.g.
  25389. // "AllowSubnetCidrRoutesOverlap") to include in API requests with the
  25390. // JSON null value. By default, fields with empty values are omitted
  25391. // from API requests. However, any field with an empty value appearing
  25392. // in NullFields will be sent to the server as null. It is an error if a
  25393. // field in this list has a non-empty value. This may be used to include
  25394. // null fields in Patch requests.
  25395. NullFields []string `json:"-"`
  25396. }
  25397. func (s *Subnetwork) MarshalJSON() ([]byte, error) {
  25398. type NoMethod Subnetwork
  25399. raw := NoMethod(*s)
  25400. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25401. }
  25402. type SubnetworkAggregatedList struct {
  25403. // Id: [Output Only] Unique identifier for the resource; defined by the
  25404. // server.
  25405. Id string `json:"id,omitempty"`
  25406. // Items: A list of SubnetworksScopedList resources.
  25407. Items map[string]SubnetworksScopedList `json:"items,omitempty"`
  25408. // Kind: [Output Only] Type of resource. Always
  25409. // compute#subnetworkAggregatedList for aggregated lists of subnetworks.
  25410. Kind string `json:"kind,omitempty"`
  25411. // NextPageToken: [Output Only] This token allows you to get the next
  25412. // page of results for list requests. If the number of results is larger
  25413. // than maxResults, use the nextPageToken as a value for the query
  25414. // parameter pageToken in the next list request. Subsequent list
  25415. // requests will have their own nextPageToken to continue paging through
  25416. // the results.
  25417. NextPageToken string `json:"nextPageToken,omitempty"`
  25418. // SelfLink: [Output Only] Server-defined URL for this resource.
  25419. SelfLink string `json:"selfLink,omitempty"`
  25420. // Warning: [Output Only] Informational warning message.
  25421. Warning *SubnetworkAggregatedListWarning `json:"warning,omitempty"`
  25422. // ServerResponse contains the HTTP response code and headers from the
  25423. // server.
  25424. googleapi.ServerResponse `json:"-"`
  25425. // ForceSendFields is a list of field names (e.g. "Id") to
  25426. // unconditionally include in API requests. By default, fields with
  25427. // empty values are omitted from API requests. However, any non-pointer,
  25428. // non-interface field appearing in ForceSendFields will be sent to the
  25429. // server regardless of whether the field is empty or not. This may be
  25430. // used to include empty fields in Patch requests.
  25431. ForceSendFields []string `json:"-"`
  25432. // NullFields is a list of field names (e.g. "Id") to include in API
  25433. // requests with the JSON null value. By default, fields with empty
  25434. // values are omitted from API requests. However, any field with an
  25435. // empty value appearing in NullFields will be sent to the server as
  25436. // null. It is an error if a field in this list has a non-empty value.
  25437. // This may be used to include null fields in Patch requests.
  25438. NullFields []string `json:"-"`
  25439. }
  25440. func (s *SubnetworkAggregatedList) MarshalJSON() ([]byte, error) {
  25441. type NoMethod SubnetworkAggregatedList
  25442. raw := NoMethod(*s)
  25443. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25444. }
  25445. // SubnetworkAggregatedListWarning: [Output Only] Informational warning
  25446. // message.
  25447. type SubnetworkAggregatedListWarning struct {
  25448. // Code: [Output Only] A warning code, if applicable. For example,
  25449. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  25450. // the response.
  25451. //
  25452. // Possible values:
  25453. // "CLEANUP_FAILED"
  25454. // "DEPRECATED_RESOURCE_USED"
  25455. // "DEPRECATED_TYPE_USED"
  25456. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  25457. // "EXPERIMENTAL_TYPE_USED"
  25458. // "EXTERNAL_API_WARNING"
  25459. // "FIELD_VALUE_OVERRIDEN"
  25460. // "INJECTED_KERNELS_DEPRECATED"
  25461. // "MISSING_TYPE_DEPENDENCY"
  25462. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  25463. // "NEXT_HOP_CANNOT_IP_FORWARD"
  25464. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  25465. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  25466. // "NEXT_HOP_NOT_RUNNING"
  25467. // "NOT_CRITICAL_ERROR"
  25468. // "NO_RESULTS_ON_PAGE"
  25469. // "REQUIRED_TOS_AGREEMENT"
  25470. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  25471. // "RESOURCE_NOT_DELETED"
  25472. // "SCHEMA_VALIDATION_IGNORED"
  25473. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  25474. // "UNDECLARED_PROPERTIES"
  25475. // "UNREACHABLE"
  25476. Code string `json:"code,omitempty"`
  25477. // Data: [Output Only] Metadata about this warning in key: value format.
  25478. // For example:
  25479. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  25480. Data []*SubnetworkAggregatedListWarningData `json:"data,omitempty"`
  25481. // Message: [Output Only] A human-readable description of the warning
  25482. // code.
  25483. Message string `json:"message,omitempty"`
  25484. // ForceSendFields is a list of field names (e.g. "Code") to
  25485. // unconditionally include in API requests. By default, fields with
  25486. // empty values are omitted from API requests. However, any non-pointer,
  25487. // non-interface field appearing in ForceSendFields will be sent to the
  25488. // server regardless of whether the field is empty or not. This may be
  25489. // used to include empty fields in Patch requests.
  25490. ForceSendFields []string `json:"-"`
  25491. // NullFields is a list of field names (e.g. "Code") to include in API
  25492. // requests with the JSON null value. By default, fields with empty
  25493. // values are omitted from API requests. However, any field with an
  25494. // empty value appearing in NullFields will be sent to the server as
  25495. // null. It is an error if a field in this list has a non-empty value.
  25496. // This may be used to include null fields in Patch requests.
  25497. NullFields []string `json:"-"`
  25498. }
  25499. func (s *SubnetworkAggregatedListWarning) MarshalJSON() ([]byte, error) {
  25500. type NoMethod SubnetworkAggregatedListWarning
  25501. raw := NoMethod(*s)
  25502. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25503. }
  25504. type SubnetworkAggregatedListWarningData struct {
  25505. // Key: [Output Only] A key that provides more detail on the warning
  25506. // being returned. For example, for warnings where there are no results
  25507. // in a list request for a particular zone, this key might be scope and
  25508. // the key value might be the zone name. Other examples might be a key
  25509. // indicating a deprecated resource and a suggested replacement, or a
  25510. // warning about invalid network settings (for example, if an instance
  25511. // attempts to perform IP forwarding but is not enabled for IP
  25512. // forwarding).
  25513. Key string `json:"key,omitempty"`
  25514. // Value: [Output Only] A warning data value corresponding to the key.
  25515. Value string `json:"value,omitempty"`
  25516. // ForceSendFields is a list of field names (e.g. "Key") to
  25517. // unconditionally include in API requests. By default, fields with
  25518. // empty values are omitted from API requests. However, any non-pointer,
  25519. // non-interface field appearing in ForceSendFields will be sent to the
  25520. // server regardless of whether the field is empty or not. This may be
  25521. // used to include empty fields in Patch requests.
  25522. ForceSendFields []string `json:"-"`
  25523. // NullFields is a list of field names (e.g. "Key") to include in API
  25524. // requests with the JSON null value. By default, fields with empty
  25525. // values are omitted from API requests. However, any field with an
  25526. // empty value appearing in NullFields will be sent to the server as
  25527. // null. It is an error if a field in this list has a non-empty value.
  25528. // This may be used to include null fields in Patch requests.
  25529. NullFields []string `json:"-"`
  25530. }
  25531. func (s *SubnetworkAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  25532. type NoMethod SubnetworkAggregatedListWarningData
  25533. raw := NoMethod(*s)
  25534. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25535. }
  25536. // SubnetworkList: Contains a list of Subnetwork resources.
  25537. type SubnetworkList struct {
  25538. // Id: [Output Only] Unique identifier for the resource; defined by the
  25539. // server.
  25540. Id string `json:"id,omitempty"`
  25541. // Items: A list of Subnetwork resources.
  25542. Items []*Subnetwork `json:"items,omitempty"`
  25543. // Kind: [Output Only] Type of resource. Always compute#subnetworkList
  25544. // for lists of subnetworks.
  25545. Kind string `json:"kind,omitempty"`
  25546. // NextPageToken: [Output Only] This token allows you to get the next
  25547. // page of results for list requests. If the number of results is larger
  25548. // than maxResults, use the nextPageToken as a value for the query
  25549. // parameter pageToken in the next list request. Subsequent list
  25550. // requests will have their own nextPageToken to continue paging through
  25551. // the results.
  25552. NextPageToken string `json:"nextPageToken,omitempty"`
  25553. // SelfLink: [Output Only] Server-defined URL for this resource.
  25554. SelfLink string `json:"selfLink,omitempty"`
  25555. // Warning: [Output Only] Informational warning message.
  25556. Warning *SubnetworkListWarning `json:"warning,omitempty"`
  25557. // ServerResponse contains the HTTP response code and headers from the
  25558. // server.
  25559. googleapi.ServerResponse `json:"-"`
  25560. // ForceSendFields is a list of field names (e.g. "Id") to
  25561. // unconditionally include in API requests. By default, fields with
  25562. // empty values are omitted from API requests. However, any non-pointer,
  25563. // non-interface field appearing in ForceSendFields will be sent to the
  25564. // server regardless of whether the field is empty or not. This may be
  25565. // used to include empty fields in Patch requests.
  25566. ForceSendFields []string `json:"-"`
  25567. // NullFields is a list of field names (e.g. "Id") to include in API
  25568. // requests with the JSON null value. By default, fields with empty
  25569. // values are omitted from API requests. However, any field with an
  25570. // empty value appearing in NullFields will be sent to the server as
  25571. // null. It is an error if a field in this list has a non-empty value.
  25572. // This may be used to include null fields in Patch requests.
  25573. NullFields []string `json:"-"`
  25574. }
  25575. func (s *SubnetworkList) MarshalJSON() ([]byte, error) {
  25576. type NoMethod SubnetworkList
  25577. raw := NoMethod(*s)
  25578. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25579. }
  25580. // SubnetworkListWarning: [Output Only] Informational warning message.
  25581. type SubnetworkListWarning struct {
  25582. // Code: [Output Only] A warning code, if applicable. For example,
  25583. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  25584. // the response.
  25585. //
  25586. // Possible values:
  25587. // "CLEANUP_FAILED"
  25588. // "DEPRECATED_RESOURCE_USED"
  25589. // "DEPRECATED_TYPE_USED"
  25590. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  25591. // "EXPERIMENTAL_TYPE_USED"
  25592. // "EXTERNAL_API_WARNING"
  25593. // "FIELD_VALUE_OVERRIDEN"
  25594. // "INJECTED_KERNELS_DEPRECATED"
  25595. // "MISSING_TYPE_DEPENDENCY"
  25596. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  25597. // "NEXT_HOP_CANNOT_IP_FORWARD"
  25598. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  25599. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  25600. // "NEXT_HOP_NOT_RUNNING"
  25601. // "NOT_CRITICAL_ERROR"
  25602. // "NO_RESULTS_ON_PAGE"
  25603. // "REQUIRED_TOS_AGREEMENT"
  25604. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  25605. // "RESOURCE_NOT_DELETED"
  25606. // "SCHEMA_VALIDATION_IGNORED"
  25607. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  25608. // "UNDECLARED_PROPERTIES"
  25609. // "UNREACHABLE"
  25610. Code string `json:"code,omitempty"`
  25611. // Data: [Output Only] Metadata about this warning in key: value format.
  25612. // For example:
  25613. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  25614. Data []*SubnetworkListWarningData `json:"data,omitempty"`
  25615. // Message: [Output Only] A human-readable description of the warning
  25616. // code.
  25617. Message string `json:"message,omitempty"`
  25618. // ForceSendFields is a list of field names (e.g. "Code") to
  25619. // unconditionally include in API requests. By default, fields with
  25620. // empty values are omitted from API requests. However, any non-pointer,
  25621. // non-interface field appearing in ForceSendFields will be sent to the
  25622. // server regardless of whether the field is empty or not. This may be
  25623. // used to include empty fields in Patch requests.
  25624. ForceSendFields []string `json:"-"`
  25625. // NullFields is a list of field names (e.g. "Code") to include in API
  25626. // requests with the JSON null value. By default, fields with empty
  25627. // values are omitted from API requests. However, any field with an
  25628. // empty value appearing in NullFields will be sent to the server as
  25629. // null. It is an error if a field in this list has a non-empty value.
  25630. // This may be used to include null fields in Patch requests.
  25631. NullFields []string `json:"-"`
  25632. }
  25633. func (s *SubnetworkListWarning) MarshalJSON() ([]byte, error) {
  25634. type NoMethod SubnetworkListWarning
  25635. raw := NoMethod(*s)
  25636. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25637. }
  25638. type SubnetworkListWarningData struct {
  25639. // Key: [Output Only] A key that provides more detail on the warning
  25640. // being returned. For example, for warnings where there are no results
  25641. // in a list request for a particular zone, this key might be scope and
  25642. // the key value might be the zone name. Other examples might be a key
  25643. // indicating a deprecated resource and a suggested replacement, or a
  25644. // warning about invalid network settings (for example, if an instance
  25645. // attempts to perform IP forwarding but is not enabled for IP
  25646. // forwarding).
  25647. Key string `json:"key,omitempty"`
  25648. // Value: [Output Only] A warning data value corresponding to the key.
  25649. Value string `json:"value,omitempty"`
  25650. // ForceSendFields is a list of field names (e.g. "Key") to
  25651. // unconditionally include in API requests. By default, fields with
  25652. // empty values are omitted from API requests. However, any non-pointer,
  25653. // non-interface field appearing in ForceSendFields will be sent to the
  25654. // server regardless of whether the field is empty or not. This may be
  25655. // used to include empty fields in Patch requests.
  25656. ForceSendFields []string `json:"-"`
  25657. // NullFields is a list of field names (e.g. "Key") to include in API
  25658. // requests with the JSON null value. By default, fields with empty
  25659. // values are omitted from API requests. However, any field with an
  25660. // empty value appearing in NullFields will be sent to the server as
  25661. // null. It is an error if a field in this list has a non-empty value.
  25662. // This may be used to include null fields in Patch requests.
  25663. NullFields []string `json:"-"`
  25664. }
  25665. func (s *SubnetworkListWarningData) MarshalJSON() ([]byte, error) {
  25666. type NoMethod SubnetworkListWarningData
  25667. raw := NoMethod(*s)
  25668. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25669. }
  25670. // SubnetworkSecondaryRange: Represents a secondary IP range of a
  25671. // subnetwork.
  25672. type SubnetworkSecondaryRange struct {
  25673. // IpCidrRange: The range of IP addresses belonging to this subnetwork
  25674. // secondary range. Provide this property when you create the
  25675. // subnetwork. Ranges must be unique and non-overlapping with all
  25676. // primary and secondary IP ranges within a network. Only IPv4 is
  25677. // supported.
  25678. IpCidrRange string `json:"ipCidrRange,omitempty"`
  25679. // RangeName: The name associated with this subnetwork secondary range,
  25680. // used when adding an alias IP range to a VM instance. The name must be
  25681. // 1-63 characters long, and comply with RFC1035. The name must be
  25682. // unique within the subnetwork.
  25683. RangeName string `json:"rangeName,omitempty"`
  25684. // ForceSendFields is a list of field names (e.g. "IpCidrRange") to
  25685. // unconditionally include in API requests. By default, fields with
  25686. // empty values are omitted from API requests. However, any non-pointer,
  25687. // non-interface field appearing in ForceSendFields will be sent to the
  25688. // server regardless of whether the field is empty or not. This may be
  25689. // used to include empty fields in Patch requests.
  25690. ForceSendFields []string `json:"-"`
  25691. // NullFields is a list of field names (e.g. "IpCidrRange") to include
  25692. // in API requests with the JSON null value. By default, fields with
  25693. // empty values are omitted from API requests. However, any field with
  25694. // an empty value appearing in NullFields will be sent to the server as
  25695. // null. It is an error if a field in this list has a non-empty value.
  25696. // This may be used to include null fields in Patch requests.
  25697. NullFields []string `json:"-"`
  25698. }
  25699. func (s *SubnetworkSecondaryRange) MarshalJSON() ([]byte, error) {
  25700. type NoMethod SubnetworkSecondaryRange
  25701. raw := NoMethod(*s)
  25702. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25703. }
  25704. type SubnetworksExpandIpCidrRangeRequest struct {
  25705. // IpCidrRange: The IP (in CIDR format or netmask) of internal addresses
  25706. // that are legal on this Subnetwork. This range should be disjoint from
  25707. // other subnetworks within this network. This range can only be larger
  25708. // than (i.e. a superset of) the range previously defined before the
  25709. // update.
  25710. IpCidrRange string `json:"ipCidrRange,omitempty"`
  25711. // ForceSendFields is a list of field names (e.g. "IpCidrRange") to
  25712. // unconditionally include in API requests. By default, fields with
  25713. // empty values are omitted from API requests. However, any non-pointer,
  25714. // non-interface field appearing in ForceSendFields will be sent to the
  25715. // server regardless of whether the field is empty or not. This may be
  25716. // used to include empty fields in Patch requests.
  25717. ForceSendFields []string `json:"-"`
  25718. // NullFields is a list of field names (e.g. "IpCidrRange") to include
  25719. // in API requests with the JSON null value. By default, fields with
  25720. // empty values are omitted from API requests. However, any field with
  25721. // an empty value appearing in NullFields will be sent to the server as
  25722. // null. It is an error if a field in this list has a non-empty value.
  25723. // This may be used to include null fields in Patch requests.
  25724. NullFields []string `json:"-"`
  25725. }
  25726. func (s *SubnetworksExpandIpCidrRangeRequest) MarshalJSON() ([]byte, error) {
  25727. type NoMethod SubnetworksExpandIpCidrRangeRequest
  25728. raw := NoMethod(*s)
  25729. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25730. }
  25731. type SubnetworksScopedList struct {
  25732. // Subnetworks: A list of subnetworks contained in this scope.
  25733. Subnetworks []*Subnetwork `json:"subnetworks,omitempty"`
  25734. // Warning: An informational warning that appears when the list of
  25735. // addresses is empty.
  25736. Warning *SubnetworksScopedListWarning `json:"warning,omitempty"`
  25737. // ForceSendFields is a list of field names (e.g. "Subnetworks") to
  25738. // unconditionally include in API requests. By default, fields with
  25739. // empty values are omitted from API requests. However, any non-pointer,
  25740. // non-interface field appearing in ForceSendFields will be sent to the
  25741. // server regardless of whether the field is empty or not. This may be
  25742. // used to include empty fields in Patch requests.
  25743. ForceSendFields []string `json:"-"`
  25744. // NullFields is a list of field names (e.g. "Subnetworks") to include
  25745. // in API requests with the JSON null value. By default, fields with
  25746. // empty values are omitted from API requests. However, any field with
  25747. // an empty value appearing in NullFields will be sent to the server as
  25748. // null. It is an error if a field in this list has a non-empty value.
  25749. // This may be used to include null fields in Patch requests.
  25750. NullFields []string `json:"-"`
  25751. }
  25752. func (s *SubnetworksScopedList) MarshalJSON() ([]byte, error) {
  25753. type NoMethod SubnetworksScopedList
  25754. raw := NoMethod(*s)
  25755. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25756. }
  25757. // SubnetworksScopedListWarning: An informational warning that appears
  25758. // when the list of addresses is empty.
  25759. type SubnetworksScopedListWarning struct {
  25760. // Code: [Output Only] A warning code, if applicable. For example,
  25761. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  25762. // the response.
  25763. //
  25764. // Possible values:
  25765. // "CLEANUP_FAILED"
  25766. // "DEPRECATED_RESOURCE_USED"
  25767. // "DEPRECATED_TYPE_USED"
  25768. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  25769. // "EXPERIMENTAL_TYPE_USED"
  25770. // "EXTERNAL_API_WARNING"
  25771. // "FIELD_VALUE_OVERRIDEN"
  25772. // "INJECTED_KERNELS_DEPRECATED"
  25773. // "MISSING_TYPE_DEPENDENCY"
  25774. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  25775. // "NEXT_HOP_CANNOT_IP_FORWARD"
  25776. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  25777. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  25778. // "NEXT_HOP_NOT_RUNNING"
  25779. // "NOT_CRITICAL_ERROR"
  25780. // "NO_RESULTS_ON_PAGE"
  25781. // "REQUIRED_TOS_AGREEMENT"
  25782. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  25783. // "RESOURCE_NOT_DELETED"
  25784. // "SCHEMA_VALIDATION_IGNORED"
  25785. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  25786. // "UNDECLARED_PROPERTIES"
  25787. // "UNREACHABLE"
  25788. Code string `json:"code,omitempty"`
  25789. // Data: [Output Only] Metadata about this warning in key: value format.
  25790. // For example:
  25791. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  25792. Data []*SubnetworksScopedListWarningData `json:"data,omitempty"`
  25793. // Message: [Output Only] A human-readable description of the warning
  25794. // code.
  25795. Message string `json:"message,omitempty"`
  25796. // ForceSendFields is a list of field names (e.g. "Code") to
  25797. // unconditionally include in API requests. By default, fields with
  25798. // empty values are omitted from API requests. However, any non-pointer,
  25799. // non-interface field appearing in ForceSendFields will be sent to the
  25800. // server regardless of whether the field is empty or not. This may be
  25801. // used to include empty fields in Patch requests.
  25802. ForceSendFields []string `json:"-"`
  25803. // NullFields is a list of field names (e.g. "Code") to include in API
  25804. // requests with the JSON null value. By default, fields with empty
  25805. // values are omitted from API requests. However, any field with an
  25806. // empty value appearing in NullFields will be sent to the server as
  25807. // null. It is an error if a field in this list has a non-empty value.
  25808. // This may be used to include null fields in Patch requests.
  25809. NullFields []string `json:"-"`
  25810. }
  25811. func (s *SubnetworksScopedListWarning) MarshalJSON() ([]byte, error) {
  25812. type NoMethod SubnetworksScopedListWarning
  25813. raw := NoMethod(*s)
  25814. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25815. }
  25816. type SubnetworksScopedListWarningData struct {
  25817. // Key: [Output Only] A key that provides more detail on the warning
  25818. // being returned. For example, for warnings where there are no results
  25819. // in a list request for a particular zone, this key might be scope and
  25820. // the key value might be the zone name. Other examples might be a key
  25821. // indicating a deprecated resource and a suggested replacement, or a
  25822. // warning about invalid network settings (for example, if an instance
  25823. // attempts to perform IP forwarding but is not enabled for IP
  25824. // forwarding).
  25825. Key string `json:"key,omitempty"`
  25826. // Value: [Output Only] A warning data value corresponding to the key.
  25827. Value string `json:"value,omitempty"`
  25828. // ForceSendFields is a list of field names (e.g. "Key") to
  25829. // unconditionally include in API requests. By default, fields with
  25830. // empty values are omitted from API requests. However, any non-pointer,
  25831. // non-interface field appearing in ForceSendFields will be sent to the
  25832. // server regardless of whether the field is empty or not. This may be
  25833. // used to include empty fields in Patch requests.
  25834. ForceSendFields []string `json:"-"`
  25835. // NullFields is a list of field names (e.g. "Key") to include in API
  25836. // requests with the JSON null value. By default, fields with empty
  25837. // values are omitted from API requests. However, any field with an
  25838. // empty value appearing in NullFields will be sent to the server as
  25839. // null. It is an error if a field in this list has a non-empty value.
  25840. // This may be used to include null fields in Patch requests.
  25841. NullFields []string `json:"-"`
  25842. }
  25843. func (s *SubnetworksScopedListWarningData) MarshalJSON() ([]byte, error) {
  25844. type NoMethod SubnetworksScopedListWarningData
  25845. raw := NoMethod(*s)
  25846. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25847. }
  25848. type SubnetworksSetPrivateIpGoogleAccessRequest struct {
  25849. PrivateIpGoogleAccess bool `json:"privateIpGoogleAccess,omitempty"`
  25850. // ForceSendFields is a list of field names (e.g.
  25851. // "PrivateIpGoogleAccess") to unconditionally include in API requests.
  25852. // By default, fields with empty values are omitted from API requests.
  25853. // However, any non-pointer, non-interface field appearing in
  25854. // ForceSendFields will be sent to the server regardless of whether the
  25855. // field is empty or not. This may be used to include empty fields in
  25856. // Patch requests.
  25857. ForceSendFields []string `json:"-"`
  25858. // NullFields is a list of field names (e.g. "PrivateIpGoogleAccess") to
  25859. // include in API requests with the JSON null value. By default, fields
  25860. // with empty values are omitted from API requests. However, any field
  25861. // with an empty value appearing in NullFields will be sent to the
  25862. // server as null. It is an error if a field in this list has a
  25863. // non-empty value. This may be used to include null fields in Patch
  25864. // requests.
  25865. NullFields []string `json:"-"`
  25866. }
  25867. func (s *SubnetworksSetPrivateIpGoogleAccessRequest) MarshalJSON() ([]byte, error) {
  25868. type NoMethod SubnetworksSetPrivateIpGoogleAccessRequest
  25869. raw := NoMethod(*s)
  25870. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25871. }
  25872. type TCPHealthCheck struct {
  25873. // Port: The TCP port number for the health check request. The default
  25874. // value is 80. Valid values are 1 through 65535.
  25875. Port int64 `json:"port,omitempty"`
  25876. // PortName: Port name as defined in InstanceGroup#NamedPort#name. If
  25877. // both port and port_name are defined, port takes precedence.
  25878. PortName string `json:"portName,omitempty"`
  25879. // PortSpecification: Specifies how port is selected for health
  25880. // checking, can be one of following values:
  25881. // USE_FIXED_PORT: The port number in
  25882. // port
  25883. // is used for health checking.
  25884. // USE_NAMED_PORT: The
  25885. // portName
  25886. // is used for health checking.
  25887. // USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for
  25888. // each network endpoint is used for health checking. For other
  25889. // backends, the port or named port specified in the Backend Service is
  25890. // used for health checking.
  25891. //
  25892. //
  25893. // If not specified, TCP health check follows behavior specified
  25894. // in
  25895. // port
  25896. // and
  25897. // portName
  25898. // fields.
  25899. //
  25900. // Possible values:
  25901. // "USE_FIXED_PORT"
  25902. // "USE_NAMED_PORT"
  25903. // "USE_SERVING_PORT"
  25904. PortSpecification string `json:"portSpecification,omitempty"`
  25905. // ProxyHeader: Specifies the type of proxy header to append before
  25906. // sending data to the backend, either NONE or PROXY_V1. The default is
  25907. // NONE.
  25908. //
  25909. // Possible values:
  25910. // "NONE"
  25911. // "PROXY_V1"
  25912. ProxyHeader string `json:"proxyHeader,omitempty"`
  25913. // Request: The application data to send once the TCP connection has
  25914. // been established (default value is empty). If both request and
  25915. // response are empty, the connection establishment alone will indicate
  25916. // health. The request data can only be ASCII.
  25917. Request string `json:"request,omitempty"`
  25918. // Response: The bytes to match against the beginning of the response
  25919. // data. If left empty (the default value), any response will indicate
  25920. // health. The response data can only be ASCII.
  25921. Response string `json:"response,omitempty"`
  25922. // ForceSendFields is a list of field names (e.g. "Port") to
  25923. // unconditionally include in API requests. By default, fields with
  25924. // empty values are omitted from API requests. However, any non-pointer,
  25925. // non-interface field appearing in ForceSendFields will be sent to the
  25926. // server regardless of whether the field is empty or not. This may be
  25927. // used to include empty fields in Patch requests.
  25928. ForceSendFields []string `json:"-"`
  25929. // NullFields is a list of field names (e.g. "Port") to include in API
  25930. // requests with the JSON null value. By default, fields with empty
  25931. // values are omitted from API requests. However, any field with an
  25932. // empty value appearing in NullFields will be sent to the server as
  25933. // null. It is an error if a field in this list has a non-empty value.
  25934. // This may be used to include null fields in Patch requests.
  25935. NullFields []string `json:"-"`
  25936. }
  25937. func (s *TCPHealthCheck) MarshalJSON() ([]byte, error) {
  25938. type NoMethod TCPHealthCheck
  25939. raw := NoMethod(*s)
  25940. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25941. }
  25942. // Tags: A set of instance tags.
  25943. type Tags struct {
  25944. // Fingerprint: Specifies a fingerprint for this request, which is
  25945. // essentially a hash of the tags' contents and used for optimistic
  25946. // locking. The fingerprint is initially generated by Compute Engine and
  25947. // changes after every request to modify or update tags. You must always
  25948. // provide an up-to-date fingerprint hash in order to update or change
  25949. // tags.
  25950. //
  25951. // To see the latest fingerprint, make get() request to the instance.
  25952. Fingerprint string `json:"fingerprint,omitempty"`
  25953. // Items: An array of tags. Each tag must be 1-63 characters long, and
  25954. // comply with RFC1035.
  25955. Items []string `json:"items,omitempty"`
  25956. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  25957. // unconditionally include in API requests. By default, fields with
  25958. // empty values are omitted from API requests. However, any non-pointer,
  25959. // non-interface field appearing in ForceSendFields will be sent to the
  25960. // server regardless of whether the field is empty or not. This may be
  25961. // used to include empty fields in Patch requests.
  25962. ForceSendFields []string `json:"-"`
  25963. // NullFields is a list of field names (e.g. "Fingerprint") to include
  25964. // in API requests with the JSON null value. By default, fields with
  25965. // empty values are omitted from API requests. However, any field with
  25966. // an empty value appearing in NullFields will be sent to the server as
  25967. // null. It is an error if a field in this list has a non-empty value.
  25968. // This may be used to include null fields in Patch requests.
  25969. NullFields []string `json:"-"`
  25970. }
  25971. func (s *Tags) MarshalJSON() ([]byte, error) {
  25972. type NoMethod Tags
  25973. raw := NoMethod(*s)
  25974. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25975. }
  25976. type TargetHttpProxiesScopedList struct {
  25977. // TargetHttpProxies: A list of TargetHttpProxies contained in this
  25978. // scope.
  25979. TargetHttpProxies []*TargetHttpProxy `json:"targetHttpProxies,omitempty"`
  25980. // Warning: Informational warning which replaces the list of backend
  25981. // services when the list is empty.
  25982. Warning *TargetHttpProxiesScopedListWarning `json:"warning,omitempty"`
  25983. // ForceSendFields is a list of field names (e.g. "TargetHttpProxies")
  25984. // to unconditionally include in API requests. By default, fields with
  25985. // empty values are omitted from API requests. However, any non-pointer,
  25986. // non-interface field appearing in ForceSendFields will be sent to the
  25987. // server regardless of whether the field is empty or not. This may be
  25988. // used to include empty fields in Patch requests.
  25989. ForceSendFields []string `json:"-"`
  25990. // NullFields is a list of field names (e.g. "TargetHttpProxies") to
  25991. // include in API requests with the JSON null value. By default, fields
  25992. // with empty values are omitted from API requests. However, any field
  25993. // with an empty value appearing in NullFields will be sent to the
  25994. // server as null. It is an error if a field in this list has a
  25995. // non-empty value. This may be used to include null fields in Patch
  25996. // requests.
  25997. NullFields []string `json:"-"`
  25998. }
  25999. func (s *TargetHttpProxiesScopedList) MarshalJSON() ([]byte, error) {
  26000. type NoMethod TargetHttpProxiesScopedList
  26001. raw := NoMethod(*s)
  26002. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26003. }
  26004. // TargetHttpProxiesScopedListWarning: Informational warning which
  26005. // replaces the list of backend services when the list is empty.
  26006. type TargetHttpProxiesScopedListWarning struct {
  26007. // Code: [Output Only] A warning code, if applicable. For example,
  26008. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  26009. // the response.
  26010. //
  26011. // Possible values:
  26012. // "CLEANUP_FAILED"
  26013. // "DEPRECATED_RESOURCE_USED"
  26014. // "DEPRECATED_TYPE_USED"
  26015. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  26016. // "EXPERIMENTAL_TYPE_USED"
  26017. // "EXTERNAL_API_WARNING"
  26018. // "FIELD_VALUE_OVERRIDEN"
  26019. // "INJECTED_KERNELS_DEPRECATED"
  26020. // "MISSING_TYPE_DEPENDENCY"
  26021. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  26022. // "NEXT_HOP_CANNOT_IP_FORWARD"
  26023. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  26024. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  26025. // "NEXT_HOP_NOT_RUNNING"
  26026. // "NOT_CRITICAL_ERROR"
  26027. // "NO_RESULTS_ON_PAGE"
  26028. // "REQUIRED_TOS_AGREEMENT"
  26029. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  26030. // "RESOURCE_NOT_DELETED"
  26031. // "SCHEMA_VALIDATION_IGNORED"
  26032. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  26033. // "UNDECLARED_PROPERTIES"
  26034. // "UNREACHABLE"
  26035. Code string `json:"code,omitempty"`
  26036. // Data: [Output Only] Metadata about this warning in key: value format.
  26037. // For example:
  26038. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  26039. Data []*TargetHttpProxiesScopedListWarningData `json:"data,omitempty"`
  26040. // Message: [Output Only] A human-readable description of the warning
  26041. // code.
  26042. Message string `json:"message,omitempty"`
  26043. // ForceSendFields is a list of field names (e.g. "Code") to
  26044. // unconditionally include in API requests. By default, fields with
  26045. // empty values are omitted from API requests. However, any non-pointer,
  26046. // non-interface field appearing in ForceSendFields will be sent to the
  26047. // server regardless of whether the field is empty or not. This may be
  26048. // used to include empty fields in Patch requests.
  26049. ForceSendFields []string `json:"-"`
  26050. // NullFields is a list of field names (e.g. "Code") to include in API
  26051. // requests with the JSON null value. By default, fields with empty
  26052. // values are omitted from API requests. However, any field with an
  26053. // empty value appearing in NullFields will be sent to the server as
  26054. // null. It is an error if a field in this list has a non-empty value.
  26055. // This may be used to include null fields in Patch requests.
  26056. NullFields []string `json:"-"`
  26057. }
  26058. func (s *TargetHttpProxiesScopedListWarning) MarshalJSON() ([]byte, error) {
  26059. type NoMethod TargetHttpProxiesScopedListWarning
  26060. raw := NoMethod(*s)
  26061. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26062. }
  26063. type TargetHttpProxiesScopedListWarningData struct {
  26064. // Key: [Output Only] A key that provides more detail on the warning
  26065. // being returned. For example, for warnings where there are no results
  26066. // in a list request for a particular zone, this key might be scope and
  26067. // the key value might be the zone name. Other examples might be a key
  26068. // indicating a deprecated resource and a suggested replacement, or a
  26069. // warning about invalid network settings (for example, if an instance
  26070. // attempts to perform IP forwarding but is not enabled for IP
  26071. // forwarding).
  26072. Key string `json:"key,omitempty"`
  26073. // Value: [Output Only] A warning data value corresponding to the key.
  26074. Value string `json:"value,omitempty"`
  26075. // ForceSendFields is a list of field names (e.g. "Key") to
  26076. // unconditionally include in API requests. By default, fields with
  26077. // empty values are omitted from API requests. However, any non-pointer,
  26078. // non-interface field appearing in ForceSendFields will be sent to the
  26079. // server regardless of whether the field is empty or not. This may be
  26080. // used to include empty fields in Patch requests.
  26081. ForceSendFields []string `json:"-"`
  26082. // NullFields is a list of field names (e.g. "Key") to include in API
  26083. // requests with the JSON null value. By default, fields with empty
  26084. // values are omitted from API requests. However, any field with an
  26085. // empty value appearing in NullFields will be sent to the server as
  26086. // null. It is an error if a field in this list has a non-empty value.
  26087. // This may be used to include null fields in Patch requests.
  26088. NullFields []string `json:"-"`
  26089. }
  26090. func (s *TargetHttpProxiesScopedListWarningData) MarshalJSON() ([]byte, error) {
  26091. type NoMethod TargetHttpProxiesScopedListWarningData
  26092. raw := NoMethod(*s)
  26093. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26094. }
  26095. // TargetHttpProxy: A TargetHttpProxy resource. This resource defines an
  26096. // HTTP proxy. (== resource_for beta.targetHttpProxies ==) (==
  26097. // resource_for v1.targetHttpProxies ==)
  26098. type TargetHttpProxy struct {
  26099. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  26100. // format.
  26101. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  26102. // Description: An optional description of this resource. Provide this
  26103. // property when you create the resource.
  26104. Description string `json:"description,omitempty"`
  26105. // Id: [Output Only] The unique identifier for the resource. This
  26106. // identifier is defined by the server.
  26107. Id uint64 `json:"id,omitempty,string"`
  26108. // Kind: [Output Only] Type of resource. Always compute#targetHttpProxy
  26109. // for target HTTP proxies.
  26110. Kind string `json:"kind,omitempty"`
  26111. // Name: Name of the resource. Provided by the client when the resource
  26112. // is created. The name must be 1-63 characters long, and comply with
  26113. // RFC1035. Specifically, the name must be 1-63 characters long and
  26114. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  26115. // the first character must be a lowercase letter, and all following
  26116. // characters must be a dash, lowercase letter, or digit, except the
  26117. // last character, which cannot be a dash.
  26118. Name string `json:"name,omitempty"`
  26119. // Region: [Output Only] URL of the region where the regional Target
  26120. // HTTP Proxy resides. This field is not applicable to global Target
  26121. // HTTP Proxies.
  26122. Region string `json:"region,omitempty"`
  26123. // SelfLink: [Output Only] Server-defined URL for the resource.
  26124. SelfLink string `json:"selfLink,omitempty"`
  26125. // UrlMap: URL to the UrlMap resource that defines the mapping from URL
  26126. // to the BackendService.
  26127. UrlMap string `json:"urlMap,omitempty"`
  26128. // ServerResponse contains the HTTP response code and headers from the
  26129. // server.
  26130. googleapi.ServerResponse `json:"-"`
  26131. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  26132. // to unconditionally include in API requests. By default, fields with
  26133. // empty values are omitted from API requests. However, any non-pointer,
  26134. // non-interface field appearing in ForceSendFields will be sent to the
  26135. // server regardless of whether the field is empty or not. This may be
  26136. // used to include empty fields in Patch requests.
  26137. ForceSendFields []string `json:"-"`
  26138. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  26139. // include in API requests with the JSON null value. By default, fields
  26140. // with empty values are omitted from API requests. However, any field
  26141. // with an empty value appearing in NullFields will be sent to the
  26142. // server as null. It is an error if a field in this list has a
  26143. // non-empty value. This may be used to include null fields in Patch
  26144. // requests.
  26145. NullFields []string `json:"-"`
  26146. }
  26147. func (s *TargetHttpProxy) MarshalJSON() ([]byte, error) {
  26148. type NoMethod TargetHttpProxy
  26149. raw := NoMethod(*s)
  26150. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26151. }
  26152. type TargetHttpProxyAggregatedList struct {
  26153. // Id: [Output Only] Unique identifier for the resource; defined by the
  26154. // server.
  26155. Id string `json:"id,omitempty"`
  26156. // Items: A list of TargetHttpProxiesScopedList resources.
  26157. Items map[string]TargetHttpProxiesScopedList `json:"items,omitempty"`
  26158. // Kind: [Output Only] Type of resource. Always
  26159. // compute#targetHttpProxyAggregatedList for lists of Target HTTP
  26160. // Proxies.
  26161. Kind string `json:"kind,omitempty"`
  26162. // NextPageToken: [Output Only] This token allows you to get the next
  26163. // page of results for list requests. If the number of results is larger
  26164. // than maxResults, use the nextPageToken as a value for the query
  26165. // parameter pageToken in the next list request. Subsequent list
  26166. // requests will have their own nextPageToken to continue paging through
  26167. // the results.
  26168. NextPageToken string `json:"nextPageToken,omitempty"`
  26169. // SelfLink: [Output Only] Server-defined URL for this resource.
  26170. SelfLink string `json:"selfLink,omitempty"`
  26171. // Warning: [Output Only] Informational warning message.
  26172. Warning *TargetHttpProxyAggregatedListWarning `json:"warning,omitempty"`
  26173. // ServerResponse contains the HTTP response code and headers from the
  26174. // server.
  26175. googleapi.ServerResponse `json:"-"`
  26176. // ForceSendFields is a list of field names (e.g. "Id") to
  26177. // unconditionally include in API requests. By default, fields with
  26178. // empty values are omitted from API requests. However, any non-pointer,
  26179. // non-interface field appearing in ForceSendFields will be sent to the
  26180. // server regardless of whether the field is empty or not. This may be
  26181. // used to include empty fields in Patch requests.
  26182. ForceSendFields []string `json:"-"`
  26183. // NullFields is a list of field names (e.g. "Id") to include in API
  26184. // requests with the JSON null value. By default, fields with empty
  26185. // values are omitted from API requests. However, any field with an
  26186. // empty value appearing in NullFields will be sent to the server as
  26187. // null. It is an error if a field in this list has a non-empty value.
  26188. // This may be used to include null fields in Patch requests.
  26189. NullFields []string `json:"-"`
  26190. }
  26191. func (s *TargetHttpProxyAggregatedList) MarshalJSON() ([]byte, error) {
  26192. type NoMethod TargetHttpProxyAggregatedList
  26193. raw := NoMethod(*s)
  26194. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26195. }
  26196. // TargetHttpProxyAggregatedListWarning: [Output Only] Informational
  26197. // warning message.
  26198. type TargetHttpProxyAggregatedListWarning struct {
  26199. // Code: [Output Only] A warning code, if applicable. For example,
  26200. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  26201. // the response.
  26202. //
  26203. // Possible values:
  26204. // "CLEANUP_FAILED"
  26205. // "DEPRECATED_RESOURCE_USED"
  26206. // "DEPRECATED_TYPE_USED"
  26207. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  26208. // "EXPERIMENTAL_TYPE_USED"
  26209. // "EXTERNAL_API_WARNING"
  26210. // "FIELD_VALUE_OVERRIDEN"
  26211. // "INJECTED_KERNELS_DEPRECATED"
  26212. // "MISSING_TYPE_DEPENDENCY"
  26213. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  26214. // "NEXT_HOP_CANNOT_IP_FORWARD"
  26215. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  26216. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  26217. // "NEXT_HOP_NOT_RUNNING"
  26218. // "NOT_CRITICAL_ERROR"
  26219. // "NO_RESULTS_ON_PAGE"
  26220. // "REQUIRED_TOS_AGREEMENT"
  26221. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  26222. // "RESOURCE_NOT_DELETED"
  26223. // "SCHEMA_VALIDATION_IGNORED"
  26224. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  26225. // "UNDECLARED_PROPERTIES"
  26226. // "UNREACHABLE"
  26227. Code string `json:"code,omitempty"`
  26228. // Data: [Output Only] Metadata about this warning in key: value format.
  26229. // For example:
  26230. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  26231. Data []*TargetHttpProxyAggregatedListWarningData `json:"data,omitempty"`
  26232. // Message: [Output Only] A human-readable description of the warning
  26233. // code.
  26234. Message string `json:"message,omitempty"`
  26235. // ForceSendFields is a list of field names (e.g. "Code") to
  26236. // unconditionally include in API requests. By default, fields with
  26237. // empty values are omitted from API requests. However, any non-pointer,
  26238. // non-interface field appearing in ForceSendFields will be sent to the
  26239. // server regardless of whether the field is empty or not. This may be
  26240. // used to include empty fields in Patch requests.
  26241. ForceSendFields []string `json:"-"`
  26242. // NullFields is a list of field names (e.g. "Code") to include in API
  26243. // requests with the JSON null value. By default, fields with empty
  26244. // values are omitted from API requests. However, any field with an
  26245. // empty value appearing in NullFields will be sent to the server as
  26246. // null. It is an error if a field in this list has a non-empty value.
  26247. // This may be used to include null fields in Patch requests.
  26248. NullFields []string `json:"-"`
  26249. }
  26250. func (s *TargetHttpProxyAggregatedListWarning) MarshalJSON() ([]byte, error) {
  26251. type NoMethod TargetHttpProxyAggregatedListWarning
  26252. raw := NoMethod(*s)
  26253. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26254. }
  26255. type TargetHttpProxyAggregatedListWarningData struct {
  26256. // Key: [Output Only] A key that provides more detail on the warning
  26257. // being returned. For example, for warnings where there are no results
  26258. // in a list request for a particular zone, this key might be scope and
  26259. // the key value might be the zone name. Other examples might be a key
  26260. // indicating a deprecated resource and a suggested replacement, or a
  26261. // warning about invalid network settings (for example, if an instance
  26262. // attempts to perform IP forwarding but is not enabled for IP
  26263. // forwarding).
  26264. Key string `json:"key,omitempty"`
  26265. // Value: [Output Only] A warning data value corresponding to the key.
  26266. Value string `json:"value,omitempty"`
  26267. // ForceSendFields is a list of field names (e.g. "Key") to
  26268. // unconditionally include in API requests. By default, fields with
  26269. // empty values are omitted from API requests. However, any non-pointer,
  26270. // non-interface field appearing in ForceSendFields will be sent to the
  26271. // server regardless of whether the field is empty or not. This may be
  26272. // used to include empty fields in Patch requests.
  26273. ForceSendFields []string `json:"-"`
  26274. // NullFields is a list of field names (e.g. "Key") to include in API
  26275. // requests with the JSON null value. By default, fields with empty
  26276. // values are omitted from API requests. However, any field with an
  26277. // empty value appearing in NullFields will be sent to the server as
  26278. // null. It is an error if a field in this list has a non-empty value.
  26279. // This may be used to include null fields in Patch requests.
  26280. NullFields []string `json:"-"`
  26281. }
  26282. func (s *TargetHttpProxyAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  26283. type NoMethod TargetHttpProxyAggregatedListWarningData
  26284. raw := NoMethod(*s)
  26285. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26286. }
  26287. // TargetHttpProxyList: A list of TargetHttpProxy resources.
  26288. type TargetHttpProxyList struct {
  26289. // Id: [Output Only] Unique identifier for the resource; defined by the
  26290. // server.
  26291. Id string `json:"id,omitempty"`
  26292. // Items: A list of TargetHttpProxy resources.
  26293. Items []*TargetHttpProxy `json:"items,omitempty"`
  26294. // Kind: Type of resource. Always compute#targetHttpProxyList for lists
  26295. // of target HTTP proxies.
  26296. Kind string `json:"kind,omitempty"`
  26297. // NextPageToken: [Output Only] This token allows you to get the next
  26298. // page of results for list requests. If the number of results is larger
  26299. // than maxResults, use the nextPageToken as a value for the query
  26300. // parameter pageToken in the next list request. Subsequent list
  26301. // requests will have their own nextPageToken to continue paging through
  26302. // the results.
  26303. NextPageToken string `json:"nextPageToken,omitempty"`
  26304. // SelfLink: [Output Only] Server-defined URL for this resource.
  26305. SelfLink string `json:"selfLink,omitempty"`
  26306. // Warning: [Output Only] Informational warning message.
  26307. Warning *TargetHttpProxyListWarning `json:"warning,omitempty"`
  26308. // ServerResponse contains the HTTP response code and headers from the
  26309. // server.
  26310. googleapi.ServerResponse `json:"-"`
  26311. // ForceSendFields is a list of field names (e.g. "Id") to
  26312. // unconditionally include in API requests. By default, fields with
  26313. // empty values are omitted from API requests. However, any non-pointer,
  26314. // non-interface field appearing in ForceSendFields will be sent to the
  26315. // server regardless of whether the field is empty or not. This may be
  26316. // used to include empty fields in Patch requests.
  26317. ForceSendFields []string `json:"-"`
  26318. // NullFields is a list of field names (e.g. "Id") to include in API
  26319. // requests with the JSON null value. By default, fields with empty
  26320. // values are omitted from API requests. However, any field with an
  26321. // empty value appearing in NullFields will be sent to the server as
  26322. // null. It is an error if a field in this list has a non-empty value.
  26323. // This may be used to include null fields in Patch requests.
  26324. NullFields []string `json:"-"`
  26325. }
  26326. func (s *TargetHttpProxyList) MarshalJSON() ([]byte, error) {
  26327. type NoMethod TargetHttpProxyList
  26328. raw := NoMethod(*s)
  26329. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26330. }
  26331. // TargetHttpProxyListWarning: [Output Only] Informational warning
  26332. // message.
  26333. type TargetHttpProxyListWarning struct {
  26334. // Code: [Output Only] A warning code, if applicable. For example,
  26335. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  26336. // the response.
  26337. //
  26338. // Possible values:
  26339. // "CLEANUP_FAILED"
  26340. // "DEPRECATED_RESOURCE_USED"
  26341. // "DEPRECATED_TYPE_USED"
  26342. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  26343. // "EXPERIMENTAL_TYPE_USED"
  26344. // "EXTERNAL_API_WARNING"
  26345. // "FIELD_VALUE_OVERRIDEN"
  26346. // "INJECTED_KERNELS_DEPRECATED"
  26347. // "MISSING_TYPE_DEPENDENCY"
  26348. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  26349. // "NEXT_HOP_CANNOT_IP_FORWARD"
  26350. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  26351. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  26352. // "NEXT_HOP_NOT_RUNNING"
  26353. // "NOT_CRITICAL_ERROR"
  26354. // "NO_RESULTS_ON_PAGE"
  26355. // "REQUIRED_TOS_AGREEMENT"
  26356. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  26357. // "RESOURCE_NOT_DELETED"
  26358. // "SCHEMA_VALIDATION_IGNORED"
  26359. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  26360. // "UNDECLARED_PROPERTIES"
  26361. // "UNREACHABLE"
  26362. Code string `json:"code,omitempty"`
  26363. // Data: [Output Only] Metadata about this warning in key: value format.
  26364. // For example:
  26365. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  26366. Data []*TargetHttpProxyListWarningData `json:"data,omitempty"`
  26367. // Message: [Output Only] A human-readable description of the warning
  26368. // code.
  26369. Message string `json:"message,omitempty"`
  26370. // ForceSendFields is a list of field names (e.g. "Code") to
  26371. // unconditionally include in API requests. By default, fields with
  26372. // empty values are omitted from API requests. However, any non-pointer,
  26373. // non-interface field appearing in ForceSendFields will be sent to the
  26374. // server regardless of whether the field is empty or not. This may be
  26375. // used to include empty fields in Patch requests.
  26376. ForceSendFields []string `json:"-"`
  26377. // NullFields is a list of field names (e.g. "Code") to include in API
  26378. // requests with the JSON null value. By default, fields with empty
  26379. // values are omitted from API requests. However, any field with an
  26380. // empty value appearing in NullFields will be sent to the server as
  26381. // null. It is an error if a field in this list has a non-empty value.
  26382. // This may be used to include null fields in Patch requests.
  26383. NullFields []string `json:"-"`
  26384. }
  26385. func (s *TargetHttpProxyListWarning) MarshalJSON() ([]byte, error) {
  26386. type NoMethod TargetHttpProxyListWarning
  26387. raw := NoMethod(*s)
  26388. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26389. }
  26390. type TargetHttpProxyListWarningData struct {
  26391. // Key: [Output Only] A key that provides more detail on the warning
  26392. // being returned. For example, for warnings where there are no results
  26393. // in a list request for a particular zone, this key might be scope and
  26394. // the key value might be the zone name. Other examples might be a key
  26395. // indicating a deprecated resource and a suggested replacement, or a
  26396. // warning about invalid network settings (for example, if an instance
  26397. // attempts to perform IP forwarding but is not enabled for IP
  26398. // forwarding).
  26399. Key string `json:"key,omitempty"`
  26400. // Value: [Output Only] A warning data value corresponding to the key.
  26401. Value string `json:"value,omitempty"`
  26402. // ForceSendFields is a list of field names (e.g. "Key") to
  26403. // unconditionally include in API requests. By default, fields with
  26404. // empty values are omitted from API requests. However, any non-pointer,
  26405. // non-interface field appearing in ForceSendFields will be sent to the
  26406. // server regardless of whether the field is empty or not. This may be
  26407. // used to include empty fields in Patch requests.
  26408. ForceSendFields []string `json:"-"`
  26409. // NullFields is a list of field names (e.g. "Key") to include in API
  26410. // requests with the JSON null value. By default, fields with empty
  26411. // values are omitted from API requests. However, any field with an
  26412. // empty value appearing in NullFields will be sent to the server as
  26413. // null. It is an error if a field in this list has a non-empty value.
  26414. // This may be used to include null fields in Patch requests.
  26415. NullFields []string `json:"-"`
  26416. }
  26417. func (s *TargetHttpProxyListWarningData) MarshalJSON() ([]byte, error) {
  26418. type NoMethod TargetHttpProxyListWarningData
  26419. raw := NoMethod(*s)
  26420. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26421. }
  26422. type TargetHttpsProxiesSetQuicOverrideRequest struct {
  26423. // QuicOverride: QUIC policy for the TargetHttpsProxy resource.
  26424. //
  26425. // Possible values:
  26426. // "DISABLE"
  26427. // "ENABLE"
  26428. // "NONE"
  26429. QuicOverride string `json:"quicOverride,omitempty"`
  26430. // ForceSendFields is a list of field names (e.g. "QuicOverride") to
  26431. // unconditionally include in API requests. By default, fields with
  26432. // empty values are omitted from API requests. However, any non-pointer,
  26433. // non-interface field appearing in ForceSendFields will be sent to the
  26434. // server regardless of whether the field is empty or not. This may be
  26435. // used to include empty fields in Patch requests.
  26436. ForceSendFields []string `json:"-"`
  26437. // NullFields is a list of field names (e.g. "QuicOverride") to include
  26438. // in API requests with the JSON null value. By default, fields with
  26439. // empty values are omitted from API requests. However, any field with
  26440. // an empty value appearing in NullFields will be sent to the server as
  26441. // null. It is an error if a field in this list has a non-empty value.
  26442. // This may be used to include null fields in Patch requests.
  26443. NullFields []string `json:"-"`
  26444. }
  26445. func (s *TargetHttpsProxiesSetQuicOverrideRequest) MarshalJSON() ([]byte, error) {
  26446. type NoMethod TargetHttpsProxiesSetQuicOverrideRequest
  26447. raw := NoMethod(*s)
  26448. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26449. }
  26450. type TargetHttpsProxiesSetSslCertificatesRequest struct {
  26451. // SslCertificates: New set of SslCertificate resources to associate
  26452. // with this TargetHttpsProxy resource. Currently exactly one
  26453. // SslCertificate resource must be specified.
  26454. SslCertificates []string `json:"sslCertificates,omitempty"`
  26455. // ForceSendFields is a list of field names (e.g. "SslCertificates") to
  26456. // unconditionally include in API requests. By default, fields with
  26457. // empty values are omitted from API requests. However, any non-pointer,
  26458. // non-interface field appearing in ForceSendFields will be sent to the
  26459. // server regardless of whether the field is empty or not. This may be
  26460. // used to include empty fields in Patch requests.
  26461. ForceSendFields []string `json:"-"`
  26462. // NullFields is a list of field names (e.g. "SslCertificates") to
  26463. // include in API requests with the JSON null value. By default, fields
  26464. // with empty values are omitted from API requests. However, any field
  26465. // with an empty value appearing in NullFields will be sent to the
  26466. // server as null. It is an error if a field in this list has a
  26467. // non-empty value. This may be used to include null fields in Patch
  26468. // requests.
  26469. NullFields []string `json:"-"`
  26470. }
  26471. func (s *TargetHttpsProxiesSetSslCertificatesRequest) MarshalJSON() ([]byte, error) {
  26472. type NoMethod TargetHttpsProxiesSetSslCertificatesRequest
  26473. raw := NoMethod(*s)
  26474. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26475. }
  26476. // TargetHttpsProxy: A TargetHttpsProxy resource. This resource defines
  26477. // an HTTPS proxy. (== resource_for beta.targetHttpsProxies ==) (==
  26478. // resource_for v1.targetHttpsProxies ==)
  26479. type TargetHttpsProxy struct {
  26480. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  26481. // format.
  26482. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  26483. // Description: An optional description of this resource. Provide this
  26484. // property when you create the resource.
  26485. Description string `json:"description,omitempty"`
  26486. // Id: [Output Only] The unique identifier for the resource. This
  26487. // identifier is defined by the server.
  26488. Id uint64 `json:"id,omitempty,string"`
  26489. // Kind: [Output Only] Type of resource. Always compute#targetHttpsProxy
  26490. // for target HTTPS proxies.
  26491. Kind string `json:"kind,omitempty"`
  26492. // Name: Name of the resource. Provided by the client when the resource
  26493. // is created. The name must be 1-63 characters long, and comply with
  26494. // RFC1035. Specifically, the name must be 1-63 characters long and
  26495. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  26496. // the first character must be a lowercase letter, and all following
  26497. // characters must be a dash, lowercase letter, or digit, except the
  26498. // last character, which cannot be a dash.
  26499. Name string `json:"name,omitempty"`
  26500. // QuicOverride: Specifies the QUIC override policy for this
  26501. // TargetHttpsProxy resource. This determines whether the load balancer
  26502. // will attempt to negotiate QUIC with clients or not. Can specify one
  26503. // of NONE, ENABLE, or DISABLE. Specify ENABLE to always enable QUIC,
  26504. // Enables QUIC when set to ENABLE, and disables QUIC when set to
  26505. // DISABLE. If NONE is specified, uses the QUIC policy with no user
  26506. // overrides, which is equivalent to DISABLE. Not specifying this field
  26507. // is equivalent to specifying NONE.
  26508. //
  26509. // Possible values:
  26510. // "DISABLE"
  26511. // "ENABLE"
  26512. // "NONE"
  26513. QuicOverride string `json:"quicOverride,omitempty"`
  26514. // SelfLink: [Output Only] Server-defined URL for the resource.
  26515. SelfLink string `json:"selfLink,omitempty"`
  26516. // SslCertificates: URLs to SslCertificate resources that are used to
  26517. // authenticate connections between users and the load balancer.
  26518. // Currently, exactly one SSL certificate must be specified.
  26519. SslCertificates []string `json:"sslCertificates,omitempty"`
  26520. // SslPolicy: URL of SslPolicy resource that will be associated with the
  26521. // TargetHttpsProxy resource. If not set, the TargetHttpsProxy resource
  26522. // will not have any SSL policy configured.
  26523. SslPolicy string `json:"sslPolicy,omitempty"`
  26524. // UrlMap: A fully-qualified or valid partial URL to the UrlMap resource
  26525. // that defines the mapping from URL to the BackendService. For example,
  26526. // the following are all valid URLs for specifying a URL map:
  26527. // -
  26528. // https://www.googleapis.compute/v1/projects/project/global/urlMaps/url-map
  26529. // - projects/project/global/urlMaps/url-map
  26530. // - global/urlMaps/url-map
  26531. UrlMap string `json:"urlMap,omitempty"`
  26532. // ServerResponse contains the HTTP response code and headers from the
  26533. // server.
  26534. googleapi.ServerResponse `json:"-"`
  26535. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  26536. // to unconditionally include in API requests. By default, fields with
  26537. // empty values are omitted from API requests. However, any non-pointer,
  26538. // non-interface field appearing in ForceSendFields will be sent to the
  26539. // server regardless of whether the field is empty or not. This may be
  26540. // used to include empty fields in Patch requests.
  26541. ForceSendFields []string `json:"-"`
  26542. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  26543. // include in API requests with the JSON null value. By default, fields
  26544. // with empty values are omitted from API requests. However, any field
  26545. // with an empty value appearing in NullFields will be sent to the
  26546. // server as null. It is an error if a field in this list has a
  26547. // non-empty value. This may be used to include null fields in Patch
  26548. // requests.
  26549. NullFields []string `json:"-"`
  26550. }
  26551. func (s *TargetHttpsProxy) MarshalJSON() ([]byte, error) {
  26552. type NoMethod TargetHttpsProxy
  26553. raw := NoMethod(*s)
  26554. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26555. }
  26556. // TargetHttpsProxyList: Contains a list of TargetHttpsProxy resources.
  26557. type TargetHttpsProxyList struct {
  26558. // Id: [Output Only] Unique identifier for the resource; defined by the
  26559. // server.
  26560. Id string `json:"id,omitempty"`
  26561. // Items: A list of TargetHttpsProxy resources.
  26562. Items []*TargetHttpsProxy `json:"items,omitempty"`
  26563. // Kind: Type of resource. Always compute#targetHttpsProxyList for lists
  26564. // of target HTTPS proxies.
  26565. Kind string `json:"kind,omitempty"`
  26566. // NextPageToken: [Output Only] This token allows you to get the next
  26567. // page of results for list requests. If the number of results is larger
  26568. // than maxResults, use the nextPageToken as a value for the query
  26569. // parameter pageToken in the next list request. Subsequent list
  26570. // requests will have their own nextPageToken to continue paging through
  26571. // the results.
  26572. NextPageToken string `json:"nextPageToken,omitempty"`
  26573. // SelfLink: [Output Only] Server-defined URL for this resource.
  26574. SelfLink string `json:"selfLink,omitempty"`
  26575. // Warning: [Output Only] Informational warning message.
  26576. Warning *TargetHttpsProxyListWarning `json:"warning,omitempty"`
  26577. // ServerResponse contains the HTTP response code and headers from the
  26578. // server.
  26579. googleapi.ServerResponse `json:"-"`
  26580. // ForceSendFields is a list of field names (e.g. "Id") to
  26581. // unconditionally include in API requests. By default, fields with
  26582. // empty values are omitted from API requests. However, any non-pointer,
  26583. // non-interface field appearing in ForceSendFields will be sent to the
  26584. // server regardless of whether the field is empty or not. This may be
  26585. // used to include empty fields in Patch requests.
  26586. ForceSendFields []string `json:"-"`
  26587. // NullFields is a list of field names (e.g. "Id") to include in API
  26588. // requests with the JSON null value. By default, fields with empty
  26589. // values are omitted from API requests. However, any field with an
  26590. // empty value appearing in NullFields will be sent to the server as
  26591. // null. It is an error if a field in this list has a non-empty value.
  26592. // This may be used to include null fields in Patch requests.
  26593. NullFields []string `json:"-"`
  26594. }
  26595. func (s *TargetHttpsProxyList) MarshalJSON() ([]byte, error) {
  26596. type NoMethod TargetHttpsProxyList
  26597. raw := NoMethod(*s)
  26598. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26599. }
  26600. // TargetHttpsProxyListWarning: [Output Only] Informational warning
  26601. // message.
  26602. type TargetHttpsProxyListWarning struct {
  26603. // Code: [Output Only] A warning code, if applicable. For example,
  26604. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  26605. // the response.
  26606. //
  26607. // Possible values:
  26608. // "CLEANUP_FAILED"
  26609. // "DEPRECATED_RESOURCE_USED"
  26610. // "DEPRECATED_TYPE_USED"
  26611. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  26612. // "EXPERIMENTAL_TYPE_USED"
  26613. // "EXTERNAL_API_WARNING"
  26614. // "FIELD_VALUE_OVERRIDEN"
  26615. // "INJECTED_KERNELS_DEPRECATED"
  26616. // "MISSING_TYPE_DEPENDENCY"
  26617. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  26618. // "NEXT_HOP_CANNOT_IP_FORWARD"
  26619. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  26620. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  26621. // "NEXT_HOP_NOT_RUNNING"
  26622. // "NOT_CRITICAL_ERROR"
  26623. // "NO_RESULTS_ON_PAGE"
  26624. // "REQUIRED_TOS_AGREEMENT"
  26625. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  26626. // "RESOURCE_NOT_DELETED"
  26627. // "SCHEMA_VALIDATION_IGNORED"
  26628. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  26629. // "UNDECLARED_PROPERTIES"
  26630. // "UNREACHABLE"
  26631. Code string `json:"code,omitempty"`
  26632. // Data: [Output Only] Metadata about this warning in key: value format.
  26633. // For example:
  26634. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  26635. Data []*TargetHttpsProxyListWarningData `json:"data,omitempty"`
  26636. // Message: [Output Only] A human-readable description of the warning
  26637. // code.
  26638. Message string `json:"message,omitempty"`
  26639. // ForceSendFields is a list of field names (e.g. "Code") to
  26640. // unconditionally include in API requests. By default, fields with
  26641. // empty values are omitted from API requests. However, any non-pointer,
  26642. // non-interface field appearing in ForceSendFields will be sent to the
  26643. // server regardless of whether the field is empty or not. This may be
  26644. // used to include empty fields in Patch requests.
  26645. ForceSendFields []string `json:"-"`
  26646. // NullFields is a list of field names (e.g. "Code") to include in API
  26647. // requests with the JSON null value. By default, fields with empty
  26648. // values are omitted from API requests. However, any field with an
  26649. // empty value appearing in NullFields will be sent to the server as
  26650. // null. It is an error if a field in this list has a non-empty value.
  26651. // This may be used to include null fields in Patch requests.
  26652. NullFields []string `json:"-"`
  26653. }
  26654. func (s *TargetHttpsProxyListWarning) MarshalJSON() ([]byte, error) {
  26655. type NoMethod TargetHttpsProxyListWarning
  26656. raw := NoMethod(*s)
  26657. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26658. }
  26659. type TargetHttpsProxyListWarningData struct {
  26660. // Key: [Output Only] A key that provides more detail on the warning
  26661. // being returned. For example, for warnings where there are no results
  26662. // in a list request for a particular zone, this key might be scope and
  26663. // the key value might be the zone name. Other examples might be a key
  26664. // indicating a deprecated resource and a suggested replacement, or a
  26665. // warning about invalid network settings (for example, if an instance
  26666. // attempts to perform IP forwarding but is not enabled for IP
  26667. // forwarding).
  26668. Key string `json:"key,omitempty"`
  26669. // Value: [Output Only] A warning data value corresponding to the key.
  26670. Value string `json:"value,omitempty"`
  26671. // ForceSendFields is a list of field names (e.g. "Key") to
  26672. // unconditionally include in API requests. By default, fields with
  26673. // empty values are omitted from API requests. However, any non-pointer,
  26674. // non-interface field appearing in ForceSendFields will be sent to the
  26675. // server regardless of whether the field is empty or not. This may be
  26676. // used to include empty fields in Patch requests.
  26677. ForceSendFields []string `json:"-"`
  26678. // NullFields is a list of field names (e.g. "Key") to include in API
  26679. // requests with the JSON null value. By default, fields with empty
  26680. // values are omitted from API requests. However, any field with an
  26681. // empty value appearing in NullFields will be sent to the server as
  26682. // null. It is an error if a field in this list has a non-empty value.
  26683. // This may be used to include null fields in Patch requests.
  26684. NullFields []string `json:"-"`
  26685. }
  26686. func (s *TargetHttpsProxyListWarningData) MarshalJSON() ([]byte, error) {
  26687. type NoMethod TargetHttpsProxyListWarningData
  26688. raw := NoMethod(*s)
  26689. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26690. }
  26691. // TargetInstance: A TargetInstance resource. This resource defines an
  26692. // endpoint instance that terminates traffic of certain protocols. (==
  26693. // resource_for beta.targetInstances ==) (== resource_for
  26694. // v1.targetInstances ==)
  26695. type TargetInstance struct {
  26696. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  26697. // format.
  26698. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  26699. // Description: An optional description of this resource. Provide this
  26700. // property when you create the resource.
  26701. Description string `json:"description,omitempty"`
  26702. // Id: [Output Only] The unique identifier for the resource. This
  26703. // identifier is defined by the server.
  26704. Id uint64 `json:"id,omitempty,string"`
  26705. // Instance: A URL to the virtual machine instance that handles traffic
  26706. // for this target instance. When creating a target instance, you can
  26707. // provide the fully-qualified URL or a valid partial URL to the desired
  26708. // virtual machine. For example, the following are all valid URLs:
  26709. // -
  26710. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance
  26711. // - projects/project/zones/zone/instances/instance
  26712. // - zones/zone/instances/instance
  26713. Instance string `json:"instance,omitempty"`
  26714. // Kind: [Output Only] The type of the resource. Always
  26715. // compute#targetInstance for target instances.
  26716. Kind string `json:"kind,omitempty"`
  26717. // Name: Name of the resource. Provided by the client when the resource
  26718. // is created. The name must be 1-63 characters long, and comply with
  26719. // RFC1035. Specifically, the name must be 1-63 characters long and
  26720. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  26721. // the first character must be a lowercase letter, and all following
  26722. // characters must be a dash, lowercase letter, or digit, except the
  26723. // last character, which cannot be a dash.
  26724. Name string `json:"name,omitempty"`
  26725. // NatPolicy: NAT option controlling how IPs are NAT'ed to the instance.
  26726. // Currently only NO_NAT (default value) is supported.
  26727. //
  26728. // Possible values:
  26729. // "NO_NAT"
  26730. NatPolicy string `json:"natPolicy,omitempty"`
  26731. // SelfLink: [Output Only] Server-defined URL for the resource.
  26732. SelfLink string `json:"selfLink,omitempty"`
  26733. // Zone: [Output Only] URL of the zone where the target instance
  26734. // resides. You must specify this field as part of the HTTP request URL.
  26735. // It is not settable as a field in the request body.
  26736. Zone string `json:"zone,omitempty"`
  26737. // ServerResponse contains the HTTP response code and headers from the
  26738. // server.
  26739. googleapi.ServerResponse `json:"-"`
  26740. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  26741. // to unconditionally include in API requests. By default, fields with
  26742. // empty values are omitted from API requests. However, any non-pointer,
  26743. // non-interface field appearing in ForceSendFields will be sent to the
  26744. // server regardless of whether the field is empty or not. This may be
  26745. // used to include empty fields in Patch requests.
  26746. ForceSendFields []string `json:"-"`
  26747. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  26748. // include in API requests with the JSON null value. By default, fields
  26749. // with empty values are omitted from API requests. However, any field
  26750. // with an empty value appearing in NullFields will be sent to the
  26751. // server as null. It is an error if a field in this list has a
  26752. // non-empty value. This may be used to include null fields in Patch
  26753. // requests.
  26754. NullFields []string `json:"-"`
  26755. }
  26756. func (s *TargetInstance) MarshalJSON() ([]byte, error) {
  26757. type NoMethod TargetInstance
  26758. raw := NoMethod(*s)
  26759. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26760. }
  26761. type TargetInstanceAggregatedList struct {
  26762. // Id: [Output Only] Unique identifier for the resource; defined by the
  26763. // server.
  26764. Id string `json:"id,omitempty"`
  26765. // Items: A list of TargetInstance resources.
  26766. Items map[string]TargetInstancesScopedList `json:"items,omitempty"`
  26767. // Kind: Type of resource.
  26768. Kind string `json:"kind,omitempty"`
  26769. // NextPageToken: [Output Only] This token allows you to get the next
  26770. // page of results for list requests. If the number of results is larger
  26771. // than maxResults, use the nextPageToken as a value for the query
  26772. // parameter pageToken in the next list request. Subsequent list
  26773. // requests will have their own nextPageToken to continue paging through
  26774. // the results.
  26775. NextPageToken string `json:"nextPageToken,omitempty"`
  26776. // SelfLink: [Output Only] Server-defined URL for this resource.
  26777. SelfLink string `json:"selfLink,omitempty"`
  26778. // Warning: [Output Only] Informational warning message.
  26779. Warning *TargetInstanceAggregatedListWarning `json:"warning,omitempty"`
  26780. // ServerResponse contains the HTTP response code and headers from the
  26781. // server.
  26782. googleapi.ServerResponse `json:"-"`
  26783. // ForceSendFields is a list of field names (e.g. "Id") to
  26784. // unconditionally include in API requests. By default, fields with
  26785. // empty values are omitted from API requests. However, any non-pointer,
  26786. // non-interface field appearing in ForceSendFields will be sent to the
  26787. // server regardless of whether the field is empty or not. This may be
  26788. // used to include empty fields in Patch requests.
  26789. ForceSendFields []string `json:"-"`
  26790. // NullFields is a list of field names (e.g. "Id") to include in API
  26791. // requests with the JSON null value. By default, fields with empty
  26792. // values are omitted from API requests. However, any field with an
  26793. // empty value appearing in NullFields will be sent to the server as
  26794. // null. It is an error if a field in this list has a non-empty value.
  26795. // This may be used to include null fields in Patch requests.
  26796. NullFields []string `json:"-"`
  26797. }
  26798. func (s *TargetInstanceAggregatedList) MarshalJSON() ([]byte, error) {
  26799. type NoMethod TargetInstanceAggregatedList
  26800. raw := NoMethod(*s)
  26801. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26802. }
  26803. // TargetInstanceAggregatedListWarning: [Output Only] Informational
  26804. // warning message.
  26805. type TargetInstanceAggregatedListWarning struct {
  26806. // Code: [Output Only] A warning code, if applicable. For example,
  26807. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  26808. // the response.
  26809. //
  26810. // Possible values:
  26811. // "CLEANUP_FAILED"
  26812. // "DEPRECATED_RESOURCE_USED"
  26813. // "DEPRECATED_TYPE_USED"
  26814. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  26815. // "EXPERIMENTAL_TYPE_USED"
  26816. // "EXTERNAL_API_WARNING"
  26817. // "FIELD_VALUE_OVERRIDEN"
  26818. // "INJECTED_KERNELS_DEPRECATED"
  26819. // "MISSING_TYPE_DEPENDENCY"
  26820. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  26821. // "NEXT_HOP_CANNOT_IP_FORWARD"
  26822. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  26823. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  26824. // "NEXT_HOP_NOT_RUNNING"
  26825. // "NOT_CRITICAL_ERROR"
  26826. // "NO_RESULTS_ON_PAGE"
  26827. // "REQUIRED_TOS_AGREEMENT"
  26828. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  26829. // "RESOURCE_NOT_DELETED"
  26830. // "SCHEMA_VALIDATION_IGNORED"
  26831. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  26832. // "UNDECLARED_PROPERTIES"
  26833. // "UNREACHABLE"
  26834. Code string `json:"code,omitempty"`
  26835. // Data: [Output Only] Metadata about this warning in key: value format.
  26836. // For example:
  26837. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  26838. Data []*TargetInstanceAggregatedListWarningData `json:"data,omitempty"`
  26839. // Message: [Output Only] A human-readable description of the warning
  26840. // code.
  26841. Message string `json:"message,omitempty"`
  26842. // ForceSendFields is a list of field names (e.g. "Code") to
  26843. // unconditionally include in API requests. By default, fields with
  26844. // empty values are omitted from API requests. However, any non-pointer,
  26845. // non-interface field appearing in ForceSendFields will be sent to the
  26846. // server regardless of whether the field is empty or not. This may be
  26847. // used to include empty fields in Patch requests.
  26848. ForceSendFields []string `json:"-"`
  26849. // NullFields is a list of field names (e.g. "Code") to include in API
  26850. // requests with the JSON null value. By default, fields with empty
  26851. // values are omitted from API requests. However, any field with an
  26852. // empty value appearing in NullFields will be sent to the server as
  26853. // null. It is an error if a field in this list has a non-empty value.
  26854. // This may be used to include null fields in Patch requests.
  26855. NullFields []string `json:"-"`
  26856. }
  26857. func (s *TargetInstanceAggregatedListWarning) MarshalJSON() ([]byte, error) {
  26858. type NoMethod TargetInstanceAggregatedListWarning
  26859. raw := NoMethod(*s)
  26860. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26861. }
  26862. type TargetInstanceAggregatedListWarningData struct {
  26863. // Key: [Output Only] A key that provides more detail on the warning
  26864. // being returned. For example, for warnings where there are no results
  26865. // in a list request for a particular zone, this key might be scope and
  26866. // the key value might be the zone name. Other examples might be a key
  26867. // indicating a deprecated resource and a suggested replacement, or a
  26868. // warning about invalid network settings (for example, if an instance
  26869. // attempts to perform IP forwarding but is not enabled for IP
  26870. // forwarding).
  26871. Key string `json:"key,omitempty"`
  26872. // Value: [Output Only] A warning data value corresponding to the key.
  26873. Value string `json:"value,omitempty"`
  26874. // ForceSendFields is a list of field names (e.g. "Key") to
  26875. // unconditionally include in API requests. By default, fields with
  26876. // empty values are omitted from API requests. However, any non-pointer,
  26877. // non-interface field appearing in ForceSendFields will be sent to the
  26878. // server regardless of whether the field is empty or not. This may be
  26879. // used to include empty fields in Patch requests.
  26880. ForceSendFields []string `json:"-"`
  26881. // NullFields is a list of field names (e.g. "Key") to include in API
  26882. // requests with the JSON null value. By default, fields with empty
  26883. // values are omitted from API requests. However, any field with an
  26884. // empty value appearing in NullFields will be sent to the server as
  26885. // null. It is an error if a field in this list has a non-empty value.
  26886. // This may be used to include null fields in Patch requests.
  26887. NullFields []string `json:"-"`
  26888. }
  26889. func (s *TargetInstanceAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  26890. type NoMethod TargetInstanceAggregatedListWarningData
  26891. raw := NoMethod(*s)
  26892. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26893. }
  26894. // TargetInstanceList: Contains a list of TargetInstance resources.
  26895. type TargetInstanceList struct {
  26896. // Id: [Output Only] Unique identifier for the resource; defined by the
  26897. // server.
  26898. Id string `json:"id,omitempty"`
  26899. // Items: A list of TargetInstance resources.
  26900. Items []*TargetInstance `json:"items,omitempty"`
  26901. // Kind: Type of resource.
  26902. Kind string `json:"kind,omitempty"`
  26903. // NextPageToken: [Output Only] This token allows you to get the next
  26904. // page of results for list requests. If the number of results is larger
  26905. // than maxResults, use the nextPageToken as a value for the query
  26906. // parameter pageToken in the next list request. Subsequent list
  26907. // requests will have their own nextPageToken to continue paging through
  26908. // the results.
  26909. NextPageToken string `json:"nextPageToken,omitempty"`
  26910. // SelfLink: [Output Only] Server-defined URL for this resource.
  26911. SelfLink string `json:"selfLink,omitempty"`
  26912. // Warning: [Output Only] Informational warning message.
  26913. Warning *TargetInstanceListWarning `json:"warning,omitempty"`
  26914. // ServerResponse contains the HTTP response code and headers from the
  26915. // server.
  26916. googleapi.ServerResponse `json:"-"`
  26917. // ForceSendFields is a list of field names (e.g. "Id") to
  26918. // unconditionally include in API requests. By default, fields with
  26919. // empty values are omitted from API requests. However, any non-pointer,
  26920. // non-interface field appearing in ForceSendFields will be sent to the
  26921. // server regardless of whether the field is empty or not. This may be
  26922. // used to include empty fields in Patch requests.
  26923. ForceSendFields []string `json:"-"`
  26924. // NullFields is a list of field names (e.g. "Id") to include in API
  26925. // requests with the JSON null value. By default, fields with empty
  26926. // values are omitted from API requests. However, any field with an
  26927. // empty value appearing in NullFields will be sent to the server as
  26928. // null. It is an error if a field in this list has a non-empty value.
  26929. // This may be used to include null fields in Patch requests.
  26930. NullFields []string `json:"-"`
  26931. }
  26932. func (s *TargetInstanceList) MarshalJSON() ([]byte, error) {
  26933. type NoMethod TargetInstanceList
  26934. raw := NoMethod(*s)
  26935. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26936. }
  26937. // TargetInstanceListWarning: [Output Only] Informational warning
  26938. // message.
  26939. type TargetInstanceListWarning struct {
  26940. // Code: [Output Only] A warning code, if applicable. For example,
  26941. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  26942. // the response.
  26943. //
  26944. // Possible values:
  26945. // "CLEANUP_FAILED"
  26946. // "DEPRECATED_RESOURCE_USED"
  26947. // "DEPRECATED_TYPE_USED"
  26948. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  26949. // "EXPERIMENTAL_TYPE_USED"
  26950. // "EXTERNAL_API_WARNING"
  26951. // "FIELD_VALUE_OVERRIDEN"
  26952. // "INJECTED_KERNELS_DEPRECATED"
  26953. // "MISSING_TYPE_DEPENDENCY"
  26954. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  26955. // "NEXT_HOP_CANNOT_IP_FORWARD"
  26956. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  26957. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  26958. // "NEXT_HOP_NOT_RUNNING"
  26959. // "NOT_CRITICAL_ERROR"
  26960. // "NO_RESULTS_ON_PAGE"
  26961. // "REQUIRED_TOS_AGREEMENT"
  26962. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  26963. // "RESOURCE_NOT_DELETED"
  26964. // "SCHEMA_VALIDATION_IGNORED"
  26965. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  26966. // "UNDECLARED_PROPERTIES"
  26967. // "UNREACHABLE"
  26968. Code string `json:"code,omitempty"`
  26969. // Data: [Output Only] Metadata about this warning in key: value format.
  26970. // For example:
  26971. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  26972. Data []*TargetInstanceListWarningData `json:"data,omitempty"`
  26973. // Message: [Output Only] A human-readable description of the warning
  26974. // code.
  26975. Message string `json:"message,omitempty"`
  26976. // ForceSendFields is a list of field names (e.g. "Code") to
  26977. // unconditionally include in API requests. By default, fields with
  26978. // empty values are omitted from API requests. However, any non-pointer,
  26979. // non-interface field appearing in ForceSendFields will be sent to the
  26980. // server regardless of whether the field is empty or not. This may be
  26981. // used to include empty fields in Patch requests.
  26982. ForceSendFields []string `json:"-"`
  26983. // NullFields is a list of field names (e.g. "Code") to include in API
  26984. // requests with the JSON null value. By default, fields with empty
  26985. // values are omitted from API requests. However, any field with an
  26986. // empty value appearing in NullFields will be sent to the server as
  26987. // null. It is an error if a field in this list has a non-empty value.
  26988. // This may be used to include null fields in Patch requests.
  26989. NullFields []string `json:"-"`
  26990. }
  26991. func (s *TargetInstanceListWarning) MarshalJSON() ([]byte, error) {
  26992. type NoMethod TargetInstanceListWarning
  26993. raw := NoMethod(*s)
  26994. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26995. }
  26996. type TargetInstanceListWarningData struct {
  26997. // Key: [Output Only] A key that provides more detail on the warning
  26998. // being returned. For example, for warnings where there are no results
  26999. // in a list request for a particular zone, this key might be scope and
  27000. // the key value might be the zone name. Other examples might be a key
  27001. // indicating a deprecated resource and a suggested replacement, or a
  27002. // warning about invalid network settings (for example, if an instance
  27003. // attempts to perform IP forwarding but is not enabled for IP
  27004. // forwarding).
  27005. Key string `json:"key,omitempty"`
  27006. // Value: [Output Only] A warning data value corresponding to the key.
  27007. Value string `json:"value,omitempty"`
  27008. // ForceSendFields is a list of field names (e.g. "Key") to
  27009. // unconditionally include in API requests. By default, fields with
  27010. // empty values are omitted from API requests. However, any non-pointer,
  27011. // non-interface field appearing in ForceSendFields will be sent to the
  27012. // server regardless of whether the field is empty or not. This may be
  27013. // used to include empty fields in Patch requests.
  27014. ForceSendFields []string `json:"-"`
  27015. // NullFields is a list of field names (e.g. "Key") to include in API
  27016. // requests with the JSON null value. By default, fields with empty
  27017. // values are omitted from API requests. However, any field with an
  27018. // empty value appearing in NullFields will be sent to the server as
  27019. // null. It is an error if a field in this list has a non-empty value.
  27020. // This may be used to include null fields in Patch requests.
  27021. NullFields []string `json:"-"`
  27022. }
  27023. func (s *TargetInstanceListWarningData) MarshalJSON() ([]byte, error) {
  27024. type NoMethod TargetInstanceListWarningData
  27025. raw := NoMethod(*s)
  27026. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27027. }
  27028. type TargetInstancesScopedList struct {
  27029. // TargetInstances: A list of target instances contained in this scope.
  27030. TargetInstances []*TargetInstance `json:"targetInstances,omitempty"`
  27031. // Warning: Informational warning which replaces the list of addresses
  27032. // when the list is empty.
  27033. Warning *TargetInstancesScopedListWarning `json:"warning,omitempty"`
  27034. // ForceSendFields is a list of field names (e.g. "TargetInstances") to
  27035. // unconditionally include in API requests. By default, fields with
  27036. // empty values are omitted from API requests. However, any non-pointer,
  27037. // non-interface field appearing in ForceSendFields will be sent to the
  27038. // server regardless of whether the field is empty or not. This may be
  27039. // used to include empty fields in Patch requests.
  27040. ForceSendFields []string `json:"-"`
  27041. // NullFields is a list of field names (e.g. "TargetInstances") to
  27042. // include in API requests with the JSON null value. By default, fields
  27043. // with empty values are omitted from API requests. However, any field
  27044. // with an empty value appearing in NullFields will be sent to the
  27045. // server as null. It is an error if a field in this list has a
  27046. // non-empty value. This may be used to include null fields in Patch
  27047. // requests.
  27048. NullFields []string `json:"-"`
  27049. }
  27050. func (s *TargetInstancesScopedList) MarshalJSON() ([]byte, error) {
  27051. type NoMethod TargetInstancesScopedList
  27052. raw := NoMethod(*s)
  27053. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27054. }
  27055. // TargetInstancesScopedListWarning: Informational warning which
  27056. // replaces the list of addresses when the list is empty.
  27057. type TargetInstancesScopedListWarning struct {
  27058. // Code: [Output Only] A warning code, if applicable. For example,
  27059. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  27060. // the response.
  27061. //
  27062. // Possible values:
  27063. // "CLEANUP_FAILED"
  27064. // "DEPRECATED_RESOURCE_USED"
  27065. // "DEPRECATED_TYPE_USED"
  27066. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  27067. // "EXPERIMENTAL_TYPE_USED"
  27068. // "EXTERNAL_API_WARNING"
  27069. // "FIELD_VALUE_OVERRIDEN"
  27070. // "INJECTED_KERNELS_DEPRECATED"
  27071. // "MISSING_TYPE_DEPENDENCY"
  27072. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  27073. // "NEXT_HOP_CANNOT_IP_FORWARD"
  27074. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  27075. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  27076. // "NEXT_HOP_NOT_RUNNING"
  27077. // "NOT_CRITICAL_ERROR"
  27078. // "NO_RESULTS_ON_PAGE"
  27079. // "REQUIRED_TOS_AGREEMENT"
  27080. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  27081. // "RESOURCE_NOT_DELETED"
  27082. // "SCHEMA_VALIDATION_IGNORED"
  27083. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  27084. // "UNDECLARED_PROPERTIES"
  27085. // "UNREACHABLE"
  27086. Code string `json:"code,omitempty"`
  27087. // Data: [Output Only] Metadata about this warning in key: value format.
  27088. // For example:
  27089. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  27090. Data []*TargetInstancesScopedListWarningData `json:"data,omitempty"`
  27091. // Message: [Output Only] A human-readable description of the warning
  27092. // code.
  27093. Message string `json:"message,omitempty"`
  27094. // ForceSendFields is a list of field names (e.g. "Code") to
  27095. // unconditionally include in API requests. By default, fields with
  27096. // empty values are omitted from API requests. However, any non-pointer,
  27097. // non-interface field appearing in ForceSendFields will be sent to the
  27098. // server regardless of whether the field is empty or not. This may be
  27099. // used to include empty fields in Patch requests.
  27100. ForceSendFields []string `json:"-"`
  27101. // NullFields is a list of field names (e.g. "Code") to include in API
  27102. // requests with the JSON null value. By default, fields with empty
  27103. // values are omitted from API requests. However, any field with an
  27104. // empty value appearing in NullFields will be sent to the server as
  27105. // null. It is an error if a field in this list has a non-empty value.
  27106. // This may be used to include null fields in Patch requests.
  27107. NullFields []string `json:"-"`
  27108. }
  27109. func (s *TargetInstancesScopedListWarning) MarshalJSON() ([]byte, error) {
  27110. type NoMethod TargetInstancesScopedListWarning
  27111. raw := NoMethod(*s)
  27112. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27113. }
  27114. type TargetInstancesScopedListWarningData struct {
  27115. // Key: [Output Only] A key that provides more detail on the warning
  27116. // being returned. For example, for warnings where there are no results
  27117. // in a list request for a particular zone, this key might be scope and
  27118. // the key value might be the zone name. Other examples might be a key
  27119. // indicating a deprecated resource and a suggested replacement, or a
  27120. // warning about invalid network settings (for example, if an instance
  27121. // attempts to perform IP forwarding but is not enabled for IP
  27122. // forwarding).
  27123. Key string `json:"key,omitempty"`
  27124. // Value: [Output Only] A warning data value corresponding to the key.
  27125. Value string `json:"value,omitempty"`
  27126. // ForceSendFields is a list of field names (e.g. "Key") to
  27127. // unconditionally include in API requests. By default, fields with
  27128. // empty values are omitted from API requests. However, any non-pointer,
  27129. // non-interface field appearing in ForceSendFields will be sent to the
  27130. // server regardless of whether the field is empty or not. This may be
  27131. // used to include empty fields in Patch requests.
  27132. ForceSendFields []string `json:"-"`
  27133. // NullFields is a list of field names (e.g. "Key") to include in API
  27134. // requests with the JSON null value. By default, fields with empty
  27135. // values are omitted from API requests. However, any field with an
  27136. // empty value appearing in NullFields will be sent to the server as
  27137. // null. It is an error if a field in this list has a non-empty value.
  27138. // This may be used to include null fields in Patch requests.
  27139. NullFields []string `json:"-"`
  27140. }
  27141. func (s *TargetInstancesScopedListWarningData) MarshalJSON() ([]byte, error) {
  27142. type NoMethod TargetInstancesScopedListWarningData
  27143. raw := NoMethod(*s)
  27144. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27145. }
  27146. // TargetPool: A TargetPool resource. This resource defines a pool of
  27147. // instances, an associated HttpHealthCheck resource, and the fallback
  27148. // target pool. (== resource_for beta.targetPools ==) (== resource_for
  27149. // v1.targetPools ==)
  27150. type TargetPool struct {
  27151. // BackupPool: This field is applicable only when the containing target
  27152. // pool is serving a forwarding rule as the primary pool, and its
  27153. // failoverRatio field is properly set to a value between [0,
  27154. // 1].
  27155. //
  27156. // backupPool and failoverRatio together define the fallback behavior of
  27157. // the primary target pool: if the ratio of the healthy instances in the
  27158. // primary pool is at or below failoverRatio, traffic arriving at the
  27159. // load-balanced IP will be directed to the backup pool.
  27160. //
  27161. // In case where failoverRatio and backupPool are not set, or all the
  27162. // instances in the backup pool are unhealthy, the traffic will be
  27163. // directed back to the primary pool in the "force" mode, where traffic
  27164. // will be spread to the healthy instances with the best effort, or to
  27165. // all instances when no instance is healthy.
  27166. BackupPool string `json:"backupPool,omitempty"`
  27167. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  27168. // format.
  27169. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  27170. // Description: An optional description of this resource. Provide this
  27171. // property when you create the resource.
  27172. Description string `json:"description,omitempty"`
  27173. // FailoverRatio: This field is applicable only when the containing
  27174. // target pool is serving a forwarding rule as the primary pool (i.e.,
  27175. // not as a backup pool to some other target pool). The value of the
  27176. // field must be in [0, 1].
  27177. //
  27178. // If set, backupPool must also be set. They together define the
  27179. // fallback behavior of the primary target pool: if the ratio of the
  27180. // healthy instances in the primary pool is at or below this number,
  27181. // traffic arriving at the load-balanced IP will be directed to the
  27182. // backup pool.
  27183. //
  27184. // In case where failoverRatio is not set or all the instances in the
  27185. // backup pool are unhealthy, the traffic will be directed back to the
  27186. // primary pool in the "force" mode, where traffic will be spread to the
  27187. // healthy instances with the best effort, or to all instances when no
  27188. // instance is healthy.
  27189. FailoverRatio float64 `json:"failoverRatio,omitempty"`
  27190. // HealthChecks: The URL of the HttpHealthCheck resource. A member
  27191. // instance in this pool is considered healthy if and only if the health
  27192. // checks pass. An empty list means all member instances will be
  27193. // considered healthy at all times. Only HttpHealthChecks are supported.
  27194. // Only one health check may be specified.
  27195. HealthChecks []string `json:"healthChecks,omitempty"`
  27196. // Id: [Output Only] The unique identifier for the resource. This
  27197. // identifier is defined by the server.
  27198. Id uint64 `json:"id,omitempty,string"`
  27199. // Instances: A list of resource URLs to the virtual machine instances
  27200. // serving this pool. They must live in zones contained in the same
  27201. // region as this pool.
  27202. Instances []string `json:"instances,omitempty"`
  27203. // Kind: [Output Only] Type of the resource. Always compute#targetPool
  27204. // for target pools.
  27205. Kind string `json:"kind,omitempty"`
  27206. // Name: Name of the resource. Provided by the client when the resource
  27207. // is created. The name must be 1-63 characters long, and comply with
  27208. // RFC1035. Specifically, the name must be 1-63 characters long and
  27209. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  27210. // the first character must be a lowercase letter, and all following
  27211. // characters must be a dash, lowercase letter, or digit, except the
  27212. // last character, which cannot be a dash.
  27213. Name string `json:"name,omitempty"`
  27214. // Region: [Output Only] URL of the region where the target pool
  27215. // resides.
  27216. Region string `json:"region,omitempty"`
  27217. // SelfLink: [Output Only] Server-defined URL for the resource.
  27218. SelfLink string `json:"selfLink,omitempty"`
  27219. // SessionAffinity: Sesssion affinity option, must be one of the
  27220. // following values:
  27221. // NONE: Connections from the same client IP may go to any instance in
  27222. // the pool.
  27223. // CLIENT_IP: Connections from the same client IP will go to the same
  27224. // instance in the pool while that instance remains
  27225. // healthy.
  27226. // CLIENT_IP_PROTO: Connections from the same client IP with the same IP
  27227. // protocol will go to the same instance in the pool while that instance
  27228. // remains healthy.
  27229. //
  27230. // Possible values:
  27231. // "CLIENT_IP"
  27232. // "CLIENT_IP_PORT_PROTO"
  27233. // "CLIENT_IP_PROTO"
  27234. // "GENERATED_COOKIE"
  27235. // "NONE"
  27236. SessionAffinity string `json:"sessionAffinity,omitempty"`
  27237. // ServerResponse contains the HTTP response code and headers from the
  27238. // server.
  27239. googleapi.ServerResponse `json:"-"`
  27240. // ForceSendFields is a list of field names (e.g. "BackupPool") to
  27241. // unconditionally include in API requests. By default, fields with
  27242. // empty values are omitted from API requests. However, any non-pointer,
  27243. // non-interface field appearing in ForceSendFields will be sent to the
  27244. // server regardless of whether the field is empty or not. This may be
  27245. // used to include empty fields in Patch requests.
  27246. ForceSendFields []string `json:"-"`
  27247. // NullFields is a list of field names (e.g. "BackupPool") to include in
  27248. // API requests with the JSON null value. By default, fields with empty
  27249. // values are omitted from API requests. However, any field with an
  27250. // empty value appearing in NullFields will be sent to the server as
  27251. // null. It is an error if a field in this list has a non-empty value.
  27252. // This may be used to include null fields in Patch requests.
  27253. NullFields []string `json:"-"`
  27254. }
  27255. func (s *TargetPool) MarshalJSON() ([]byte, error) {
  27256. type NoMethod TargetPool
  27257. raw := NoMethod(*s)
  27258. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27259. }
  27260. func (s *TargetPool) UnmarshalJSON(data []byte) error {
  27261. type NoMethod TargetPool
  27262. var s1 struct {
  27263. FailoverRatio gensupport.JSONFloat64 `json:"failoverRatio"`
  27264. *NoMethod
  27265. }
  27266. s1.NoMethod = (*NoMethod)(s)
  27267. if err := json.Unmarshal(data, &s1); err != nil {
  27268. return err
  27269. }
  27270. s.FailoverRatio = float64(s1.FailoverRatio)
  27271. return nil
  27272. }
  27273. type TargetPoolAggregatedList struct {
  27274. // Id: [Output Only] Unique identifier for the resource; defined by the
  27275. // server.
  27276. Id string `json:"id,omitempty"`
  27277. // Items: A list of TargetPool resources.
  27278. Items map[string]TargetPoolsScopedList `json:"items,omitempty"`
  27279. // Kind: [Output Only] Type of resource. Always
  27280. // compute#targetPoolAggregatedList for aggregated lists of target
  27281. // pools.
  27282. Kind string `json:"kind,omitempty"`
  27283. // NextPageToken: [Output Only] This token allows you to get the next
  27284. // page of results for list requests. If the number of results is larger
  27285. // than maxResults, use the nextPageToken as a value for the query
  27286. // parameter pageToken in the next list request. Subsequent list
  27287. // requests will have their own nextPageToken to continue paging through
  27288. // the results.
  27289. NextPageToken string `json:"nextPageToken,omitempty"`
  27290. // SelfLink: [Output Only] Server-defined URL for this resource.
  27291. SelfLink string `json:"selfLink,omitempty"`
  27292. // Warning: [Output Only] Informational warning message.
  27293. Warning *TargetPoolAggregatedListWarning `json:"warning,omitempty"`
  27294. // ServerResponse contains the HTTP response code and headers from the
  27295. // server.
  27296. googleapi.ServerResponse `json:"-"`
  27297. // ForceSendFields is a list of field names (e.g. "Id") to
  27298. // unconditionally include in API requests. By default, fields with
  27299. // empty values are omitted from API requests. However, any non-pointer,
  27300. // non-interface field appearing in ForceSendFields will be sent to the
  27301. // server regardless of whether the field is empty or not. This may be
  27302. // used to include empty fields in Patch requests.
  27303. ForceSendFields []string `json:"-"`
  27304. // NullFields is a list of field names (e.g. "Id") to include in API
  27305. // requests with the JSON null value. By default, fields with empty
  27306. // values are omitted from API requests. However, any field with an
  27307. // empty value appearing in NullFields will be sent to the server as
  27308. // null. It is an error if a field in this list has a non-empty value.
  27309. // This may be used to include null fields in Patch requests.
  27310. NullFields []string `json:"-"`
  27311. }
  27312. func (s *TargetPoolAggregatedList) MarshalJSON() ([]byte, error) {
  27313. type NoMethod TargetPoolAggregatedList
  27314. raw := NoMethod(*s)
  27315. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27316. }
  27317. // TargetPoolAggregatedListWarning: [Output Only] Informational warning
  27318. // message.
  27319. type TargetPoolAggregatedListWarning struct {
  27320. // Code: [Output Only] A warning code, if applicable. For example,
  27321. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  27322. // the response.
  27323. //
  27324. // Possible values:
  27325. // "CLEANUP_FAILED"
  27326. // "DEPRECATED_RESOURCE_USED"
  27327. // "DEPRECATED_TYPE_USED"
  27328. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  27329. // "EXPERIMENTAL_TYPE_USED"
  27330. // "EXTERNAL_API_WARNING"
  27331. // "FIELD_VALUE_OVERRIDEN"
  27332. // "INJECTED_KERNELS_DEPRECATED"
  27333. // "MISSING_TYPE_DEPENDENCY"
  27334. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  27335. // "NEXT_HOP_CANNOT_IP_FORWARD"
  27336. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  27337. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  27338. // "NEXT_HOP_NOT_RUNNING"
  27339. // "NOT_CRITICAL_ERROR"
  27340. // "NO_RESULTS_ON_PAGE"
  27341. // "REQUIRED_TOS_AGREEMENT"
  27342. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  27343. // "RESOURCE_NOT_DELETED"
  27344. // "SCHEMA_VALIDATION_IGNORED"
  27345. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  27346. // "UNDECLARED_PROPERTIES"
  27347. // "UNREACHABLE"
  27348. Code string `json:"code,omitempty"`
  27349. // Data: [Output Only] Metadata about this warning in key: value format.
  27350. // For example:
  27351. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  27352. Data []*TargetPoolAggregatedListWarningData `json:"data,omitempty"`
  27353. // Message: [Output Only] A human-readable description of the warning
  27354. // code.
  27355. Message string `json:"message,omitempty"`
  27356. // ForceSendFields is a list of field names (e.g. "Code") to
  27357. // unconditionally include in API requests. By default, fields with
  27358. // empty values are omitted from API requests. However, any non-pointer,
  27359. // non-interface field appearing in ForceSendFields will be sent to the
  27360. // server regardless of whether the field is empty or not. This may be
  27361. // used to include empty fields in Patch requests.
  27362. ForceSendFields []string `json:"-"`
  27363. // NullFields is a list of field names (e.g. "Code") to include in API
  27364. // requests with the JSON null value. By default, fields with empty
  27365. // values are omitted from API requests. However, any field with an
  27366. // empty value appearing in NullFields will be sent to the server as
  27367. // null. It is an error if a field in this list has a non-empty value.
  27368. // This may be used to include null fields in Patch requests.
  27369. NullFields []string `json:"-"`
  27370. }
  27371. func (s *TargetPoolAggregatedListWarning) MarshalJSON() ([]byte, error) {
  27372. type NoMethod TargetPoolAggregatedListWarning
  27373. raw := NoMethod(*s)
  27374. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27375. }
  27376. type TargetPoolAggregatedListWarningData struct {
  27377. // Key: [Output Only] A key that provides more detail on the warning
  27378. // being returned. For example, for warnings where there are no results
  27379. // in a list request for a particular zone, this key might be scope and
  27380. // the key value might be the zone name. Other examples might be a key
  27381. // indicating a deprecated resource and a suggested replacement, or a
  27382. // warning about invalid network settings (for example, if an instance
  27383. // attempts to perform IP forwarding but is not enabled for IP
  27384. // forwarding).
  27385. Key string `json:"key,omitempty"`
  27386. // Value: [Output Only] A warning data value corresponding to the key.
  27387. Value string `json:"value,omitempty"`
  27388. // ForceSendFields is a list of field names (e.g. "Key") to
  27389. // unconditionally include in API requests. By default, fields with
  27390. // empty values are omitted from API requests. However, any non-pointer,
  27391. // non-interface field appearing in ForceSendFields will be sent to the
  27392. // server regardless of whether the field is empty or not. This may be
  27393. // used to include empty fields in Patch requests.
  27394. ForceSendFields []string `json:"-"`
  27395. // NullFields is a list of field names (e.g. "Key") to include in API
  27396. // requests with the JSON null value. By default, fields with empty
  27397. // values are omitted from API requests. However, any field with an
  27398. // empty value appearing in NullFields will be sent to the server as
  27399. // null. It is an error if a field in this list has a non-empty value.
  27400. // This may be used to include null fields in Patch requests.
  27401. NullFields []string `json:"-"`
  27402. }
  27403. func (s *TargetPoolAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  27404. type NoMethod TargetPoolAggregatedListWarningData
  27405. raw := NoMethod(*s)
  27406. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27407. }
  27408. type TargetPoolInstanceHealth struct {
  27409. HealthStatus []*HealthStatus `json:"healthStatus,omitempty"`
  27410. // Kind: [Output Only] Type of resource. Always
  27411. // compute#targetPoolInstanceHealth when checking the health of an
  27412. // instance.
  27413. Kind string `json:"kind,omitempty"`
  27414. // ServerResponse contains the HTTP response code and headers from the
  27415. // server.
  27416. googleapi.ServerResponse `json:"-"`
  27417. // ForceSendFields is a list of field names (e.g. "HealthStatus") to
  27418. // unconditionally include in API requests. By default, fields with
  27419. // empty values are omitted from API requests. However, any non-pointer,
  27420. // non-interface field appearing in ForceSendFields will be sent to the
  27421. // server regardless of whether the field is empty or not. This may be
  27422. // used to include empty fields in Patch requests.
  27423. ForceSendFields []string `json:"-"`
  27424. // NullFields is a list of field names (e.g. "HealthStatus") to include
  27425. // in API requests with the JSON null value. By default, fields with
  27426. // empty values are omitted from API requests. However, any field with
  27427. // an empty value appearing in NullFields will be sent to the server as
  27428. // null. It is an error if a field in this list has a non-empty value.
  27429. // This may be used to include null fields in Patch requests.
  27430. NullFields []string `json:"-"`
  27431. }
  27432. func (s *TargetPoolInstanceHealth) MarshalJSON() ([]byte, error) {
  27433. type NoMethod TargetPoolInstanceHealth
  27434. raw := NoMethod(*s)
  27435. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27436. }
  27437. // TargetPoolList: Contains a list of TargetPool resources.
  27438. type TargetPoolList struct {
  27439. // Id: [Output Only] Unique identifier for the resource; defined by the
  27440. // server.
  27441. Id string `json:"id,omitempty"`
  27442. // Items: A list of TargetPool resources.
  27443. Items []*TargetPool `json:"items,omitempty"`
  27444. // Kind: [Output Only] Type of resource. Always compute#targetPoolList
  27445. // for lists of target pools.
  27446. Kind string `json:"kind,omitempty"`
  27447. // NextPageToken: [Output Only] This token allows you to get the next
  27448. // page of results for list requests. If the number of results is larger
  27449. // than maxResults, use the nextPageToken as a value for the query
  27450. // parameter pageToken in the next list request. Subsequent list
  27451. // requests will have their own nextPageToken to continue paging through
  27452. // the results.
  27453. NextPageToken string `json:"nextPageToken,omitempty"`
  27454. // SelfLink: [Output Only] Server-defined URL for this resource.
  27455. SelfLink string `json:"selfLink,omitempty"`
  27456. // Warning: [Output Only] Informational warning message.
  27457. Warning *TargetPoolListWarning `json:"warning,omitempty"`
  27458. // ServerResponse contains the HTTP response code and headers from the
  27459. // server.
  27460. googleapi.ServerResponse `json:"-"`
  27461. // ForceSendFields is a list of field names (e.g. "Id") to
  27462. // unconditionally include in API requests. By default, fields with
  27463. // empty values are omitted from API requests. However, any non-pointer,
  27464. // non-interface field appearing in ForceSendFields will be sent to the
  27465. // server regardless of whether the field is empty or not. This may be
  27466. // used to include empty fields in Patch requests.
  27467. ForceSendFields []string `json:"-"`
  27468. // NullFields is a list of field names (e.g. "Id") to include in API
  27469. // requests with the JSON null value. By default, fields with empty
  27470. // values are omitted from API requests. However, any field with an
  27471. // empty value appearing in NullFields will be sent to the server as
  27472. // null. It is an error if a field in this list has a non-empty value.
  27473. // This may be used to include null fields in Patch requests.
  27474. NullFields []string `json:"-"`
  27475. }
  27476. func (s *TargetPoolList) MarshalJSON() ([]byte, error) {
  27477. type NoMethod TargetPoolList
  27478. raw := NoMethod(*s)
  27479. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27480. }
  27481. // TargetPoolListWarning: [Output Only] Informational warning message.
  27482. type TargetPoolListWarning struct {
  27483. // Code: [Output Only] A warning code, if applicable. For example,
  27484. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  27485. // the response.
  27486. //
  27487. // Possible values:
  27488. // "CLEANUP_FAILED"
  27489. // "DEPRECATED_RESOURCE_USED"
  27490. // "DEPRECATED_TYPE_USED"
  27491. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  27492. // "EXPERIMENTAL_TYPE_USED"
  27493. // "EXTERNAL_API_WARNING"
  27494. // "FIELD_VALUE_OVERRIDEN"
  27495. // "INJECTED_KERNELS_DEPRECATED"
  27496. // "MISSING_TYPE_DEPENDENCY"
  27497. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  27498. // "NEXT_HOP_CANNOT_IP_FORWARD"
  27499. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  27500. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  27501. // "NEXT_HOP_NOT_RUNNING"
  27502. // "NOT_CRITICAL_ERROR"
  27503. // "NO_RESULTS_ON_PAGE"
  27504. // "REQUIRED_TOS_AGREEMENT"
  27505. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  27506. // "RESOURCE_NOT_DELETED"
  27507. // "SCHEMA_VALIDATION_IGNORED"
  27508. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  27509. // "UNDECLARED_PROPERTIES"
  27510. // "UNREACHABLE"
  27511. Code string `json:"code,omitempty"`
  27512. // Data: [Output Only] Metadata about this warning in key: value format.
  27513. // For example:
  27514. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  27515. Data []*TargetPoolListWarningData `json:"data,omitempty"`
  27516. // Message: [Output Only] A human-readable description of the warning
  27517. // code.
  27518. Message string `json:"message,omitempty"`
  27519. // ForceSendFields is a list of field names (e.g. "Code") to
  27520. // unconditionally include in API requests. By default, fields with
  27521. // empty values are omitted from API requests. However, any non-pointer,
  27522. // non-interface field appearing in ForceSendFields will be sent to the
  27523. // server regardless of whether the field is empty or not. This may be
  27524. // used to include empty fields in Patch requests.
  27525. ForceSendFields []string `json:"-"`
  27526. // NullFields is a list of field names (e.g. "Code") to include in API
  27527. // requests with the JSON null value. By default, fields with empty
  27528. // values are omitted from API requests. However, any field with an
  27529. // empty value appearing in NullFields will be sent to the server as
  27530. // null. It is an error if a field in this list has a non-empty value.
  27531. // This may be used to include null fields in Patch requests.
  27532. NullFields []string `json:"-"`
  27533. }
  27534. func (s *TargetPoolListWarning) MarshalJSON() ([]byte, error) {
  27535. type NoMethod TargetPoolListWarning
  27536. raw := NoMethod(*s)
  27537. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27538. }
  27539. type TargetPoolListWarningData struct {
  27540. // Key: [Output Only] A key that provides more detail on the warning
  27541. // being returned. For example, for warnings where there are no results
  27542. // in a list request for a particular zone, this key might be scope and
  27543. // the key value might be the zone name. Other examples might be a key
  27544. // indicating a deprecated resource and a suggested replacement, or a
  27545. // warning about invalid network settings (for example, if an instance
  27546. // attempts to perform IP forwarding but is not enabled for IP
  27547. // forwarding).
  27548. Key string `json:"key,omitempty"`
  27549. // Value: [Output Only] A warning data value corresponding to the key.
  27550. Value string `json:"value,omitempty"`
  27551. // ForceSendFields is a list of field names (e.g. "Key") to
  27552. // unconditionally include in API requests. By default, fields with
  27553. // empty values are omitted from API requests. However, any non-pointer,
  27554. // non-interface field appearing in ForceSendFields will be sent to the
  27555. // server regardless of whether the field is empty or not. This may be
  27556. // used to include empty fields in Patch requests.
  27557. ForceSendFields []string `json:"-"`
  27558. // NullFields is a list of field names (e.g. "Key") to include in API
  27559. // requests with the JSON null value. By default, fields with empty
  27560. // values are omitted from API requests. However, any field with an
  27561. // empty value appearing in NullFields will be sent to the server as
  27562. // null. It is an error if a field in this list has a non-empty value.
  27563. // This may be used to include null fields in Patch requests.
  27564. NullFields []string `json:"-"`
  27565. }
  27566. func (s *TargetPoolListWarningData) MarshalJSON() ([]byte, error) {
  27567. type NoMethod TargetPoolListWarningData
  27568. raw := NoMethod(*s)
  27569. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27570. }
  27571. type TargetPoolsAddHealthCheckRequest struct {
  27572. // HealthChecks: The HttpHealthCheck to add to the target pool.
  27573. HealthChecks []*HealthCheckReference `json:"healthChecks,omitempty"`
  27574. // ForceSendFields is a list of field names (e.g. "HealthChecks") to
  27575. // unconditionally include in API requests. By default, fields with
  27576. // empty values are omitted from API requests. However, any non-pointer,
  27577. // non-interface field appearing in ForceSendFields will be sent to the
  27578. // server regardless of whether the field is empty or not. This may be
  27579. // used to include empty fields in Patch requests.
  27580. ForceSendFields []string `json:"-"`
  27581. // NullFields is a list of field names (e.g. "HealthChecks") to include
  27582. // in API requests with the JSON null value. By default, fields with
  27583. // empty values are omitted from API requests. However, any field with
  27584. // an empty value appearing in NullFields will be sent to the server as
  27585. // null. It is an error if a field in this list has a non-empty value.
  27586. // This may be used to include null fields in Patch requests.
  27587. NullFields []string `json:"-"`
  27588. }
  27589. func (s *TargetPoolsAddHealthCheckRequest) MarshalJSON() ([]byte, error) {
  27590. type NoMethod TargetPoolsAddHealthCheckRequest
  27591. raw := NoMethod(*s)
  27592. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27593. }
  27594. type TargetPoolsAddInstanceRequest struct {
  27595. // Instances: A full or partial URL to an instance to add to this target
  27596. // pool. This can be a full or partial URL. For example, the following
  27597. // are valid URLs:
  27598. // -
  27599. // https://www.googleapis.com/compute/v1/projects/project-id/zones/zone/instances/instance-name
  27600. // - projects/project-id/zones/zone/instances/instance-name
  27601. // - zones/zone/instances/instance-name
  27602. Instances []*InstanceReference `json:"instances,omitempty"`
  27603. // ForceSendFields is a list of field names (e.g. "Instances") to
  27604. // unconditionally include in API requests. By default, fields with
  27605. // empty values are omitted from API requests. However, any non-pointer,
  27606. // non-interface field appearing in ForceSendFields will be sent to the
  27607. // server regardless of whether the field is empty or not. This may be
  27608. // used to include empty fields in Patch requests.
  27609. ForceSendFields []string `json:"-"`
  27610. // NullFields is a list of field names (e.g. "Instances") to include in
  27611. // API requests with the JSON null value. By default, fields with empty
  27612. // values are omitted from API requests. However, any field with an
  27613. // empty value appearing in NullFields will be sent to the server as
  27614. // null. It is an error if a field in this list has a non-empty value.
  27615. // This may be used to include null fields in Patch requests.
  27616. NullFields []string `json:"-"`
  27617. }
  27618. func (s *TargetPoolsAddInstanceRequest) MarshalJSON() ([]byte, error) {
  27619. type NoMethod TargetPoolsAddInstanceRequest
  27620. raw := NoMethod(*s)
  27621. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27622. }
  27623. type TargetPoolsRemoveHealthCheckRequest struct {
  27624. // HealthChecks: Health check URL to be removed. This can be a full or
  27625. // valid partial URL. For example, the following are valid URLs:
  27626. // -
  27627. // https://www.googleapis.com/compute/beta/projects/project/global/httpHealthChecks/health-check
  27628. // - projects/project/global/httpHealthChecks/health-check
  27629. // - global/httpHealthChecks/health-check
  27630. HealthChecks []*HealthCheckReference `json:"healthChecks,omitempty"`
  27631. // ForceSendFields is a list of field names (e.g. "HealthChecks") to
  27632. // unconditionally include in API requests. By default, fields with
  27633. // empty values are omitted from API requests. However, any non-pointer,
  27634. // non-interface field appearing in ForceSendFields will be sent to the
  27635. // server regardless of whether the field is empty or not. This may be
  27636. // used to include empty fields in Patch requests.
  27637. ForceSendFields []string `json:"-"`
  27638. // NullFields is a list of field names (e.g. "HealthChecks") to include
  27639. // in API requests with the JSON null value. By default, fields with
  27640. // empty values are omitted from API requests. However, any field with
  27641. // an empty value appearing in NullFields will be sent to the server as
  27642. // null. It is an error if a field in this list has a non-empty value.
  27643. // This may be used to include null fields in Patch requests.
  27644. NullFields []string `json:"-"`
  27645. }
  27646. func (s *TargetPoolsRemoveHealthCheckRequest) MarshalJSON() ([]byte, error) {
  27647. type NoMethod TargetPoolsRemoveHealthCheckRequest
  27648. raw := NoMethod(*s)
  27649. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27650. }
  27651. type TargetPoolsRemoveInstanceRequest struct {
  27652. // Instances: URLs of the instances to be removed from target pool.
  27653. Instances []*InstanceReference `json:"instances,omitempty"`
  27654. // ForceSendFields is a list of field names (e.g. "Instances") to
  27655. // unconditionally include in API requests. By default, fields with
  27656. // empty values are omitted from API requests. However, any non-pointer,
  27657. // non-interface field appearing in ForceSendFields will be sent to the
  27658. // server regardless of whether the field is empty or not. This may be
  27659. // used to include empty fields in Patch requests.
  27660. ForceSendFields []string `json:"-"`
  27661. // NullFields is a list of field names (e.g. "Instances") to include in
  27662. // API requests with the JSON null value. By default, fields with empty
  27663. // values are omitted from API requests. However, any field with an
  27664. // empty value appearing in NullFields will be sent to the server as
  27665. // null. It is an error if a field in this list has a non-empty value.
  27666. // This may be used to include null fields in Patch requests.
  27667. NullFields []string `json:"-"`
  27668. }
  27669. func (s *TargetPoolsRemoveInstanceRequest) MarshalJSON() ([]byte, error) {
  27670. type NoMethod TargetPoolsRemoveInstanceRequest
  27671. raw := NoMethod(*s)
  27672. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27673. }
  27674. type TargetPoolsScopedList struct {
  27675. // TargetPools: A list of target pools contained in this scope.
  27676. TargetPools []*TargetPool `json:"targetPools,omitempty"`
  27677. // Warning: Informational warning which replaces the list of addresses
  27678. // when the list is empty.
  27679. Warning *TargetPoolsScopedListWarning `json:"warning,omitempty"`
  27680. // ForceSendFields is a list of field names (e.g. "TargetPools") to
  27681. // unconditionally include in API requests. By default, fields with
  27682. // empty values are omitted from API requests. However, any non-pointer,
  27683. // non-interface field appearing in ForceSendFields will be sent to the
  27684. // server regardless of whether the field is empty or not. This may be
  27685. // used to include empty fields in Patch requests.
  27686. ForceSendFields []string `json:"-"`
  27687. // NullFields is a list of field names (e.g. "TargetPools") to include
  27688. // in API requests with the JSON null value. By default, fields with
  27689. // empty values are omitted from API requests. However, any field with
  27690. // an empty value appearing in NullFields will be sent to the server as
  27691. // null. It is an error if a field in this list has a non-empty value.
  27692. // This may be used to include null fields in Patch requests.
  27693. NullFields []string `json:"-"`
  27694. }
  27695. func (s *TargetPoolsScopedList) MarshalJSON() ([]byte, error) {
  27696. type NoMethod TargetPoolsScopedList
  27697. raw := NoMethod(*s)
  27698. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27699. }
  27700. // TargetPoolsScopedListWarning: Informational warning which replaces
  27701. // the list of addresses when the list is empty.
  27702. type TargetPoolsScopedListWarning struct {
  27703. // Code: [Output Only] A warning code, if applicable. For example,
  27704. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  27705. // the response.
  27706. //
  27707. // Possible values:
  27708. // "CLEANUP_FAILED"
  27709. // "DEPRECATED_RESOURCE_USED"
  27710. // "DEPRECATED_TYPE_USED"
  27711. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  27712. // "EXPERIMENTAL_TYPE_USED"
  27713. // "EXTERNAL_API_WARNING"
  27714. // "FIELD_VALUE_OVERRIDEN"
  27715. // "INJECTED_KERNELS_DEPRECATED"
  27716. // "MISSING_TYPE_DEPENDENCY"
  27717. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  27718. // "NEXT_HOP_CANNOT_IP_FORWARD"
  27719. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  27720. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  27721. // "NEXT_HOP_NOT_RUNNING"
  27722. // "NOT_CRITICAL_ERROR"
  27723. // "NO_RESULTS_ON_PAGE"
  27724. // "REQUIRED_TOS_AGREEMENT"
  27725. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  27726. // "RESOURCE_NOT_DELETED"
  27727. // "SCHEMA_VALIDATION_IGNORED"
  27728. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  27729. // "UNDECLARED_PROPERTIES"
  27730. // "UNREACHABLE"
  27731. Code string `json:"code,omitempty"`
  27732. // Data: [Output Only] Metadata about this warning in key: value format.
  27733. // For example:
  27734. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  27735. Data []*TargetPoolsScopedListWarningData `json:"data,omitempty"`
  27736. // Message: [Output Only] A human-readable description of the warning
  27737. // code.
  27738. Message string `json:"message,omitempty"`
  27739. // ForceSendFields is a list of field names (e.g. "Code") to
  27740. // unconditionally include in API requests. By default, fields with
  27741. // empty values are omitted from API requests. However, any non-pointer,
  27742. // non-interface field appearing in ForceSendFields will be sent to the
  27743. // server regardless of whether the field is empty or not. This may be
  27744. // used to include empty fields in Patch requests.
  27745. ForceSendFields []string `json:"-"`
  27746. // NullFields is a list of field names (e.g. "Code") to include in API
  27747. // requests with the JSON null value. By default, fields with empty
  27748. // values are omitted from API requests. However, any field with an
  27749. // empty value appearing in NullFields will be sent to the server as
  27750. // null. It is an error if a field in this list has a non-empty value.
  27751. // This may be used to include null fields in Patch requests.
  27752. NullFields []string `json:"-"`
  27753. }
  27754. func (s *TargetPoolsScopedListWarning) MarshalJSON() ([]byte, error) {
  27755. type NoMethod TargetPoolsScopedListWarning
  27756. raw := NoMethod(*s)
  27757. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27758. }
  27759. type TargetPoolsScopedListWarningData struct {
  27760. // Key: [Output Only] A key that provides more detail on the warning
  27761. // being returned. For example, for warnings where there are no results
  27762. // in a list request for a particular zone, this key might be scope and
  27763. // the key value might be the zone name. Other examples might be a key
  27764. // indicating a deprecated resource and a suggested replacement, or a
  27765. // warning about invalid network settings (for example, if an instance
  27766. // attempts to perform IP forwarding but is not enabled for IP
  27767. // forwarding).
  27768. Key string `json:"key,omitempty"`
  27769. // Value: [Output Only] A warning data value corresponding to the key.
  27770. Value string `json:"value,omitempty"`
  27771. // ForceSendFields is a list of field names (e.g. "Key") to
  27772. // unconditionally include in API requests. By default, fields with
  27773. // empty values are omitted from API requests. However, any non-pointer,
  27774. // non-interface field appearing in ForceSendFields will be sent to the
  27775. // server regardless of whether the field is empty or not. This may be
  27776. // used to include empty fields in Patch requests.
  27777. ForceSendFields []string `json:"-"`
  27778. // NullFields is a list of field names (e.g. "Key") to include in API
  27779. // requests with the JSON null value. By default, fields with empty
  27780. // values are omitted from API requests. However, any field with an
  27781. // empty value appearing in NullFields will be sent to the server as
  27782. // null. It is an error if a field in this list has a non-empty value.
  27783. // This may be used to include null fields in Patch requests.
  27784. NullFields []string `json:"-"`
  27785. }
  27786. func (s *TargetPoolsScopedListWarningData) MarshalJSON() ([]byte, error) {
  27787. type NoMethod TargetPoolsScopedListWarningData
  27788. raw := NoMethod(*s)
  27789. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27790. }
  27791. type TargetReference struct {
  27792. Target string `json:"target,omitempty"`
  27793. // ForceSendFields is a list of field names (e.g. "Target") to
  27794. // unconditionally include in API requests. By default, fields with
  27795. // empty values are omitted from API requests. However, any non-pointer,
  27796. // non-interface field appearing in ForceSendFields will be sent to the
  27797. // server regardless of whether the field is empty or not. This may be
  27798. // used to include empty fields in Patch requests.
  27799. ForceSendFields []string `json:"-"`
  27800. // NullFields is a list of field names (e.g. "Target") to include in API
  27801. // requests with the JSON null value. By default, fields with empty
  27802. // values are omitted from API requests. However, any field with an
  27803. // empty value appearing in NullFields will be sent to the server as
  27804. // null. It is an error if a field in this list has a non-empty value.
  27805. // This may be used to include null fields in Patch requests.
  27806. NullFields []string `json:"-"`
  27807. }
  27808. func (s *TargetReference) MarshalJSON() ([]byte, error) {
  27809. type NoMethod TargetReference
  27810. raw := NoMethod(*s)
  27811. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27812. }
  27813. type TargetSslProxiesSetBackendServiceRequest struct {
  27814. // Service: The URL of the new BackendService resource for the
  27815. // targetSslProxy.
  27816. Service string `json:"service,omitempty"`
  27817. // ForceSendFields is a list of field names (e.g. "Service") to
  27818. // unconditionally include in API requests. By default, fields with
  27819. // empty values are omitted from API requests. However, any non-pointer,
  27820. // non-interface field appearing in ForceSendFields will be sent to the
  27821. // server regardless of whether the field is empty or not. This may be
  27822. // used to include empty fields in Patch requests.
  27823. ForceSendFields []string `json:"-"`
  27824. // NullFields is a list of field names (e.g. "Service") to include in
  27825. // API requests with the JSON null value. By default, fields with empty
  27826. // values are omitted from API requests. However, any field with an
  27827. // empty value appearing in NullFields will be sent to the server as
  27828. // null. It is an error if a field in this list has a non-empty value.
  27829. // This may be used to include null fields in Patch requests.
  27830. NullFields []string `json:"-"`
  27831. }
  27832. func (s *TargetSslProxiesSetBackendServiceRequest) MarshalJSON() ([]byte, error) {
  27833. type NoMethod TargetSslProxiesSetBackendServiceRequest
  27834. raw := NoMethod(*s)
  27835. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27836. }
  27837. type TargetSslProxiesSetProxyHeaderRequest struct {
  27838. // ProxyHeader: The new type of proxy header to append before sending
  27839. // data to the backend. NONE or PROXY_V1 are allowed.
  27840. //
  27841. // Possible values:
  27842. // "NONE"
  27843. // "PROXY_V1"
  27844. ProxyHeader string `json:"proxyHeader,omitempty"`
  27845. // ForceSendFields is a list of field names (e.g. "ProxyHeader") to
  27846. // unconditionally include in API requests. By default, fields with
  27847. // empty values are omitted from API requests. However, any non-pointer,
  27848. // non-interface field appearing in ForceSendFields will be sent to the
  27849. // server regardless of whether the field is empty or not. This may be
  27850. // used to include empty fields in Patch requests.
  27851. ForceSendFields []string `json:"-"`
  27852. // NullFields is a list of field names (e.g. "ProxyHeader") to include
  27853. // in API requests with the JSON null value. By default, fields with
  27854. // empty values are omitted from API requests. However, any field with
  27855. // an empty value appearing in NullFields will be sent to the server as
  27856. // null. It is an error if a field in this list has a non-empty value.
  27857. // This may be used to include null fields in Patch requests.
  27858. NullFields []string `json:"-"`
  27859. }
  27860. func (s *TargetSslProxiesSetProxyHeaderRequest) MarshalJSON() ([]byte, error) {
  27861. type NoMethod TargetSslProxiesSetProxyHeaderRequest
  27862. raw := NoMethod(*s)
  27863. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27864. }
  27865. type TargetSslProxiesSetSslCertificatesRequest struct {
  27866. // SslCertificates: New set of URLs to SslCertificate resources to
  27867. // associate with this TargetSslProxy. Currently exactly one ssl
  27868. // certificate must be specified.
  27869. SslCertificates []string `json:"sslCertificates,omitempty"`
  27870. // ForceSendFields is a list of field names (e.g. "SslCertificates") to
  27871. // unconditionally include in API requests. By default, fields with
  27872. // empty values are omitted from API requests. However, any non-pointer,
  27873. // non-interface field appearing in ForceSendFields will be sent to the
  27874. // server regardless of whether the field is empty or not. This may be
  27875. // used to include empty fields in Patch requests.
  27876. ForceSendFields []string `json:"-"`
  27877. // NullFields is a list of field names (e.g. "SslCertificates") to
  27878. // include in API requests with the JSON null value. By default, fields
  27879. // with empty values are omitted from API requests. However, any field
  27880. // with an empty value appearing in NullFields will be sent to the
  27881. // server as null. It is an error if a field in this list has a
  27882. // non-empty value. This may be used to include null fields in Patch
  27883. // requests.
  27884. NullFields []string `json:"-"`
  27885. }
  27886. func (s *TargetSslProxiesSetSslCertificatesRequest) MarshalJSON() ([]byte, error) {
  27887. type NoMethod TargetSslProxiesSetSslCertificatesRequest
  27888. raw := NoMethod(*s)
  27889. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27890. }
  27891. // TargetSslProxy: A TargetSslProxy resource. This resource defines an
  27892. // SSL proxy. (== resource_for beta.targetSslProxies ==) (==
  27893. // resource_for v1.targetSslProxies ==)
  27894. type TargetSslProxy struct {
  27895. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  27896. // format.
  27897. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  27898. // Description: An optional description of this resource. Provide this
  27899. // property when you create the resource.
  27900. Description string `json:"description,omitempty"`
  27901. // Id: [Output Only] The unique identifier for the resource. This
  27902. // identifier is defined by the server.
  27903. Id uint64 `json:"id,omitempty,string"`
  27904. // Kind: [Output Only] Type of the resource. Always
  27905. // compute#targetSslProxy for target SSL proxies.
  27906. Kind string `json:"kind,omitempty"`
  27907. // Name: Name of the resource. Provided by the client when the resource
  27908. // is created. The name must be 1-63 characters long, and comply with
  27909. // RFC1035. Specifically, the name must be 1-63 characters long and
  27910. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  27911. // the first character must be a lowercase letter, and all following
  27912. // characters must be a dash, lowercase letter, or digit, except the
  27913. // last character, which cannot be a dash.
  27914. Name string `json:"name,omitempty"`
  27915. // ProxyHeader: Specifies the type of proxy header to append before
  27916. // sending data to the backend, either NONE or PROXY_V1. The default is
  27917. // NONE.
  27918. //
  27919. // Possible values:
  27920. // "NONE"
  27921. // "PROXY_V1"
  27922. ProxyHeader string `json:"proxyHeader,omitempty"`
  27923. // SelfLink: [Output Only] Server-defined URL for the resource.
  27924. SelfLink string `json:"selfLink,omitempty"`
  27925. // Service: URL to the BackendService resource.
  27926. Service string `json:"service,omitempty"`
  27927. // SslCertificates: URLs to SslCertificate resources that are used to
  27928. // authenticate connections to Backends. Currently exactly one SSL
  27929. // certificate must be specified.
  27930. SslCertificates []string `json:"sslCertificates,omitempty"`
  27931. // SslPolicy: URL of SslPolicy resource that will be associated with the
  27932. // TargetSslProxy resource. If not set, the TargetSslProxy resource will
  27933. // not have any SSL policy configured.
  27934. SslPolicy string `json:"sslPolicy,omitempty"`
  27935. // ServerResponse contains the HTTP response code and headers from the
  27936. // server.
  27937. googleapi.ServerResponse `json:"-"`
  27938. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  27939. // to unconditionally include in API requests. By default, fields with
  27940. // empty values are omitted from API requests. However, any non-pointer,
  27941. // non-interface field appearing in ForceSendFields will be sent to the
  27942. // server regardless of whether the field is empty or not. This may be
  27943. // used to include empty fields in Patch requests.
  27944. ForceSendFields []string `json:"-"`
  27945. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  27946. // include in API requests with the JSON null value. By default, fields
  27947. // with empty values are omitted from API requests. However, any field
  27948. // with an empty value appearing in NullFields will be sent to the
  27949. // server as null. It is an error if a field in this list has a
  27950. // non-empty value. This may be used to include null fields in Patch
  27951. // requests.
  27952. NullFields []string `json:"-"`
  27953. }
  27954. func (s *TargetSslProxy) MarshalJSON() ([]byte, error) {
  27955. type NoMethod TargetSslProxy
  27956. raw := NoMethod(*s)
  27957. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27958. }
  27959. // TargetSslProxyList: Contains a list of TargetSslProxy resources.
  27960. type TargetSslProxyList struct {
  27961. // Id: [Output Only] Unique identifier for the resource; defined by the
  27962. // server.
  27963. Id string `json:"id,omitempty"`
  27964. // Items: A list of TargetSslProxy resources.
  27965. Items []*TargetSslProxy `json:"items,omitempty"`
  27966. // Kind: Type of resource.
  27967. Kind string `json:"kind,omitempty"`
  27968. // NextPageToken: [Output Only] This token allows you to get the next
  27969. // page of results for list requests. If the number of results is larger
  27970. // than maxResults, use the nextPageToken as a value for the query
  27971. // parameter pageToken in the next list request. Subsequent list
  27972. // requests will have their own nextPageToken to continue paging through
  27973. // the results.
  27974. NextPageToken string `json:"nextPageToken,omitempty"`
  27975. // SelfLink: [Output Only] Server-defined URL for this resource.
  27976. SelfLink string `json:"selfLink,omitempty"`
  27977. // Warning: [Output Only] Informational warning message.
  27978. Warning *TargetSslProxyListWarning `json:"warning,omitempty"`
  27979. // ServerResponse contains the HTTP response code and headers from the
  27980. // server.
  27981. googleapi.ServerResponse `json:"-"`
  27982. // ForceSendFields is a list of field names (e.g. "Id") to
  27983. // unconditionally include in API requests. By default, fields with
  27984. // empty values are omitted from API requests. However, any non-pointer,
  27985. // non-interface field appearing in ForceSendFields will be sent to the
  27986. // server regardless of whether the field is empty or not. This may be
  27987. // used to include empty fields in Patch requests.
  27988. ForceSendFields []string `json:"-"`
  27989. // NullFields is a list of field names (e.g. "Id") to include in API
  27990. // requests with the JSON null value. By default, fields with empty
  27991. // values are omitted from API requests. However, any field with an
  27992. // empty value appearing in NullFields will be sent to the server as
  27993. // null. It is an error if a field in this list has a non-empty value.
  27994. // This may be used to include null fields in Patch requests.
  27995. NullFields []string `json:"-"`
  27996. }
  27997. func (s *TargetSslProxyList) MarshalJSON() ([]byte, error) {
  27998. type NoMethod TargetSslProxyList
  27999. raw := NoMethod(*s)
  28000. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28001. }
  28002. // TargetSslProxyListWarning: [Output Only] Informational warning
  28003. // message.
  28004. type TargetSslProxyListWarning struct {
  28005. // Code: [Output Only] A warning code, if applicable. For example,
  28006. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  28007. // the response.
  28008. //
  28009. // Possible values:
  28010. // "CLEANUP_FAILED"
  28011. // "DEPRECATED_RESOURCE_USED"
  28012. // "DEPRECATED_TYPE_USED"
  28013. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  28014. // "EXPERIMENTAL_TYPE_USED"
  28015. // "EXTERNAL_API_WARNING"
  28016. // "FIELD_VALUE_OVERRIDEN"
  28017. // "INJECTED_KERNELS_DEPRECATED"
  28018. // "MISSING_TYPE_DEPENDENCY"
  28019. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  28020. // "NEXT_HOP_CANNOT_IP_FORWARD"
  28021. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  28022. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  28023. // "NEXT_HOP_NOT_RUNNING"
  28024. // "NOT_CRITICAL_ERROR"
  28025. // "NO_RESULTS_ON_PAGE"
  28026. // "REQUIRED_TOS_AGREEMENT"
  28027. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  28028. // "RESOURCE_NOT_DELETED"
  28029. // "SCHEMA_VALIDATION_IGNORED"
  28030. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  28031. // "UNDECLARED_PROPERTIES"
  28032. // "UNREACHABLE"
  28033. Code string `json:"code,omitempty"`
  28034. // Data: [Output Only] Metadata about this warning in key: value format.
  28035. // For example:
  28036. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  28037. Data []*TargetSslProxyListWarningData `json:"data,omitempty"`
  28038. // Message: [Output Only] A human-readable description of the warning
  28039. // code.
  28040. Message string `json:"message,omitempty"`
  28041. // ForceSendFields is a list of field names (e.g. "Code") to
  28042. // unconditionally include in API requests. By default, fields with
  28043. // empty values are omitted from API requests. However, any non-pointer,
  28044. // non-interface field appearing in ForceSendFields will be sent to the
  28045. // server regardless of whether the field is empty or not. This may be
  28046. // used to include empty fields in Patch requests.
  28047. ForceSendFields []string `json:"-"`
  28048. // NullFields is a list of field names (e.g. "Code") to include in API
  28049. // requests with the JSON null value. By default, fields with empty
  28050. // values are omitted from API requests. However, any field with an
  28051. // empty value appearing in NullFields will be sent to the server as
  28052. // null. It is an error if a field in this list has a non-empty value.
  28053. // This may be used to include null fields in Patch requests.
  28054. NullFields []string `json:"-"`
  28055. }
  28056. func (s *TargetSslProxyListWarning) MarshalJSON() ([]byte, error) {
  28057. type NoMethod TargetSslProxyListWarning
  28058. raw := NoMethod(*s)
  28059. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28060. }
  28061. type TargetSslProxyListWarningData struct {
  28062. // Key: [Output Only] A key that provides more detail on the warning
  28063. // being returned. For example, for warnings where there are no results
  28064. // in a list request for a particular zone, this key might be scope and
  28065. // the key value might be the zone name. Other examples might be a key
  28066. // indicating a deprecated resource and a suggested replacement, or a
  28067. // warning about invalid network settings (for example, if an instance
  28068. // attempts to perform IP forwarding but is not enabled for IP
  28069. // forwarding).
  28070. Key string `json:"key,omitempty"`
  28071. // Value: [Output Only] A warning data value corresponding to the key.
  28072. Value string `json:"value,omitempty"`
  28073. // ForceSendFields is a list of field names (e.g. "Key") to
  28074. // unconditionally include in API requests. By default, fields with
  28075. // empty values are omitted from API requests. However, any non-pointer,
  28076. // non-interface field appearing in ForceSendFields will be sent to the
  28077. // server regardless of whether the field is empty or not. This may be
  28078. // used to include empty fields in Patch requests.
  28079. ForceSendFields []string `json:"-"`
  28080. // NullFields is a list of field names (e.g. "Key") to include in API
  28081. // requests with the JSON null value. By default, fields with empty
  28082. // values are omitted from API requests. However, any field with an
  28083. // empty value appearing in NullFields will be sent to the server as
  28084. // null. It is an error if a field in this list has a non-empty value.
  28085. // This may be used to include null fields in Patch requests.
  28086. NullFields []string `json:"-"`
  28087. }
  28088. func (s *TargetSslProxyListWarningData) MarshalJSON() ([]byte, error) {
  28089. type NoMethod TargetSslProxyListWarningData
  28090. raw := NoMethod(*s)
  28091. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28092. }
  28093. type TargetTcpProxiesSetBackendServiceRequest struct {
  28094. // Service: The URL of the new BackendService resource for the
  28095. // targetTcpProxy.
  28096. Service string `json:"service,omitempty"`
  28097. // ForceSendFields is a list of field names (e.g. "Service") to
  28098. // unconditionally include in API requests. By default, fields with
  28099. // empty values are omitted from API requests. However, any non-pointer,
  28100. // non-interface field appearing in ForceSendFields will be sent to the
  28101. // server regardless of whether the field is empty or not. This may be
  28102. // used to include empty fields in Patch requests.
  28103. ForceSendFields []string `json:"-"`
  28104. // NullFields is a list of field names (e.g. "Service") to include in
  28105. // API requests with the JSON null value. By default, fields with empty
  28106. // values are omitted from API requests. However, any field with an
  28107. // empty value appearing in NullFields will be sent to the server as
  28108. // null. It is an error if a field in this list has a non-empty value.
  28109. // This may be used to include null fields in Patch requests.
  28110. NullFields []string `json:"-"`
  28111. }
  28112. func (s *TargetTcpProxiesSetBackendServiceRequest) MarshalJSON() ([]byte, error) {
  28113. type NoMethod TargetTcpProxiesSetBackendServiceRequest
  28114. raw := NoMethod(*s)
  28115. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28116. }
  28117. type TargetTcpProxiesSetProxyHeaderRequest struct {
  28118. // ProxyHeader: The new type of proxy header to append before sending
  28119. // data to the backend. NONE or PROXY_V1 are allowed.
  28120. //
  28121. // Possible values:
  28122. // "NONE"
  28123. // "PROXY_V1"
  28124. ProxyHeader string `json:"proxyHeader,omitempty"`
  28125. // ForceSendFields is a list of field names (e.g. "ProxyHeader") to
  28126. // unconditionally include in API requests. By default, fields with
  28127. // empty values are omitted from API requests. However, any non-pointer,
  28128. // non-interface field appearing in ForceSendFields will be sent to the
  28129. // server regardless of whether the field is empty or not. This may be
  28130. // used to include empty fields in Patch requests.
  28131. ForceSendFields []string `json:"-"`
  28132. // NullFields is a list of field names (e.g. "ProxyHeader") to include
  28133. // in API requests with the JSON null value. By default, fields with
  28134. // empty values are omitted from API requests. However, any field with
  28135. // an empty value appearing in NullFields will be sent to the server as
  28136. // null. It is an error if a field in this list has a non-empty value.
  28137. // This may be used to include null fields in Patch requests.
  28138. NullFields []string `json:"-"`
  28139. }
  28140. func (s *TargetTcpProxiesSetProxyHeaderRequest) MarshalJSON() ([]byte, error) {
  28141. type NoMethod TargetTcpProxiesSetProxyHeaderRequest
  28142. raw := NoMethod(*s)
  28143. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28144. }
  28145. // TargetTcpProxy: A TargetTcpProxy resource. This resource defines a
  28146. // TCP proxy. (== resource_for beta.targetTcpProxies ==) (==
  28147. // resource_for v1.targetTcpProxies ==)
  28148. type TargetTcpProxy struct {
  28149. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  28150. // format.
  28151. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  28152. // Description: An optional description of this resource. Provide this
  28153. // property when you create the resource.
  28154. Description string `json:"description,omitempty"`
  28155. // Id: [Output Only] The unique identifier for the resource. This
  28156. // identifier is defined by the server.
  28157. Id uint64 `json:"id,omitempty,string"`
  28158. // Kind: [Output Only] Type of the resource. Always
  28159. // compute#targetTcpProxy for target TCP proxies.
  28160. Kind string `json:"kind,omitempty"`
  28161. // Name: Name of the resource. Provided by the client when the resource
  28162. // is created. The name must be 1-63 characters long, and comply with
  28163. // RFC1035. Specifically, the name must be 1-63 characters long and
  28164. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  28165. // the first character must be a lowercase letter, and all following
  28166. // characters must be a dash, lowercase letter, or digit, except the
  28167. // last character, which cannot be a dash.
  28168. Name string `json:"name,omitempty"`
  28169. // ProxyHeader: Specifies the type of proxy header to append before
  28170. // sending data to the backend, either NONE or PROXY_V1. The default is
  28171. // NONE.
  28172. //
  28173. // Possible values:
  28174. // "NONE"
  28175. // "PROXY_V1"
  28176. ProxyHeader string `json:"proxyHeader,omitempty"`
  28177. // SelfLink: [Output Only] Server-defined URL for the resource.
  28178. SelfLink string `json:"selfLink,omitempty"`
  28179. // Service: URL to the BackendService resource.
  28180. Service string `json:"service,omitempty"`
  28181. // ServerResponse contains the HTTP response code and headers from the
  28182. // server.
  28183. googleapi.ServerResponse `json:"-"`
  28184. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  28185. // to unconditionally include in API requests. By default, fields with
  28186. // empty values are omitted from API requests. However, any non-pointer,
  28187. // non-interface field appearing in ForceSendFields will be sent to the
  28188. // server regardless of whether the field is empty or not. This may be
  28189. // used to include empty fields in Patch requests.
  28190. ForceSendFields []string `json:"-"`
  28191. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  28192. // include in API requests with the JSON null value. By default, fields
  28193. // with empty values are omitted from API requests. However, any field
  28194. // with an empty value appearing in NullFields will be sent to the
  28195. // server as null. It is an error if a field in this list has a
  28196. // non-empty value. This may be used to include null fields in Patch
  28197. // requests.
  28198. NullFields []string `json:"-"`
  28199. }
  28200. func (s *TargetTcpProxy) MarshalJSON() ([]byte, error) {
  28201. type NoMethod TargetTcpProxy
  28202. raw := NoMethod(*s)
  28203. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28204. }
  28205. // TargetTcpProxyList: Contains a list of TargetTcpProxy resources.
  28206. type TargetTcpProxyList struct {
  28207. // Id: [Output Only] Unique identifier for the resource; defined by the
  28208. // server.
  28209. Id string `json:"id,omitempty"`
  28210. // Items: A list of TargetTcpProxy resources.
  28211. Items []*TargetTcpProxy `json:"items,omitempty"`
  28212. // Kind: Type of resource.
  28213. Kind string `json:"kind,omitempty"`
  28214. // NextPageToken: [Output Only] This token allows you to get the next
  28215. // page of results for list requests. If the number of results is larger
  28216. // than maxResults, use the nextPageToken as a value for the query
  28217. // parameter pageToken in the next list request. Subsequent list
  28218. // requests will have their own nextPageToken to continue paging through
  28219. // the results.
  28220. NextPageToken string `json:"nextPageToken,omitempty"`
  28221. // SelfLink: [Output Only] Server-defined URL for this resource.
  28222. SelfLink string `json:"selfLink,omitempty"`
  28223. // Warning: [Output Only] Informational warning message.
  28224. Warning *TargetTcpProxyListWarning `json:"warning,omitempty"`
  28225. // ServerResponse contains the HTTP response code and headers from the
  28226. // server.
  28227. googleapi.ServerResponse `json:"-"`
  28228. // ForceSendFields is a list of field names (e.g. "Id") to
  28229. // unconditionally include in API requests. By default, fields with
  28230. // empty values are omitted from API requests. However, any non-pointer,
  28231. // non-interface field appearing in ForceSendFields will be sent to the
  28232. // server regardless of whether the field is empty or not. This may be
  28233. // used to include empty fields in Patch requests.
  28234. ForceSendFields []string `json:"-"`
  28235. // NullFields is a list of field names (e.g. "Id") to include in API
  28236. // requests with the JSON null value. By default, fields with empty
  28237. // values are omitted from API requests. However, any field with an
  28238. // empty value appearing in NullFields will be sent to the server as
  28239. // null. It is an error if a field in this list has a non-empty value.
  28240. // This may be used to include null fields in Patch requests.
  28241. NullFields []string `json:"-"`
  28242. }
  28243. func (s *TargetTcpProxyList) MarshalJSON() ([]byte, error) {
  28244. type NoMethod TargetTcpProxyList
  28245. raw := NoMethod(*s)
  28246. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28247. }
  28248. // TargetTcpProxyListWarning: [Output Only] Informational warning
  28249. // message.
  28250. type TargetTcpProxyListWarning struct {
  28251. // Code: [Output Only] A warning code, if applicable. For example,
  28252. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  28253. // the response.
  28254. //
  28255. // Possible values:
  28256. // "CLEANUP_FAILED"
  28257. // "DEPRECATED_RESOURCE_USED"
  28258. // "DEPRECATED_TYPE_USED"
  28259. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  28260. // "EXPERIMENTAL_TYPE_USED"
  28261. // "EXTERNAL_API_WARNING"
  28262. // "FIELD_VALUE_OVERRIDEN"
  28263. // "INJECTED_KERNELS_DEPRECATED"
  28264. // "MISSING_TYPE_DEPENDENCY"
  28265. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  28266. // "NEXT_HOP_CANNOT_IP_FORWARD"
  28267. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  28268. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  28269. // "NEXT_HOP_NOT_RUNNING"
  28270. // "NOT_CRITICAL_ERROR"
  28271. // "NO_RESULTS_ON_PAGE"
  28272. // "REQUIRED_TOS_AGREEMENT"
  28273. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  28274. // "RESOURCE_NOT_DELETED"
  28275. // "SCHEMA_VALIDATION_IGNORED"
  28276. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  28277. // "UNDECLARED_PROPERTIES"
  28278. // "UNREACHABLE"
  28279. Code string `json:"code,omitempty"`
  28280. // Data: [Output Only] Metadata about this warning in key: value format.
  28281. // For example:
  28282. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  28283. Data []*TargetTcpProxyListWarningData `json:"data,omitempty"`
  28284. // Message: [Output Only] A human-readable description of the warning
  28285. // code.
  28286. Message string `json:"message,omitempty"`
  28287. // ForceSendFields is a list of field names (e.g. "Code") to
  28288. // unconditionally include in API requests. By default, fields with
  28289. // empty values are omitted from API requests. However, any non-pointer,
  28290. // non-interface field appearing in ForceSendFields will be sent to the
  28291. // server regardless of whether the field is empty or not. This may be
  28292. // used to include empty fields in Patch requests.
  28293. ForceSendFields []string `json:"-"`
  28294. // NullFields is a list of field names (e.g. "Code") to include in API
  28295. // requests with the JSON null value. By default, fields with empty
  28296. // values are omitted from API requests. However, any field with an
  28297. // empty value appearing in NullFields will be sent to the server as
  28298. // null. It is an error if a field in this list has a non-empty value.
  28299. // This may be used to include null fields in Patch requests.
  28300. NullFields []string `json:"-"`
  28301. }
  28302. func (s *TargetTcpProxyListWarning) MarshalJSON() ([]byte, error) {
  28303. type NoMethod TargetTcpProxyListWarning
  28304. raw := NoMethod(*s)
  28305. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28306. }
  28307. type TargetTcpProxyListWarningData struct {
  28308. // Key: [Output Only] A key that provides more detail on the warning
  28309. // being returned. For example, for warnings where there are no results
  28310. // in a list request for a particular zone, this key might be scope and
  28311. // the key value might be the zone name. Other examples might be a key
  28312. // indicating a deprecated resource and a suggested replacement, or a
  28313. // warning about invalid network settings (for example, if an instance
  28314. // attempts to perform IP forwarding but is not enabled for IP
  28315. // forwarding).
  28316. Key string `json:"key,omitempty"`
  28317. // Value: [Output Only] A warning data value corresponding to the key.
  28318. Value string `json:"value,omitempty"`
  28319. // ForceSendFields is a list of field names (e.g. "Key") to
  28320. // unconditionally include in API requests. By default, fields with
  28321. // empty values are omitted from API requests. However, any non-pointer,
  28322. // non-interface field appearing in ForceSendFields will be sent to the
  28323. // server regardless of whether the field is empty or not. This may be
  28324. // used to include empty fields in Patch requests.
  28325. ForceSendFields []string `json:"-"`
  28326. // NullFields is a list of field names (e.g. "Key") to include in API
  28327. // requests with the JSON null value. By default, fields with empty
  28328. // values are omitted from API requests. However, any field with an
  28329. // empty value appearing in NullFields will be sent to the server as
  28330. // null. It is an error if a field in this list has a non-empty value.
  28331. // This may be used to include null fields in Patch requests.
  28332. NullFields []string `json:"-"`
  28333. }
  28334. func (s *TargetTcpProxyListWarningData) MarshalJSON() ([]byte, error) {
  28335. type NoMethod TargetTcpProxyListWarningData
  28336. raw := NoMethod(*s)
  28337. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28338. }
  28339. // TargetVpnGateway: Represents a Target VPN gateway resource. (==
  28340. // resource_for beta.targetVpnGateways ==) (== resource_for
  28341. // v1.targetVpnGateways ==)
  28342. type TargetVpnGateway struct {
  28343. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  28344. // format.
  28345. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  28346. // Description: An optional description of this resource. Provide this
  28347. // property when you create the resource.
  28348. Description string `json:"description,omitempty"`
  28349. // ForwardingRules: [Output Only] A list of URLs to the ForwardingRule
  28350. // resources. ForwardingRules are created using
  28351. // compute.forwardingRules.insert and associated to a VPN gateway.
  28352. ForwardingRules []string `json:"forwardingRules,omitempty"`
  28353. // Id: [Output Only] The unique identifier for the resource. This
  28354. // identifier is defined by the server.
  28355. Id uint64 `json:"id,omitempty,string"`
  28356. // Kind: [Output Only] Type of resource. Always compute#targetVpnGateway
  28357. // for target VPN gateways.
  28358. Kind string `json:"kind,omitempty"`
  28359. // LabelFingerprint: A fingerprint for the labels being applied to this
  28360. // TargetVpnGateway, which is essentially a hash of the labels set used
  28361. // for optimistic locking. The fingerprint is initially generated by
  28362. // Compute Engine and changes after every request to modify or update
  28363. // labels. You must always provide an up-to-date fingerprint hash in
  28364. // order to update or change labels.
  28365. //
  28366. // To see the latest fingerprint, make a get() request to retrieve an
  28367. // TargetVpnGateway.
  28368. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  28369. // Labels: Labels to apply to this TargetVpnGateway resource. These can
  28370. // be later modified by the setLabels method. Each label key/value must
  28371. // comply with RFC1035. Label values may be empty.
  28372. Labels map[string]string `json:"labels,omitempty"`
  28373. // Name: Name of the resource. Provided by the client when the resource
  28374. // is created. The name must be 1-63 characters long, and comply with
  28375. // RFC1035. Specifically, the name must be 1-63 characters long and
  28376. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  28377. // the first character must be a lowercase letter, and all following
  28378. // characters must be a dash, lowercase letter, or digit, except the
  28379. // last character, which cannot be a dash.
  28380. Name string `json:"name,omitempty"`
  28381. // Network: URL of the network to which this VPN gateway is attached.
  28382. // Provided by the client when the VPN gateway is created.
  28383. Network string `json:"network,omitempty"`
  28384. // Region: [Output Only] URL of the region where the target VPN gateway
  28385. // resides. You must specify this field as part of the HTTP request URL.
  28386. // It is not settable as a field in the request body.
  28387. Region string `json:"region,omitempty"`
  28388. // SelfLink: [Output Only] Server-defined URL for the resource.
  28389. SelfLink string `json:"selfLink,omitempty"`
  28390. // Status: [Output Only] The status of the VPN gateway.
  28391. //
  28392. // Possible values:
  28393. // "CREATING"
  28394. // "DELETING"
  28395. // "FAILED"
  28396. // "READY"
  28397. Status string `json:"status,omitempty"`
  28398. // Tunnels: [Output Only] A list of URLs to VpnTunnel resources.
  28399. // VpnTunnels are created using compute.vpntunnels.insert method and
  28400. // associated to a VPN gateway.
  28401. Tunnels []string `json:"tunnels,omitempty"`
  28402. // ServerResponse contains the HTTP response code and headers from the
  28403. // server.
  28404. googleapi.ServerResponse `json:"-"`
  28405. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  28406. // to unconditionally include in API requests. By default, fields with
  28407. // empty values are omitted from API requests. However, any non-pointer,
  28408. // non-interface field appearing in ForceSendFields will be sent to the
  28409. // server regardless of whether the field is empty or not. This may be
  28410. // used to include empty fields in Patch requests.
  28411. ForceSendFields []string `json:"-"`
  28412. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  28413. // include in API requests with the JSON null value. By default, fields
  28414. // with empty values are omitted from API requests. However, any field
  28415. // with an empty value appearing in NullFields will be sent to the
  28416. // server as null. It is an error if a field in this list has a
  28417. // non-empty value. This may be used to include null fields in Patch
  28418. // requests.
  28419. NullFields []string `json:"-"`
  28420. }
  28421. func (s *TargetVpnGateway) MarshalJSON() ([]byte, error) {
  28422. type NoMethod TargetVpnGateway
  28423. raw := NoMethod(*s)
  28424. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28425. }
  28426. type TargetVpnGatewayAggregatedList struct {
  28427. // Id: [Output Only] Unique identifier for the resource; defined by the
  28428. // server.
  28429. Id string `json:"id,omitempty"`
  28430. // Items: A list of TargetVpnGateway resources.
  28431. Items map[string]TargetVpnGatewaysScopedList `json:"items,omitempty"`
  28432. // Kind: [Output Only] Type of resource. Always compute#targetVpnGateway
  28433. // for target VPN gateways.
  28434. Kind string `json:"kind,omitempty"`
  28435. // NextPageToken: [Output Only] This token allows you to get the next
  28436. // page of results for list requests. If the number of results is larger
  28437. // than maxResults, use the nextPageToken as a value for the query
  28438. // parameter pageToken in the next list request. Subsequent list
  28439. // requests will have their own nextPageToken to continue paging through
  28440. // the results.
  28441. NextPageToken string `json:"nextPageToken,omitempty"`
  28442. // SelfLink: [Output Only] Server-defined URL for this resource.
  28443. SelfLink string `json:"selfLink,omitempty"`
  28444. // Warning: [Output Only] Informational warning message.
  28445. Warning *TargetVpnGatewayAggregatedListWarning `json:"warning,omitempty"`
  28446. // ServerResponse contains the HTTP response code and headers from the
  28447. // server.
  28448. googleapi.ServerResponse `json:"-"`
  28449. // ForceSendFields is a list of field names (e.g. "Id") to
  28450. // unconditionally include in API requests. By default, fields with
  28451. // empty values are omitted from API requests. However, any non-pointer,
  28452. // non-interface field appearing in ForceSendFields will be sent to the
  28453. // server regardless of whether the field is empty or not. This may be
  28454. // used to include empty fields in Patch requests.
  28455. ForceSendFields []string `json:"-"`
  28456. // NullFields is a list of field names (e.g. "Id") to include in API
  28457. // requests with the JSON null value. By default, fields with empty
  28458. // values are omitted from API requests. However, any field with an
  28459. // empty value appearing in NullFields will be sent to the server as
  28460. // null. It is an error if a field in this list has a non-empty value.
  28461. // This may be used to include null fields in Patch requests.
  28462. NullFields []string `json:"-"`
  28463. }
  28464. func (s *TargetVpnGatewayAggregatedList) MarshalJSON() ([]byte, error) {
  28465. type NoMethod TargetVpnGatewayAggregatedList
  28466. raw := NoMethod(*s)
  28467. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28468. }
  28469. // TargetVpnGatewayAggregatedListWarning: [Output Only] Informational
  28470. // warning message.
  28471. type TargetVpnGatewayAggregatedListWarning struct {
  28472. // Code: [Output Only] A warning code, if applicable. For example,
  28473. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  28474. // the response.
  28475. //
  28476. // Possible values:
  28477. // "CLEANUP_FAILED"
  28478. // "DEPRECATED_RESOURCE_USED"
  28479. // "DEPRECATED_TYPE_USED"
  28480. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  28481. // "EXPERIMENTAL_TYPE_USED"
  28482. // "EXTERNAL_API_WARNING"
  28483. // "FIELD_VALUE_OVERRIDEN"
  28484. // "INJECTED_KERNELS_DEPRECATED"
  28485. // "MISSING_TYPE_DEPENDENCY"
  28486. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  28487. // "NEXT_HOP_CANNOT_IP_FORWARD"
  28488. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  28489. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  28490. // "NEXT_HOP_NOT_RUNNING"
  28491. // "NOT_CRITICAL_ERROR"
  28492. // "NO_RESULTS_ON_PAGE"
  28493. // "REQUIRED_TOS_AGREEMENT"
  28494. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  28495. // "RESOURCE_NOT_DELETED"
  28496. // "SCHEMA_VALIDATION_IGNORED"
  28497. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  28498. // "UNDECLARED_PROPERTIES"
  28499. // "UNREACHABLE"
  28500. Code string `json:"code,omitempty"`
  28501. // Data: [Output Only] Metadata about this warning in key: value format.
  28502. // For example:
  28503. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  28504. Data []*TargetVpnGatewayAggregatedListWarningData `json:"data,omitempty"`
  28505. // Message: [Output Only] A human-readable description of the warning
  28506. // code.
  28507. Message string `json:"message,omitempty"`
  28508. // ForceSendFields is a list of field names (e.g. "Code") to
  28509. // unconditionally include in API requests. By default, fields with
  28510. // empty values are omitted from API requests. However, any non-pointer,
  28511. // non-interface field appearing in ForceSendFields will be sent to the
  28512. // server regardless of whether the field is empty or not. This may be
  28513. // used to include empty fields in Patch requests.
  28514. ForceSendFields []string `json:"-"`
  28515. // NullFields is a list of field names (e.g. "Code") to include in API
  28516. // requests with the JSON null value. By default, fields with empty
  28517. // values are omitted from API requests. However, any field with an
  28518. // empty value appearing in NullFields will be sent to the server as
  28519. // null. It is an error if a field in this list has a non-empty value.
  28520. // This may be used to include null fields in Patch requests.
  28521. NullFields []string `json:"-"`
  28522. }
  28523. func (s *TargetVpnGatewayAggregatedListWarning) MarshalJSON() ([]byte, error) {
  28524. type NoMethod TargetVpnGatewayAggregatedListWarning
  28525. raw := NoMethod(*s)
  28526. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28527. }
  28528. type TargetVpnGatewayAggregatedListWarningData struct {
  28529. // Key: [Output Only] A key that provides more detail on the warning
  28530. // being returned. For example, for warnings where there are no results
  28531. // in a list request for a particular zone, this key might be scope and
  28532. // the key value might be the zone name. Other examples might be a key
  28533. // indicating a deprecated resource and a suggested replacement, or a
  28534. // warning about invalid network settings (for example, if an instance
  28535. // attempts to perform IP forwarding but is not enabled for IP
  28536. // forwarding).
  28537. Key string `json:"key,omitempty"`
  28538. // Value: [Output Only] A warning data value corresponding to the key.
  28539. Value string `json:"value,omitempty"`
  28540. // ForceSendFields is a list of field names (e.g. "Key") to
  28541. // unconditionally include in API requests. By default, fields with
  28542. // empty values are omitted from API requests. However, any non-pointer,
  28543. // non-interface field appearing in ForceSendFields will be sent to the
  28544. // server regardless of whether the field is empty or not. This may be
  28545. // used to include empty fields in Patch requests.
  28546. ForceSendFields []string `json:"-"`
  28547. // NullFields is a list of field names (e.g. "Key") to include in API
  28548. // requests with the JSON null value. By default, fields with empty
  28549. // values are omitted from API requests. However, any field with an
  28550. // empty value appearing in NullFields will be sent to the server as
  28551. // null. It is an error if a field in this list has a non-empty value.
  28552. // This may be used to include null fields in Patch requests.
  28553. NullFields []string `json:"-"`
  28554. }
  28555. func (s *TargetVpnGatewayAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  28556. type NoMethod TargetVpnGatewayAggregatedListWarningData
  28557. raw := NoMethod(*s)
  28558. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28559. }
  28560. // TargetVpnGatewayList: Contains a list of TargetVpnGateway resources.
  28561. type TargetVpnGatewayList struct {
  28562. // Id: [Output Only] Unique identifier for the resource; defined by the
  28563. // server.
  28564. Id string `json:"id,omitempty"`
  28565. // Items: A list of TargetVpnGateway resources.
  28566. Items []*TargetVpnGateway `json:"items,omitempty"`
  28567. // Kind: [Output Only] Type of resource. Always compute#targetVpnGateway
  28568. // for target VPN gateways.
  28569. Kind string `json:"kind,omitempty"`
  28570. // NextPageToken: [Output Only] This token allows you to get the next
  28571. // page of results for list requests. If the number of results is larger
  28572. // than maxResults, use the nextPageToken as a value for the query
  28573. // parameter pageToken in the next list request. Subsequent list
  28574. // requests will have their own nextPageToken to continue paging through
  28575. // the results.
  28576. NextPageToken string `json:"nextPageToken,omitempty"`
  28577. // SelfLink: [Output Only] Server-defined URL for this resource.
  28578. SelfLink string `json:"selfLink,omitempty"`
  28579. // Warning: [Output Only] Informational warning message.
  28580. Warning *TargetVpnGatewayListWarning `json:"warning,omitempty"`
  28581. // ServerResponse contains the HTTP response code and headers from the
  28582. // server.
  28583. googleapi.ServerResponse `json:"-"`
  28584. // ForceSendFields is a list of field names (e.g. "Id") to
  28585. // unconditionally include in API requests. By default, fields with
  28586. // empty values are omitted from API requests. However, any non-pointer,
  28587. // non-interface field appearing in ForceSendFields will be sent to the
  28588. // server regardless of whether the field is empty or not. This may be
  28589. // used to include empty fields in Patch requests.
  28590. ForceSendFields []string `json:"-"`
  28591. // NullFields is a list of field names (e.g. "Id") to include in API
  28592. // requests with the JSON null value. By default, fields with empty
  28593. // values are omitted from API requests. However, any field with an
  28594. // empty value appearing in NullFields will be sent to the server as
  28595. // null. It is an error if a field in this list has a non-empty value.
  28596. // This may be used to include null fields in Patch requests.
  28597. NullFields []string `json:"-"`
  28598. }
  28599. func (s *TargetVpnGatewayList) MarshalJSON() ([]byte, error) {
  28600. type NoMethod TargetVpnGatewayList
  28601. raw := NoMethod(*s)
  28602. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28603. }
  28604. // TargetVpnGatewayListWarning: [Output Only] Informational warning
  28605. // message.
  28606. type TargetVpnGatewayListWarning struct {
  28607. // Code: [Output Only] A warning code, if applicable. For example,
  28608. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  28609. // the response.
  28610. //
  28611. // Possible values:
  28612. // "CLEANUP_FAILED"
  28613. // "DEPRECATED_RESOURCE_USED"
  28614. // "DEPRECATED_TYPE_USED"
  28615. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  28616. // "EXPERIMENTAL_TYPE_USED"
  28617. // "EXTERNAL_API_WARNING"
  28618. // "FIELD_VALUE_OVERRIDEN"
  28619. // "INJECTED_KERNELS_DEPRECATED"
  28620. // "MISSING_TYPE_DEPENDENCY"
  28621. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  28622. // "NEXT_HOP_CANNOT_IP_FORWARD"
  28623. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  28624. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  28625. // "NEXT_HOP_NOT_RUNNING"
  28626. // "NOT_CRITICAL_ERROR"
  28627. // "NO_RESULTS_ON_PAGE"
  28628. // "REQUIRED_TOS_AGREEMENT"
  28629. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  28630. // "RESOURCE_NOT_DELETED"
  28631. // "SCHEMA_VALIDATION_IGNORED"
  28632. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  28633. // "UNDECLARED_PROPERTIES"
  28634. // "UNREACHABLE"
  28635. Code string `json:"code,omitempty"`
  28636. // Data: [Output Only] Metadata about this warning in key: value format.
  28637. // For example:
  28638. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  28639. Data []*TargetVpnGatewayListWarningData `json:"data,omitempty"`
  28640. // Message: [Output Only] A human-readable description of the warning
  28641. // code.
  28642. Message string `json:"message,omitempty"`
  28643. // ForceSendFields is a list of field names (e.g. "Code") to
  28644. // unconditionally include in API requests. By default, fields with
  28645. // empty values are omitted from API requests. However, any non-pointer,
  28646. // non-interface field appearing in ForceSendFields will be sent to the
  28647. // server regardless of whether the field is empty or not. This may be
  28648. // used to include empty fields in Patch requests.
  28649. ForceSendFields []string `json:"-"`
  28650. // NullFields is a list of field names (e.g. "Code") to include in API
  28651. // requests with the JSON null value. By default, fields with empty
  28652. // values are omitted from API requests. However, any field with an
  28653. // empty value appearing in NullFields will be sent to the server as
  28654. // null. It is an error if a field in this list has a non-empty value.
  28655. // This may be used to include null fields in Patch requests.
  28656. NullFields []string `json:"-"`
  28657. }
  28658. func (s *TargetVpnGatewayListWarning) MarshalJSON() ([]byte, error) {
  28659. type NoMethod TargetVpnGatewayListWarning
  28660. raw := NoMethod(*s)
  28661. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28662. }
  28663. type TargetVpnGatewayListWarningData struct {
  28664. // Key: [Output Only] A key that provides more detail on the warning
  28665. // being returned. For example, for warnings where there are no results
  28666. // in a list request for a particular zone, this key might be scope and
  28667. // the key value might be the zone name. Other examples might be a key
  28668. // indicating a deprecated resource and a suggested replacement, or a
  28669. // warning about invalid network settings (for example, if an instance
  28670. // attempts to perform IP forwarding but is not enabled for IP
  28671. // forwarding).
  28672. Key string `json:"key,omitempty"`
  28673. // Value: [Output Only] A warning data value corresponding to the key.
  28674. Value string `json:"value,omitempty"`
  28675. // ForceSendFields is a list of field names (e.g. "Key") to
  28676. // unconditionally include in API requests. By default, fields with
  28677. // empty values are omitted from API requests. However, any non-pointer,
  28678. // non-interface field appearing in ForceSendFields will be sent to the
  28679. // server regardless of whether the field is empty or not. This may be
  28680. // used to include empty fields in Patch requests.
  28681. ForceSendFields []string `json:"-"`
  28682. // NullFields is a list of field names (e.g. "Key") to include in API
  28683. // requests with the JSON null value. By default, fields with empty
  28684. // values are omitted from API requests. However, any field with an
  28685. // empty value appearing in NullFields will be sent to the server as
  28686. // null. It is an error if a field in this list has a non-empty value.
  28687. // This may be used to include null fields in Patch requests.
  28688. NullFields []string `json:"-"`
  28689. }
  28690. func (s *TargetVpnGatewayListWarningData) MarshalJSON() ([]byte, error) {
  28691. type NoMethod TargetVpnGatewayListWarningData
  28692. raw := NoMethod(*s)
  28693. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28694. }
  28695. type TargetVpnGatewaysScopedList struct {
  28696. // TargetVpnGateways: [Output Only] A list of target vpn gateways
  28697. // contained in this scope.
  28698. TargetVpnGateways []*TargetVpnGateway `json:"targetVpnGateways,omitempty"`
  28699. // Warning: [Output Only] Informational warning which replaces the list
  28700. // of addresses when the list is empty.
  28701. Warning *TargetVpnGatewaysScopedListWarning `json:"warning,omitempty"`
  28702. // ForceSendFields is a list of field names (e.g. "TargetVpnGateways")
  28703. // to unconditionally include in API requests. By default, fields with
  28704. // empty values are omitted from API requests. However, any non-pointer,
  28705. // non-interface field appearing in ForceSendFields will be sent to the
  28706. // server regardless of whether the field is empty or not. This may be
  28707. // used to include empty fields in Patch requests.
  28708. ForceSendFields []string `json:"-"`
  28709. // NullFields is a list of field names (e.g. "TargetVpnGateways") to
  28710. // include in API requests with the JSON null value. By default, fields
  28711. // with empty values are omitted from API requests. However, any field
  28712. // with an empty value appearing in NullFields will be sent to the
  28713. // server as null. It is an error if a field in this list has a
  28714. // non-empty value. This may be used to include null fields in Patch
  28715. // requests.
  28716. NullFields []string `json:"-"`
  28717. }
  28718. func (s *TargetVpnGatewaysScopedList) MarshalJSON() ([]byte, error) {
  28719. type NoMethod TargetVpnGatewaysScopedList
  28720. raw := NoMethod(*s)
  28721. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28722. }
  28723. // TargetVpnGatewaysScopedListWarning: [Output Only] Informational
  28724. // warning which replaces the list of addresses when the list is empty.
  28725. type TargetVpnGatewaysScopedListWarning struct {
  28726. // Code: [Output Only] A warning code, if applicable. For example,
  28727. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  28728. // the response.
  28729. //
  28730. // Possible values:
  28731. // "CLEANUP_FAILED"
  28732. // "DEPRECATED_RESOURCE_USED"
  28733. // "DEPRECATED_TYPE_USED"
  28734. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  28735. // "EXPERIMENTAL_TYPE_USED"
  28736. // "EXTERNAL_API_WARNING"
  28737. // "FIELD_VALUE_OVERRIDEN"
  28738. // "INJECTED_KERNELS_DEPRECATED"
  28739. // "MISSING_TYPE_DEPENDENCY"
  28740. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  28741. // "NEXT_HOP_CANNOT_IP_FORWARD"
  28742. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  28743. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  28744. // "NEXT_HOP_NOT_RUNNING"
  28745. // "NOT_CRITICAL_ERROR"
  28746. // "NO_RESULTS_ON_PAGE"
  28747. // "REQUIRED_TOS_AGREEMENT"
  28748. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  28749. // "RESOURCE_NOT_DELETED"
  28750. // "SCHEMA_VALIDATION_IGNORED"
  28751. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  28752. // "UNDECLARED_PROPERTIES"
  28753. // "UNREACHABLE"
  28754. Code string `json:"code,omitempty"`
  28755. // Data: [Output Only] Metadata about this warning in key: value format.
  28756. // For example:
  28757. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  28758. Data []*TargetVpnGatewaysScopedListWarningData `json:"data,omitempty"`
  28759. // Message: [Output Only] A human-readable description of the warning
  28760. // code.
  28761. Message string `json:"message,omitempty"`
  28762. // ForceSendFields is a list of field names (e.g. "Code") to
  28763. // unconditionally include in API requests. By default, fields with
  28764. // empty values are omitted from API requests. However, any non-pointer,
  28765. // non-interface field appearing in ForceSendFields will be sent to the
  28766. // server regardless of whether the field is empty or not. This may be
  28767. // used to include empty fields in Patch requests.
  28768. ForceSendFields []string `json:"-"`
  28769. // NullFields is a list of field names (e.g. "Code") to include in API
  28770. // requests with the JSON null value. By default, fields with empty
  28771. // values are omitted from API requests. However, any field with an
  28772. // empty value appearing in NullFields will be sent to the server as
  28773. // null. It is an error if a field in this list has a non-empty value.
  28774. // This may be used to include null fields in Patch requests.
  28775. NullFields []string `json:"-"`
  28776. }
  28777. func (s *TargetVpnGatewaysScopedListWarning) MarshalJSON() ([]byte, error) {
  28778. type NoMethod TargetVpnGatewaysScopedListWarning
  28779. raw := NoMethod(*s)
  28780. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28781. }
  28782. type TargetVpnGatewaysScopedListWarningData struct {
  28783. // Key: [Output Only] A key that provides more detail on the warning
  28784. // being returned. For example, for warnings where there are no results
  28785. // in a list request for a particular zone, this key might be scope and
  28786. // the key value might be the zone name. Other examples might be a key
  28787. // indicating a deprecated resource and a suggested replacement, or a
  28788. // warning about invalid network settings (for example, if an instance
  28789. // attempts to perform IP forwarding but is not enabled for IP
  28790. // forwarding).
  28791. Key string `json:"key,omitempty"`
  28792. // Value: [Output Only] A warning data value corresponding to the key.
  28793. Value string `json:"value,omitempty"`
  28794. // ForceSendFields is a list of field names (e.g. "Key") to
  28795. // unconditionally include in API requests. By default, fields with
  28796. // empty values are omitted from API requests. However, any non-pointer,
  28797. // non-interface field appearing in ForceSendFields will be sent to the
  28798. // server regardless of whether the field is empty or not. This may be
  28799. // used to include empty fields in Patch requests.
  28800. ForceSendFields []string `json:"-"`
  28801. // NullFields is a list of field names (e.g. "Key") to include in API
  28802. // requests with the JSON null value. By default, fields with empty
  28803. // values are omitted from API requests. However, any field with an
  28804. // empty value appearing in NullFields will be sent to the server as
  28805. // null. It is an error if a field in this list has a non-empty value.
  28806. // This may be used to include null fields in Patch requests.
  28807. NullFields []string `json:"-"`
  28808. }
  28809. func (s *TargetVpnGatewaysScopedListWarningData) MarshalJSON() ([]byte, error) {
  28810. type NoMethod TargetVpnGatewaysScopedListWarningData
  28811. raw := NoMethod(*s)
  28812. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28813. }
  28814. type TestFailure struct {
  28815. ActualService string `json:"actualService,omitempty"`
  28816. ExpectedService string `json:"expectedService,omitempty"`
  28817. Host string `json:"host,omitempty"`
  28818. Path string `json:"path,omitempty"`
  28819. // ForceSendFields is a list of field names (e.g. "ActualService") to
  28820. // unconditionally include in API requests. By default, fields with
  28821. // empty values are omitted from API requests. However, any non-pointer,
  28822. // non-interface field appearing in ForceSendFields will be sent to the
  28823. // server regardless of whether the field is empty or not. This may be
  28824. // used to include empty fields in Patch requests.
  28825. ForceSendFields []string `json:"-"`
  28826. // NullFields is a list of field names (e.g. "ActualService") to include
  28827. // in API requests with the JSON null value. By default, fields with
  28828. // empty values are omitted from API requests. However, any field with
  28829. // an empty value appearing in NullFields will be sent to the server as
  28830. // null. It is an error if a field in this list has a non-empty value.
  28831. // This may be used to include null fields in Patch requests.
  28832. NullFields []string `json:"-"`
  28833. }
  28834. func (s *TestFailure) MarshalJSON() ([]byte, error) {
  28835. type NoMethod TestFailure
  28836. raw := NoMethod(*s)
  28837. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28838. }
  28839. type TestPermissionsRequest struct {
  28840. // Permissions: The set of permissions to check for the 'resource'.
  28841. // Permissions with wildcards (such as '*' or 'storage.*') are not
  28842. // allowed.
  28843. Permissions []string `json:"permissions,omitempty"`
  28844. // ForceSendFields is a list of field names (e.g. "Permissions") to
  28845. // unconditionally include in API requests. By default, fields with
  28846. // empty values are omitted from API requests. However, any non-pointer,
  28847. // non-interface field appearing in ForceSendFields will be sent to the
  28848. // server regardless of whether the field is empty or not. This may be
  28849. // used to include empty fields in Patch requests.
  28850. ForceSendFields []string `json:"-"`
  28851. // NullFields is a list of field names (e.g. "Permissions") to include
  28852. // in API requests with the JSON null value. By default, fields with
  28853. // empty values are omitted from API requests. However, any field with
  28854. // an empty value appearing in NullFields will be sent to the server as
  28855. // null. It is an error if a field in this list has a non-empty value.
  28856. // This may be used to include null fields in Patch requests.
  28857. NullFields []string `json:"-"`
  28858. }
  28859. func (s *TestPermissionsRequest) MarshalJSON() ([]byte, error) {
  28860. type NoMethod TestPermissionsRequest
  28861. raw := NoMethod(*s)
  28862. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28863. }
  28864. type TestPermissionsResponse struct {
  28865. // Permissions: A subset of `TestPermissionsRequest.permissions` that
  28866. // the caller is allowed.
  28867. Permissions []string `json:"permissions,omitempty"`
  28868. // ServerResponse contains the HTTP response code and headers from the
  28869. // server.
  28870. googleapi.ServerResponse `json:"-"`
  28871. // ForceSendFields is a list of field names (e.g. "Permissions") to
  28872. // unconditionally include in API requests. By default, fields with
  28873. // empty values are omitted from API requests. However, any non-pointer,
  28874. // non-interface field appearing in ForceSendFields will be sent to the
  28875. // server regardless of whether the field is empty or not. This may be
  28876. // used to include empty fields in Patch requests.
  28877. ForceSendFields []string `json:"-"`
  28878. // NullFields is a list of field names (e.g. "Permissions") to include
  28879. // in API requests with the JSON null value. By default, fields with
  28880. // empty values are omitted from API requests. However, any field with
  28881. // an empty value appearing in NullFields will be sent to the server as
  28882. // null. It is an error if a field in this list has a non-empty value.
  28883. // This may be used to include null fields in Patch requests.
  28884. NullFields []string `json:"-"`
  28885. }
  28886. func (s *TestPermissionsResponse) MarshalJSON() ([]byte, error) {
  28887. type NoMethod TestPermissionsResponse
  28888. raw := NoMethod(*s)
  28889. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28890. }
  28891. type UDPHealthCheck struct {
  28892. // Port: The UDP port number for the health check request. Valid values
  28893. // are 1 through 65535.
  28894. Port int64 `json:"port,omitempty"`
  28895. // PortName: Port name as defined in InstanceGroup#NamedPort#name. If
  28896. // both port and port_name are defined, port takes precedence.
  28897. PortName string `json:"portName,omitempty"`
  28898. // Request: Raw data of request to send in payload of UDP packet. It is
  28899. // an error if this is empty. The request data can only be ASCII.
  28900. Request string `json:"request,omitempty"`
  28901. // Response: The bytes to match against the beginning of the response
  28902. // data. It is an error if this is empty. The response data can only be
  28903. // ASCII.
  28904. Response string `json:"response,omitempty"`
  28905. // ForceSendFields is a list of field names (e.g. "Port") to
  28906. // unconditionally include in API requests. By default, fields with
  28907. // empty values are omitted from API requests. However, any non-pointer,
  28908. // non-interface field appearing in ForceSendFields will be sent to the
  28909. // server regardless of whether the field is empty or not. This may be
  28910. // used to include empty fields in Patch requests.
  28911. ForceSendFields []string `json:"-"`
  28912. // NullFields is a list of field names (e.g. "Port") to include in API
  28913. // requests with the JSON null value. By default, fields with empty
  28914. // values are omitted from API requests. However, any field with an
  28915. // empty value appearing in NullFields will be sent to the server as
  28916. // null. It is an error if a field in this list has a non-empty value.
  28917. // This may be used to include null fields in Patch requests.
  28918. NullFields []string `json:"-"`
  28919. }
  28920. func (s *UDPHealthCheck) MarshalJSON() ([]byte, error) {
  28921. type NoMethod UDPHealthCheck
  28922. raw := NoMethod(*s)
  28923. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28924. }
  28925. // UrlMap: A UrlMap resource. This resource defines the mapping from URL
  28926. // to the BackendService resource, based on the "longest-match" of the
  28927. // URL's host and path.
  28928. type UrlMap struct {
  28929. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  28930. // format.
  28931. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  28932. // DefaultService: The URL of the BackendService resource if none of the
  28933. // hostRules match.
  28934. DefaultService string `json:"defaultService,omitempty"`
  28935. // Description: An optional description of this resource. Provide this
  28936. // property when you create the resource.
  28937. Description string `json:"description,omitempty"`
  28938. // Fingerprint: Fingerprint of this resource. A hash of the contents
  28939. // stored in this object. This field is used in optimistic locking. This
  28940. // field will be ignored when inserting a UrlMap. An up-to-date
  28941. // fingerprint must be provided in order to update the UrlMap.
  28942. Fingerprint string `json:"fingerprint,omitempty"`
  28943. // HostRules: The list of HostRules to use against the URL.
  28944. HostRules []*HostRule `json:"hostRules,omitempty"`
  28945. // Id: [Output Only] The unique identifier for the resource. This
  28946. // identifier is defined by the server.
  28947. Id uint64 `json:"id,omitempty,string"`
  28948. // Kind: [Output Only] Type of the resource. Always compute#urlMaps for
  28949. // url maps.
  28950. Kind string `json:"kind,omitempty"`
  28951. // Name: Name of the resource. Provided by the client when the resource
  28952. // is created. The name must be 1-63 characters long, and comply with
  28953. // RFC1035. Specifically, the name must be 1-63 characters long and
  28954. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  28955. // the first character must be a lowercase letter, and all following
  28956. // characters must be a dash, lowercase letter, or digit, except the
  28957. // last character, which cannot be a dash.
  28958. Name string `json:"name,omitempty"`
  28959. // PathMatchers: The list of named PathMatchers to use against the URL.
  28960. PathMatchers []*PathMatcher `json:"pathMatchers,omitempty"`
  28961. // Region: [Output Only] URL of the region where the regional URL map
  28962. // resides. This field is not applicable to global URL maps. You must
  28963. // specify this field as part of the HTTP request URL. It is not
  28964. // settable as a field in the request body.
  28965. Region string `json:"region,omitempty"`
  28966. // SelfLink: [Output Only] Server-defined URL for the resource.
  28967. SelfLink string `json:"selfLink,omitempty"`
  28968. // Tests: The list of expected URL mapping tests. Request to update this
  28969. // UrlMap will succeed only if all of the test cases pass. You can
  28970. // specify a maximum of 100 tests per UrlMap.
  28971. Tests []*UrlMapTest `json:"tests,omitempty"`
  28972. // ServerResponse contains the HTTP response code and headers from the
  28973. // server.
  28974. googleapi.ServerResponse `json:"-"`
  28975. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  28976. // to unconditionally include in API requests. By default, fields with
  28977. // empty values are omitted from API requests. However, any non-pointer,
  28978. // non-interface field appearing in ForceSendFields will be sent to the
  28979. // server regardless of whether the field is empty or not. This may be
  28980. // used to include empty fields in Patch requests.
  28981. ForceSendFields []string `json:"-"`
  28982. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  28983. // include in API requests with the JSON null value. By default, fields
  28984. // with empty values are omitted from API requests. However, any field
  28985. // with an empty value appearing in NullFields will be sent to the
  28986. // server as null. It is an error if a field in this list has a
  28987. // non-empty value. This may be used to include null fields in Patch
  28988. // requests.
  28989. NullFields []string `json:"-"`
  28990. }
  28991. func (s *UrlMap) MarshalJSON() ([]byte, error) {
  28992. type NoMethod UrlMap
  28993. raw := NoMethod(*s)
  28994. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28995. }
  28996. // UrlMapList: Contains a list of UrlMap resources.
  28997. type UrlMapList struct {
  28998. // Id: [Output Only] Unique identifier for the resource; defined by the
  28999. // server.
  29000. Id string `json:"id,omitempty"`
  29001. // Items: A list of UrlMap resources.
  29002. Items []*UrlMap `json:"items,omitempty"`
  29003. // Kind: Type of resource.
  29004. Kind string `json:"kind,omitempty"`
  29005. // NextPageToken: [Output Only] This token allows you to get the next
  29006. // page of results for list requests. If the number of results is larger
  29007. // than maxResults, use the nextPageToken as a value for the query
  29008. // parameter pageToken in the next list request. Subsequent list
  29009. // requests will have their own nextPageToken to continue paging through
  29010. // the results.
  29011. NextPageToken string `json:"nextPageToken,omitempty"`
  29012. // SelfLink: [Output Only] Server-defined URL for this resource.
  29013. SelfLink string `json:"selfLink,omitempty"`
  29014. // Warning: [Output Only] Informational warning message.
  29015. Warning *UrlMapListWarning `json:"warning,omitempty"`
  29016. // ServerResponse contains the HTTP response code and headers from the
  29017. // server.
  29018. googleapi.ServerResponse `json:"-"`
  29019. // ForceSendFields is a list of field names (e.g. "Id") to
  29020. // unconditionally include in API requests. By default, fields with
  29021. // empty values are omitted from API requests. However, any non-pointer,
  29022. // non-interface field appearing in ForceSendFields will be sent to the
  29023. // server regardless of whether the field is empty or not. This may be
  29024. // used to include empty fields in Patch requests.
  29025. ForceSendFields []string `json:"-"`
  29026. // NullFields is a list of field names (e.g. "Id") to include in API
  29027. // requests with the JSON null value. By default, fields with empty
  29028. // values are omitted from API requests. However, any field with an
  29029. // empty value appearing in NullFields will be sent to the server as
  29030. // null. It is an error if a field in this list has a non-empty value.
  29031. // This may be used to include null fields in Patch requests.
  29032. NullFields []string `json:"-"`
  29033. }
  29034. func (s *UrlMapList) MarshalJSON() ([]byte, error) {
  29035. type NoMethod UrlMapList
  29036. raw := NoMethod(*s)
  29037. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29038. }
  29039. // UrlMapListWarning: [Output Only] Informational warning message.
  29040. type UrlMapListWarning struct {
  29041. // Code: [Output Only] A warning code, if applicable. For example,
  29042. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  29043. // the response.
  29044. //
  29045. // Possible values:
  29046. // "CLEANUP_FAILED"
  29047. // "DEPRECATED_RESOURCE_USED"
  29048. // "DEPRECATED_TYPE_USED"
  29049. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  29050. // "EXPERIMENTAL_TYPE_USED"
  29051. // "EXTERNAL_API_WARNING"
  29052. // "FIELD_VALUE_OVERRIDEN"
  29053. // "INJECTED_KERNELS_DEPRECATED"
  29054. // "MISSING_TYPE_DEPENDENCY"
  29055. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  29056. // "NEXT_HOP_CANNOT_IP_FORWARD"
  29057. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  29058. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  29059. // "NEXT_HOP_NOT_RUNNING"
  29060. // "NOT_CRITICAL_ERROR"
  29061. // "NO_RESULTS_ON_PAGE"
  29062. // "REQUIRED_TOS_AGREEMENT"
  29063. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  29064. // "RESOURCE_NOT_DELETED"
  29065. // "SCHEMA_VALIDATION_IGNORED"
  29066. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  29067. // "UNDECLARED_PROPERTIES"
  29068. // "UNREACHABLE"
  29069. Code string `json:"code,omitempty"`
  29070. // Data: [Output Only] Metadata about this warning in key: value format.
  29071. // For example:
  29072. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  29073. Data []*UrlMapListWarningData `json:"data,omitempty"`
  29074. // Message: [Output Only] A human-readable description of the warning
  29075. // code.
  29076. Message string `json:"message,omitempty"`
  29077. // ForceSendFields is a list of field names (e.g. "Code") to
  29078. // unconditionally include in API requests. By default, fields with
  29079. // empty values are omitted from API requests. However, any non-pointer,
  29080. // non-interface field appearing in ForceSendFields will be sent to the
  29081. // server regardless of whether the field is empty or not. This may be
  29082. // used to include empty fields in Patch requests.
  29083. ForceSendFields []string `json:"-"`
  29084. // NullFields is a list of field names (e.g. "Code") to include in API
  29085. // requests with the JSON null value. By default, fields with empty
  29086. // values are omitted from API requests. However, any field with an
  29087. // empty value appearing in NullFields will be sent to the server as
  29088. // null. It is an error if a field in this list has a non-empty value.
  29089. // This may be used to include null fields in Patch requests.
  29090. NullFields []string `json:"-"`
  29091. }
  29092. func (s *UrlMapListWarning) MarshalJSON() ([]byte, error) {
  29093. type NoMethod UrlMapListWarning
  29094. raw := NoMethod(*s)
  29095. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29096. }
  29097. type UrlMapListWarningData struct {
  29098. // Key: [Output Only] A key that provides more detail on the warning
  29099. // being returned. For example, for warnings where there are no results
  29100. // in a list request for a particular zone, this key might be scope and
  29101. // the key value might be the zone name. Other examples might be a key
  29102. // indicating a deprecated resource and a suggested replacement, or a
  29103. // warning about invalid network settings (for example, if an instance
  29104. // attempts to perform IP forwarding but is not enabled for IP
  29105. // forwarding).
  29106. Key string `json:"key,omitempty"`
  29107. // Value: [Output Only] A warning data value corresponding to the key.
  29108. Value string `json:"value,omitempty"`
  29109. // ForceSendFields is a list of field names (e.g. "Key") to
  29110. // unconditionally include in API requests. By default, fields with
  29111. // empty values are omitted from API requests. However, any non-pointer,
  29112. // non-interface field appearing in ForceSendFields will be sent to the
  29113. // server regardless of whether the field is empty or not. This may be
  29114. // used to include empty fields in Patch requests.
  29115. ForceSendFields []string `json:"-"`
  29116. // NullFields is a list of field names (e.g. "Key") to include in API
  29117. // requests with the JSON null value. By default, fields with empty
  29118. // values are omitted from API requests. However, any field with an
  29119. // empty value appearing in NullFields will be sent to the server as
  29120. // null. It is an error if a field in this list has a non-empty value.
  29121. // This may be used to include null fields in Patch requests.
  29122. NullFields []string `json:"-"`
  29123. }
  29124. func (s *UrlMapListWarningData) MarshalJSON() ([]byte, error) {
  29125. type NoMethod UrlMapListWarningData
  29126. raw := NoMethod(*s)
  29127. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29128. }
  29129. type UrlMapReference struct {
  29130. UrlMap string `json:"urlMap,omitempty"`
  29131. // ForceSendFields is a list of field names (e.g. "UrlMap") to
  29132. // unconditionally include in API requests. By default, fields with
  29133. // empty values are omitted from API requests. However, any non-pointer,
  29134. // non-interface field appearing in ForceSendFields will be sent to the
  29135. // server regardless of whether the field is empty or not. This may be
  29136. // used to include empty fields in Patch requests.
  29137. ForceSendFields []string `json:"-"`
  29138. // NullFields is a list of field names (e.g. "UrlMap") to include in API
  29139. // requests with the JSON null value. By default, fields with empty
  29140. // values are omitted from API requests. However, any field with an
  29141. // empty value appearing in NullFields will be sent to the server as
  29142. // null. It is an error if a field in this list has a non-empty value.
  29143. // This may be used to include null fields in Patch requests.
  29144. NullFields []string `json:"-"`
  29145. }
  29146. func (s *UrlMapReference) MarshalJSON() ([]byte, error) {
  29147. type NoMethod UrlMapReference
  29148. raw := NoMethod(*s)
  29149. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29150. }
  29151. // UrlMapTest: Message for the expected URL mappings.
  29152. type UrlMapTest struct {
  29153. // Description: Description of this test case.
  29154. Description string `json:"description,omitempty"`
  29155. // Host: Host portion of the URL.
  29156. Host string `json:"host,omitempty"`
  29157. // Path: Path portion of the URL.
  29158. Path string `json:"path,omitempty"`
  29159. // Service: Expected BackendService resource the given URL should be
  29160. // mapped to.
  29161. Service string `json:"service,omitempty"`
  29162. // ForceSendFields is a list of field names (e.g. "Description") to
  29163. // unconditionally include in API requests. By default, fields with
  29164. // empty values are omitted from API requests. However, any non-pointer,
  29165. // non-interface field appearing in ForceSendFields will be sent to the
  29166. // server regardless of whether the field is empty or not. This may be
  29167. // used to include empty fields in Patch requests.
  29168. ForceSendFields []string `json:"-"`
  29169. // NullFields is a list of field names (e.g. "Description") to include
  29170. // in API requests with the JSON null value. By default, fields with
  29171. // empty values are omitted from API requests. However, any field with
  29172. // an empty value appearing in NullFields will be sent to the server as
  29173. // null. It is an error if a field in this list has a non-empty value.
  29174. // This may be used to include null fields in Patch requests.
  29175. NullFields []string `json:"-"`
  29176. }
  29177. func (s *UrlMapTest) MarshalJSON() ([]byte, error) {
  29178. type NoMethod UrlMapTest
  29179. raw := NoMethod(*s)
  29180. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29181. }
  29182. // UrlMapValidationResult: Message representing the validation result
  29183. // for a UrlMap.
  29184. type UrlMapValidationResult struct {
  29185. LoadErrors []string `json:"loadErrors,omitempty"`
  29186. // LoadSucceeded: Whether the given UrlMap can be successfully loaded.
  29187. // If false, 'loadErrors' indicates the reasons.
  29188. LoadSucceeded bool `json:"loadSucceeded,omitempty"`
  29189. TestFailures []*TestFailure `json:"testFailures,omitempty"`
  29190. // TestPassed: If successfully loaded, this field indicates whether the
  29191. // test passed. If false, 'testFailures's indicate the reason of
  29192. // failure.
  29193. TestPassed bool `json:"testPassed,omitempty"`
  29194. // ForceSendFields is a list of field names (e.g. "LoadErrors") to
  29195. // unconditionally include in API requests. By default, fields with
  29196. // empty values are omitted from API requests. However, any non-pointer,
  29197. // non-interface field appearing in ForceSendFields will be sent to the
  29198. // server regardless of whether the field is empty or not. This may be
  29199. // used to include empty fields in Patch requests.
  29200. ForceSendFields []string `json:"-"`
  29201. // NullFields is a list of field names (e.g. "LoadErrors") to include in
  29202. // API requests with the JSON null value. By default, fields with empty
  29203. // values are omitted from API requests. However, any field with an
  29204. // empty value appearing in NullFields will be sent to the server as
  29205. // null. It is an error if a field in this list has a non-empty value.
  29206. // This may be used to include null fields in Patch requests.
  29207. NullFields []string `json:"-"`
  29208. }
  29209. func (s *UrlMapValidationResult) MarshalJSON() ([]byte, error) {
  29210. type NoMethod UrlMapValidationResult
  29211. raw := NoMethod(*s)
  29212. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29213. }
  29214. type UrlMapsValidateRequest struct {
  29215. // Resource: Content of the UrlMap to be validated.
  29216. Resource *UrlMap `json:"resource,omitempty"`
  29217. // ForceSendFields is a list of field names (e.g. "Resource") to
  29218. // unconditionally include in API requests. By default, fields with
  29219. // empty values are omitted from API requests. However, any non-pointer,
  29220. // non-interface field appearing in ForceSendFields will be sent to the
  29221. // server regardless of whether the field is empty or not. This may be
  29222. // used to include empty fields in Patch requests.
  29223. ForceSendFields []string `json:"-"`
  29224. // NullFields is a list of field names (e.g. "Resource") to include in
  29225. // API requests with the JSON null value. By default, fields with empty
  29226. // values are omitted from API requests. However, any field with an
  29227. // empty value appearing in NullFields will be sent to the server as
  29228. // null. It is an error if a field in this list has a non-empty value.
  29229. // This may be used to include null fields in Patch requests.
  29230. NullFields []string `json:"-"`
  29231. }
  29232. func (s *UrlMapsValidateRequest) MarshalJSON() ([]byte, error) {
  29233. type NoMethod UrlMapsValidateRequest
  29234. raw := NoMethod(*s)
  29235. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29236. }
  29237. type UrlMapsValidateResponse struct {
  29238. Result *UrlMapValidationResult `json:"result,omitempty"`
  29239. // ServerResponse contains the HTTP response code and headers from the
  29240. // server.
  29241. googleapi.ServerResponse `json:"-"`
  29242. // ForceSendFields is a list of field names (e.g. "Result") to
  29243. // unconditionally include in API requests. By default, fields with
  29244. // empty values are omitted from API requests. However, any non-pointer,
  29245. // non-interface field appearing in ForceSendFields will be sent to the
  29246. // server regardless of whether the field is empty or not. This may be
  29247. // used to include empty fields in Patch requests.
  29248. ForceSendFields []string `json:"-"`
  29249. // NullFields is a list of field names (e.g. "Result") to include in API
  29250. // requests with the JSON null value. By default, fields with empty
  29251. // values are omitted from API requests. However, any field with an
  29252. // empty value appearing in NullFields will be sent to the server as
  29253. // null. It is an error if a field in this list has a non-empty value.
  29254. // This may be used to include null fields in Patch requests.
  29255. NullFields []string `json:"-"`
  29256. }
  29257. func (s *UrlMapsValidateResponse) MarshalJSON() ([]byte, error) {
  29258. type NoMethod UrlMapsValidateResponse
  29259. raw := NoMethod(*s)
  29260. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29261. }
  29262. // UsableSubnetwork: Subnetwork which the current user has
  29263. // compute.subnetworks.use permission on.
  29264. type UsableSubnetwork struct {
  29265. // IpCidrRange: The range of internal addresses that are owned by this
  29266. // subnetwork.
  29267. IpCidrRange string `json:"ipCidrRange,omitempty"`
  29268. // Network: Network URL.
  29269. Network string `json:"network,omitempty"`
  29270. // SecondaryIpRanges: Secondary IP ranges.
  29271. SecondaryIpRanges []*UsableSubnetworkSecondaryRange `json:"secondaryIpRanges,omitempty"`
  29272. // Subnetwork: Subnetwork URL.
  29273. Subnetwork string `json:"subnetwork,omitempty"`
  29274. // ForceSendFields is a list of field names (e.g. "IpCidrRange") to
  29275. // unconditionally include in API requests. By default, fields with
  29276. // empty values are omitted from API requests. However, any non-pointer,
  29277. // non-interface field appearing in ForceSendFields will be sent to the
  29278. // server regardless of whether the field is empty or not. This may be
  29279. // used to include empty fields in Patch requests.
  29280. ForceSendFields []string `json:"-"`
  29281. // NullFields is a list of field names (e.g. "IpCidrRange") to include
  29282. // in API requests with the JSON null value. By default, fields with
  29283. // empty values are omitted from API requests. However, any field with
  29284. // an empty value appearing in NullFields will be sent to the server as
  29285. // null. It is an error if a field in this list has a non-empty value.
  29286. // This may be used to include null fields in Patch requests.
  29287. NullFields []string `json:"-"`
  29288. }
  29289. func (s *UsableSubnetwork) MarshalJSON() ([]byte, error) {
  29290. type NoMethod UsableSubnetwork
  29291. raw := NoMethod(*s)
  29292. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29293. }
  29294. // UsableSubnetworkSecondaryRange: Secondary IP range of a usable
  29295. // subnetwork.
  29296. type UsableSubnetworkSecondaryRange struct {
  29297. // IpCidrRange: The range of IP addresses belonging to this subnetwork
  29298. // secondary range.
  29299. IpCidrRange string `json:"ipCidrRange,omitempty"`
  29300. // RangeName: The name associated with this subnetwork secondary range,
  29301. // used when adding an alias IP range to a VM instance. The name must be
  29302. // 1-63 characters long, and comply with RFC1035. The name must be
  29303. // unique within the subnetwork.
  29304. RangeName string `json:"rangeName,omitempty"`
  29305. // ForceSendFields is a list of field names (e.g. "IpCidrRange") to
  29306. // unconditionally include in API requests. By default, fields with
  29307. // empty values are omitted from API requests. However, any non-pointer,
  29308. // non-interface field appearing in ForceSendFields will be sent to the
  29309. // server regardless of whether the field is empty or not. This may be
  29310. // used to include empty fields in Patch requests.
  29311. ForceSendFields []string `json:"-"`
  29312. // NullFields is a list of field names (e.g. "IpCidrRange") to include
  29313. // in API requests with the JSON null value. By default, fields with
  29314. // empty values are omitted from API requests. However, any field with
  29315. // an empty value appearing in NullFields will be sent to the server as
  29316. // null. It is an error if a field in this list has a non-empty value.
  29317. // This may be used to include null fields in Patch requests.
  29318. NullFields []string `json:"-"`
  29319. }
  29320. func (s *UsableSubnetworkSecondaryRange) MarshalJSON() ([]byte, error) {
  29321. type NoMethod UsableSubnetworkSecondaryRange
  29322. raw := NoMethod(*s)
  29323. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29324. }
  29325. type UsableSubnetworksAggregatedList struct {
  29326. // Id: [Output Only] The unique identifier for the resource. This
  29327. // identifier is defined by the server.
  29328. Id string `json:"id,omitempty"`
  29329. // Items: [Output] A list of usable subnetwork URLs.
  29330. Items []*UsableSubnetwork `json:"items,omitempty"`
  29331. // Kind: [Output Only] Type of resource. Always
  29332. // compute#usableSubnetworksAggregatedList for aggregated lists of
  29333. // usable subnetworks.
  29334. Kind string `json:"kind,omitempty"`
  29335. // NextPageToken: [Output Only] This token allows you to get the next
  29336. // page of results for list requests. If the number of results is larger
  29337. // than maxResults, use the nextPageToken as a value for the query
  29338. // parameter pageToken in the next list request. Subsequent list
  29339. // requests will have their own nextPageToken to continue paging through
  29340. // the results.
  29341. NextPageToken string `json:"nextPageToken,omitempty"`
  29342. // SelfLink: [Output Only] Server-defined URL for this resource.
  29343. SelfLink string `json:"selfLink,omitempty"`
  29344. // Warning: [Output Only] Informational warning message.
  29345. Warning *UsableSubnetworksAggregatedListWarning `json:"warning,omitempty"`
  29346. // ServerResponse contains the HTTP response code and headers from the
  29347. // server.
  29348. googleapi.ServerResponse `json:"-"`
  29349. // ForceSendFields is a list of field names (e.g. "Id") to
  29350. // unconditionally include in API requests. By default, fields with
  29351. // empty values are omitted from API requests. However, any non-pointer,
  29352. // non-interface field appearing in ForceSendFields will be sent to the
  29353. // server regardless of whether the field is empty or not. This may be
  29354. // used to include empty fields in Patch requests.
  29355. ForceSendFields []string `json:"-"`
  29356. // NullFields is a list of field names (e.g. "Id") to include in API
  29357. // requests with the JSON null value. By default, fields with empty
  29358. // values are omitted from API requests. However, any field with an
  29359. // empty value appearing in NullFields will be sent to the server as
  29360. // null. It is an error if a field in this list has a non-empty value.
  29361. // This may be used to include null fields in Patch requests.
  29362. NullFields []string `json:"-"`
  29363. }
  29364. func (s *UsableSubnetworksAggregatedList) MarshalJSON() ([]byte, error) {
  29365. type NoMethod UsableSubnetworksAggregatedList
  29366. raw := NoMethod(*s)
  29367. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29368. }
  29369. // UsableSubnetworksAggregatedListWarning: [Output Only] Informational
  29370. // warning message.
  29371. type UsableSubnetworksAggregatedListWarning struct {
  29372. // Code: [Output Only] A warning code, if applicable. For example,
  29373. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  29374. // the response.
  29375. //
  29376. // Possible values:
  29377. // "CLEANUP_FAILED"
  29378. // "DEPRECATED_RESOURCE_USED"
  29379. // "DEPRECATED_TYPE_USED"
  29380. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  29381. // "EXPERIMENTAL_TYPE_USED"
  29382. // "EXTERNAL_API_WARNING"
  29383. // "FIELD_VALUE_OVERRIDEN"
  29384. // "INJECTED_KERNELS_DEPRECATED"
  29385. // "MISSING_TYPE_DEPENDENCY"
  29386. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  29387. // "NEXT_HOP_CANNOT_IP_FORWARD"
  29388. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  29389. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  29390. // "NEXT_HOP_NOT_RUNNING"
  29391. // "NOT_CRITICAL_ERROR"
  29392. // "NO_RESULTS_ON_PAGE"
  29393. // "REQUIRED_TOS_AGREEMENT"
  29394. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  29395. // "RESOURCE_NOT_DELETED"
  29396. // "SCHEMA_VALIDATION_IGNORED"
  29397. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  29398. // "UNDECLARED_PROPERTIES"
  29399. // "UNREACHABLE"
  29400. Code string `json:"code,omitempty"`
  29401. // Data: [Output Only] Metadata about this warning in key: value format.
  29402. // For example:
  29403. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  29404. Data []*UsableSubnetworksAggregatedListWarningData `json:"data,omitempty"`
  29405. // Message: [Output Only] A human-readable description of the warning
  29406. // code.
  29407. Message string `json:"message,omitempty"`
  29408. // ForceSendFields is a list of field names (e.g. "Code") to
  29409. // unconditionally include in API requests. By default, fields with
  29410. // empty values are omitted from API requests. However, any non-pointer,
  29411. // non-interface field appearing in ForceSendFields will be sent to the
  29412. // server regardless of whether the field is empty or not. This may be
  29413. // used to include empty fields in Patch requests.
  29414. ForceSendFields []string `json:"-"`
  29415. // NullFields is a list of field names (e.g. "Code") to include in API
  29416. // requests with the JSON null value. By default, fields with empty
  29417. // values are omitted from API requests. However, any field with an
  29418. // empty value appearing in NullFields will be sent to the server as
  29419. // null. It is an error if a field in this list has a non-empty value.
  29420. // This may be used to include null fields in Patch requests.
  29421. NullFields []string `json:"-"`
  29422. }
  29423. func (s *UsableSubnetworksAggregatedListWarning) MarshalJSON() ([]byte, error) {
  29424. type NoMethod UsableSubnetworksAggregatedListWarning
  29425. raw := NoMethod(*s)
  29426. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29427. }
  29428. type UsableSubnetworksAggregatedListWarningData struct {
  29429. // Key: [Output Only] A key that provides more detail on the warning
  29430. // being returned. For example, for warnings where there are no results
  29431. // in a list request for a particular zone, this key might be scope and
  29432. // the key value might be the zone name. Other examples might be a key
  29433. // indicating a deprecated resource and a suggested replacement, or a
  29434. // warning about invalid network settings (for example, if an instance
  29435. // attempts to perform IP forwarding but is not enabled for IP
  29436. // forwarding).
  29437. Key string `json:"key,omitempty"`
  29438. // Value: [Output Only] A warning data value corresponding to the key.
  29439. Value string `json:"value,omitempty"`
  29440. // ForceSendFields is a list of field names (e.g. "Key") to
  29441. // unconditionally include in API requests. By default, fields with
  29442. // empty values are omitted from API requests. However, any non-pointer,
  29443. // non-interface field appearing in ForceSendFields will be sent to the
  29444. // server regardless of whether the field is empty or not. This may be
  29445. // used to include empty fields in Patch requests.
  29446. ForceSendFields []string `json:"-"`
  29447. // NullFields is a list of field names (e.g. "Key") to include in API
  29448. // requests with the JSON null value. By default, fields with empty
  29449. // values are omitted from API requests. However, any field with an
  29450. // empty value appearing in NullFields will be sent to the server as
  29451. // null. It is an error if a field in this list has a non-empty value.
  29452. // This may be used to include null fields in Patch requests.
  29453. NullFields []string `json:"-"`
  29454. }
  29455. func (s *UsableSubnetworksAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  29456. type NoMethod UsableSubnetworksAggregatedListWarningData
  29457. raw := NoMethod(*s)
  29458. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29459. }
  29460. // UsageExportLocation: The location in Cloud Storage and naming method
  29461. // of the daily usage report. Contains bucket_name and report_name
  29462. // prefix.
  29463. type UsageExportLocation struct {
  29464. // BucketName: The name of an existing bucket in Cloud Storage where the
  29465. // usage report object is stored. The Google Service Account is granted
  29466. // write access to this bucket. This can either be the bucket name by
  29467. // itself, such as example-bucket, or the bucket name with gs:// or
  29468. // https://storage.googleapis.com/ in front of it, such as
  29469. // gs://example-bucket.
  29470. BucketName string `json:"bucketName,omitempty"`
  29471. // ReportNamePrefix: An optional prefix for the name of the usage report
  29472. // object stored in bucketName. If not supplied, defaults to usage. The
  29473. // report is stored as a CSV file named
  29474. // report_name_prefix_gce_YYYYMMDD.csv where YYYYMMDD is the day of the
  29475. // usage according to Pacific Time. If you supply a prefix, it should
  29476. // conform to Cloud Storage object naming conventions.
  29477. ReportNamePrefix string `json:"reportNamePrefix,omitempty"`
  29478. // ForceSendFields is a list of field names (e.g. "BucketName") to
  29479. // unconditionally include in API requests. By default, fields with
  29480. // empty values are omitted from API requests. However, any non-pointer,
  29481. // non-interface field appearing in ForceSendFields will be sent to the
  29482. // server regardless of whether the field is empty or not. This may be
  29483. // used to include empty fields in Patch requests.
  29484. ForceSendFields []string `json:"-"`
  29485. // NullFields is a list of field names (e.g. "BucketName") to include in
  29486. // API requests with the JSON null value. By default, fields with empty
  29487. // values are omitted from API requests. However, any field with an
  29488. // empty value appearing in NullFields will be sent to the server as
  29489. // null. It is an error if a field in this list has a non-empty value.
  29490. // This may be used to include null fields in Patch requests.
  29491. NullFields []string `json:"-"`
  29492. }
  29493. func (s *UsageExportLocation) MarshalJSON() ([]byte, error) {
  29494. type NoMethod UsageExportLocation
  29495. raw := NoMethod(*s)
  29496. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29497. }
  29498. // VpnGateway: Represents a VPN gateway resource.
  29499. type VpnGateway struct {
  29500. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  29501. // format.
  29502. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  29503. // Description: An optional description of this resource. Provide this
  29504. // property when you create the resource.
  29505. Description string `json:"description,omitempty"`
  29506. // Id: [Output Only] The unique identifier for the resource. This
  29507. // identifier is defined by the server.
  29508. Id uint64 `json:"id,omitempty,string"`
  29509. // Kind: [Output Only] Type of resource. Always compute#vpnGateway for
  29510. // VPN gateways.
  29511. Kind string `json:"kind,omitempty"`
  29512. // LabelFingerprint: A fingerprint for the labels being applied to this
  29513. // VpnGateway, which is essentially a hash of the labels set used for
  29514. // optimistic locking. The fingerprint is initially generated by Compute
  29515. // Engine and changes after every request to modify or update labels.
  29516. // You must always provide an up-to-date fingerprint hash in order to
  29517. // update or change labels.
  29518. //
  29519. // To see the latest fingerprint, make a get() request to retrieve an
  29520. // VpnGateway.
  29521. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  29522. // Labels: Labels to apply to this VpnGateway resource. These can be
  29523. // later modified by the setLabels method. Each label key/value must
  29524. // comply with RFC1035. Label values may be empty.
  29525. Labels map[string]string `json:"labels,omitempty"`
  29526. // Name: Name of the resource. Provided by the client when the resource
  29527. // is created. The name must be 1-63 characters long, and comply with
  29528. // RFC1035. Specifically, the name must be 1-63 characters long and
  29529. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  29530. // the first character must be a lowercase letter, and all following
  29531. // characters must be a dash, lowercase letter, or digit, except the
  29532. // last character, which cannot be a dash.
  29533. Name string `json:"name,omitempty"`
  29534. // Network: URL of the network to which this VPN gateway is attached.
  29535. // Provided by the client when the VPN gateway is created.
  29536. Network string `json:"network,omitempty"`
  29537. // Region: [Output Only] URL of the region where the VPN gateway
  29538. // resides.
  29539. Region string `json:"region,omitempty"`
  29540. // SelfLink: [Output Only] Server-defined URL for the resource.
  29541. SelfLink string `json:"selfLink,omitempty"`
  29542. // VpnInterfaces: [Output Only] A list of interfaces on this VPN
  29543. // gateway.
  29544. VpnInterfaces []*VpnGatewayVpnGatewayInterface `json:"vpnInterfaces,omitempty"`
  29545. // ServerResponse contains the HTTP response code and headers from the
  29546. // server.
  29547. googleapi.ServerResponse `json:"-"`
  29548. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  29549. // to unconditionally include in API requests. By default, fields with
  29550. // empty values are omitted from API requests. However, any non-pointer,
  29551. // non-interface field appearing in ForceSendFields will be sent to the
  29552. // server regardless of whether the field is empty or not. This may be
  29553. // used to include empty fields in Patch requests.
  29554. ForceSendFields []string `json:"-"`
  29555. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  29556. // include in API requests with the JSON null value. By default, fields
  29557. // with empty values are omitted from API requests. However, any field
  29558. // with an empty value appearing in NullFields will be sent to the
  29559. // server as null. It is an error if a field in this list has a
  29560. // non-empty value. This may be used to include null fields in Patch
  29561. // requests.
  29562. NullFields []string `json:"-"`
  29563. }
  29564. func (s *VpnGateway) MarshalJSON() ([]byte, error) {
  29565. type NoMethod VpnGateway
  29566. raw := NoMethod(*s)
  29567. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29568. }
  29569. type VpnGatewayAggregatedList struct {
  29570. // Id: [Output Only] Unique identifier for the resource; defined by the
  29571. // server.
  29572. Id string `json:"id,omitempty"`
  29573. // Items: A list of VpnGateway resources.
  29574. Items map[string]VpnGatewaysScopedList `json:"items,omitempty"`
  29575. // Kind: [Output Only] Type of resource. Always compute#vpnGateway for
  29576. // VPN gateways.
  29577. Kind string `json:"kind,omitempty"`
  29578. // NextPageToken: [Output Only] This token allows you to get the next
  29579. // page of results for list requests. If the number of results is larger
  29580. // than maxResults, use the nextPageToken as a value for the query
  29581. // parameter pageToken in the next list request. Subsequent list
  29582. // requests will have their own nextPageToken to continue paging through
  29583. // the results.
  29584. NextPageToken string `json:"nextPageToken,omitempty"`
  29585. // SelfLink: [Output Only] Server-defined URL for this resource.
  29586. SelfLink string `json:"selfLink,omitempty"`
  29587. // Warning: [Output Only] Informational warning message.
  29588. Warning *VpnGatewayAggregatedListWarning `json:"warning,omitempty"`
  29589. // ServerResponse contains the HTTP response code and headers from the
  29590. // server.
  29591. googleapi.ServerResponse `json:"-"`
  29592. // ForceSendFields is a list of field names (e.g. "Id") to
  29593. // unconditionally include in API requests. By default, fields with
  29594. // empty values are omitted from API requests. However, any non-pointer,
  29595. // non-interface field appearing in ForceSendFields will be sent to the
  29596. // server regardless of whether the field is empty or not. This may be
  29597. // used to include empty fields in Patch requests.
  29598. ForceSendFields []string `json:"-"`
  29599. // NullFields is a list of field names (e.g. "Id") to include in API
  29600. // requests with the JSON null value. By default, fields with empty
  29601. // values are omitted from API requests. However, any field with an
  29602. // empty value appearing in NullFields will be sent to the server as
  29603. // null. It is an error if a field in this list has a non-empty value.
  29604. // This may be used to include null fields in Patch requests.
  29605. NullFields []string `json:"-"`
  29606. }
  29607. func (s *VpnGatewayAggregatedList) MarshalJSON() ([]byte, error) {
  29608. type NoMethod VpnGatewayAggregatedList
  29609. raw := NoMethod(*s)
  29610. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29611. }
  29612. // VpnGatewayAggregatedListWarning: [Output Only] Informational warning
  29613. // message.
  29614. type VpnGatewayAggregatedListWarning struct {
  29615. // Code: [Output Only] A warning code, if applicable. For example,
  29616. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  29617. // the response.
  29618. //
  29619. // Possible values:
  29620. // "CLEANUP_FAILED"
  29621. // "DEPRECATED_RESOURCE_USED"
  29622. // "DEPRECATED_TYPE_USED"
  29623. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  29624. // "EXPERIMENTAL_TYPE_USED"
  29625. // "EXTERNAL_API_WARNING"
  29626. // "FIELD_VALUE_OVERRIDEN"
  29627. // "INJECTED_KERNELS_DEPRECATED"
  29628. // "MISSING_TYPE_DEPENDENCY"
  29629. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  29630. // "NEXT_HOP_CANNOT_IP_FORWARD"
  29631. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  29632. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  29633. // "NEXT_HOP_NOT_RUNNING"
  29634. // "NOT_CRITICAL_ERROR"
  29635. // "NO_RESULTS_ON_PAGE"
  29636. // "REQUIRED_TOS_AGREEMENT"
  29637. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  29638. // "RESOURCE_NOT_DELETED"
  29639. // "SCHEMA_VALIDATION_IGNORED"
  29640. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  29641. // "UNDECLARED_PROPERTIES"
  29642. // "UNREACHABLE"
  29643. Code string `json:"code,omitempty"`
  29644. // Data: [Output Only] Metadata about this warning in key: value format.
  29645. // For example:
  29646. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  29647. Data []*VpnGatewayAggregatedListWarningData `json:"data,omitempty"`
  29648. // Message: [Output Only] A human-readable description of the warning
  29649. // code.
  29650. Message string `json:"message,omitempty"`
  29651. // ForceSendFields is a list of field names (e.g. "Code") to
  29652. // unconditionally include in API requests. By default, fields with
  29653. // empty values are omitted from API requests. However, any non-pointer,
  29654. // non-interface field appearing in ForceSendFields will be sent to the
  29655. // server regardless of whether the field is empty or not. This may be
  29656. // used to include empty fields in Patch requests.
  29657. ForceSendFields []string `json:"-"`
  29658. // NullFields is a list of field names (e.g. "Code") to include in API
  29659. // requests with the JSON null value. By default, fields with empty
  29660. // values are omitted from API requests. However, any field with an
  29661. // empty value appearing in NullFields will be sent to the server as
  29662. // null. It is an error if a field in this list has a non-empty value.
  29663. // This may be used to include null fields in Patch requests.
  29664. NullFields []string `json:"-"`
  29665. }
  29666. func (s *VpnGatewayAggregatedListWarning) MarshalJSON() ([]byte, error) {
  29667. type NoMethod VpnGatewayAggregatedListWarning
  29668. raw := NoMethod(*s)
  29669. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29670. }
  29671. type VpnGatewayAggregatedListWarningData struct {
  29672. // Key: [Output Only] A key that provides more detail on the warning
  29673. // being returned. For example, for warnings where there are no results
  29674. // in a list request for a particular zone, this key might be scope and
  29675. // the key value might be the zone name. Other examples might be a key
  29676. // indicating a deprecated resource and a suggested replacement, or a
  29677. // warning about invalid network settings (for example, if an instance
  29678. // attempts to perform IP forwarding but is not enabled for IP
  29679. // forwarding).
  29680. Key string `json:"key,omitempty"`
  29681. // Value: [Output Only] A warning data value corresponding to the key.
  29682. Value string `json:"value,omitempty"`
  29683. // ForceSendFields is a list of field names (e.g. "Key") to
  29684. // unconditionally include in API requests. By default, fields with
  29685. // empty values are omitted from API requests. However, any non-pointer,
  29686. // non-interface field appearing in ForceSendFields will be sent to the
  29687. // server regardless of whether the field is empty or not. This may be
  29688. // used to include empty fields in Patch requests.
  29689. ForceSendFields []string `json:"-"`
  29690. // NullFields is a list of field names (e.g. "Key") to include in API
  29691. // requests with the JSON null value. By default, fields with empty
  29692. // values are omitted from API requests. However, any field with an
  29693. // empty value appearing in NullFields will be sent to the server as
  29694. // null. It is an error if a field in this list has a non-empty value.
  29695. // This may be used to include null fields in Patch requests.
  29696. NullFields []string `json:"-"`
  29697. }
  29698. func (s *VpnGatewayAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  29699. type NoMethod VpnGatewayAggregatedListWarningData
  29700. raw := NoMethod(*s)
  29701. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29702. }
  29703. // VpnGatewayList: Contains a list of VpnGateway resources.
  29704. type VpnGatewayList struct {
  29705. // Id: [Output Only] Unique identifier for the resource; defined by the
  29706. // server.
  29707. Id string `json:"id,omitempty"`
  29708. // Items: A list of VpnGateway resources.
  29709. Items []*VpnGateway `json:"items,omitempty"`
  29710. // Kind: [Output Only] Type of resource. Always compute#vpnGateway for
  29711. // VPN gateways.
  29712. Kind string `json:"kind,omitempty"`
  29713. // NextPageToken: [Output Only] This token allows you to get the next
  29714. // page of results for list requests. If the number of results is larger
  29715. // than maxResults, use the nextPageToken as a value for the query
  29716. // parameter pageToken in the next list request. Subsequent list
  29717. // requests will have their own nextPageToken to continue paging through
  29718. // the results.
  29719. NextPageToken string `json:"nextPageToken,omitempty"`
  29720. // SelfLink: [Output Only] Server-defined URL for this resource.
  29721. SelfLink string `json:"selfLink,omitempty"`
  29722. // Warning: [Output Only] Informational warning message.
  29723. Warning *VpnGatewayListWarning `json:"warning,omitempty"`
  29724. // ServerResponse contains the HTTP response code and headers from the
  29725. // server.
  29726. googleapi.ServerResponse `json:"-"`
  29727. // ForceSendFields is a list of field names (e.g. "Id") to
  29728. // unconditionally include in API requests. By default, fields with
  29729. // empty values are omitted from API requests. However, any non-pointer,
  29730. // non-interface field appearing in ForceSendFields will be sent to the
  29731. // server regardless of whether the field is empty or not. This may be
  29732. // used to include empty fields in Patch requests.
  29733. ForceSendFields []string `json:"-"`
  29734. // NullFields is a list of field names (e.g. "Id") to include in API
  29735. // requests with the JSON null value. By default, fields with empty
  29736. // values are omitted from API requests. However, any field with an
  29737. // empty value appearing in NullFields will be sent to the server as
  29738. // null. It is an error if a field in this list has a non-empty value.
  29739. // This may be used to include null fields in Patch requests.
  29740. NullFields []string `json:"-"`
  29741. }
  29742. func (s *VpnGatewayList) MarshalJSON() ([]byte, error) {
  29743. type NoMethod VpnGatewayList
  29744. raw := NoMethod(*s)
  29745. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29746. }
  29747. // VpnGatewayListWarning: [Output Only] Informational warning message.
  29748. type VpnGatewayListWarning struct {
  29749. // Code: [Output Only] A warning code, if applicable. For example,
  29750. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  29751. // the response.
  29752. //
  29753. // Possible values:
  29754. // "CLEANUP_FAILED"
  29755. // "DEPRECATED_RESOURCE_USED"
  29756. // "DEPRECATED_TYPE_USED"
  29757. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  29758. // "EXPERIMENTAL_TYPE_USED"
  29759. // "EXTERNAL_API_WARNING"
  29760. // "FIELD_VALUE_OVERRIDEN"
  29761. // "INJECTED_KERNELS_DEPRECATED"
  29762. // "MISSING_TYPE_DEPENDENCY"
  29763. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  29764. // "NEXT_HOP_CANNOT_IP_FORWARD"
  29765. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  29766. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  29767. // "NEXT_HOP_NOT_RUNNING"
  29768. // "NOT_CRITICAL_ERROR"
  29769. // "NO_RESULTS_ON_PAGE"
  29770. // "REQUIRED_TOS_AGREEMENT"
  29771. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  29772. // "RESOURCE_NOT_DELETED"
  29773. // "SCHEMA_VALIDATION_IGNORED"
  29774. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  29775. // "UNDECLARED_PROPERTIES"
  29776. // "UNREACHABLE"
  29777. Code string `json:"code,omitempty"`
  29778. // Data: [Output Only] Metadata about this warning in key: value format.
  29779. // For example:
  29780. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  29781. Data []*VpnGatewayListWarningData `json:"data,omitempty"`
  29782. // Message: [Output Only] A human-readable description of the warning
  29783. // code.
  29784. Message string `json:"message,omitempty"`
  29785. // ForceSendFields is a list of field names (e.g. "Code") to
  29786. // unconditionally include in API requests. By default, fields with
  29787. // empty values are omitted from API requests. However, any non-pointer,
  29788. // non-interface field appearing in ForceSendFields will be sent to the
  29789. // server regardless of whether the field is empty or not. This may be
  29790. // used to include empty fields in Patch requests.
  29791. ForceSendFields []string `json:"-"`
  29792. // NullFields is a list of field names (e.g. "Code") to include in API
  29793. // requests with the JSON null value. By default, fields with empty
  29794. // values are omitted from API requests. However, any field with an
  29795. // empty value appearing in NullFields will be sent to the server as
  29796. // null. It is an error if a field in this list has a non-empty value.
  29797. // This may be used to include null fields in Patch requests.
  29798. NullFields []string `json:"-"`
  29799. }
  29800. func (s *VpnGatewayListWarning) MarshalJSON() ([]byte, error) {
  29801. type NoMethod VpnGatewayListWarning
  29802. raw := NoMethod(*s)
  29803. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29804. }
  29805. type VpnGatewayListWarningData struct {
  29806. // Key: [Output Only] A key that provides more detail on the warning
  29807. // being returned. For example, for warnings where there are no results
  29808. // in a list request for a particular zone, this key might be scope and
  29809. // the key value might be the zone name. Other examples might be a key
  29810. // indicating a deprecated resource and a suggested replacement, or a
  29811. // warning about invalid network settings (for example, if an instance
  29812. // attempts to perform IP forwarding but is not enabled for IP
  29813. // forwarding).
  29814. Key string `json:"key,omitempty"`
  29815. // Value: [Output Only] A warning data value corresponding to the key.
  29816. Value string `json:"value,omitempty"`
  29817. // ForceSendFields is a list of field names (e.g. "Key") to
  29818. // unconditionally include in API requests. By default, fields with
  29819. // empty values are omitted from API requests. However, any non-pointer,
  29820. // non-interface field appearing in ForceSendFields will be sent to the
  29821. // server regardless of whether the field is empty or not. This may be
  29822. // used to include empty fields in Patch requests.
  29823. ForceSendFields []string `json:"-"`
  29824. // NullFields is a list of field names (e.g. "Key") to include in API
  29825. // requests with the JSON null value. By default, fields with empty
  29826. // values are omitted from API requests. However, any field with an
  29827. // empty value appearing in NullFields will be sent to the server as
  29828. // null. It is an error if a field in this list has a non-empty value.
  29829. // This may be used to include null fields in Patch requests.
  29830. NullFields []string `json:"-"`
  29831. }
  29832. func (s *VpnGatewayListWarningData) MarshalJSON() ([]byte, error) {
  29833. type NoMethod VpnGatewayListWarningData
  29834. raw := NoMethod(*s)
  29835. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29836. }
  29837. // VpnGatewayVpnGatewayInterface: A VPN gateway interface.
  29838. type VpnGatewayVpnGatewayInterface struct {
  29839. // Id: The numeric ID of this VPN gateway interface.
  29840. Id int64 `json:"id,omitempty"`
  29841. // IpAddress: The external IP address for this VPN gateway interface.
  29842. IpAddress string `json:"ipAddress,omitempty"`
  29843. // ForceSendFields is a list of field names (e.g. "Id") to
  29844. // unconditionally include in API requests. By default, fields with
  29845. // empty values are omitted from API requests. However, any non-pointer,
  29846. // non-interface field appearing in ForceSendFields will be sent to the
  29847. // server regardless of whether the field is empty or not. This may be
  29848. // used to include empty fields in Patch requests.
  29849. ForceSendFields []string `json:"-"`
  29850. // NullFields is a list of field names (e.g. "Id") to include in API
  29851. // requests with the JSON null value. By default, fields with empty
  29852. // values are omitted from API requests. However, any field with an
  29853. // empty value appearing in NullFields will be sent to the server as
  29854. // null. It is an error if a field in this list has a non-empty value.
  29855. // This may be used to include null fields in Patch requests.
  29856. NullFields []string `json:"-"`
  29857. }
  29858. func (s *VpnGatewayVpnGatewayInterface) MarshalJSON() ([]byte, error) {
  29859. type NoMethod VpnGatewayVpnGatewayInterface
  29860. raw := NoMethod(*s)
  29861. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29862. }
  29863. type VpnGatewaysScopedList struct {
  29864. // VpnGateways: [Output Only] A list of VPN gateways contained in this
  29865. // scope.
  29866. VpnGateways []*VpnGateway `json:"vpnGateways,omitempty"`
  29867. // Warning: [Output Only] Informational warning which replaces the list
  29868. // of addresses when the list is empty.
  29869. Warning *VpnGatewaysScopedListWarning `json:"warning,omitempty"`
  29870. // ForceSendFields is a list of field names (e.g. "VpnGateways") to
  29871. // unconditionally include in API requests. By default, fields with
  29872. // empty values are omitted from API requests. However, any non-pointer,
  29873. // non-interface field appearing in ForceSendFields will be sent to the
  29874. // server regardless of whether the field is empty or not. This may be
  29875. // used to include empty fields in Patch requests.
  29876. ForceSendFields []string `json:"-"`
  29877. // NullFields is a list of field names (e.g. "VpnGateways") to include
  29878. // in API requests with the JSON null value. By default, fields with
  29879. // empty values are omitted from API requests. However, any field with
  29880. // an empty value appearing in NullFields will be sent to the server as
  29881. // null. It is an error if a field in this list has a non-empty value.
  29882. // This may be used to include null fields in Patch requests.
  29883. NullFields []string `json:"-"`
  29884. }
  29885. func (s *VpnGatewaysScopedList) MarshalJSON() ([]byte, error) {
  29886. type NoMethod VpnGatewaysScopedList
  29887. raw := NoMethod(*s)
  29888. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29889. }
  29890. // VpnGatewaysScopedListWarning: [Output Only] Informational warning
  29891. // which replaces the list of addresses when the list is empty.
  29892. type VpnGatewaysScopedListWarning struct {
  29893. // Code: [Output Only] A warning code, if applicable. For example,
  29894. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  29895. // the response.
  29896. //
  29897. // Possible values:
  29898. // "CLEANUP_FAILED"
  29899. // "DEPRECATED_RESOURCE_USED"
  29900. // "DEPRECATED_TYPE_USED"
  29901. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  29902. // "EXPERIMENTAL_TYPE_USED"
  29903. // "EXTERNAL_API_WARNING"
  29904. // "FIELD_VALUE_OVERRIDEN"
  29905. // "INJECTED_KERNELS_DEPRECATED"
  29906. // "MISSING_TYPE_DEPENDENCY"
  29907. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  29908. // "NEXT_HOP_CANNOT_IP_FORWARD"
  29909. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  29910. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  29911. // "NEXT_HOP_NOT_RUNNING"
  29912. // "NOT_CRITICAL_ERROR"
  29913. // "NO_RESULTS_ON_PAGE"
  29914. // "REQUIRED_TOS_AGREEMENT"
  29915. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  29916. // "RESOURCE_NOT_DELETED"
  29917. // "SCHEMA_VALIDATION_IGNORED"
  29918. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  29919. // "UNDECLARED_PROPERTIES"
  29920. // "UNREACHABLE"
  29921. Code string `json:"code,omitempty"`
  29922. // Data: [Output Only] Metadata about this warning in key: value format.
  29923. // For example:
  29924. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  29925. Data []*VpnGatewaysScopedListWarningData `json:"data,omitempty"`
  29926. // Message: [Output Only] A human-readable description of the warning
  29927. // code.
  29928. Message string `json:"message,omitempty"`
  29929. // ForceSendFields is a list of field names (e.g. "Code") to
  29930. // unconditionally include in API requests. By default, fields with
  29931. // empty values are omitted from API requests. However, any non-pointer,
  29932. // non-interface field appearing in ForceSendFields will be sent to the
  29933. // server regardless of whether the field is empty or not. This may be
  29934. // used to include empty fields in Patch requests.
  29935. ForceSendFields []string `json:"-"`
  29936. // NullFields is a list of field names (e.g. "Code") to include in API
  29937. // requests with the JSON null value. By default, fields with empty
  29938. // values are omitted from API requests. However, any field with an
  29939. // empty value appearing in NullFields will be sent to the server as
  29940. // null. It is an error if a field in this list has a non-empty value.
  29941. // This may be used to include null fields in Patch requests.
  29942. NullFields []string `json:"-"`
  29943. }
  29944. func (s *VpnGatewaysScopedListWarning) MarshalJSON() ([]byte, error) {
  29945. type NoMethod VpnGatewaysScopedListWarning
  29946. raw := NoMethod(*s)
  29947. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29948. }
  29949. type VpnGatewaysScopedListWarningData struct {
  29950. // Key: [Output Only] A key that provides more detail on the warning
  29951. // being returned. For example, for warnings where there are no results
  29952. // in a list request for a particular zone, this key might be scope and
  29953. // the key value might be the zone name. Other examples might be a key
  29954. // indicating a deprecated resource and a suggested replacement, or a
  29955. // warning about invalid network settings (for example, if an instance
  29956. // attempts to perform IP forwarding but is not enabled for IP
  29957. // forwarding).
  29958. Key string `json:"key,omitempty"`
  29959. // Value: [Output Only] A warning data value corresponding to the key.
  29960. Value string `json:"value,omitempty"`
  29961. // ForceSendFields is a list of field names (e.g. "Key") to
  29962. // unconditionally include in API requests. By default, fields with
  29963. // empty values are omitted from API requests. However, any non-pointer,
  29964. // non-interface field appearing in ForceSendFields will be sent to the
  29965. // server regardless of whether the field is empty or not. This may be
  29966. // used to include empty fields in Patch requests.
  29967. ForceSendFields []string `json:"-"`
  29968. // NullFields is a list of field names (e.g. "Key") to include in API
  29969. // requests with the JSON null value. By default, fields with empty
  29970. // values are omitted from API requests. However, any field with an
  29971. // empty value appearing in NullFields will be sent to the server as
  29972. // null. It is an error if a field in this list has a non-empty value.
  29973. // This may be used to include null fields in Patch requests.
  29974. NullFields []string `json:"-"`
  29975. }
  29976. func (s *VpnGatewaysScopedListWarningData) MarshalJSON() ([]byte, error) {
  29977. type NoMethod VpnGatewaysScopedListWarningData
  29978. raw := NoMethod(*s)
  29979. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29980. }
  29981. // VpnTunnel: VPN tunnel resource. (== resource_for beta.vpnTunnels ==)
  29982. // (== resource_for v1.vpnTunnels ==)
  29983. type VpnTunnel struct {
  29984. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  29985. // format.
  29986. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  29987. // Description: An optional description of this resource. Provide this
  29988. // property when you create the resource.
  29989. Description string `json:"description,omitempty"`
  29990. // DetailedStatus: [Output Only] Detailed status message for the VPN
  29991. // tunnel.
  29992. DetailedStatus string `json:"detailedStatus,omitempty"`
  29993. // Id: [Output Only] The unique identifier for the resource. This
  29994. // identifier is defined by the server.
  29995. Id uint64 `json:"id,omitempty,string"`
  29996. // IkeVersion: IKE protocol version to use when establishing the VPN
  29997. // tunnel with peer VPN gateway. Acceptable IKE versions are 1 or 2.
  29998. // Default version is 2.
  29999. IkeVersion int64 `json:"ikeVersion,omitempty"`
  30000. // Kind: [Output Only] Type of resource. Always compute#vpnTunnel for
  30001. // VPN tunnels.
  30002. Kind string `json:"kind,omitempty"`
  30003. // LabelFingerprint: A fingerprint for the labels being applied to this
  30004. // VpnTunnel, which is essentially a hash of the labels set used for
  30005. // optimistic locking. The fingerprint is initially generated by Compute
  30006. // Engine and changes after every request to modify or update labels.
  30007. // You must always provide an up-to-date fingerprint hash in order to
  30008. // update or change labels.
  30009. //
  30010. // To see the latest fingerprint, make a get() request to retrieve a
  30011. // VpnTunnel.
  30012. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  30013. // Labels: Labels to apply to this VpnTunnel. These can be later
  30014. // modified by the setLabels method. Each label key/value pair must
  30015. // comply with RFC1035. Label values may be empty.
  30016. Labels map[string]string `json:"labels,omitempty"`
  30017. // LocalTrafficSelector: Local traffic selector to use when establishing
  30018. // the VPN tunnel with peer VPN gateway. The value should be a CIDR
  30019. // formatted string, for example: 192.168.0.0/16. The ranges should be
  30020. // disjoint. Only IPv4 is supported.
  30021. LocalTrafficSelector []string `json:"localTrafficSelector,omitempty"`
  30022. // Name: Name of the resource. Provided by the client when the resource
  30023. // is created. The name must be 1-63 characters long, and comply with
  30024. // RFC1035. Specifically, the name must be 1-63 characters long and
  30025. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  30026. // the first character must be a lowercase letter, and all following
  30027. // characters must be a dash, lowercase letter, or digit, except the
  30028. // last character, which cannot be a dash.
  30029. Name string `json:"name,omitempty"`
  30030. // PeerIp: IP address of the peer VPN gateway. Only IPv4 is supported.
  30031. PeerIp string `json:"peerIp,omitempty"`
  30032. // Region: [Output Only] URL of the region where the VPN tunnel resides.
  30033. // You must specify this field as part of the HTTP request URL. It is
  30034. // not settable as a field in the request body.
  30035. Region string `json:"region,omitempty"`
  30036. // RemoteTrafficSelector: Remote traffic selectors to use when
  30037. // establishing the VPN tunnel with peer VPN gateway. The value should
  30038. // be a CIDR formatted string, for example: 192.168.0.0/16. The ranges
  30039. // should be disjoint. Only IPv4 is supported.
  30040. RemoteTrafficSelector []string `json:"remoteTrafficSelector,omitempty"`
  30041. // Router: URL of router resource to be used for dynamic routing.
  30042. Router string `json:"router,omitempty"`
  30043. // SelfLink: [Output Only] Server-defined URL for the resource.
  30044. SelfLink string `json:"selfLink,omitempty"`
  30045. // SharedSecret: Shared secret used to set the secure session between
  30046. // the Cloud VPN gateway and the peer VPN gateway.
  30047. SharedSecret string `json:"sharedSecret,omitempty"`
  30048. // SharedSecretHash: Hash of the shared secret.
  30049. SharedSecretHash string `json:"sharedSecretHash,omitempty"`
  30050. // Status: [Output Only] The status of the VPN tunnel.
  30051. //
  30052. // Possible values:
  30053. // "ALLOCATING_RESOURCES"
  30054. // "AUTHORIZATION_ERROR"
  30055. // "DEPROVISIONING"
  30056. // "ESTABLISHED"
  30057. // "FAILED"
  30058. // "FIRST_HANDSHAKE"
  30059. // "NEGOTIATION_FAILURE"
  30060. // "NETWORK_ERROR"
  30061. // "NO_INCOMING_PACKETS"
  30062. // "PROVISIONING"
  30063. // "REJECTED"
  30064. // "WAITING_FOR_FULL_CONFIG"
  30065. Status string `json:"status,omitempty"`
  30066. // TargetVpnGateway: URL of the Target VPN gateway with which this VPN
  30067. // tunnel is associated. Provided by the client when the VPN tunnel is
  30068. // created.
  30069. TargetVpnGateway string `json:"targetVpnGateway,omitempty"`
  30070. // VpnGateway: URL of the VPN gateway with which this VPN tunnel is
  30071. // associated. Provided by the client when the VPN tunnel is created.
  30072. // This must be used (instead of target_vpn_gateway) if a High
  30073. // Availability VPN gateway resource is created.
  30074. VpnGateway string `json:"vpnGateway,omitempty"`
  30075. // VpnGatewayInterface: The interface ID of the VPN gateway with which
  30076. // this VPN tunnel is associated.
  30077. VpnGatewayInterface int64 `json:"vpnGatewayInterface,omitempty"`
  30078. // ServerResponse contains the HTTP response code and headers from the
  30079. // server.
  30080. googleapi.ServerResponse `json:"-"`
  30081. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  30082. // to unconditionally include in API requests. By default, fields with
  30083. // empty values are omitted from API requests. However, any non-pointer,
  30084. // non-interface field appearing in ForceSendFields will be sent to the
  30085. // server regardless of whether the field is empty or not. This may be
  30086. // used to include empty fields in Patch requests.
  30087. ForceSendFields []string `json:"-"`
  30088. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  30089. // include in API requests with the JSON null value. By default, fields
  30090. // with empty values are omitted from API requests. However, any field
  30091. // with an empty value appearing in NullFields will be sent to the
  30092. // server as null. It is an error if a field in this list has a
  30093. // non-empty value. This may be used to include null fields in Patch
  30094. // requests.
  30095. NullFields []string `json:"-"`
  30096. }
  30097. func (s *VpnTunnel) MarshalJSON() ([]byte, error) {
  30098. type NoMethod VpnTunnel
  30099. raw := NoMethod(*s)
  30100. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30101. }
  30102. type VpnTunnelAggregatedList struct {
  30103. // Id: [Output Only] Unique identifier for the resource; defined by the
  30104. // server.
  30105. Id string `json:"id,omitempty"`
  30106. // Items: A list of VpnTunnelsScopedList resources.
  30107. Items map[string]VpnTunnelsScopedList `json:"items,omitempty"`
  30108. // Kind: [Output Only] Type of resource. Always compute#vpnTunnel for
  30109. // VPN tunnels.
  30110. Kind string `json:"kind,omitempty"`
  30111. // NextPageToken: [Output Only] This token allows you to get the next
  30112. // page of results for list requests. If the number of results is larger
  30113. // than maxResults, use the nextPageToken as a value for the query
  30114. // parameter pageToken in the next list request. Subsequent list
  30115. // requests will have their own nextPageToken to continue paging through
  30116. // the results.
  30117. NextPageToken string `json:"nextPageToken,omitempty"`
  30118. // SelfLink: [Output Only] Server-defined URL for this resource.
  30119. SelfLink string `json:"selfLink,omitempty"`
  30120. // Warning: [Output Only] Informational warning message.
  30121. Warning *VpnTunnelAggregatedListWarning `json:"warning,omitempty"`
  30122. // ServerResponse contains the HTTP response code and headers from the
  30123. // server.
  30124. googleapi.ServerResponse `json:"-"`
  30125. // ForceSendFields is a list of field names (e.g. "Id") to
  30126. // unconditionally include in API requests. By default, fields with
  30127. // empty values are omitted from API requests. However, any non-pointer,
  30128. // non-interface field appearing in ForceSendFields will be sent to the
  30129. // server regardless of whether the field is empty or not. This may be
  30130. // used to include empty fields in Patch requests.
  30131. ForceSendFields []string `json:"-"`
  30132. // NullFields is a list of field names (e.g. "Id") to include in API
  30133. // requests with the JSON null value. By default, fields with empty
  30134. // values are omitted from API requests. However, any field with an
  30135. // empty value appearing in NullFields will be sent to the server as
  30136. // null. It is an error if a field in this list has a non-empty value.
  30137. // This may be used to include null fields in Patch requests.
  30138. NullFields []string `json:"-"`
  30139. }
  30140. func (s *VpnTunnelAggregatedList) MarshalJSON() ([]byte, error) {
  30141. type NoMethod VpnTunnelAggregatedList
  30142. raw := NoMethod(*s)
  30143. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30144. }
  30145. // VpnTunnelAggregatedListWarning: [Output Only] Informational warning
  30146. // message.
  30147. type VpnTunnelAggregatedListWarning struct {
  30148. // Code: [Output Only] A warning code, if applicable. For example,
  30149. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  30150. // the response.
  30151. //
  30152. // Possible values:
  30153. // "CLEANUP_FAILED"
  30154. // "DEPRECATED_RESOURCE_USED"
  30155. // "DEPRECATED_TYPE_USED"
  30156. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  30157. // "EXPERIMENTAL_TYPE_USED"
  30158. // "EXTERNAL_API_WARNING"
  30159. // "FIELD_VALUE_OVERRIDEN"
  30160. // "INJECTED_KERNELS_DEPRECATED"
  30161. // "MISSING_TYPE_DEPENDENCY"
  30162. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  30163. // "NEXT_HOP_CANNOT_IP_FORWARD"
  30164. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  30165. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  30166. // "NEXT_HOP_NOT_RUNNING"
  30167. // "NOT_CRITICAL_ERROR"
  30168. // "NO_RESULTS_ON_PAGE"
  30169. // "REQUIRED_TOS_AGREEMENT"
  30170. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  30171. // "RESOURCE_NOT_DELETED"
  30172. // "SCHEMA_VALIDATION_IGNORED"
  30173. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  30174. // "UNDECLARED_PROPERTIES"
  30175. // "UNREACHABLE"
  30176. Code string `json:"code,omitempty"`
  30177. // Data: [Output Only] Metadata about this warning in key: value format.
  30178. // For example:
  30179. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  30180. Data []*VpnTunnelAggregatedListWarningData `json:"data,omitempty"`
  30181. // Message: [Output Only] A human-readable description of the warning
  30182. // code.
  30183. Message string `json:"message,omitempty"`
  30184. // ForceSendFields is a list of field names (e.g. "Code") to
  30185. // unconditionally include in API requests. By default, fields with
  30186. // empty values are omitted from API requests. However, any non-pointer,
  30187. // non-interface field appearing in ForceSendFields will be sent to the
  30188. // server regardless of whether the field is empty or not. This may be
  30189. // used to include empty fields in Patch requests.
  30190. ForceSendFields []string `json:"-"`
  30191. // NullFields is a list of field names (e.g. "Code") to include in API
  30192. // requests with the JSON null value. By default, fields with empty
  30193. // values are omitted from API requests. However, any field with an
  30194. // empty value appearing in NullFields will be sent to the server as
  30195. // null. It is an error if a field in this list has a non-empty value.
  30196. // This may be used to include null fields in Patch requests.
  30197. NullFields []string `json:"-"`
  30198. }
  30199. func (s *VpnTunnelAggregatedListWarning) MarshalJSON() ([]byte, error) {
  30200. type NoMethod VpnTunnelAggregatedListWarning
  30201. raw := NoMethod(*s)
  30202. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30203. }
  30204. type VpnTunnelAggregatedListWarningData struct {
  30205. // Key: [Output Only] A key that provides more detail on the warning
  30206. // being returned. For example, for warnings where there are no results
  30207. // in a list request for a particular zone, this key might be scope and
  30208. // the key value might be the zone name. Other examples might be a key
  30209. // indicating a deprecated resource and a suggested replacement, or a
  30210. // warning about invalid network settings (for example, if an instance
  30211. // attempts to perform IP forwarding but is not enabled for IP
  30212. // forwarding).
  30213. Key string `json:"key,omitempty"`
  30214. // Value: [Output Only] A warning data value corresponding to the key.
  30215. Value string `json:"value,omitempty"`
  30216. // ForceSendFields is a list of field names (e.g. "Key") to
  30217. // unconditionally include in API requests. By default, fields with
  30218. // empty values are omitted from API requests. However, any non-pointer,
  30219. // non-interface field appearing in ForceSendFields will be sent to the
  30220. // server regardless of whether the field is empty or not. This may be
  30221. // used to include empty fields in Patch requests.
  30222. ForceSendFields []string `json:"-"`
  30223. // NullFields is a list of field names (e.g. "Key") to include in API
  30224. // requests with the JSON null value. By default, fields with empty
  30225. // values are omitted from API requests. However, any field with an
  30226. // empty value appearing in NullFields will be sent to the server as
  30227. // null. It is an error if a field in this list has a non-empty value.
  30228. // This may be used to include null fields in Patch requests.
  30229. NullFields []string `json:"-"`
  30230. }
  30231. func (s *VpnTunnelAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  30232. type NoMethod VpnTunnelAggregatedListWarningData
  30233. raw := NoMethod(*s)
  30234. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30235. }
  30236. // VpnTunnelList: Contains a list of VpnTunnel resources.
  30237. type VpnTunnelList struct {
  30238. // Id: [Output Only] Unique identifier for the resource; defined by the
  30239. // server.
  30240. Id string `json:"id,omitempty"`
  30241. // Items: A list of VpnTunnel resources.
  30242. Items []*VpnTunnel `json:"items,omitempty"`
  30243. // Kind: [Output Only] Type of resource. Always compute#vpnTunnel for
  30244. // VPN tunnels.
  30245. Kind string `json:"kind,omitempty"`
  30246. // NextPageToken: [Output Only] This token allows you to get the next
  30247. // page of results for list requests. If the number of results is larger
  30248. // than maxResults, use the nextPageToken as a value for the query
  30249. // parameter pageToken in the next list request. Subsequent list
  30250. // requests will have their own nextPageToken to continue paging through
  30251. // the results.
  30252. NextPageToken string `json:"nextPageToken,omitempty"`
  30253. // SelfLink: [Output Only] Server-defined URL for this resource.
  30254. SelfLink string `json:"selfLink,omitempty"`
  30255. // Warning: [Output Only] Informational warning message.
  30256. Warning *VpnTunnelListWarning `json:"warning,omitempty"`
  30257. // ServerResponse contains the HTTP response code and headers from the
  30258. // server.
  30259. googleapi.ServerResponse `json:"-"`
  30260. // ForceSendFields is a list of field names (e.g. "Id") to
  30261. // unconditionally include in API requests. By default, fields with
  30262. // empty values are omitted from API requests. However, any non-pointer,
  30263. // non-interface field appearing in ForceSendFields will be sent to the
  30264. // server regardless of whether the field is empty or not. This may be
  30265. // used to include empty fields in Patch requests.
  30266. ForceSendFields []string `json:"-"`
  30267. // NullFields is a list of field names (e.g. "Id") to include in API
  30268. // requests with the JSON null value. By default, fields with empty
  30269. // values are omitted from API requests. However, any field with an
  30270. // empty value appearing in NullFields will be sent to the server as
  30271. // null. It is an error if a field in this list has a non-empty value.
  30272. // This may be used to include null fields in Patch requests.
  30273. NullFields []string `json:"-"`
  30274. }
  30275. func (s *VpnTunnelList) MarshalJSON() ([]byte, error) {
  30276. type NoMethod VpnTunnelList
  30277. raw := NoMethod(*s)
  30278. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30279. }
  30280. // VpnTunnelListWarning: [Output Only] Informational warning message.
  30281. type VpnTunnelListWarning struct {
  30282. // Code: [Output Only] A warning code, if applicable. For example,
  30283. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  30284. // the response.
  30285. //
  30286. // Possible values:
  30287. // "CLEANUP_FAILED"
  30288. // "DEPRECATED_RESOURCE_USED"
  30289. // "DEPRECATED_TYPE_USED"
  30290. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  30291. // "EXPERIMENTAL_TYPE_USED"
  30292. // "EXTERNAL_API_WARNING"
  30293. // "FIELD_VALUE_OVERRIDEN"
  30294. // "INJECTED_KERNELS_DEPRECATED"
  30295. // "MISSING_TYPE_DEPENDENCY"
  30296. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  30297. // "NEXT_HOP_CANNOT_IP_FORWARD"
  30298. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  30299. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  30300. // "NEXT_HOP_NOT_RUNNING"
  30301. // "NOT_CRITICAL_ERROR"
  30302. // "NO_RESULTS_ON_PAGE"
  30303. // "REQUIRED_TOS_AGREEMENT"
  30304. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  30305. // "RESOURCE_NOT_DELETED"
  30306. // "SCHEMA_VALIDATION_IGNORED"
  30307. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  30308. // "UNDECLARED_PROPERTIES"
  30309. // "UNREACHABLE"
  30310. Code string `json:"code,omitempty"`
  30311. // Data: [Output Only] Metadata about this warning in key: value format.
  30312. // For example:
  30313. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  30314. Data []*VpnTunnelListWarningData `json:"data,omitempty"`
  30315. // Message: [Output Only] A human-readable description of the warning
  30316. // code.
  30317. Message string `json:"message,omitempty"`
  30318. // ForceSendFields is a list of field names (e.g. "Code") to
  30319. // unconditionally include in API requests. By default, fields with
  30320. // empty values are omitted from API requests. However, any non-pointer,
  30321. // non-interface field appearing in ForceSendFields will be sent to the
  30322. // server regardless of whether the field is empty or not. This may be
  30323. // used to include empty fields in Patch requests.
  30324. ForceSendFields []string `json:"-"`
  30325. // NullFields is a list of field names (e.g. "Code") to include in API
  30326. // requests with the JSON null value. By default, fields with empty
  30327. // values are omitted from API requests. However, any field with an
  30328. // empty value appearing in NullFields will be sent to the server as
  30329. // null. It is an error if a field in this list has a non-empty value.
  30330. // This may be used to include null fields in Patch requests.
  30331. NullFields []string `json:"-"`
  30332. }
  30333. func (s *VpnTunnelListWarning) MarshalJSON() ([]byte, error) {
  30334. type NoMethod VpnTunnelListWarning
  30335. raw := NoMethod(*s)
  30336. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30337. }
  30338. type VpnTunnelListWarningData struct {
  30339. // Key: [Output Only] A key that provides more detail on the warning
  30340. // being returned. For example, for warnings where there are no results
  30341. // in a list request for a particular zone, this key might be scope and
  30342. // the key value might be the zone name. Other examples might be a key
  30343. // indicating a deprecated resource and a suggested replacement, or a
  30344. // warning about invalid network settings (for example, if an instance
  30345. // attempts to perform IP forwarding but is not enabled for IP
  30346. // forwarding).
  30347. Key string `json:"key,omitempty"`
  30348. // Value: [Output Only] A warning data value corresponding to the key.
  30349. Value string `json:"value,omitempty"`
  30350. // ForceSendFields is a list of field names (e.g. "Key") to
  30351. // unconditionally include in API requests. By default, fields with
  30352. // empty values are omitted from API requests. However, any non-pointer,
  30353. // non-interface field appearing in ForceSendFields will be sent to the
  30354. // server regardless of whether the field is empty or not. This may be
  30355. // used to include empty fields in Patch requests.
  30356. ForceSendFields []string `json:"-"`
  30357. // NullFields is a list of field names (e.g. "Key") to include in API
  30358. // requests with the JSON null value. By default, fields with empty
  30359. // values are omitted from API requests. However, any field with an
  30360. // empty value appearing in NullFields will be sent to the server as
  30361. // null. It is an error if a field in this list has a non-empty value.
  30362. // This may be used to include null fields in Patch requests.
  30363. NullFields []string `json:"-"`
  30364. }
  30365. func (s *VpnTunnelListWarningData) MarshalJSON() ([]byte, error) {
  30366. type NoMethod VpnTunnelListWarningData
  30367. raw := NoMethod(*s)
  30368. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30369. }
  30370. type VpnTunnelsScopedList struct {
  30371. // VpnTunnels: A list of vpn tunnels contained in this scope.
  30372. VpnTunnels []*VpnTunnel `json:"vpnTunnels,omitempty"`
  30373. // Warning: Informational warning which replaces the list of addresses
  30374. // when the list is empty.
  30375. Warning *VpnTunnelsScopedListWarning `json:"warning,omitempty"`
  30376. // ForceSendFields is a list of field names (e.g. "VpnTunnels") to
  30377. // unconditionally include in API requests. By default, fields with
  30378. // empty values are omitted from API requests. However, any non-pointer,
  30379. // non-interface field appearing in ForceSendFields will be sent to the
  30380. // server regardless of whether the field is empty or not. This may be
  30381. // used to include empty fields in Patch requests.
  30382. ForceSendFields []string `json:"-"`
  30383. // NullFields is a list of field names (e.g. "VpnTunnels") to include in
  30384. // API requests with the JSON null value. By default, fields with empty
  30385. // values are omitted from API requests. However, any field with an
  30386. // empty value appearing in NullFields will be sent to the server as
  30387. // null. It is an error if a field in this list has a non-empty value.
  30388. // This may be used to include null fields in Patch requests.
  30389. NullFields []string `json:"-"`
  30390. }
  30391. func (s *VpnTunnelsScopedList) MarshalJSON() ([]byte, error) {
  30392. type NoMethod VpnTunnelsScopedList
  30393. raw := NoMethod(*s)
  30394. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30395. }
  30396. // VpnTunnelsScopedListWarning: Informational warning which replaces the
  30397. // list of addresses when the list is empty.
  30398. type VpnTunnelsScopedListWarning struct {
  30399. // Code: [Output Only] A warning code, if applicable. For example,
  30400. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  30401. // the response.
  30402. //
  30403. // Possible values:
  30404. // "CLEANUP_FAILED"
  30405. // "DEPRECATED_RESOURCE_USED"
  30406. // "DEPRECATED_TYPE_USED"
  30407. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  30408. // "EXPERIMENTAL_TYPE_USED"
  30409. // "EXTERNAL_API_WARNING"
  30410. // "FIELD_VALUE_OVERRIDEN"
  30411. // "INJECTED_KERNELS_DEPRECATED"
  30412. // "MISSING_TYPE_DEPENDENCY"
  30413. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  30414. // "NEXT_HOP_CANNOT_IP_FORWARD"
  30415. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  30416. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  30417. // "NEXT_HOP_NOT_RUNNING"
  30418. // "NOT_CRITICAL_ERROR"
  30419. // "NO_RESULTS_ON_PAGE"
  30420. // "REQUIRED_TOS_AGREEMENT"
  30421. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  30422. // "RESOURCE_NOT_DELETED"
  30423. // "SCHEMA_VALIDATION_IGNORED"
  30424. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  30425. // "UNDECLARED_PROPERTIES"
  30426. // "UNREACHABLE"
  30427. Code string `json:"code,omitempty"`
  30428. // Data: [Output Only] Metadata about this warning in key: value format.
  30429. // For example:
  30430. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  30431. Data []*VpnTunnelsScopedListWarningData `json:"data,omitempty"`
  30432. // Message: [Output Only] A human-readable description of the warning
  30433. // code.
  30434. Message string `json:"message,omitempty"`
  30435. // ForceSendFields is a list of field names (e.g. "Code") to
  30436. // unconditionally include in API requests. By default, fields with
  30437. // empty values are omitted from API requests. However, any non-pointer,
  30438. // non-interface field appearing in ForceSendFields will be sent to the
  30439. // server regardless of whether the field is empty or not. This may be
  30440. // used to include empty fields in Patch requests.
  30441. ForceSendFields []string `json:"-"`
  30442. // NullFields is a list of field names (e.g. "Code") to include in API
  30443. // requests with the JSON null value. By default, fields with empty
  30444. // values are omitted from API requests. However, any field with an
  30445. // empty value appearing in NullFields will be sent to the server as
  30446. // null. It is an error if a field in this list has a non-empty value.
  30447. // This may be used to include null fields in Patch requests.
  30448. NullFields []string `json:"-"`
  30449. }
  30450. func (s *VpnTunnelsScopedListWarning) MarshalJSON() ([]byte, error) {
  30451. type NoMethod VpnTunnelsScopedListWarning
  30452. raw := NoMethod(*s)
  30453. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30454. }
  30455. type VpnTunnelsScopedListWarningData struct {
  30456. // Key: [Output Only] A key that provides more detail on the warning
  30457. // being returned. For example, for warnings where there are no results
  30458. // in a list request for a particular zone, this key might be scope and
  30459. // the key value might be the zone name. Other examples might be a key
  30460. // indicating a deprecated resource and a suggested replacement, or a
  30461. // warning about invalid network settings (for example, if an instance
  30462. // attempts to perform IP forwarding but is not enabled for IP
  30463. // forwarding).
  30464. Key string `json:"key,omitempty"`
  30465. // Value: [Output Only] A warning data value corresponding to the key.
  30466. Value string `json:"value,omitempty"`
  30467. // ForceSendFields is a list of field names (e.g. "Key") to
  30468. // unconditionally include in API requests. By default, fields with
  30469. // empty values are omitted from API requests. However, any non-pointer,
  30470. // non-interface field appearing in ForceSendFields will be sent to the
  30471. // server regardless of whether the field is empty or not. This may be
  30472. // used to include empty fields in Patch requests.
  30473. ForceSendFields []string `json:"-"`
  30474. // NullFields is a list of field names (e.g. "Key") to include in API
  30475. // requests with the JSON null value. By default, fields with empty
  30476. // values are omitted from API requests. However, any field with an
  30477. // empty value appearing in NullFields will be sent to the server as
  30478. // null. It is an error if a field in this list has a non-empty value.
  30479. // This may be used to include null fields in Patch requests.
  30480. NullFields []string `json:"-"`
  30481. }
  30482. func (s *VpnTunnelsScopedListWarningData) MarshalJSON() ([]byte, error) {
  30483. type NoMethod VpnTunnelsScopedListWarningData
  30484. raw := NoMethod(*s)
  30485. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30486. }
  30487. type WafExpressionSet struct {
  30488. // Aliases: A list of alternate IDs. The format should be: - E.g.
  30489. // XSS-stable Generic suffix like "stable" is particularly useful if a
  30490. // policy likes to avail newer set of expressions without having to
  30491. // change the policy. A given alias name can't be used for more than one
  30492. // entity set.
  30493. Aliases []string `json:"aliases,omitempty"`
  30494. // Expressions: List of available expressions.
  30495. Expressions []*WafExpressionSetExpression `json:"expressions,omitempty"`
  30496. // Id: Google specified expression set ID. The format should be: - E.g.
  30497. // XSS-20170329
  30498. Id string `json:"id,omitempty"`
  30499. // ForceSendFields is a list of field names (e.g. "Aliases") to
  30500. // unconditionally include in API requests. By default, fields with
  30501. // empty values are omitted from API requests. However, any non-pointer,
  30502. // non-interface field appearing in ForceSendFields will be sent to the
  30503. // server regardless of whether the field is empty or not. This may be
  30504. // used to include empty fields in Patch requests.
  30505. ForceSendFields []string `json:"-"`
  30506. // NullFields is a list of field names (e.g. "Aliases") to include in
  30507. // API requests with the JSON null value. By default, fields with empty
  30508. // values are omitted from API requests. However, any field with an
  30509. // empty value appearing in NullFields will be sent to the server as
  30510. // null. It is an error if a field in this list has a non-empty value.
  30511. // This may be used to include null fields in Patch requests.
  30512. NullFields []string `json:"-"`
  30513. }
  30514. func (s *WafExpressionSet) MarshalJSON() ([]byte, error) {
  30515. type NoMethod WafExpressionSet
  30516. raw := NoMethod(*s)
  30517. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30518. }
  30519. type WafExpressionSetExpression struct {
  30520. // Id: Expression ID should uniquely identify the origin of the
  30521. // expression. E.g. owasp-crs-v020901-id973337 identifies Owasp core
  30522. // rule set version 2.9.1 rule id 973337. The ID could be used to
  30523. // determine the individual attack definition that has been detected. It
  30524. // could also be used to exclude it from the policy in case of false
  30525. // positive.
  30526. Id string `json:"id,omitempty"`
  30527. // ForceSendFields is a list of field names (e.g. "Id") to
  30528. // unconditionally include in API requests. By default, fields with
  30529. // empty values are omitted from API requests. However, any non-pointer,
  30530. // non-interface field appearing in ForceSendFields will be sent to the
  30531. // server regardless of whether the field is empty or not. This may be
  30532. // used to include empty fields in Patch requests.
  30533. ForceSendFields []string `json:"-"`
  30534. // NullFields is a list of field names (e.g. "Id") to include in API
  30535. // requests with the JSON null value. By default, fields with empty
  30536. // values are omitted from API requests. However, any field with an
  30537. // empty value appearing in NullFields will be sent to the server as
  30538. // null. It is an error if a field in this list has a non-empty value.
  30539. // This may be used to include null fields in Patch requests.
  30540. NullFields []string `json:"-"`
  30541. }
  30542. func (s *WafExpressionSetExpression) MarshalJSON() ([]byte, error) {
  30543. type NoMethod WafExpressionSetExpression
  30544. raw := NoMethod(*s)
  30545. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30546. }
  30547. type XpnHostList struct {
  30548. // Id: [Output Only] Unique identifier for the resource; defined by the
  30549. // server.
  30550. Id string `json:"id,omitempty"`
  30551. // Items: [Output Only] A list of shared VPC host project URLs.
  30552. Items []*Project `json:"items,omitempty"`
  30553. // Kind: [Output Only] Type of resource. Always compute#xpnHostList for
  30554. // lists of shared VPC hosts.
  30555. Kind string `json:"kind,omitempty"`
  30556. // NextPageToken: [Output Only] This token allows you to get the next
  30557. // page of results for list requests. If the number of results is larger
  30558. // than maxResults, use the nextPageToken as a value for the query
  30559. // parameter pageToken in the next list request. Subsequent list
  30560. // requests will have their own nextPageToken to continue paging through
  30561. // the results.
  30562. NextPageToken string `json:"nextPageToken,omitempty"`
  30563. // SelfLink: [Output Only] Server-defined URL for this resource.
  30564. SelfLink string `json:"selfLink,omitempty"`
  30565. // Warning: [Output Only] Informational warning message.
  30566. Warning *XpnHostListWarning `json:"warning,omitempty"`
  30567. // ServerResponse contains the HTTP response code and headers from the
  30568. // server.
  30569. googleapi.ServerResponse `json:"-"`
  30570. // ForceSendFields is a list of field names (e.g. "Id") to
  30571. // unconditionally include in API requests. By default, fields with
  30572. // empty values are omitted from API requests. However, any non-pointer,
  30573. // non-interface field appearing in ForceSendFields will be sent to the
  30574. // server regardless of whether the field is empty or not. This may be
  30575. // used to include empty fields in Patch requests.
  30576. ForceSendFields []string `json:"-"`
  30577. // NullFields is a list of field names (e.g. "Id") to include in API
  30578. // requests with the JSON null value. By default, fields with empty
  30579. // values are omitted from API requests. However, any field with an
  30580. // empty value appearing in NullFields will be sent to the server as
  30581. // null. It is an error if a field in this list has a non-empty value.
  30582. // This may be used to include null fields in Patch requests.
  30583. NullFields []string `json:"-"`
  30584. }
  30585. func (s *XpnHostList) MarshalJSON() ([]byte, error) {
  30586. type NoMethod XpnHostList
  30587. raw := NoMethod(*s)
  30588. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30589. }
  30590. // XpnHostListWarning: [Output Only] Informational warning message.
  30591. type XpnHostListWarning struct {
  30592. // Code: [Output Only] A warning code, if applicable. For example,
  30593. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  30594. // the response.
  30595. //
  30596. // Possible values:
  30597. // "CLEANUP_FAILED"
  30598. // "DEPRECATED_RESOURCE_USED"
  30599. // "DEPRECATED_TYPE_USED"
  30600. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  30601. // "EXPERIMENTAL_TYPE_USED"
  30602. // "EXTERNAL_API_WARNING"
  30603. // "FIELD_VALUE_OVERRIDEN"
  30604. // "INJECTED_KERNELS_DEPRECATED"
  30605. // "MISSING_TYPE_DEPENDENCY"
  30606. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  30607. // "NEXT_HOP_CANNOT_IP_FORWARD"
  30608. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  30609. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  30610. // "NEXT_HOP_NOT_RUNNING"
  30611. // "NOT_CRITICAL_ERROR"
  30612. // "NO_RESULTS_ON_PAGE"
  30613. // "REQUIRED_TOS_AGREEMENT"
  30614. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  30615. // "RESOURCE_NOT_DELETED"
  30616. // "SCHEMA_VALIDATION_IGNORED"
  30617. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  30618. // "UNDECLARED_PROPERTIES"
  30619. // "UNREACHABLE"
  30620. Code string `json:"code,omitempty"`
  30621. // Data: [Output Only] Metadata about this warning in key: value format.
  30622. // For example:
  30623. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  30624. Data []*XpnHostListWarningData `json:"data,omitempty"`
  30625. // Message: [Output Only] A human-readable description of the warning
  30626. // code.
  30627. Message string `json:"message,omitempty"`
  30628. // ForceSendFields is a list of field names (e.g. "Code") to
  30629. // unconditionally include in API requests. By default, fields with
  30630. // empty values are omitted from API requests. However, any non-pointer,
  30631. // non-interface field appearing in ForceSendFields will be sent to the
  30632. // server regardless of whether the field is empty or not. This may be
  30633. // used to include empty fields in Patch requests.
  30634. ForceSendFields []string `json:"-"`
  30635. // NullFields is a list of field names (e.g. "Code") to include in API
  30636. // requests with the JSON null value. By default, fields with empty
  30637. // values are omitted from API requests. However, any field with an
  30638. // empty value appearing in NullFields will be sent to the server as
  30639. // null. It is an error if a field in this list has a non-empty value.
  30640. // This may be used to include null fields in Patch requests.
  30641. NullFields []string `json:"-"`
  30642. }
  30643. func (s *XpnHostListWarning) MarshalJSON() ([]byte, error) {
  30644. type NoMethod XpnHostListWarning
  30645. raw := NoMethod(*s)
  30646. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30647. }
  30648. type XpnHostListWarningData struct {
  30649. // Key: [Output Only] A key that provides more detail on the warning
  30650. // being returned. For example, for warnings where there are no results
  30651. // in a list request for a particular zone, this key might be scope and
  30652. // the key value might be the zone name. Other examples might be a key
  30653. // indicating a deprecated resource and a suggested replacement, or a
  30654. // warning about invalid network settings (for example, if an instance
  30655. // attempts to perform IP forwarding but is not enabled for IP
  30656. // forwarding).
  30657. Key string `json:"key,omitempty"`
  30658. // Value: [Output Only] A warning data value corresponding to the key.
  30659. Value string `json:"value,omitempty"`
  30660. // ForceSendFields is a list of field names (e.g. "Key") to
  30661. // unconditionally include in API requests. By default, fields with
  30662. // empty values are omitted from API requests. However, any non-pointer,
  30663. // non-interface field appearing in ForceSendFields will be sent to the
  30664. // server regardless of whether the field is empty or not. This may be
  30665. // used to include empty fields in Patch requests.
  30666. ForceSendFields []string `json:"-"`
  30667. // NullFields is a list of field names (e.g. "Key") to include in API
  30668. // requests with the JSON null value. By default, fields with empty
  30669. // values are omitted from API requests. However, any field with an
  30670. // empty value appearing in NullFields will be sent to the server as
  30671. // null. It is an error if a field in this list has a non-empty value.
  30672. // This may be used to include null fields in Patch requests.
  30673. NullFields []string `json:"-"`
  30674. }
  30675. func (s *XpnHostListWarningData) MarshalJSON() ([]byte, error) {
  30676. type NoMethod XpnHostListWarningData
  30677. raw := NoMethod(*s)
  30678. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30679. }
  30680. // XpnResourceId: Service resource (a.k.a service project) ID.
  30681. type XpnResourceId struct {
  30682. // Id: The ID of the service resource. In the case of projects, this
  30683. // field matches the project ID (e.g., my-project), not the project
  30684. // number (e.g., 12345678).
  30685. Id string `json:"id,omitempty"`
  30686. // Type: The type of the service resource.
  30687. //
  30688. // Possible values:
  30689. // "PROJECT"
  30690. // "XPN_RESOURCE_TYPE_UNSPECIFIED"
  30691. Type string `json:"type,omitempty"`
  30692. // ForceSendFields is a list of field names (e.g. "Id") to
  30693. // unconditionally include in API requests. By default, fields with
  30694. // empty values are omitted from API requests. However, any non-pointer,
  30695. // non-interface field appearing in ForceSendFields will be sent to the
  30696. // server regardless of whether the field is empty or not. This may be
  30697. // used to include empty fields in Patch requests.
  30698. ForceSendFields []string `json:"-"`
  30699. // NullFields is a list of field names (e.g. "Id") to include in API
  30700. // requests with the JSON null value. By default, fields with empty
  30701. // values are omitted from API requests. However, any field with an
  30702. // empty value appearing in NullFields will be sent to the server as
  30703. // null. It is an error if a field in this list has a non-empty value.
  30704. // This may be used to include null fields in Patch requests.
  30705. NullFields []string `json:"-"`
  30706. }
  30707. func (s *XpnResourceId) MarshalJSON() ([]byte, error) {
  30708. type NoMethod XpnResourceId
  30709. raw := NoMethod(*s)
  30710. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30711. }
  30712. // Zone: A Zone resource. (== resource_for beta.zones ==) (==
  30713. // resource_for v1.zones ==)
  30714. type Zone struct {
  30715. // AvailableCpuPlatforms: [Output Only] Available cpu/platform
  30716. // selections for the zone.
  30717. AvailableCpuPlatforms []string `json:"availableCpuPlatforms,omitempty"`
  30718. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  30719. // format.
  30720. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  30721. // Deprecated: [Output Only] The deprecation status associated with this
  30722. // zone.
  30723. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  30724. // Description: [Output Only] Textual description of the resource.
  30725. Description string `json:"description,omitempty"`
  30726. // Id: [Output Only] The unique identifier for the resource. This
  30727. // identifier is defined by the server.
  30728. Id uint64 `json:"id,omitempty,string"`
  30729. // Kind: [Output Only] Type of the resource. Always compute#zone for
  30730. // zones.
  30731. Kind string `json:"kind,omitempty"`
  30732. // Name: [Output Only] Name of the resource.
  30733. Name string `json:"name,omitempty"`
  30734. // Region: [Output Only] Full URL reference to the region which hosts
  30735. // the zone.
  30736. Region string `json:"region,omitempty"`
  30737. // SelfLink: [Output Only] Server-defined URL for the resource.
  30738. SelfLink string `json:"selfLink,omitempty"`
  30739. // Status: [Output Only] Status of the zone, either UP or DOWN.
  30740. //
  30741. // Possible values:
  30742. // "DOWN"
  30743. // "UP"
  30744. Status string `json:"status,omitempty"`
  30745. // ServerResponse contains the HTTP response code and headers from the
  30746. // server.
  30747. googleapi.ServerResponse `json:"-"`
  30748. // ForceSendFields is a list of field names (e.g.
  30749. // "AvailableCpuPlatforms") to unconditionally include in API requests.
  30750. // By default, fields with empty values are omitted from API requests.
  30751. // However, any non-pointer, non-interface field appearing in
  30752. // ForceSendFields will be sent to the server regardless of whether the
  30753. // field is empty or not. This may be used to include empty fields in
  30754. // Patch requests.
  30755. ForceSendFields []string `json:"-"`
  30756. // NullFields is a list of field names (e.g. "AvailableCpuPlatforms") to
  30757. // include in API requests with the JSON null value. By default, fields
  30758. // with empty values are omitted from API requests. However, any field
  30759. // with an empty value appearing in NullFields will be sent to the
  30760. // server as null. It is an error if a field in this list has a
  30761. // non-empty value. This may be used to include null fields in Patch
  30762. // requests.
  30763. NullFields []string `json:"-"`
  30764. }
  30765. func (s *Zone) MarshalJSON() ([]byte, error) {
  30766. type NoMethod Zone
  30767. raw := NoMethod(*s)
  30768. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30769. }
  30770. // ZoneList: Contains a list of zone resources.
  30771. type ZoneList struct {
  30772. // Id: [Output Only] Unique identifier for the resource; defined by the
  30773. // server.
  30774. Id string `json:"id,omitempty"`
  30775. // Items: A list of Zone resources.
  30776. Items []*Zone `json:"items,omitempty"`
  30777. // Kind: Type of resource.
  30778. Kind string `json:"kind,omitempty"`
  30779. // NextPageToken: [Output Only] This token allows you to get the next
  30780. // page of results for list requests. If the number of results is larger
  30781. // than maxResults, use the nextPageToken as a value for the query
  30782. // parameter pageToken in the next list request. Subsequent list
  30783. // requests will have their own nextPageToken to continue paging through
  30784. // the results.
  30785. NextPageToken string `json:"nextPageToken,omitempty"`
  30786. // SelfLink: [Output Only] Server-defined URL for this resource.
  30787. SelfLink string `json:"selfLink,omitempty"`
  30788. // Warning: [Output Only] Informational warning message.
  30789. Warning *ZoneListWarning `json:"warning,omitempty"`
  30790. // ServerResponse contains the HTTP response code and headers from the
  30791. // server.
  30792. googleapi.ServerResponse `json:"-"`
  30793. // ForceSendFields is a list of field names (e.g. "Id") to
  30794. // unconditionally include in API requests. By default, fields with
  30795. // empty values are omitted from API requests. However, any non-pointer,
  30796. // non-interface field appearing in ForceSendFields will be sent to the
  30797. // server regardless of whether the field is empty or not. This may be
  30798. // used to include empty fields in Patch requests.
  30799. ForceSendFields []string `json:"-"`
  30800. // NullFields is a list of field names (e.g. "Id") to include in API
  30801. // requests with the JSON null value. By default, fields with empty
  30802. // values are omitted from API requests. However, any field with an
  30803. // empty value appearing in NullFields will be sent to the server as
  30804. // null. It is an error if a field in this list has a non-empty value.
  30805. // This may be used to include null fields in Patch requests.
  30806. NullFields []string `json:"-"`
  30807. }
  30808. func (s *ZoneList) MarshalJSON() ([]byte, error) {
  30809. type NoMethod ZoneList
  30810. raw := NoMethod(*s)
  30811. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30812. }
  30813. // ZoneListWarning: [Output Only] Informational warning message.
  30814. type ZoneListWarning struct {
  30815. // Code: [Output Only] A warning code, if applicable. For example,
  30816. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  30817. // the response.
  30818. //
  30819. // Possible values:
  30820. // "CLEANUP_FAILED"
  30821. // "DEPRECATED_RESOURCE_USED"
  30822. // "DEPRECATED_TYPE_USED"
  30823. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  30824. // "EXPERIMENTAL_TYPE_USED"
  30825. // "EXTERNAL_API_WARNING"
  30826. // "FIELD_VALUE_OVERRIDEN"
  30827. // "INJECTED_KERNELS_DEPRECATED"
  30828. // "MISSING_TYPE_DEPENDENCY"
  30829. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  30830. // "NEXT_HOP_CANNOT_IP_FORWARD"
  30831. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  30832. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  30833. // "NEXT_HOP_NOT_RUNNING"
  30834. // "NOT_CRITICAL_ERROR"
  30835. // "NO_RESULTS_ON_PAGE"
  30836. // "REQUIRED_TOS_AGREEMENT"
  30837. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  30838. // "RESOURCE_NOT_DELETED"
  30839. // "SCHEMA_VALIDATION_IGNORED"
  30840. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  30841. // "UNDECLARED_PROPERTIES"
  30842. // "UNREACHABLE"
  30843. Code string `json:"code,omitempty"`
  30844. // Data: [Output Only] Metadata about this warning in key: value format.
  30845. // For example:
  30846. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  30847. Data []*ZoneListWarningData `json:"data,omitempty"`
  30848. // Message: [Output Only] A human-readable description of the warning
  30849. // code.
  30850. Message string `json:"message,omitempty"`
  30851. // ForceSendFields is a list of field names (e.g. "Code") to
  30852. // unconditionally include in API requests. By default, fields with
  30853. // empty values are omitted from API requests. However, any non-pointer,
  30854. // non-interface field appearing in ForceSendFields will be sent to the
  30855. // server regardless of whether the field is empty or not. This may be
  30856. // used to include empty fields in Patch requests.
  30857. ForceSendFields []string `json:"-"`
  30858. // NullFields is a list of field names (e.g. "Code") to include in API
  30859. // requests with the JSON null value. By default, fields with empty
  30860. // values are omitted from API requests. However, any field with an
  30861. // empty value appearing in NullFields will be sent to the server as
  30862. // null. It is an error if a field in this list has a non-empty value.
  30863. // This may be used to include null fields in Patch requests.
  30864. NullFields []string `json:"-"`
  30865. }
  30866. func (s *ZoneListWarning) MarshalJSON() ([]byte, error) {
  30867. type NoMethod ZoneListWarning
  30868. raw := NoMethod(*s)
  30869. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30870. }
  30871. type ZoneListWarningData struct {
  30872. // Key: [Output Only] A key that provides more detail on the warning
  30873. // being returned. For example, for warnings where there are no results
  30874. // in a list request for a particular zone, this key might be scope and
  30875. // the key value might be the zone name. Other examples might be a key
  30876. // indicating a deprecated resource and a suggested replacement, or a
  30877. // warning about invalid network settings (for example, if an instance
  30878. // attempts to perform IP forwarding but is not enabled for IP
  30879. // forwarding).
  30880. Key string `json:"key,omitempty"`
  30881. // Value: [Output Only] A warning data value corresponding to the key.
  30882. Value string `json:"value,omitempty"`
  30883. // ForceSendFields is a list of field names (e.g. "Key") to
  30884. // unconditionally include in API requests. By default, fields with
  30885. // empty values are omitted from API requests. However, any non-pointer,
  30886. // non-interface field appearing in ForceSendFields will be sent to the
  30887. // server regardless of whether the field is empty or not. This may be
  30888. // used to include empty fields in Patch requests.
  30889. ForceSendFields []string `json:"-"`
  30890. // NullFields is a list of field names (e.g. "Key") to include in API
  30891. // requests with the JSON null value. By default, fields with empty
  30892. // values are omitted from API requests. However, any field with an
  30893. // empty value appearing in NullFields will be sent to the server as
  30894. // null. It is an error if a field in this list has a non-empty value.
  30895. // This may be used to include null fields in Patch requests.
  30896. NullFields []string `json:"-"`
  30897. }
  30898. func (s *ZoneListWarningData) MarshalJSON() ([]byte, error) {
  30899. type NoMethod ZoneListWarningData
  30900. raw := NoMethod(*s)
  30901. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30902. }
  30903. type ZoneSetLabelsRequest struct {
  30904. // LabelFingerprint: The fingerprint of the previous set of labels for
  30905. // this resource, used to detect conflicts. The fingerprint is initially
  30906. // generated by Compute Engine and changes after every request to modify
  30907. // or update labels. You must always provide an up-to-date fingerprint
  30908. // hash in order to update or change labels. Make a get() request to the
  30909. // resource to get the latest fingerprint.
  30910. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  30911. // Labels: The labels to set for this resource.
  30912. Labels map[string]string `json:"labels,omitempty"`
  30913. // ForceSendFields is a list of field names (e.g. "LabelFingerprint") to
  30914. // unconditionally include in API requests. By default, fields with
  30915. // empty values are omitted from API requests. However, any non-pointer,
  30916. // non-interface field appearing in ForceSendFields will be sent to the
  30917. // server regardless of whether the field is empty or not. This may be
  30918. // used to include empty fields in Patch requests.
  30919. ForceSendFields []string `json:"-"`
  30920. // NullFields is a list of field names (e.g. "LabelFingerprint") to
  30921. // include in API requests with the JSON null value. By default, fields
  30922. // with empty values are omitted from API requests. However, any field
  30923. // with an empty value appearing in NullFields will be sent to the
  30924. // server as null. It is an error if a field in this list has a
  30925. // non-empty value. This may be used to include null fields in Patch
  30926. // requests.
  30927. NullFields []string `json:"-"`
  30928. }
  30929. func (s *ZoneSetLabelsRequest) MarshalJSON() ([]byte, error) {
  30930. type NoMethod ZoneSetLabelsRequest
  30931. raw := NoMethod(*s)
  30932. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30933. }
  30934. type ZoneSetPolicyRequest struct {
  30935. // Bindings: Flatten Policy to create a backwacd compatible wire-format.
  30936. // Deprecated. Use 'policy' to specify bindings.
  30937. Bindings []*Binding `json:"bindings,omitempty"`
  30938. // Etag: Flatten Policy to create a backward compatible wire-format.
  30939. // Deprecated. Use 'policy' to specify the etag.
  30940. Etag string `json:"etag,omitempty"`
  30941. // Policy: REQUIRED: The complete policy to be applied to the
  30942. // 'resource'. The size of the policy is limited to a few 10s of KB. An
  30943. // empty policy is in general a valid policy but certain services (like
  30944. // Projects) might reject them.
  30945. Policy *Policy `json:"policy,omitempty"`
  30946. // ForceSendFields is a list of field names (e.g. "Bindings") to
  30947. // unconditionally include in API requests. By default, fields with
  30948. // empty values are omitted from API requests. However, any non-pointer,
  30949. // non-interface field appearing in ForceSendFields will be sent to the
  30950. // server regardless of whether the field is empty or not. This may be
  30951. // used to include empty fields in Patch requests.
  30952. ForceSendFields []string `json:"-"`
  30953. // NullFields is a list of field names (e.g. "Bindings") to include in
  30954. // API requests with the JSON null value. By default, fields with empty
  30955. // values are omitted from API requests. However, any field with an
  30956. // empty value appearing in NullFields will be sent to the server as
  30957. // null. It is an error if a field in this list has a non-empty value.
  30958. // This may be used to include null fields in Patch requests.
  30959. NullFields []string `json:"-"`
  30960. }
  30961. func (s *ZoneSetPolicyRequest) MarshalJSON() ([]byte, error) {
  30962. type NoMethod ZoneSetPolicyRequest
  30963. raw := NoMethod(*s)
  30964. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30965. }
  30966. // method id "compute.acceleratorTypes.aggregatedList":
  30967. type AcceleratorTypesAggregatedListCall struct {
  30968. s *Service
  30969. project string
  30970. urlParams_ gensupport.URLParams
  30971. ifNoneMatch_ string
  30972. ctx_ context.Context
  30973. header_ http.Header
  30974. }
  30975. // AggregatedList: Retrieves an aggregated list of accelerator types.
  30976. func (r *AcceleratorTypesService) AggregatedList(project string) *AcceleratorTypesAggregatedListCall {
  30977. c := &AcceleratorTypesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30978. c.project = project
  30979. return c
  30980. }
  30981. // Filter sets the optional parameter "filter": A filter expression that
  30982. // filters resources listed in the response. The expression must specify
  30983. // the field name, a comparison operator, and the value that you want to
  30984. // use for filtering. The value must be a string, a number, or a
  30985. // boolean. The comparison operator must be either =, !=, >, or <.
  30986. //
  30987. // For example, if you are filtering Compute Engine instances, you can
  30988. // exclude instances named example-instance by specifying name !=
  30989. // example-instance.
  30990. //
  30991. // You can also filter nested fields. For example, you could specify
  30992. // scheduling.automaticRestart = false to include instances only if they
  30993. // are not scheduled for automatic restarts. You can use filtering on
  30994. // nested fields to filter based on resource labels.
  30995. //
  30996. // To filter on multiple expressions, provide each separate expression
  30997. // within parentheses. For example, (scheduling.automaticRestart = true)
  30998. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  30999. // AND expression. However, you can include AND and OR expressions
  31000. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  31001. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  31002. // true).
  31003. func (c *AcceleratorTypesAggregatedListCall) Filter(filter string) *AcceleratorTypesAggregatedListCall {
  31004. c.urlParams_.Set("filter", filter)
  31005. return c
  31006. }
  31007. // MaxResults sets the optional parameter "maxResults": The maximum
  31008. // number of results per page that should be returned. If the number of
  31009. // available results is larger than maxResults, Compute Engine returns a
  31010. // nextPageToken that can be used to get the next page of results in
  31011. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  31012. // (Default: 500)
  31013. func (c *AcceleratorTypesAggregatedListCall) MaxResults(maxResults int64) *AcceleratorTypesAggregatedListCall {
  31014. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  31015. return c
  31016. }
  31017. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  31018. // a certain order. By default, results are returned in alphanumerical
  31019. // order based on the resource name.
  31020. //
  31021. // You can also sort results in descending order based on the creation
  31022. // timestamp using orderBy="creationTimestamp desc". This sorts results
  31023. // based on the creationTimestamp field in reverse chronological order
  31024. // (newest result first). Use this to sort resources like operations so
  31025. // that the newest operation is returned first.
  31026. //
  31027. // Currently, only sorting by name or creationTimestamp desc is
  31028. // supported.
  31029. func (c *AcceleratorTypesAggregatedListCall) OrderBy(orderBy string) *AcceleratorTypesAggregatedListCall {
  31030. c.urlParams_.Set("orderBy", orderBy)
  31031. return c
  31032. }
  31033. // PageToken sets the optional parameter "pageToken": Specifies a page
  31034. // token to use. Set pageToken to the nextPageToken returned by a
  31035. // previous list request to get the next page of results.
  31036. func (c *AcceleratorTypesAggregatedListCall) PageToken(pageToken string) *AcceleratorTypesAggregatedListCall {
  31037. c.urlParams_.Set("pageToken", pageToken)
  31038. return c
  31039. }
  31040. // Fields allows partial responses to be retrieved. See
  31041. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31042. // for more information.
  31043. func (c *AcceleratorTypesAggregatedListCall) Fields(s ...googleapi.Field) *AcceleratorTypesAggregatedListCall {
  31044. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31045. return c
  31046. }
  31047. // IfNoneMatch sets the optional parameter which makes the operation
  31048. // fail if the object's ETag matches the given value. This is useful for
  31049. // getting updates only after the object has changed since the last
  31050. // request. Use googleapi.IsNotModified to check whether the response
  31051. // error from Do is the result of In-None-Match.
  31052. func (c *AcceleratorTypesAggregatedListCall) IfNoneMatch(entityTag string) *AcceleratorTypesAggregatedListCall {
  31053. c.ifNoneMatch_ = entityTag
  31054. return c
  31055. }
  31056. // Context sets the context to be used in this call's Do method. Any
  31057. // pending HTTP request will be aborted if the provided context is
  31058. // canceled.
  31059. func (c *AcceleratorTypesAggregatedListCall) Context(ctx context.Context) *AcceleratorTypesAggregatedListCall {
  31060. c.ctx_ = ctx
  31061. return c
  31062. }
  31063. // Header returns an http.Header that can be modified by the caller to
  31064. // add HTTP headers to the request.
  31065. func (c *AcceleratorTypesAggregatedListCall) Header() http.Header {
  31066. if c.header_ == nil {
  31067. c.header_ = make(http.Header)
  31068. }
  31069. return c.header_
  31070. }
  31071. func (c *AcceleratorTypesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  31072. reqHeaders := make(http.Header)
  31073. for k, v := range c.header_ {
  31074. reqHeaders[k] = v
  31075. }
  31076. reqHeaders.Set("User-Agent", c.s.userAgent())
  31077. if c.ifNoneMatch_ != "" {
  31078. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  31079. }
  31080. var body io.Reader = nil
  31081. c.urlParams_.Set("alt", alt)
  31082. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/acceleratorTypes")
  31083. urls += "?" + c.urlParams_.Encode()
  31084. req, _ := http.NewRequest("GET", urls, body)
  31085. req.Header = reqHeaders
  31086. googleapi.Expand(req.URL, map[string]string{
  31087. "project": c.project,
  31088. })
  31089. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31090. }
  31091. // Do executes the "compute.acceleratorTypes.aggregatedList" call.
  31092. // Exactly one of *AcceleratorTypeAggregatedList or error will be
  31093. // non-nil. Any non-2xx status code is an error. Response headers are in
  31094. // either *AcceleratorTypeAggregatedList.ServerResponse.Header or (if a
  31095. // response was returned at all) in error.(*googleapi.Error).Header. Use
  31096. // googleapi.IsNotModified to check whether the returned error was
  31097. // because http.StatusNotModified was returned.
  31098. func (c *AcceleratorTypesAggregatedListCall) Do(opts ...googleapi.CallOption) (*AcceleratorTypeAggregatedList, error) {
  31099. gensupport.SetOptions(c.urlParams_, opts...)
  31100. res, err := c.doRequest("json")
  31101. if res != nil && res.StatusCode == http.StatusNotModified {
  31102. if res.Body != nil {
  31103. res.Body.Close()
  31104. }
  31105. return nil, &googleapi.Error{
  31106. Code: res.StatusCode,
  31107. Header: res.Header,
  31108. }
  31109. }
  31110. if err != nil {
  31111. return nil, err
  31112. }
  31113. defer googleapi.CloseBody(res)
  31114. if err := googleapi.CheckResponse(res); err != nil {
  31115. return nil, err
  31116. }
  31117. ret := &AcceleratorTypeAggregatedList{
  31118. ServerResponse: googleapi.ServerResponse{
  31119. Header: res.Header,
  31120. HTTPStatusCode: res.StatusCode,
  31121. },
  31122. }
  31123. target := &ret
  31124. if err := gensupport.DecodeResponse(target, res); err != nil {
  31125. return nil, err
  31126. }
  31127. return ret, nil
  31128. // {
  31129. // "description": "Retrieves an aggregated list of accelerator types.",
  31130. // "httpMethod": "GET",
  31131. // "id": "compute.acceleratorTypes.aggregatedList",
  31132. // "parameterOrder": [
  31133. // "project"
  31134. // ],
  31135. // "parameters": {
  31136. // "filter": {
  31137. // "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).",
  31138. // "location": "query",
  31139. // "type": "string"
  31140. // },
  31141. // "maxResults": {
  31142. // "default": "500",
  31143. // "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)",
  31144. // "format": "uint32",
  31145. // "location": "query",
  31146. // "minimum": "0",
  31147. // "type": "integer"
  31148. // },
  31149. // "orderBy": {
  31150. // "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.",
  31151. // "location": "query",
  31152. // "type": "string"
  31153. // },
  31154. // "pageToken": {
  31155. // "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.",
  31156. // "location": "query",
  31157. // "type": "string"
  31158. // },
  31159. // "project": {
  31160. // "description": "Project ID for this request.",
  31161. // "location": "path",
  31162. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  31163. // "required": true,
  31164. // "type": "string"
  31165. // }
  31166. // },
  31167. // "path": "{project}/aggregated/acceleratorTypes",
  31168. // "response": {
  31169. // "$ref": "AcceleratorTypeAggregatedList"
  31170. // },
  31171. // "scopes": [
  31172. // "https://www.googleapis.com/auth/cloud-platform",
  31173. // "https://www.googleapis.com/auth/compute",
  31174. // "https://www.googleapis.com/auth/compute.readonly"
  31175. // ]
  31176. // }
  31177. }
  31178. // Pages invokes f for each page of results.
  31179. // A non-nil error returned from f will halt the iteration.
  31180. // The provided context supersedes any context provided to the Context method.
  31181. func (c *AcceleratorTypesAggregatedListCall) Pages(ctx context.Context, f func(*AcceleratorTypeAggregatedList) error) error {
  31182. c.ctx_ = ctx
  31183. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  31184. for {
  31185. x, err := c.Do()
  31186. if err != nil {
  31187. return err
  31188. }
  31189. if err := f(x); err != nil {
  31190. return err
  31191. }
  31192. if x.NextPageToken == "" {
  31193. return nil
  31194. }
  31195. c.PageToken(x.NextPageToken)
  31196. }
  31197. }
  31198. // method id "compute.acceleratorTypes.get":
  31199. type AcceleratorTypesGetCall struct {
  31200. s *Service
  31201. project string
  31202. zone string
  31203. acceleratorType string
  31204. urlParams_ gensupport.URLParams
  31205. ifNoneMatch_ string
  31206. ctx_ context.Context
  31207. header_ http.Header
  31208. }
  31209. // Get: Returns the specified accelerator type.
  31210. func (r *AcceleratorTypesService) Get(project string, zone string, acceleratorType string) *AcceleratorTypesGetCall {
  31211. c := &AcceleratorTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31212. c.project = project
  31213. c.zone = zone
  31214. c.acceleratorType = acceleratorType
  31215. return c
  31216. }
  31217. // Fields allows partial responses to be retrieved. See
  31218. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31219. // for more information.
  31220. func (c *AcceleratorTypesGetCall) Fields(s ...googleapi.Field) *AcceleratorTypesGetCall {
  31221. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31222. return c
  31223. }
  31224. // IfNoneMatch sets the optional parameter which makes the operation
  31225. // fail if the object's ETag matches the given value. This is useful for
  31226. // getting updates only after the object has changed since the last
  31227. // request. Use googleapi.IsNotModified to check whether the response
  31228. // error from Do is the result of In-None-Match.
  31229. func (c *AcceleratorTypesGetCall) IfNoneMatch(entityTag string) *AcceleratorTypesGetCall {
  31230. c.ifNoneMatch_ = entityTag
  31231. return c
  31232. }
  31233. // Context sets the context to be used in this call's Do method. Any
  31234. // pending HTTP request will be aborted if the provided context is
  31235. // canceled.
  31236. func (c *AcceleratorTypesGetCall) Context(ctx context.Context) *AcceleratorTypesGetCall {
  31237. c.ctx_ = ctx
  31238. return c
  31239. }
  31240. // Header returns an http.Header that can be modified by the caller to
  31241. // add HTTP headers to the request.
  31242. func (c *AcceleratorTypesGetCall) Header() http.Header {
  31243. if c.header_ == nil {
  31244. c.header_ = make(http.Header)
  31245. }
  31246. return c.header_
  31247. }
  31248. func (c *AcceleratorTypesGetCall) doRequest(alt string) (*http.Response, error) {
  31249. reqHeaders := make(http.Header)
  31250. for k, v := range c.header_ {
  31251. reqHeaders[k] = v
  31252. }
  31253. reqHeaders.Set("User-Agent", c.s.userAgent())
  31254. if c.ifNoneMatch_ != "" {
  31255. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  31256. }
  31257. var body io.Reader = nil
  31258. c.urlParams_.Set("alt", alt)
  31259. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/acceleratorTypes/{acceleratorType}")
  31260. urls += "?" + c.urlParams_.Encode()
  31261. req, _ := http.NewRequest("GET", urls, body)
  31262. req.Header = reqHeaders
  31263. googleapi.Expand(req.URL, map[string]string{
  31264. "project": c.project,
  31265. "zone": c.zone,
  31266. "acceleratorType": c.acceleratorType,
  31267. })
  31268. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31269. }
  31270. // Do executes the "compute.acceleratorTypes.get" call.
  31271. // Exactly one of *AcceleratorType or error will be non-nil. Any non-2xx
  31272. // status code is an error. Response headers are in either
  31273. // *AcceleratorType.ServerResponse.Header or (if a response was returned
  31274. // at all) in error.(*googleapi.Error).Header. Use
  31275. // googleapi.IsNotModified to check whether the returned error was
  31276. // because http.StatusNotModified was returned.
  31277. func (c *AcceleratorTypesGetCall) Do(opts ...googleapi.CallOption) (*AcceleratorType, error) {
  31278. gensupport.SetOptions(c.urlParams_, opts...)
  31279. res, err := c.doRequest("json")
  31280. if res != nil && res.StatusCode == http.StatusNotModified {
  31281. if res.Body != nil {
  31282. res.Body.Close()
  31283. }
  31284. return nil, &googleapi.Error{
  31285. Code: res.StatusCode,
  31286. Header: res.Header,
  31287. }
  31288. }
  31289. if err != nil {
  31290. return nil, err
  31291. }
  31292. defer googleapi.CloseBody(res)
  31293. if err := googleapi.CheckResponse(res); err != nil {
  31294. return nil, err
  31295. }
  31296. ret := &AcceleratorType{
  31297. ServerResponse: googleapi.ServerResponse{
  31298. Header: res.Header,
  31299. HTTPStatusCode: res.StatusCode,
  31300. },
  31301. }
  31302. target := &ret
  31303. if err := gensupport.DecodeResponse(target, res); err != nil {
  31304. return nil, err
  31305. }
  31306. return ret, nil
  31307. // {
  31308. // "description": "Returns the specified accelerator type.",
  31309. // "httpMethod": "GET",
  31310. // "id": "compute.acceleratorTypes.get",
  31311. // "parameterOrder": [
  31312. // "project",
  31313. // "zone",
  31314. // "acceleratorType"
  31315. // ],
  31316. // "parameters": {
  31317. // "acceleratorType": {
  31318. // "description": "Name of the accelerator type to return.",
  31319. // "location": "path",
  31320. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  31321. // "required": true,
  31322. // "type": "string"
  31323. // },
  31324. // "project": {
  31325. // "description": "Project ID for this request.",
  31326. // "location": "path",
  31327. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  31328. // "required": true,
  31329. // "type": "string"
  31330. // },
  31331. // "zone": {
  31332. // "description": "The name of the zone for this request.",
  31333. // "location": "path",
  31334. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  31335. // "required": true,
  31336. // "type": "string"
  31337. // }
  31338. // },
  31339. // "path": "{project}/zones/{zone}/acceleratorTypes/{acceleratorType}",
  31340. // "response": {
  31341. // "$ref": "AcceleratorType"
  31342. // },
  31343. // "scopes": [
  31344. // "https://www.googleapis.com/auth/cloud-platform",
  31345. // "https://www.googleapis.com/auth/compute",
  31346. // "https://www.googleapis.com/auth/compute.readonly"
  31347. // ]
  31348. // }
  31349. }
  31350. // method id "compute.acceleratorTypes.list":
  31351. type AcceleratorTypesListCall struct {
  31352. s *Service
  31353. project string
  31354. zone string
  31355. urlParams_ gensupport.URLParams
  31356. ifNoneMatch_ string
  31357. ctx_ context.Context
  31358. header_ http.Header
  31359. }
  31360. // List: Retrieves a list of accelerator types available to the
  31361. // specified project.
  31362. func (r *AcceleratorTypesService) List(project string, zone string) *AcceleratorTypesListCall {
  31363. c := &AcceleratorTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31364. c.project = project
  31365. c.zone = zone
  31366. return c
  31367. }
  31368. // Filter sets the optional parameter "filter": A filter expression that
  31369. // filters resources listed in the response. The expression must specify
  31370. // the field name, a comparison operator, and the value that you want to
  31371. // use for filtering. The value must be a string, a number, or a
  31372. // boolean. The comparison operator must be either =, !=, >, or <.
  31373. //
  31374. // For example, if you are filtering Compute Engine instances, you can
  31375. // exclude instances named example-instance by specifying name !=
  31376. // example-instance.
  31377. //
  31378. // You can also filter nested fields. For example, you could specify
  31379. // scheduling.automaticRestart = false to include instances only if they
  31380. // are not scheduled for automatic restarts. You can use filtering on
  31381. // nested fields to filter based on resource labels.
  31382. //
  31383. // To filter on multiple expressions, provide each separate expression
  31384. // within parentheses. For example, (scheduling.automaticRestart = true)
  31385. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  31386. // AND expression. However, you can include AND and OR expressions
  31387. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  31388. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  31389. // true).
  31390. func (c *AcceleratorTypesListCall) Filter(filter string) *AcceleratorTypesListCall {
  31391. c.urlParams_.Set("filter", filter)
  31392. return c
  31393. }
  31394. // MaxResults sets the optional parameter "maxResults": The maximum
  31395. // number of results per page that should be returned. If the number of
  31396. // available results is larger than maxResults, Compute Engine returns a
  31397. // nextPageToken that can be used to get the next page of results in
  31398. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  31399. // (Default: 500)
  31400. func (c *AcceleratorTypesListCall) MaxResults(maxResults int64) *AcceleratorTypesListCall {
  31401. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  31402. return c
  31403. }
  31404. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  31405. // a certain order. By default, results are returned in alphanumerical
  31406. // order based on the resource name.
  31407. //
  31408. // You can also sort results in descending order based on the creation
  31409. // timestamp using orderBy="creationTimestamp desc". This sorts results
  31410. // based on the creationTimestamp field in reverse chronological order
  31411. // (newest result first). Use this to sort resources like operations so
  31412. // that the newest operation is returned first.
  31413. //
  31414. // Currently, only sorting by name or creationTimestamp desc is
  31415. // supported.
  31416. func (c *AcceleratorTypesListCall) OrderBy(orderBy string) *AcceleratorTypesListCall {
  31417. c.urlParams_.Set("orderBy", orderBy)
  31418. return c
  31419. }
  31420. // PageToken sets the optional parameter "pageToken": Specifies a page
  31421. // token to use. Set pageToken to the nextPageToken returned by a
  31422. // previous list request to get the next page of results.
  31423. func (c *AcceleratorTypesListCall) PageToken(pageToken string) *AcceleratorTypesListCall {
  31424. c.urlParams_.Set("pageToken", pageToken)
  31425. return c
  31426. }
  31427. // Fields allows partial responses to be retrieved. See
  31428. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31429. // for more information.
  31430. func (c *AcceleratorTypesListCall) Fields(s ...googleapi.Field) *AcceleratorTypesListCall {
  31431. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31432. return c
  31433. }
  31434. // IfNoneMatch sets the optional parameter which makes the operation
  31435. // fail if the object's ETag matches the given value. This is useful for
  31436. // getting updates only after the object has changed since the last
  31437. // request. Use googleapi.IsNotModified to check whether the response
  31438. // error from Do is the result of In-None-Match.
  31439. func (c *AcceleratorTypesListCall) IfNoneMatch(entityTag string) *AcceleratorTypesListCall {
  31440. c.ifNoneMatch_ = entityTag
  31441. return c
  31442. }
  31443. // Context sets the context to be used in this call's Do method. Any
  31444. // pending HTTP request will be aborted if the provided context is
  31445. // canceled.
  31446. func (c *AcceleratorTypesListCall) Context(ctx context.Context) *AcceleratorTypesListCall {
  31447. c.ctx_ = ctx
  31448. return c
  31449. }
  31450. // Header returns an http.Header that can be modified by the caller to
  31451. // add HTTP headers to the request.
  31452. func (c *AcceleratorTypesListCall) Header() http.Header {
  31453. if c.header_ == nil {
  31454. c.header_ = make(http.Header)
  31455. }
  31456. return c.header_
  31457. }
  31458. func (c *AcceleratorTypesListCall) doRequest(alt string) (*http.Response, error) {
  31459. reqHeaders := make(http.Header)
  31460. for k, v := range c.header_ {
  31461. reqHeaders[k] = v
  31462. }
  31463. reqHeaders.Set("User-Agent", c.s.userAgent())
  31464. if c.ifNoneMatch_ != "" {
  31465. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  31466. }
  31467. var body io.Reader = nil
  31468. c.urlParams_.Set("alt", alt)
  31469. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/acceleratorTypes")
  31470. urls += "?" + c.urlParams_.Encode()
  31471. req, _ := http.NewRequest("GET", urls, body)
  31472. req.Header = reqHeaders
  31473. googleapi.Expand(req.URL, map[string]string{
  31474. "project": c.project,
  31475. "zone": c.zone,
  31476. })
  31477. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31478. }
  31479. // Do executes the "compute.acceleratorTypes.list" call.
  31480. // Exactly one of *AcceleratorTypeList or error will be non-nil. Any
  31481. // non-2xx status code is an error. Response headers are in either
  31482. // *AcceleratorTypeList.ServerResponse.Header or (if a response was
  31483. // returned at all) in error.(*googleapi.Error).Header. Use
  31484. // googleapi.IsNotModified to check whether the returned error was
  31485. // because http.StatusNotModified was returned.
  31486. func (c *AcceleratorTypesListCall) Do(opts ...googleapi.CallOption) (*AcceleratorTypeList, error) {
  31487. gensupport.SetOptions(c.urlParams_, opts...)
  31488. res, err := c.doRequest("json")
  31489. if res != nil && res.StatusCode == http.StatusNotModified {
  31490. if res.Body != nil {
  31491. res.Body.Close()
  31492. }
  31493. return nil, &googleapi.Error{
  31494. Code: res.StatusCode,
  31495. Header: res.Header,
  31496. }
  31497. }
  31498. if err != nil {
  31499. return nil, err
  31500. }
  31501. defer googleapi.CloseBody(res)
  31502. if err := googleapi.CheckResponse(res); err != nil {
  31503. return nil, err
  31504. }
  31505. ret := &AcceleratorTypeList{
  31506. ServerResponse: googleapi.ServerResponse{
  31507. Header: res.Header,
  31508. HTTPStatusCode: res.StatusCode,
  31509. },
  31510. }
  31511. target := &ret
  31512. if err := gensupport.DecodeResponse(target, res); err != nil {
  31513. return nil, err
  31514. }
  31515. return ret, nil
  31516. // {
  31517. // "description": "Retrieves a list of accelerator types available to the specified project.",
  31518. // "httpMethod": "GET",
  31519. // "id": "compute.acceleratorTypes.list",
  31520. // "parameterOrder": [
  31521. // "project",
  31522. // "zone"
  31523. // ],
  31524. // "parameters": {
  31525. // "filter": {
  31526. // "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).",
  31527. // "location": "query",
  31528. // "type": "string"
  31529. // },
  31530. // "maxResults": {
  31531. // "default": "500",
  31532. // "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)",
  31533. // "format": "uint32",
  31534. // "location": "query",
  31535. // "minimum": "0",
  31536. // "type": "integer"
  31537. // },
  31538. // "orderBy": {
  31539. // "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.",
  31540. // "location": "query",
  31541. // "type": "string"
  31542. // },
  31543. // "pageToken": {
  31544. // "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.",
  31545. // "location": "query",
  31546. // "type": "string"
  31547. // },
  31548. // "project": {
  31549. // "description": "Project ID for this request.",
  31550. // "location": "path",
  31551. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  31552. // "required": true,
  31553. // "type": "string"
  31554. // },
  31555. // "zone": {
  31556. // "description": "The name of the zone for this request.",
  31557. // "location": "path",
  31558. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  31559. // "required": true,
  31560. // "type": "string"
  31561. // }
  31562. // },
  31563. // "path": "{project}/zones/{zone}/acceleratorTypes",
  31564. // "response": {
  31565. // "$ref": "AcceleratorTypeList"
  31566. // },
  31567. // "scopes": [
  31568. // "https://www.googleapis.com/auth/cloud-platform",
  31569. // "https://www.googleapis.com/auth/compute",
  31570. // "https://www.googleapis.com/auth/compute.readonly"
  31571. // ]
  31572. // }
  31573. }
  31574. // Pages invokes f for each page of results.
  31575. // A non-nil error returned from f will halt the iteration.
  31576. // The provided context supersedes any context provided to the Context method.
  31577. func (c *AcceleratorTypesListCall) Pages(ctx context.Context, f func(*AcceleratorTypeList) error) error {
  31578. c.ctx_ = ctx
  31579. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  31580. for {
  31581. x, err := c.Do()
  31582. if err != nil {
  31583. return err
  31584. }
  31585. if err := f(x); err != nil {
  31586. return err
  31587. }
  31588. if x.NextPageToken == "" {
  31589. return nil
  31590. }
  31591. c.PageToken(x.NextPageToken)
  31592. }
  31593. }
  31594. // method id "compute.addresses.aggregatedList":
  31595. type AddressesAggregatedListCall struct {
  31596. s *Service
  31597. project string
  31598. urlParams_ gensupport.URLParams
  31599. ifNoneMatch_ string
  31600. ctx_ context.Context
  31601. header_ http.Header
  31602. }
  31603. // AggregatedList: Retrieves an aggregated list of addresses.
  31604. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/aggregatedList
  31605. func (r *AddressesService) AggregatedList(project string) *AddressesAggregatedListCall {
  31606. c := &AddressesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31607. c.project = project
  31608. return c
  31609. }
  31610. // Filter sets the optional parameter "filter": A filter expression that
  31611. // filters resources listed in the response. The expression must specify
  31612. // the field name, a comparison operator, and the value that you want to
  31613. // use for filtering. The value must be a string, a number, or a
  31614. // boolean. The comparison operator must be either =, !=, >, or <.
  31615. //
  31616. // For example, if you are filtering Compute Engine instances, you can
  31617. // exclude instances named example-instance by specifying name !=
  31618. // example-instance.
  31619. //
  31620. // You can also filter nested fields. For example, you could specify
  31621. // scheduling.automaticRestart = false to include instances only if they
  31622. // are not scheduled for automatic restarts. You can use filtering on
  31623. // nested fields to filter based on resource labels.
  31624. //
  31625. // To filter on multiple expressions, provide each separate expression
  31626. // within parentheses. For example, (scheduling.automaticRestart = true)
  31627. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  31628. // AND expression. However, you can include AND and OR expressions
  31629. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  31630. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  31631. // true).
  31632. func (c *AddressesAggregatedListCall) Filter(filter string) *AddressesAggregatedListCall {
  31633. c.urlParams_.Set("filter", filter)
  31634. return c
  31635. }
  31636. // MaxResults sets the optional parameter "maxResults": The maximum
  31637. // number of results per page that should be returned. If the number of
  31638. // available results is larger than maxResults, Compute Engine returns a
  31639. // nextPageToken that can be used to get the next page of results in
  31640. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  31641. // (Default: 500)
  31642. func (c *AddressesAggregatedListCall) MaxResults(maxResults int64) *AddressesAggregatedListCall {
  31643. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  31644. return c
  31645. }
  31646. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  31647. // a certain order. By default, results are returned in alphanumerical
  31648. // order based on the resource name.
  31649. //
  31650. // You can also sort results in descending order based on the creation
  31651. // timestamp using orderBy="creationTimestamp desc". This sorts results
  31652. // based on the creationTimestamp field in reverse chronological order
  31653. // (newest result first). Use this to sort resources like operations so
  31654. // that the newest operation is returned first.
  31655. //
  31656. // Currently, only sorting by name or creationTimestamp desc is
  31657. // supported.
  31658. func (c *AddressesAggregatedListCall) OrderBy(orderBy string) *AddressesAggregatedListCall {
  31659. c.urlParams_.Set("orderBy", orderBy)
  31660. return c
  31661. }
  31662. // PageToken sets the optional parameter "pageToken": Specifies a page
  31663. // token to use. Set pageToken to the nextPageToken returned by a
  31664. // previous list request to get the next page of results.
  31665. func (c *AddressesAggregatedListCall) PageToken(pageToken string) *AddressesAggregatedListCall {
  31666. c.urlParams_.Set("pageToken", pageToken)
  31667. return c
  31668. }
  31669. // Fields allows partial responses to be retrieved. See
  31670. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31671. // for more information.
  31672. func (c *AddressesAggregatedListCall) Fields(s ...googleapi.Field) *AddressesAggregatedListCall {
  31673. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31674. return c
  31675. }
  31676. // IfNoneMatch sets the optional parameter which makes the operation
  31677. // fail if the object's ETag matches the given value. This is useful for
  31678. // getting updates only after the object has changed since the last
  31679. // request. Use googleapi.IsNotModified to check whether the response
  31680. // error from Do is the result of In-None-Match.
  31681. func (c *AddressesAggregatedListCall) IfNoneMatch(entityTag string) *AddressesAggregatedListCall {
  31682. c.ifNoneMatch_ = entityTag
  31683. return c
  31684. }
  31685. // Context sets the context to be used in this call's Do method. Any
  31686. // pending HTTP request will be aborted if the provided context is
  31687. // canceled.
  31688. func (c *AddressesAggregatedListCall) Context(ctx context.Context) *AddressesAggregatedListCall {
  31689. c.ctx_ = ctx
  31690. return c
  31691. }
  31692. // Header returns an http.Header that can be modified by the caller to
  31693. // add HTTP headers to the request.
  31694. func (c *AddressesAggregatedListCall) Header() http.Header {
  31695. if c.header_ == nil {
  31696. c.header_ = make(http.Header)
  31697. }
  31698. return c.header_
  31699. }
  31700. func (c *AddressesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  31701. reqHeaders := make(http.Header)
  31702. for k, v := range c.header_ {
  31703. reqHeaders[k] = v
  31704. }
  31705. reqHeaders.Set("User-Agent", c.s.userAgent())
  31706. if c.ifNoneMatch_ != "" {
  31707. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  31708. }
  31709. var body io.Reader = nil
  31710. c.urlParams_.Set("alt", alt)
  31711. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/addresses")
  31712. urls += "?" + c.urlParams_.Encode()
  31713. req, _ := http.NewRequest("GET", urls, body)
  31714. req.Header = reqHeaders
  31715. googleapi.Expand(req.URL, map[string]string{
  31716. "project": c.project,
  31717. })
  31718. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31719. }
  31720. // Do executes the "compute.addresses.aggregatedList" call.
  31721. // Exactly one of *AddressAggregatedList or error will be non-nil. Any
  31722. // non-2xx status code is an error. Response headers are in either
  31723. // *AddressAggregatedList.ServerResponse.Header or (if a response was
  31724. // returned at all) in error.(*googleapi.Error).Header. Use
  31725. // googleapi.IsNotModified to check whether the returned error was
  31726. // because http.StatusNotModified was returned.
  31727. func (c *AddressesAggregatedListCall) Do(opts ...googleapi.CallOption) (*AddressAggregatedList, error) {
  31728. gensupport.SetOptions(c.urlParams_, opts...)
  31729. res, err := c.doRequest("json")
  31730. if res != nil && res.StatusCode == http.StatusNotModified {
  31731. if res.Body != nil {
  31732. res.Body.Close()
  31733. }
  31734. return nil, &googleapi.Error{
  31735. Code: res.StatusCode,
  31736. Header: res.Header,
  31737. }
  31738. }
  31739. if err != nil {
  31740. return nil, err
  31741. }
  31742. defer googleapi.CloseBody(res)
  31743. if err := googleapi.CheckResponse(res); err != nil {
  31744. return nil, err
  31745. }
  31746. ret := &AddressAggregatedList{
  31747. ServerResponse: googleapi.ServerResponse{
  31748. Header: res.Header,
  31749. HTTPStatusCode: res.StatusCode,
  31750. },
  31751. }
  31752. target := &ret
  31753. if err := gensupport.DecodeResponse(target, res); err != nil {
  31754. return nil, err
  31755. }
  31756. return ret, nil
  31757. // {
  31758. // "description": "Retrieves an aggregated list of addresses.",
  31759. // "httpMethod": "GET",
  31760. // "id": "compute.addresses.aggregatedList",
  31761. // "parameterOrder": [
  31762. // "project"
  31763. // ],
  31764. // "parameters": {
  31765. // "filter": {
  31766. // "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).",
  31767. // "location": "query",
  31768. // "type": "string"
  31769. // },
  31770. // "maxResults": {
  31771. // "default": "500",
  31772. // "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)",
  31773. // "format": "uint32",
  31774. // "location": "query",
  31775. // "minimum": "0",
  31776. // "type": "integer"
  31777. // },
  31778. // "orderBy": {
  31779. // "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.",
  31780. // "location": "query",
  31781. // "type": "string"
  31782. // },
  31783. // "pageToken": {
  31784. // "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.",
  31785. // "location": "query",
  31786. // "type": "string"
  31787. // },
  31788. // "project": {
  31789. // "description": "Project ID for this request.",
  31790. // "location": "path",
  31791. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  31792. // "required": true,
  31793. // "type": "string"
  31794. // }
  31795. // },
  31796. // "path": "{project}/aggregated/addresses",
  31797. // "response": {
  31798. // "$ref": "AddressAggregatedList"
  31799. // },
  31800. // "scopes": [
  31801. // "https://www.googleapis.com/auth/cloud-platform",
  31802. // "https://www.googleapis.com/auth/compute",
  31803. // "https://www.googleapis.com/auth/compute.readonly"
  31804. // ]
  31805. // }
  31806. }
  31807. // Pages invokes f for each page of results.
  31808. // A non-nil error returned from f will halt the iteration.
  31809. // The provided context supersedes any context provided to the Context method.
  31810. func (c *AddressesAggregatedListCall) Pages(ctx context.Context, f func(*AddressAggregatedList) error) error {
  31811. c.ctx_ = ctx
  31812. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  31813. for {
  31814. x, err := c.Do()
  31815. if err != nil {
  31816. return err
  31817. }
  31818. if err := f(x); err != nil {
  31819. return err
  31820. }
  31821. if x.NextPageToken == "" {
  31822. return nil
  31823. }
  31824. c.PageToken(x.NextPageToken)
  31825. }
  31826. }
  31827. // method id "compute.addresses.delete":
  31828. type AddressesDeleteCall struct {
  31829. s *Service
  31830. project string
  31831. region string
  31832. address string
  31833. urlParams_ gensupport.URLParams
  31834. ctx_ context.Context
  31835. header_ http.Header
  31836. }
  31837. // Delete: Deletes the specified address resource.
  31838. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/delete
  31839. func (r *AddressesService) Delete(project string, region string, address string) *AddressesDeleteCall {
  31840. c := &AddressesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31841. c.project = project
  31842. c.region = region
  31843. c.address = address
  31844. return c
  31845. }
  31846. // RequestId sets the optional parameter "requestId": An optional
  31847. // request ID to identify requests. Specify a unique request ID so that
  31848. // if you must retry your request, the server will know to ignore the
  31849. // request if it has already been completed.
  31850. //
  31851. // For example, consider a situation where you make an initial request
  31852. // and the request times out. If you make the request again with the
  31853. // same request ID, the server can check if original operation with the
  31854. // same request ID was received, and if so, will ignore the second
  31855. // request. This prevents clients from accidentally creating duplicate
  31856. // commitments.
  31857. //
  31858. // The request ID must be a valid UUID with the exception that zero UUID
  31859. // is not supported (00000000-0000-0000-0000-000000000000).
  31860. func (c *AddressesDeleteCall) RequestId(requestId string) *AddressesDeleteCall {
  31861. c.urlParams_.Set("requestId", requestId)
  31862. return c
  31863. }
  31864. // Fields allows partial responses to be retrieved. See
  31865. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31866. // for more information.
  31867. func (c *AddressesDeleteCall) Fields(s ...googleapi.Field) *AddressesDeleteCall {
  31868. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31869. return c
  31870. }
  31871. // Context sets the context to be used in this call's Do method. Any
  31872. // pending HTTP request will be aborted if the provided context is
  31873. // canceled.
  31874. func (c *AddressesDeleteCall) Context(ctx context.Context) *AddressesDeleteCall {
  31875. c.ctx_ = ctx
  31876. return c
  31877. }
  31878. // Header returns an http.Header that can be modified by the caller to
  31879. // add HTTP headers to the request.
  31880. func (c *AddressesDeleteCall) Header() http.Header {
  31881. if c.header_ == nil {
  31882. c.header_ = make(http.Header)
  31883. }
  31884. return c.header_
  31885. }
  31886. func (c *AddressesDeleteCall) doRequest(alt string) (*http.Response, error) {
  31887. reqHeaders := make(http.Header)
  31888. for k, v := range c.header_ {
  31889. reqHeaders[k] = v
  31890. }
  31891. reqHeaders.Set("User-Agent", c.s.userAgent())
  31892. var body io.Reader = nil
  31893. c.urlParams_.Set("alt", alt)
  31894. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses/{address}")
  31895. urls += "?" + c.urlParams_.Encode()
  31896. req, _ := http.NewRequest("DELETE", urls, body)
  31897. req.Header = reqHeaders
  31898. googleapi.Expand(req.URL, map[string]string{
  31899. "project": c.project,
  31900. "region": c.region,
  31901. "address": c.address,
  31902. })
  31903. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31904. }
  31905. // Do executes the "compute.addresses.delete" call.
  31906. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  31907. // status code is an error. Response headers are in either
  31908. // *Operation.ServerResponse.Header or (if a response was returned at
  31909. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  31910. // to check whether the returned error was because
  31911. // http.StatusNotModified was returned.
  31912. func (c *AddressesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  31913. gensupport.SetOptions(c.urlParams_, opts...)
  31914. res, err := c.doRequest("json")
  31915. if res != nil && res.StatusCode == http.StatusNotModified {
  31916. if res.Body != nil {
  31917. res.Body.Close()
  31918. }
  31919. return nil, &googleapi.Error{
  31920. Code: res.StatusCode,
  31921. Header: res.Header,
  31922. }
  31923. }
  31924. if err != nil {
  31925. return nil, err
  31926. }
  31927. defer googleapi.CloseBody(res)
  31928. if err := googleapi.CheckResponse(res); err != nil {
  31929. return nil, err
  31930. }
  31931. ret := &Operation{
  31932. ServerResponse: googleapi.ServerResponse{
  31933. Header: res.Header,
  31934. HTTPStatusCode: res.StatusCode,
  31935. },
  31936. }
  31937. target := &ret
  31938. if err := gensupport.DecodeResponse(target, res); err != nil {
  31939. return nil, err
  31940. }
  31941. return ret, nil
  31942. // {
  31943. // "description": "Deletes the specified address resource.",
  31944. // "httpMethod": "DELETE",
  31945. // "id": "compute.addresses.delete",
  31946. // "parameterOrder": [
  31947. // "project",
  31948. // "region",
  31949. // "address"
  31950. // ],
  31951. // "parameters": {
  31952. // "address": {
  31953. // "description": "Name of the address resource to delete.",
  31954. // "location": "path",
  31955. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  31956. // "required": true,
  31957. // "type": "string"
  31958. // },
  31959. // "project": {
  31960. // "description": "Project ID for this request.",
  31961. // "location": "path",
  31962. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  31963. // "required": true,
  31964. // "type": "string"
  31965. // },
  31966. // "region": {
  31967. // "description": "Name of the region for this request.",
  31968. // "location": "path",
  31969. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  31970. // "required": true,
  31971. // "type": "string"
  31972. // },
  31973. // "requestId": {
  31974. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  31975. // "location": "query",
  31976. // "type": "string"
  31977. // }
  31978. // },
  31979. // "path": "{project}/regions/{region}/addresses/{address}",
  31980. // "response": {
  31981. // "$ref": "Operation"
  31982. // },
  31983. // "scopes": [
  31984. // "https://www.googleapis.com/auth/cloud-platform",
  31985. // "https://www.googleapis.com/auth/compute"
  31986. // ]
  31987. // }
  31988. }
  31989. // method id "compute.addresses.get":
  31990. type AddressesGetCall struct {
  31991. s *Service
  31992. project string
  31993. region string
  31994. address string
  31995. urlParams_ gensupport.URLParams
  31996. ifNoneMatch_ string
  31997. ctx_ context.Context
  31998. header_ http.Header
  31999. }
  32000. // Get: Returns the specified address resource.
  32001. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/get
  32002. func (r *AddressesService) Get(project string, region string, address string) *AddressesGetCall {
  32003. c := &AddressesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32004. c.project = project
  32005. c.region = region
  32006. c.address = address
  32007. return c
  32008. }
  32009. // Fields allows partial responses to be retrieved. See
  32010. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32011. // for more information.
  32012. func (c *AddressesGetCall) Fields(s ...googleapi.Field) *AddressesGetCall {
  32013. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32014. return c
  32015. }
  32016. // IfNoneMatch sets the optional parameter which makes the operation
  32017. // fail if the object's ETag matches the given value. This is useful for
  32018. // getting updates only after the object has changed since the last
  32019. // request. Use googleapi.IsNotModified to check whether the response
  32020. // error from Do is the result of In-None-Match.
  32021. func (c *AddressesGetCall) IfNoneMatch(entityTag string) *AddressesGetCall {
  32022. c.ifNoneMatch_ = entityTag
  32023. return c
  32024. }
  32025. // Context sets the context to be used in this call's Do method. Any
  32026. // pending HTTP request will be aborted if the provided context is
  32027. // canceled.
  32028. func (c *AddressesGetCall) Context(ctx context.Context) *AddressesGetCall {
  32029. c.ctx_ = ctx
  32030. return c
  32031. }
  32032. // Header returns an http.Header that can be modified by the caller to
  32033. // add HTTP headers to the request.
  32034. func (c *AddressesGetCall) Header() http.Header {
  32035. if c.header_ == nil {
  32036. c.header_ = make(http.Header)
  32037. }
  32038. return c.header_
  32039. }
  32040. func (c *AddressesGetCall) doRequest(alt string) (*http.Response, error) {
  32041. reqHeaders := make(http.Header)
  32042. for k, v := range c.header_ {
  32043. reqHeaders[k] = v
  32044. }
  32045. reqHeaders.Set("User-Agent", c.s.userAgent())
  32046. if c.ifNoneMatch_ != "" {
  32047. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  32048. }
  32049. var body io.Reader = nil
  32050. c.urlParams_.Set("alt", alt)
  32051. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses/{address}")
  32052. urls += "?" + c.urlParams_.Encode()
  32053. req, _ := http.NewRequest("GET", urls, body)
  32054. req.Header = reqHeaders
  32055. googleapi.Expand(req.URL, map[string]string{
  32056. "project": c.project,
  32057. "region": c.region,
  32058. "address": c.address,
  32059. })
  32060. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32061. }
  32062. // Do executes the "compute.addresses.get" call.
  32063. // Exactly one of *Address or error will be non-nil. Any non-2xx status
  32064. // code is an error. Response headers are in either
  32065. // *Address.ServerResponse.Header or (if a response was returned at all)
  32066. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  32067. // check whether the returned error was because http.StatusNotModified
  32068. // was returned.
  32069. func (c *AddressesGetCall) Do(opts ...googleapi.CallOption) (*Address, error) {
  32070. gensupport.SetOptions(c.urlParams_, opts...)
  32071. res, err := c.doRequest("json")
  32072. if res != nil && res.StatusCode == http.StatusNotModified {
  32073. if res.Body != nil {
  32074. res.Body.Close()
  32075. }
  32076. return nil, &googleapi.Error{
  32077. Code: res.StatusCode,
  32078. Header: res.Header,
  32079. }
  32080. }
  32081. if err != nil {
  32082. return nil, err
  32083. }
  32084. defer googleapi.CloseBody(res)
  32085. if err := googleapi.CheckResponse(res); err != nil {
  32086. return nil, err
  32087. }
  32088. ret := &Address{
  32089. ServerResponse: googleapi.ServerResponse{
  32090. Header: res.Header,
  32091. HTTPStatusCode: res.StatusCode,
  32092. },
  32093. }
  32094. target := &ret
  32095. if err := gensupport.DecodeResponse(target, res); err != nil {
  32096. return nil, err
  32097. }
  32098. return ret, nil
  32099. // {
  32100. // "description": "Returns the specified address resource.",
  32101. // "httpMethod": "GET",
  32102. // "id": "compute.addresses.get",
  32103. // "parameterOrder": [
  32104. // "project",
  32105. // "region",
  32106. // "address"
  32107. // ],
  32108. // "parameters": {
  32109. // "address": {
  32110. // "description": "Name of the address resource to return.",
  32111. // "location": "path",
  32112. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  32113. // "required": true,
  32114. // "type": "string"
  32115. // },
  32116. // "project": {
  32117. // "description": "Project ID for this request.",
  32118. // "location": "path",
  32119. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  32120. // "required": true,
  32121. // "type": "string"
  32122. // },
  32123. // "region": {
  32124. // "description": "Name of the region for this request.",
  32125. // "location": "path",
  32126. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  32127. // "required": true,
  32128. // "type": "string"
  32129. // }
  32130. // },
  32131. // "path": "{project}/regions/{region}/addresses/{address}",
  32132. // "response": {
  32133. // "$ref": "Address"
  32134. // },
  32135. // "scopes": [
  32136. // "https://www.googleapis.com/auth/cloud-platform",
  32137. // "https://www.googleapis.com/auth/compute",
  32138. // "https://www.googleapis.com/auth/compute.readonly"
  32139. // ]
  32140. // }
  32141. }
  32142. // method id "compute.addresses.insert":
  32143. type AddressesInsertCall struct {
  32144. s *Service
  32145. project string
  32146. region string
  32147. address *Address
  32148. urlParams_ gensupport.URLParams
  32149. ctx_ context.Context
  32150. header_ http.Header
  32151. }
  32152. // Insert: Creates an address resource in the specified project using
  32153. // the data included in the request.
  32154. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/insert
  32155. func (r *AddressesService) Insert(project string, region string, address *Address) *AddressesInsertCall {
  32156. c := &AddressesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32157. c.project = project
  32158. c.region = region
  32159. c.address = address
  32160. return c
  32161. }
  32162. // RequestId sets the optional parameter "requestId": An optional
  32163. // request ID to identify requests. Specify a unique request ID so that
  32164. // if you must retry your request, the server will know to ignore the
  32165. // request if it has already been completed.
  32166. //
  32167. // For example, consider a situation where you make an initial request
  32168. // and the request times out. If you make the request again with the
  32169. // same request ID, the server can check if original operation with the
  32170. // same request ID was received, and if so, will ignore the second
  32171. // request. This prevents clients from accidentally creating duplicate
  32172. // commitments.
  32173. //
  32174. // The request ID must be a valid UUID with the exception that zero UUID
  32175. // is not supported (00000000-0000-0000-0000-000000000000).
  32176. func (c *AddressesInsertCall) RequestId(requestId string) *AddressesInsertCall {
  32177. c.urlParams_.Set("requestId", requestId)
  32178. return c
  32179. }
  32180. // Fields allows partial responses to be retrieved. See
  32181. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32182. // for more information.
  32183. func (c *AddressesInsertCall) Fields(s ...googleapi.Field) *AddressesInsertCall {
  32184. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32185. return c
  32186. }
  32187. // Context sets the context to be used in this call's Do method. Any
  32188. // pending HTTP request will be aborted if the provided context is
  32189. // canceled.
  32190. func (c *AddressesInsertCall) Context(ctx context.Context) *AddressesInsertCall {
  32191. c.ctx_ = ctx
  32192. return c
  32193. }
  32194. // Header returns an http.Header that can be modified by the caller to
  32195. // add HTTP headers to the request.
  32196. func (c *AddressesInsertCall) Header() http.Header {
  32197. if c.header_ == nil {
  32198. c.header_ = make(http.Header)
  32199. }
  32200. return c.header_
  32201. }
  32202. func (c *AddressesInsertCall) doRequest(alt string) (*http.Response, error) {
  32203. reqHeaders := make(http.Header)
  32204. for k, v := range c.header_ {
  32205. reqHeaders[k] = v
  32206. }
  32207. reqHeaders.Set("User-Agent", c.s.userAgent())
  32208. var body io.Reader = nil
  32209. body, err := googleapi.WithoutDataWrapper.JSONReader(c.address)
  32210. if err != nil {
  32211. return nil, err
  32212. }
  32213. reqHeaders.Set("Content-Type", "application/json")
  32214. c.urlParams_.Set("alt", alt)
  32215. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses")
  32216. urls += "?" + c.urlParams_.Encode()
  32217. req, _ := http.NewRequest("POST", urls, body)
  32218. req.Header = reqHeaders
  32219. googleapi.Expand(req.URL, map[string]string{
  32220. "project": c.project,
  32221. "region": c.region,
  32222. })
  32223. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32224. }
  32225. // Do executes the "compute.addresses.insert" call.
  32226. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  32227. // status code is an error. Response headers are in either
  32228. // *Operation.ServerResponse.Header or (if a response was returned at
  32229. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  32230. // to check whether the returned error was because
  32231. // http.StatusNotModified was returned.
  32232. func (c *AddressesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  32233. gensupport.SetOptions(c.urlParams_, opts...)
  32234. res, err := c.doRequest("json")
  32235. if res != nil && res.StatusCode == http.StatusNotModified {
  32236. if res.Body != nil {
  32237. res.Body.Close()
  32238. }
  32239. return nil, &googleapi.Error{
  32240. Code: res.StatusCode,
  32241. Header: res.Header,
  32242. }
  32243. }
  32244. if err != nil {
  32245. return nil, err
  32246. }
  32247. defer googleapi.CloseBody(res)
  32248. if err := googleapi.CheckResponse(res); err != nil {
  32249. return nil, err
  32250. }
  32251. ret := &Operation{
  32252. ServerResponse: googleapi.ServerResponse{
  32253. Header: res.Header,
  32254. HTTPStatusCode: res.StatusCode,
  32255. },
  32256. }
  32257. target := &ret
  32258. if err := gensupport.DecodeResponse(target, res); err != nil {
  32259. return nil, err
  32260. }
  32261. return ret, nil
  32262. // {
  32263. // "description": "Creates an address resource in the specified project using the data included in the request.",
  32264. // "httpMethod": "POST",
  32265. // "id": "compute.addresses.insert",
  32266. // "parameterOrder": [
  32267. // "project",
  32268. // "region"
  32269. // ],
  32270. // "parameters": {
  32271. // "project": {
  32272. // "description": "Project ID for this request.",
  32273. // "location": "path",
  32274. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  32275. // "required": true,
  32276. // "type": "string"
  32277. // },
  32278. // "region": {
  32279. // "description": "Name of the region for this request.",
  32280. // "location": "path",
  32281. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  32282. // "required": true,
  32283. // "type": "string"
  32284. // },
  32285. // "requestId": {
  32286. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  32287. // "location": "query",
  32288. // "type": "string"
  32289. // }
  32290. // },
  32291. // "path": "{project}/regions/{region}/addresses",
  32292. // "request": {
  32293. // "$ref": "Address"
  32294. // },
  32295. // "response": {
  32296. // "$ref": "Operation"
  32297. // },
  32298. // "scopes": [
  32299. // "https://www.googleapis.com/auth/cloud-platform",
  32300. // "https://www.googleapis.com/auth/compute"
  32301. // ]
  32302. // }
  32303. }
  32304. // method id "compute.addresses.list":
  32305. type AddressesListCall struct {
  32306. s *Service
  32307. project string
  32308. region string
  32309. urlParams_ gensupport.URLParams
  32310. ifNoneMatch_ string
  32311. ctx_ context.Context
  32312. header_ http.Header
  32313. }
  32314. // List: Retrieves a list of addresses contained within the specified
  32315. // region.
  32316. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/list
  32317. func (r *AddressesService) List(project string, region string) *AddressesListCall {
  32318. c := &AddressesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32319. c.project = project
  32320. c.region = region
  32321. return c
  32322. }
  32323. // Filter sets the optional parameter "filter": A filter expression that
  32324. // filters resources listed in the response. The expression must specify
  32325. // the field name, a comparison operator, and the value that you want to
  32326. // use for filtering. The value must be a string, a number, or a
  32327. // boolean. The comparison operator must be either =, !=, >, or <.
  32328. //
  32329. // For example, if you are filtering Compute Engine instances, you can
  32330. // exclude instances named example-instance by specifying name !=
  32331. // example-instance.
  32332. //
  32333. // You can also filter nested fields. For example, you could specify
  32334. // scheduling.automaticRestart = false to include instances only if they
  32335. // are not scheduled for automatic restarts. You can use filtering on
  32336. // nested fields to filter based on resource labels.
  32337. //
  32338. // To filter on multiple expressions, provide each separate expression
  32339. // within parentheses. For example, (scheduling.automaticRestart = true)
  32340. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  32341. // AND expression. However, you can include AND and OR expressions
  32342. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  32343. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  32344. // true).
  32345. func (c *AddressesListCall) Filter(filter string) *AddressesListCall {
  32346. c.urlParams_.Set("filter", filter)
  32347. return c
  32348. }
  32349. // MaxResults sets the optional parameter "maxResults": The maximum
  32350. // number of results per page that should be returned. If the number of
  32351. // available results is larger than maxResults, Compute Engine returns a
  32352. // nextPageToken that can be used to get the next page of results in
  32353. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  32354. // (Default: 500)
  32355. func (c *AddressesListCall) MaxResults(maxResults int64) *AddressesListCall {
  32356. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  32357. return c
  32358. }
  32359. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  32360. // a certain order. By default, results are returned in alphanumerical
  32361. // order based on the resource name.
  32362. //
  32363. // You can also sort results in descending order based on the creation
  32364. // timestamp using orderBy="creationTimestamp desc". This sorts results
  32365. // based on the creationTimestamp field in reverse chronological order
  32366. // (newest result first). Use this to sort resources like operations so
  32367. // that the newest operation is returned first.
  32368. //
  32369. // Currently, only sorting by name or creationTimestamp desc is
  32370. // supported.
  32371. func (c *AddressesListCall) OrderBy(orderBy string) *AddressesListCall {
  32372. c.urlParams_.Set("orderBy", orderBy)
  32373. return c
  32374. }
  32375. // PageToken sets the optional parameter "pageToken": Specifies a page
  32376. // token to use. Set pageToken to the nextPageToken returned by a
  32377. // previous list request to get the next page of results.
  32378. func (c *AddressesListCall) PageToken(pageToken string) *AddressesListCall {
  32379. c.urlParams_.Set("pageToken", pageToken)
  32380. return c
  32381. }
  32382. // Fields allows partial responses to be retrieved. See
  32383. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32384. // for more information.
  32385. func (c *AddressesListCall) Fields(s ...googleapi.Field) *AddressesListCall {
  32386. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32387. return c
  32388. }
  32389. // IfNoneMatch sets the optional parameter which makes the operation
  32390. // fail if the object's ETag matches the given value. This is useful for
  32391. // getting updates only after the object has changed since the last
  32392. // request. Use googleapi.IsNotModified to check whether the response
  32393. // error from Do is the result of In-None-Match.
  32394. func (c *AddressesListCall) IfNoneMatch(entityTag string) *AddressesListCall {
  32395. c.ifNoneMatch_ = entityTag
  32396. return c
  32397. }
  32398. // Context sets the context to be used in this call's Do method. Any
  32399. // pending HTTP request will be aborted if the provided context is
  32400. // canceled.
  32401. func (c *AddressesListCall) Context(ctx context.Context) *AddressesListCall {
  32402. c.ctx_ = ctx
  32403. return c
  32404. }
  32405. // Header returns an http.Header that can be modified by the caller to
  32406. // add HTTP headers to the request.
  32407. func (c *AddressesListCall) Header() http.Header {
  32408. if c.header_ == nil {
  32409. c.header_ = make(http.Header)
  32410. }
  32411. return c.header_
  32412. }
  32413. func (c *AddressesListCall) doRequest(alt string) (*http.Response, error) {
  32414. reqHeaders := make(http.Header)
  32415. for k, v := range c.header_ {
  32416. reqHeaders[k] = v
  32417. }
  32418. reqHeaders.Set("User-Agent", c.s.userAgent())
  32419. if c.ifNoneMatch_ != "" {
  32420. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  32421. }
  32422. var body io.Reader = nil
  32423. c.urlParams_.Set("alt", alt)
  32424. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses")
  32425. urls += "?" + c.urlParams_.Encode()
  32426. req, _ := http.NewRequest("GET", urls, body)
  32427. req.Header = reqHeaders
  32428. googleapi.Expand(req.URL, map[string]string{
  32429. "project": c.project,
  32430. "region": c.region,
  32431. })
  32432. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32433. }
  32434. // Do executes the "compute.addresses.list" call.
  32435. // Exactly one of *AddressList or error will be non-nil. Any non-2xx
  32436. // status code is an error. Response headers are in either
  32437. // *AddressList.ServerResponse.Header or (if a response was returned at
  32438. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  32439. // to check whether the returned error was because
  32440. // http.StatusNotModified was returned.
  32441. func (c *AddressesListCall) Do(opts ...googleapi.CallOption) (*AddressList, error) {
  32442. gensupport.SetOptions(c.urlParams_, opts...)
  32443. res, err := c.doRequest("json")
  32444. if res != nil && res.StatusCode == http.StatusNotModified {
  32445. if res.Body != nil {
  32446. res.Body.Close()
  32447. }
  32448. return nil, &googleapi.Error{
  32449. Code: res.StatusCode,
  32450. Header: res.Header,
  32451. }
  32452. }
  32453. if err != nil {
  32454. return nil, err
  32455. }
  32456. defer googleapi.CloseBody(res)
  32457. if err := googleapi.CheckResponse(res); err != nil {
  32458. return nil, err
  32459. }
  32460. ret := &AddressList{
  32461. ServerResponse: googleapi.ServerResponse{
  32462. Header: res.Header,
  32463. HTTPStatusCode: res.StatusCode,
  32464. },
  32465. }
  32466. target := &ret
  32467. if err := gensupport.DecodeResponse(target, res); err != nil {
  32468. return nil, err
  32469. }
  32470. return ret, nil
  32471. // {
  32472. // "description": "Retrieves a list of addresses contained within the specified region.",
  32473. // "httpMethod": "GET",
  32474. // "id": "compute.addresses.list",
  32475. // "parameterOrder": [
  32476. // "project",
  32477. // "region"
  32478. // ],
  32479. // "parameters": {
  32480. // "filter": {
  32481. // "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).",
  32482. // "location": "query",
  32483. // "type": "string"
  32484. // },
  32485. // "maxResults": {
  32486. // "default": "500",
  32487. // "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)",
  32488. // "format": "uint32",
  32489. // "location": "query",
  32490. // "minimum": "0",
  32491. // "type": "integer"
  32492. // },
  32493. // "orderBy": {
  32494. // "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.",
  32495. // "location": "query",
  32496. // "type": "string"
  32497. // },
  32498. // "pageToken": {
  32499. // "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.",
  32500. // "location": "query",
  32501. // "type": "string"
  32502. // },
  32503. // "project": {
  32504. // "description": "Project ID for this request.",
  32505. // "location": "path",
  32506. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  32507. // "required": true,
  32508. // "type": "string"
  32509. // },
  32510. // "region": {
  32511. // "description": "Name of the region for this request.",
  32512. // "location": "path",
  32513. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  32514. // "required": true,
  32515. // "type": "string"
  32516. // }
  32517. // },
  32518. // "path": "{project}/regions/{region}/addresses",
  32519. // "response": {
  32520. // "$ref": "AddressList"
  32521. // },
  32522. // "scopes": [
  32523. // "https://www.googleapis.com/auth/cloud-platform",
  32524. // "https://www.googleapis.com/auth/compute",
  32525. // "https://www.googleapis.com/auth/compute.readonly"
  32526. // ]
  32527. // }
  32528. }
  32529. // Pages invokes f for each page of results.
  32530. // A non-nil error returned from f will halt the iteration.
  32531. // The provided context supersedes any context provided to the Context method.
  32532. func (c *AddressesListCall) Pages(ctx context.Context, f func(*AddressList) error) error {
  32533. c.ctx_ = ctx
  32534. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  32535. for {
  32536. x, err := c.Do()
  32537. if err != nil {
  32538. return err
  32539. }
  32540. if err := f(x); err != nil {
  32541. return err
  32542. }
  32543. if x.NextPageToken == "" {
  32544. return nil
  32545. }
  32546. c.PageToken(x.NextPageToken)
  32547. }
  32548. }
  32549. // method id "compute.addresses.setLabels":
  32550. type AddressesSetLabelsCall struct {
  32551. s *Service
  32552. project string
  32553. region string
  32554. resource string
  32555. regionsetlabelsrequest *RegionSetLabelsRequest
  32556. urlParams_ gensupport.URLParams
  32557. ctx_ context.Context
  32558. header_ http.Header
  32559. }
  32560. // SetLabels: Sets the labels on an Address. To learn more about labels,
  32561. // read the Labeling Resources documentation.
  32562. func (r *AddressesService) SetLabels(project string, region string, resource string, regionsetlabelsrequest *RegionSetLabelsRequest) *AddressesSetLabelsCall {
  32563. c := &AddressesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32564. c.project = project
  32565. c.region = region
  32566. c.resource = resource
  32567. c.regionsetlabelsrequest = regionsetlabelsrequest
  32568. return c
  32569. }
  32570. // RequestId sets the optional parameter "requestId": An optional
  32571. // request ID to identify requests. Specify a unique request ID so that
  32572. // if you must retry your request, the server will know to ignore the
  32573. // request if it has already been completed.
  32574. //
  32575. // For example, consider a situation where you make an initial request
  32576. // and the request times out. If you make the request again with the
  32577. // same request ID, the server can check if original operation with the
  32578. // same request ID was received, and if so, will ignore the second
  32579. // request. This prevents clients from accidentally creating duplicate
  32580. // commitments.
  32581. //
  32582. // The request ID must be a valid UUID with the exception that zero UUID
  32583. // is not supported (00000000-0000-0000-0000-000000000000).
  32584. func (c *AddressesSetLabelsCall) RequestId(requestId string) *AddressesSetLabelsCall {
  32585. c.urlParams_.Set("requestId", requestId)
  32586. return c
  32587. }
  32588. // Fields allows partial responses to be retrieved. See
  32589. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32590. // for more information.
  32591. func (c *AddressesSetLabelsCall) Fields(s ...googleapi.Field) *AddressesSetLabelsCall {
  32592. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32593. return c
  32594. }
  32595. // Context sets the context to be used in this call's Do method. Any
  32596. // pending HTTP request will be aborted if the provided context is
  32597. // canceled.
  32598. func (c *AddressesSetLabelsCall) Context(ctx context.Context) *AddressesSetLabelsCall {
  32599. c.ctx_ = ctx
  32600. return c
  32601. }
  32602. // Header returns an http.Header that can be modified by the caller to
  32603. // add HTTP headers to the request.
  32604. func (c *AddressesSetLabelsCall) Header() http.Header {
  32605. if c.header_ == nil {
  32606. c.header_ = make(http.Header)
  32607. }
  32608. return c.header_
  32609. }
  32610. func (c *AddressesSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  32611. reqHeaders := make(http.Header)
  32612. for k, v := range c.header_ {
  32613. reqHeaders[k] = v
  32614. }
  32615. reqHeaders.Set("User-Agent", c.s.userAgent())
  32616. var body io.Reader = nil
  32617. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest)
  32618. if err != nil {
  32619. return nil, err
  32620. }
  32621. reqHeaders.Set("Content-Type", "application/json")
  32622. c.urlParams_.Set("alt", alt)
  32623. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses/{resource}/setLabels")
  32624. urls += "?" + c.urlParams_.Encode()
  32625. req, _ := http.NewRequest("POST", urls, body)
  32626. req.Header = reqHeaders
  32627. googleapi.Expand(req.URL, map[string]string{
  32628. "project": c.project,
  32629. "region": c.region,
  32630. "resource": c.resource,
  32631. })
  32632. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32633. }
  32634. // Do executes the "compute.addresses.setLabels" call.
  32635. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  32636. // status code is an error. Response headers are in either
  32637. // *Operation.ServerResponse.Header or (if a response was returned at
  32638. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  32639. // to check whether the returned error was because
  32640. // http.StatusNotModified was returned.
  32641. func (c *AddressesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  32642. gensupport.SetOptions(c.urlParams_, opts...)
  32643. res, err := c.doRequest("json")
  32644. if res != nil && res.StatusCode == http.StatusNotModified {
  32645. if res.Body != nil {
  32646. res.Body.Close()
  32647. }
  32648. return nil, &googleapi.Error{
  32649. Code: res.StatusCode,
  32650. Header: res.Header,
  32651. }
  32652. }
  32653. if err != nil {
  32654. return nil, err
  32655. }
  32656. defer googleapi.CloseBody(res)
  32657. if err := googleapi.CheckResponse(res); err != nil {
  32658. return nil, err
  32659. }
  32660. ret := &Operation{
  32661. ServerResponse: googleapi.ServerResponse{
  32662. Header: res.Header,
  32663. HTTPStatusCode: res.StatusCode,
  32664. },
  32665. }
  32666. target := &ret
  32667. if err := gensupport.DecodeResponse(target, res); err != nil {
  32668. return nil, err
  32669. }
  32670. return ret, nil
  32671. // {
  32672. // "description": "Sets the labels on an Address. To learn more about labels, read the Labeling Resources documentation.",
  32673. // "httpMethod": "POST",
  32674. // "id": "compute.addresses.setLabels",
  32675. // "parameterOrder": [
  32676. // "project",
  32677. // "region",
  32678. // "resource"
  32679. // ],
  32680. // "parameters": {
  32681. // "project": {
  32682. // "description": "Project ID for this request.",
  32683. // "location": "path",
  32684. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  32685. // "required": true,
  32686. // "type": "string"
  32687. // },
  32688. // "region": {
  32689. // "description": "The region for this request.",
  32690. // "location": "path",
  32691. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  32692. // "required": true,
  32693. // "type": "string"
  32694. // },
  32695. // "requestId": {
  32696. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  32697. // "location": "query",
  32698. // "type": "string"
  32699. // },
  32700. // "resource": {
  32701. // "description": "Name of the resource for this request.",
  32702. // "location": "path",
  32703. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  32704. // "required": true,
  32705. // "type": "string"
  32706. // }
  32707. // },
  32708. // "path": "{project}/regions/{region}/addresses/{resource}/setLabels",
  32709. // "request": {
  32710. // "$ref": "RegionSetLabelsRequest"
  32711. // },
  32712. // "response": {
  32713. // "$ref": "Operation"
  32714. // },
  32715. // "scopes": [
  32716. // "https://www.googleapis.com/auth/cloud-platform",
  32717. // "https://www.googleapis.com/auth/compute"
  32718. // ]
  32719. // }
  32720. }
  32721. // method id "compute.addresses.testIamPermissions":
  32722. type AddressesTestIamPermissionsCall struct {
  32723. s *Service
  32724. project string
  32725. region string
  32726. resource string
  32727. testpermissionsrequest *TestPermissionsRequest
  32728. urlParams_ gensupport.URLParams
  32729. ctx_ context.Context
  32730. header_ http.Header
  32731. }
  32732. // TestIamPermissions: Returns permissions that a caller has on the
  32733. // specified resource.
  32734. func (r *AddressesService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *AddressesTestIamPermissionsCall {
  32735. c := &AddressesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32736. c.project = project
  32737. c.region = region
  32738. c.resource = resource
  32739. c.testpermissionsrequest = testpermissionsrequest
  32740. return c
  32741. }
  32742. // Fields allows partial responses to be retrieved. See
  32743. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32744. // for more information.
  32745. func (c *AddressesTestIamPermissionsCall) Fields(s ...googleapi.Field) *AddressesTestIamPermissionsCall {
  32746. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32747. return c
  32748. }
  32749. // Context sets the context to be used in this call's Do method. Any
  32750. // pending HTTP request will be aborted if the provided context is
  32751. // canceled.
  32752. func (c *AddressesTestIamPermissionsCall) Context(ctx context.Context) *AddressesTestIamPermissionsCall {
  32753. c.ctx_ = ctx
  32754. return c
  32755. }
  32756. // Header returns an http.Header that can be modified by the caller to
  32757. // add HTTP headers to the request.
  32758. func (c *AddressesTestIamPermissionsCall) Header() http.Header {
  32759. if c.header_ == nil {
  32760. c.header_ = make(http.Header)
  32761. }
  32762. return c.header_
  32763. }
  32764. func (c *AddressesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  32765. reqHeaders := make(http.Header)
  32766. for k, v := range c.header_ {
  32767. reqHeaders[k] = v
  32768. }
  32769. reqHeaders.Set("User-Agent", c.s.userAgent())
  32770. var body io.Reader = nil
  32771. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  32772. if err != nil {
  32773. return nil, err
  32774. }
  32775. reqHeaders.Set("Content-Type", "application/json")
  32776. c.urlParams_.Set("alt", alt)
  32777. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses/{resource}/testIamPermissions")
  32778. urls += "?" + c.urlParams_.Encode()
  32779. req, _ := http.NewRequest("POST", urls, body)
  32780. req.Header = reqHeaders
  32781. googleapi.Expand(req.URL, map[string]string{
  32782. "project": c.project,
  32783. "region": c.region,
  32784. "resource": c.resource,
  32785. })
  32786. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32787. }
  32788. // Do executes the "compute.addresses.testIamPermissions" call.
  32789. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  32790. // non-2xx status code is an error. Response headers are in either
  32791. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  32792. // returned at all) in error.(*googleapi.Error).Header. Use
  32793. // googleapi.IsNotModified to check whether the returned error was
  32794. // because http.StatusNotModified was returned.
  32795. func (c *AddressesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  32796. gensupport.SetOptions(c.urlParams_, opts...)
  32797. res, err := c.doRequest("json")
  32798. if res != nil && res.StatusCode == http.StatusNotModified {
  32799. if res.Body != nil {
  32800. res.Body.Close()
  32801. }
  32802. return nil, &googleapi.Error{
  32803. Code: res.StatusCode,
  32804. Header: res.Header,
  32805. }
  32806. }
  32807. if err != nil {
  32808. return nil, err
  32809. }
  32810. defer googleapi.CloseBody(res)
  32811. if err := googleapi.CheckResponse(res); err != nil {
  32812. return nil, err
  32813. }
  32814. ret := &TestPermissionsResponse{
  32815. ServerResponse: googleapi.ServerResponse{
  32816. Header: res.Header,
  32817. HTTPStatusCode: res.StatusCode,
  32818. },
  32819. }
  32820. target := &ret
  32821. if err := gensupport.DecodeResponse(target, res); err != nil {
  32822. return nil, err
  32823. }
  32824. return ret, nil
  32825. // {
  32826. // "description": "Returns permissions that a caller has on the specified resource.",
  32827. // "httpMethod": "POST",
  32828. // "id": "compute.addresses.testIamPermissions",
  32829. // "parameterOrder": [
  32830. // "project",
  32831. // "region",
  32832. // "resource"
  32833. // ],
  32834. // "parameters": {
  32835. // "project": {
  32836. // "description": "Project ID for this request.",
  32837. // "location": "path",
  32838. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  32839. // "required": true,
  32840. // "type": "string"
  32841. // },
  32842. // "region": {
  32843. // "description": "The name of the region for this request.",
  32844. // "location": "path",
  32845. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  32846. // "required": true,
  32847. // "type": "string"
  32848. // },
  32849. // "resource": {
  32850. // "description": "Name of the resource for this request.",
  32851. // "location": "path",
  32852. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  32853. // "required": true,
  32854. // "type": "string"
  32855. // }
  32856. // },
  32857. // "path": "{project}/regions/{region}/addresses/{resource}/testIamPermissions",
  32858. // "request": {
  32859. // "$ref": "TestPermissionsRequest"
  32860. // },
  32861. // "response": {
  32862. // "$ref": "TestPermissionsResponse"
  32863. // },
  32864. // "scopes": [
  32865. // "https://www.googleapis.com/auth/cloud-platform",
  32866. // "https://www.googleapis.com/auth/compute",
  32867. // "https://www.googleapis.com/auth/compute.readonly"
  32868. // ]
  32869. // }
  32870. }
  32871. // method id "compute.autoscalers.aggregatedList":
  32872. type AutoscalersAggregatedListCall struct {
  32873. s *Service
  32874. project string
  32875. urlParams_ gensupport.URLParams
  32876. ifNoneMatch_ string
  32877. ctx_ context.Context
  32878. header_ http.Header
  32879. }
  32880. // AggregatedList: Retrieves an aggregated list of autoscalers.
  32881. func (r *AutoscalersService) AggregatedList(project string) *AutoscalersAggregatedListCall {
  32882. c := &AutoscalersAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32883. c.project = project
  32884. return c
  32885. }
  32886. // Filter sets the optional parameter "filter": A filter expression that
  32887. // filters resources listed in the response. The expression must specify
  32888. // the field name, a comparison operator, and the value that you want to
  32889. // use for filtering. The value must be a string, a number, or a
  32890. // boolean. The comparison operator must be either =, !=, >, or <.
  32891. //
  32892. // For example, if you are filtering Compute Engine instances, you can
  32893. // exclude instances named example-instance by specifying name !=
  32894. // example-instance.
  32895. //
  32896. // You can also filter nested fields. For example, you could specify
  32897. // scheduling.automaticRestart = false to include instances only if they
  32898. // are not scheduled for automatic restarts. You can use filtering on
  32899. // nested fields to filter based on resource labels.
  32900. //
  32901. // To filter on multiple expressions, provide each separate expression
  32902. // within parentheses. For example, (scheduling.automaticRestart = true)
  32903. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  32904. // AND expression. However, you can include AND and OR expressions
  32905. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  32906. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  32907. // true).
  32908. func (c *AutoscalersAggregatedListCall) Filter(filter string) *AutoscalersAggregatedListCall {
  32909. c.urlParams_.Set("filter", filter)
  32910. return c
  32911. }
  32912. // MaxResults sets the optional parameter "maxResults": The maximum
  32913. // number of results per page that should be returned. If the number of
  32914. // available results is larger than maxResults, Compute Engine returns a
  32915. // nextPageToken that can be used to get the next page of results in
  32916. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  32917. // (Default: 500)
  32918. func (c *AutoscalersAggregatedListCall) MaxResults(maxResults int64) *AutoscalersAggregatedListCall {
  32919. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  32920. return c
  32921. }
  32922. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  32923. // a certain order. By default, results are returned in alphanumerical
  32924. // order based on the resource name.
  32925. //
  32926. // You can also sort results in descending order based on the creation
  32927. // timestamp using orderBy="creationTimestamp desc". This sorts results
  32928. // based on the creationTimestamp field in reverse chronological order
  32929. // (newest result first). Use this to sort resources like operations so
  32930. // that the newest operation is returned first.
  32931. //
  32932. // Currently, only sorting by name or creationTimestamp desc is
  32933. // supported.
  32934. func (c *AutoscalersAggregatedListCall) OrderBy(orderBy string) *AutoscalersAggregatedListCall {
  32935. c.urlParams_.Set("orderBy", orderBy)
  32936. return c
  32937. }
  32938. // PageToken sets the optional parameter "pageToken": Specifies a page
  32939. // token to use. Set pageToken to the nextPageToken returned by a
  32940. // previous list request to get the next page of results.
  32941. func (c *AutoscalersAggregatedListCall) PageToken(pageToken string) *AutoscalersAggregatedListCall {
  32942. c.urlParams_.Set("pageToken", pageToken)
  32943. return c
  32944. }
  32945. // Fields allows partial responses to be retrieved. See
  32946. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32947. // for more information.
  32948. func (c *AutoscalersAggregatedListCall) Fields(s ...googleapi.Field) *AutoscalersAggregatedListCall {
  32949. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32950. return c
  32951. }
  32952. // IfNoneMatch sets the optional parameter which makes the operation
  32953. // fail if the object's ETag matches the given value. This is useful for
  32954. // getting updates only after the object has changed since the last
  32955. // request. Use googleapi.IsNotModified to check whether the response
  32956. // error from Do is the result of In-None-Match.
  32957. func (c *AutoscalersAggregatedListCall) IfNoneMatch(entityTag string) *AutoscalersAggregatedListCall {
  32958. c.ifNoneMatch_ = entityTag
  32959. return c
  32960. }
  32961. // Context sets the context to be used in this call's Do method. Any
  32962. // pending HTTP request will be aborted if the provided context is
  32963. // canceled.
  32964. func (c *AutoscalersAggregatedListCall) Context(ctx context.Context) *AutoscalersAggregatedListCall {
  32965. c.ctx_ = ctx
  32966. return c
  32967. }
  32968. // Header returns an http.Header that can be modified by the caller to
  32969. // add HTTP headers to the request.
  32970. func (c *AutoscalersAggregatedListCall) Header() http.Header {
  32971. if c.header_ == nil {
  32972. c.header_ = make(http.Header)
  32973. }
  32974. return c.header_
  32975. }
  32976. func (c *AutoscalersAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  32977. reqHeaders := make(http.Header)
  32978. for k, v := range c.header_ {
  32979. reqHeaders[k] = v
  32980. }
  32981. reqHeaders.Set("User-Agent", c.s.userAgent())
  32982. if c.ifNoneMatch_ != "" {
  32983. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  32984. }
  32985. var body io.Reader = nil
  32986. c.urlParams_.Set("alt", alt)
  32987. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/autoscalers")
  32988. urls += "?" + c.urlParams_.Encode()
  32989. req, _ := http.NewRequest("GET", urls, body)
  32990. req.Header = reqHeaders
  32991. googleapi.Expand(req.URL, map[string]string{
  32992. "project": c.project,
  32993. })
  32994. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32995. }
  32996. // Do executes the "compute.autoscalers.aggregatedList" call.
  32997. // Exactly one of *AutoscalerAggregatedList or error will be non-nil.
  32998. // Any non-2xx status code is an error. Response headers are in either
  32999. // *AutoscalerAggregatedList.ServerResponse.Header or (if a response was
  33000. // returned at all) in error.(*googleapi.Error).Header. Use
  33001. // googleapi.IsNotModified to check whether the returned error was
  33002. // because http.StatusNotModified was returned.
  33003. func (c *AutoscalersAggregatedListCall) Do(opts ...googleapi.CallOption) (*AutoscalerAggregatedList, error) {
  33004. gensupport.SetOptions(c.urlParams_, opts...)
  33005. res, err := c.doRequest("json")
  33006. if res != nil && res.StatusCode == http.StatusNotModified {
  33007. if res.Body != nil {
  33008. res.Body.Close()
  33009. }
  33010. return nil, &googleapi.Error{
  33011. Code: res.StatusCode,
  33012. Header: res.Header,
  33013. }
  33014. }
  33015. if err != nil {
  33016. return nil, err
  33017. }
  33018. defer googleapi.CloseBody(res)
  33019. if err := googleapi.CheckResponse(res); err != nil {
  33020. return nil, err
  33021. }
  33022. ret := &AutoscalerAggregatedList{
  33023. ServerResponse: googleapi.ServerResponse{
  33024. Header: res.Header,
  33025. HTTPStatusCode: res.StatusCode,
  33026. },
  33027. }
  33028. target := &ret
  33029. if err := gensupport.DecodeResponse(target, res); err != nil {
  33030. return nil, err
  33031. }
  33032. return ret, nil
  33033. // {
  33034. // "description": "Retrieves an aggregated list of autoscalers.",
  33035. // "httpMethod": "GET",
  33036. // "id": "compute.autoscalers.aggregatedList",
  33037. // "parameterOrder": [
  33038. // "project"
  33039. // ],
  33040. // "parameters": {
  33041. // "filter": {
  33042. // "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).",
  33043. // "location": "query",
  33044. // "type": "string"
  33045. // },
  33046. // "maxResults": {
  33047. // "default": "500",
  33048. // "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)",
  33049. // "format": "uint32",
  33050. // "location": "query",
  33051. // "minimum": "0",
  33052. // "type": "integer"
  33053. // },
  33054. // "orderBy": {
  33055. // "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.",
  33056. // "location": "query",
  33057. // "type": "string"
  33058. // },
  33059. // "pageToken": {
  33060. // "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.",
  33061. // "location": "query",
  33062. // "type": "string"
  33063. // },
  33064. // "project": {
  33065. // "description": "Project ID for this request.",
  33066. // "location": "path",
  33067. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  33068. // "required": true,
  33069. // "type": "string"
  33070. // }
  33071. // },
  33072. // "path": "{project}/aggregated/autoscalers",
  33073. // "response": {
  33074. // "$ref": "AutoscalerAggregatedList"
  33075. // },
  33076. // "scopes": [
  33077. // "https://www.googleapis.com/auth/cloud-platform",
  33078. // "https://www.googleapis.com/auth/compute",
  33079. // "https://www.googleapis.com/auth/compute.readonly"
  33080. // ]
  33081. // }
  33082. }
  33083. // Pages invokes f for each page of results.
  33084. // A non-nil error returned from f will halt the iteration.
  33085. // The provided context supersedes any context provided to the Context method.
  33086. func (c *AutoscalersAggregatedListCall) Pages(ctx context.Context, f func(*AutoscalerAggregatedList) error) error {
  33087. c.ctx_ = ctx
  33088. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  33089. for {
  33090. x, err := c.Do()
  33091. if err != nil {
  33092. return err
  33093. }
  33094. if err := f(x); err != nil {
  33095. return err
  33096. }
  33097. if x.NextPageToken == "" {
  33098. return nil
  33099. }
  33100. c.PageToken(x.NextPageToken)
  33101. }
  33102. }
  33103. // method id "compute.autoscalers.delete":
  33104. type AutoscalersDeleteCall struct {
  33105. s *Service
  33106. project string
  33107. zone string
  33108. autoscaler string
  33109. urlParams_ gensupport.URLParams
  33110. ctx_ context.Context
  33111. header_ http.Header
  33112. }
  33113. // Delete: Deletes the specified autoscaler.
  33114. func (r *AutoscalersService) Delete(project string, zone string, autoscaler string) *AutoscalersDeleteCall {
  33115. c := &AutoscalersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33116. c.project = project
  33117. c.zone = zone
  33118. c.autoscaler = autoscaler
  33119. return c
  33120. }
  33121. // RequestId sets the optional parameter "requestId": An optional
  33122. // request ID to identify requests. Specify a unique request ID so that
  33123. // if you must retry your request, the server will know to ignore the
  33124. // request if it has already been completed.
  33125. //
  33126. // For example, consider a situation where you make an initial request
  33127. // and the request times out. If you make the request again with the
  33128. // same request ID, the server can check if original operation with the
  33129. // same request ID was received, and if so, will ignore the second
  33130. // request. This prevents clients from accidentally creating duplicate
  33131. // commitments.
  33132. //
  33133. // The request ID must be a valid UUID with the exception that zero UUID
  33134. // is not supported (00000000-0000-0000-0000-000000000000).
  33135. func (c *AutoscalersDeleteCall) RequestId(requestId string) *AutoscalersDeleteCall {
  33136. c.urlParams_.Set("requestId", requestId)
  33137. return c
  33138. }
  33139. // Fields allows partial responses to be retrieved. See
  33140. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33141. // for more information.
  33142. func (c *AutoscalersDeleteCall) Fields(s ...googleapi.Field) *AutoscalersDeleteCall {
  33143. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33144. return c
  33145. }
  33146. // Context sets the context to be used in this call's Do method. Any
  33147. // pending HTTP request will be aborted if the provided context is
  33148. // canceled.
  33149. func (c *AutoscalersDeleteCall) Context(ctx context.Context) *AutoscalersDeleteCall {
  33150. c.ctx_ = ctx
  33151. return c
  33152. }
  33153. // Header returns an http.Header that can be modified by the caller to
  33154. // add HTTP headers to the request.
  33155. func (c *AutoscalersDeleteCall) Header() http.Header {
  33156. if c.header_ == nil {
  33157. c.header_ = make(http.Header)
  33158. }
  33159. return c.header_
  33160. }
  33161. func (c *AutoscalersDeleteCall) doRequest(alt string) (*http.Response, error) {
  33162. reqHeaders := make(http.Header)
  33163. for k, v := range c.header_ {
  33164. reqHeaders[k] = v
  33165. }
  33166. reqHeaders.Set("User-Agent", c.s.userAgent())
  33167. var body io.Reader = nil
  33168. c.urlParams_.Set("alt", alt)
  33169. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers/{autoscaler}")
  33170. urls += "?" + c.urlParams_.Encode()
  33171. req, _ := http.NewRequest("DELETE", urls, body)
  33172. req.Header = reqHeaders
  33173. googleapi.Expand(req.URL, map[string]string{
  33174. "project": c.project,
  33175. "zone": c.zone,
  33176. "autoscaler": c.autoscaler,
  33177. })
  33178. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33179. }
  33180. // Do executes the "compute.autoscalers.delete" call.
  33181. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  33182. // status code is an error. Response headers are in either
  33183. // *Operation.ServerResponse.Header or (if a response was returned at
  33184. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  33185. // to check whether the returned error was because
  33186. // http.StatusNotModified was returned.
  33187. func (c *AutoscalersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  33188. gensupport.SetOptions(c.urlParams_, opts...)
  33189. res, err := c.doRequest("json")
  33190. if res != nil && res.StatusCode == http.StatusNotModified {
  33191. if res.Body != nil {
  33192. res.Body.Close()
  33193. }
  33194. return nil, &googleapi.Error{
  33195. Code: res.StatusCode,
  33196. Header: res.Header,
  33197. }
  33198. }
  33199. if err != nil {
  33200. return nil, err
  33201. }
  33202. defer googleapi.CloseBody(res)
  33203. if err := googleapi.CheckResponse(res); err != nil {
  33204. return nil, err
  33205. }
  33206. ret := &Operation{
  33207. ServerResponse: googleapi.ServerResponse{
  33208. Header: res.Header,
  33209. HTTPStatusCode: res.StatusCode,
  33210. },
  33211. }
  33212. target := &ret
  33213. if err := gensupport.DecodeResponse(target, res); err != nil {
  33214. return nil, err
  33215. }
  33216. return ret, nil
  33217. // {
  33218. // "description": "Deletes the specified autoscaler.",
  33219. // "httpMethod": "DELETE",
  33220. // "id": "compute.autoscalers.delete",
  33221. // "parameterOrder": [
  33222. // "project",
  33223. // "zone",
  33224. // "autoscaler"
  33225. // ],
  33226. // "parameters": {
  33227. // "autoscaler": {
  33228. // "description": "Name of the autoscaler to delete.",
  33229. // "location": "path",
  33230. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33231. // "required": true,
  33232. // "type": "string"
  33233. // },
  33234. // "project": {
  33235. // "description": "Project ID for this request.",
  33236. // "location": "path",
  33237. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  33238. // "required": true,
  33239. // "type": "string"
  33240. // },
  33241. // "requestId": {
  33242. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  33243. // "location": "query",
  33244. // "type": "string"
  33245. // },
  33246. // "zone": {
  33247. // "description": "Name of the zone for this request.",
  33248. // "location": "path",
  33249. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33250. // "required": true,
  33251. // "type": "string"
  33252. // }
  33253. // },
  33254. // "path": "{project}/zones/{zone}/autoscalers/{autoscaler}",
  33255. // "response": {
  33256. // "$ref": "Operation"
  33257. // },
  33258. // "scopes": [
  33259. // "https://www.googleapis.com/auth/cloud-platform",
  33260. // "https://www.googleapis.com/auth/compute"
  33261. // ]
  33262. // }
  33263. }
  33264. // method id "compute.autoscalers.get":
  33265. type AutoscalersGetCall struct {
  33266. s *Service
  33267. project string
  33268. zone string
  33269. autoscaler string
  33270. urlParams_ gensupport.URLParams
  33271. ifNoneMatch_ string
  33272. ctx_ context.Context
  33273. header_ http.Header
  33274. }
  33275. // Get: Returns the specified autoscaler resource. Gets a list of
  33276. // available autoscalers by making a list() request.
  33277. func (r *AutoscalersService) Get(project string, zone string, autoscaler string) *AutoscalersGetCall {
  33278. c := &AutoscalersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33279. c.project = project
  33280. c.zone = zone
  33281. c.autoscaler = autoscaler
  33282. return c
  33283. }
  33284. // Fields allows partial responses to be retrieved. See
  33285. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33286. // for more information.
  33287. func (c *AutoscalersGetCall) Fields(s ...googleapi.Field) *AutoscalersGetCall {
  33288. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33289. return c
  33290. }
  33291. // IfNoneMatch sets the optional parameter which makes the operation
  33292. // fail if the object's ETag matches the given value. This is useful for
  33293. // getting updates only after the object has changed since the last
  33294. // request. Use googleapi.IsNotModified to check whether the response
  33295. // error from Do is the result of In-None-Match.
  33296. func (c *AutoscalersGetCall) IfNoneMatch(entityTag string) *AutoscalersGetCall {
  33297. c.ifNoneMatch_ = entityTag
  33298. return c
  33299. }
  33300. // Context sets the context to be used in this call's Do method. Any
  33301. // pending HTTP request will be aborted if the provided context is
  33302. // canceled.
  33303. func (c *AutoscalersGetCall) Context(ctx context.Context) *AutoscalersGetCall {
  33304. c.ctx_ = ctx
  33305. return c
  33306. }
  33307. // Header returns an http.Header that can be modified by the caller to
  33308. // add HTTP headers to the request.
  33309. func (c *AutoscalersGetCall) Header() http.Header {
  33310. if c.header_ == nil {
  33311. c.header_ = make(http.Header)
  33312. }
  33313. return c.header_
  33314. }
  33315. func (c *AutoscalersGetCall) doRequest(alt string) (*http.Response, error) {
  33316. reqHeaders := make(http.Header)
  33317. for k, v := range c.header_ {
  33318. reqHeaders[k] = v
  33319. }
  33320. reqHeaders.Set("User-Agent", c.s.userAgent())
  33321. if c.ifNoneMatch_ != "" {
  33322. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  33323. }
  33324. var body io.Reader = nil
  33325. c.urlParams_.Set("alt", alt)
  33326. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers/{autoscaler}")
  33327. urls += "?" + c.urlParams_.Encode()
  33328. req, _ := http.NewRequest("GET", urls, body)
  33329. req.Header = reqHeaders
  33330. googleapi.Expand(req.URL, map[string]string{
  33331. "project": c.project,
  33332. "zone": c.zone,
  33333. "autoscaler": c.autoscaler,
  33334. })
  33335. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33336. }
  33337. // Do executes the "compute.autoscalers.get" call.
  33338. // Exactly one of *Autoscaler or error will be non-nil. Any non-2xx
  33339. // status code is an error. Response headers are in either
  33340. // *Autoscaler.ServerResponse.Header or (if a response was returned at
  33341. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  33342. // to check whether the returned error was because
  33343. // http.StatusNotModified was returned.
  33344. func (c *AutoscalersGetCall) Do(opts ...googleapi.CallOption) (*Autoscaler, error) {
  33345. gensupport.SetOptions(c.urlParams_, opts...)
  33346. res, err := c.doRequest("json")
  33347. if res != nil && res.StatusCode == http.StatusNotModified {
  33348. if res.Body != nil {
  33349. res.Body.Close()
  33350. }
  33351. return nil, &googleapi.Error{
  33352. Code: res.StatusCode,
  33353. Header: res.Header,
  33354. }
  33355. }
  33356. if err != nil {
  33357. return nil, err
  33358. }
  33359. defer googleapi.CloseBody(res)
  33360. if err := googleapi.CheckResponse(res); err != nil {
  33361. return nil, err
  33362. }
  33363. ret := &Autoscaler{
  33364. ServerResponse: googleapi.ServerResponse{
  33365. Header: res.Header,
  33366. HTTPStatusCode: res.StatusCode,
  33367. },
  33368. }
  33369. target := &ret
  33370. if err := gensupport.DecodeResponse(target, res); err != nil {
  33371. return nil, err
  33372. }
  33373. return ret, nil
  33374. // {
  33375. // "description": "Returns the specified autoscaler resource. Gets a list of available autoscalers by making a list() request.",
  33376. // "httpMethod": "GET",
  33377. // "id": "compute.autoscalers.get",
  33378. // "parameterOrder": [
  33379. // "project",
  33380. // "zone",
  33381. // "autoscaler"
  33382. // ],
  33383. // "parameters": {
  33384. // "autoscaler": {
  33385. // "description": "Name of the autoscaler to return.",
  33386. // "location": "path",
  33387. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33388. // "required": true,
  33389. // "type": "string"
  33390. // },
  33391. // "project": {
  33392. // "description": "Project ID for this request.",
  33393. // "location": "path",
  33394. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  33395. // "required": true,
  33396. // "type": "string"
  33397. // },
  33398. // "zone": {
  33399. // "description": "Name of the zone for this request.",
  33400. // "location": "path",
  33401. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33402. // "required": true,
  33403. // "type": "string"
  33404. // }
  33405. // },
  33406. // "path": "{project}/zones/{zone}/autoscalers/{autoscaler}",
  33407. // "response": {
  33408. // "$ref": "Autoscaler"
  33409. // },
  33410. // "scopes": [
  33411. // "https://www.googleapis.com/auth/cloud-platform",
  33412. // "https://www.googleapis.com/auth/compute",
  33413. // "https://www.googleapis.com/auth/compute.readonly"
  33414. // ]
  33415. // }
  33416. }
  33417. // method id "compute.autoscalers.insert":
  33418. type AutoscalersInsertCall struct {
  33419. s *Service
  33420. project string
  33421. zone string
  33422. autoscaler *Autoscaler
  33423. urlParams_ gensupport.URLParams
  33424. ctx_ context.Context
  33425. header_ http.Header
  33426. }
  33427. // Insert: Creates an autoscaler in the specified project using the data
  33428. // included in the request.
  33429. func (r *AutoscalersService) Insert(project string, zone string, autoscaler *Autoscaler) *AutoscalersInsertCall {
  33430. c := &AutoscalersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33431. c.project = project
  33432. c.zone = zone
  33433. c.autoscaler = autoscaler
  33434. return c
  33435. }
  33436. // RequestId sets the optional parameter "requestId": An optional
  33437. // request ID to identify requests. Specify a unique request ID so that
  33438. // if you must retry your request, the server will know to ignore the
  33439. // request if it has already been completed.
  33440. //
  33441. // For example, consider a situation where you make an initial request
  33442. // and the request times out. If you make the request again with the
  33443. // same request ID, the server can check if original operation with the
  33444. // same request ID was received, and if so, will ignore the second
  33445. // request. This prevents clients from accidentally creating duplicate
  33446. // commitments.
  33447. //
  33448. // The request ID must be a valid UUID with the exception that zero UUID
  33449. // is not supported (00000000-0000-0000-0000-000000000000).
  33450. func (c *AutoscalersInsertCall) RequestId(requestId string) *AutoscalersInsertCall {
  33451. c.urlParams_.Set("requestId", requestId)
  33452. return c
  33453. }
  33454. // Fields allows partial responses to be retrieved. See
  33455. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33456. // for more information.
  33457. func (c *AutoscalersInsertCall) Fields(s ...googleapi.Field) *AutoscalersInsertCall {
  33458. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33459. return c
  33460. }
  33461. // Context sets the context to be used in this call's Do method. Any
  33462. // pending HTTP request will be aborted if the provided context is
  33463. // canceled.
  33464. func (c *AutoscalersInsertCall) Context(ctx context.Context) *AutoscalersInsertCall {
  33465. c.ctx_ = ctx
  33466. return c
  33467. }
  33468. // Header returns an http.Header that can be modified by the caller to
  33469. // add HTTP headers to the request.
  33470. func (c *AutoscalersInsertCall) Header() http.Header {
  33471. if c.header_ == nil {
  33472. c.header_ = make(http.Header)
  33473. }
  33474. return c.header_
  33475. }
  33476. func (c *AutoscalersInsertCall) doRequest(alt string) (*http.Response, error) {
  33477. reqHeaders := make(http.Header)
  33478. for k, v := range c.header_ {
  33479. reqHeaders[k] = v
  33480. }
  33481. reqHeaders.Set("User-Agent", c.s.userAgent())
  33482. var body io.Reader = nil
  33483. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  33484. if err != nil {
  33485. return nil, err
  33486. }
  33487. reqHeaders.Set("Content-Type", "application/json")
  33488. c.urlParams_.Set("alt", alt)
  33489. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers")
  33490. urls += "?" + c.urlParams_.Encode()
  33491. req, _ := http.NewRequest("POST", urls, body)
  33492. req.Header = reqHeaders
  33493. googleapi.Expand(req.URL, map[string]string{
  33494. "project": c.project,
  33495. "zone": c.zone,
  33496. })
  33497. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33498. }
  33499. // Do executes the "compute.autoscalers.insert" call.
  33500. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  33501. // status code is an error. Response headers are in either
  33502. // *Operation.ServerResponse.Header or (if a response was returned at
  33503. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  33504. // to check whether the returned error was because
  33505. // http.StatusNotModified was returned.
  33506. func (c *AutoscalersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  33507. gensupport.SetOptions(c.urlParams_, opts...)
  33508. res, err := c.doRequest("json")
  33509. if res != nil && res.StatusCode == http.StatusNotModified {
  33510. if res.Body != nil {
  33511. res.Body.Close()
  33512. }
  33513. return nil, &googleapi.Error{
  33514. Code: res.StatusCode,
  33515. Header: res.Header,
  33516. }
  33517. }
  33518. if err != nil {
  33519. return nil, err
  33520. }
  33521. defer googleapi.CloseBody(res)
  33522. if err := googleapi.CheckResponse(res); err != nil {
  33523. return nil, err
  33524. }
  33525. ret := &Operation{
  33526. ServerResponse: googleapi.ServerResponse{
  33527. Header: res.Header,
  33528. HTTPStatusCode: res.StatusCode,
  33529. },
  33530. }
  33531. target := &ret
  33532. if err := gensupport.DecodeResponse(target, res); err != nil {
  33533. return nil, err
  33534. }
  33535. return ret, nil
  33536. // {
  33537. // "description": "Creates an autoscaler in the specified project using the data included in the request.",
  33538. // "httpMethod": "POST",
  33539. // "id": "compute.autoscalers.insert",
  33540. // "parameterOrder": [
  33541. // "project",
  33542. // "zone"
  33543. // ],
  33544. // "parameters": {
  33545. // "project": {
  33546. // "description": "Project ID for this request.",
  33547. // "location": "path",
  33548. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  33549. // "required": true,
  33550. // "type": "string"
  33551. // },
  33552. // "requestId": {
  33553. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  33554. // "location": "query",
  33555. // "type": "string"
  33556. // },
  33557. // "zone": {
  33558. // "description": "Name of the zone for this request.",
  33559. // "location": "path",
  33560. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33561. // "required": true,
  33562. // "type": "string"
  33563. // }
  33564. // },
  33565. // "path": "{project}/zones/{zone}/autoscalers",
  33566. // "request": {
  33567. // "$ref": "Autoscaler"
  33568. // },
  33569. // "response": {
  33570. // "$ref": "Operation"
  33571. // },
  33572. // "scopes": [
  33573. // "https://www.googleapis.com/auth/cloud-platform",
  33574. // "https://www.googleapis.com/auth/compute"
  33575. // ]
  33576. // }
  33577. }
  33578. // method id "compute.autoscalers.list":
  33579. type AutoscalersListCall struct {
  33580. s *Service
  33581. project string
  33582. zone string
  33583. urlParams_ gensupport.URLParams
  33584. ifNoneMatch_ string
  33585. ctx_ context.Context
  33586. header_ http.Header
  33587. }
  33588. // List: Retrieves a list of autoscalers contained within the specified
  33589. // zone.
  33590. func (r *AutoscalersService) List(project string, zone string) *AutoscalersListCall {
  33591. c := &AutoscalersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33592. c.project = project
  33593. c.zone = zone
  33594. return c
  33595. }
  33596. // Filter sets the optional parameter "filter": A filter expression that
  33597. // filters resources listed in the response. The expression must specify
  33598. // the field name, a comparison operator, and the value that you want to
  33599. // use for filtering. The value must be a string, a number, or a
  33600. // boolean. The comparison operator must be either =, !=, >, or <.
  33601. //
  33602. // For example, if you are filtering Compute Engine instances, you can
  33603. // exclude instances named example-instance by specifying name !=
  33604. // example-instance.
  33605. //
  33606. // You can also filter nested fields. For example, you could specify
  33607. // scheduling.automaticRestart = false to include instances only if they
  33608. // are not scheduled for automatic restarts. You can use filtering on
  33609. // nested fields to filter based on resource labels.
  33610. //
  33611. // To filter on multiple expressions, provide each separate expression
  33612. // within parentheses. For example, (scheduling.automaticRestart = true)
  33613. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  33614. // AND expression. However, you can include AND and OR expressions
  33615. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  33616. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  33617. // true).
  33618. func (c *AutoscalersListCall) Filter(filter string) *AutoscalersListCall {
  33619. c.urlParams_.Set("filter", filter)
  33620. return c
  33621. }
  33622. // MaxResults sets the optional parameter "maxResults": The maximum
  33623. // number of results per page that should be returned. If the number of
  33624. // available results is larger than maxResults, Compute Engine returns a
  33625. // nextPageToken that can be used to get the next page of results in
  33626. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  33627. // (Default: 500)
  33628. func (c *AutoscalersListCall) MaxResults(maxResults int64) *AutoscalersListCall {
  33629. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  33630. return c
  33631. }
  33632. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  33633. // a certain order. By default, results are returned in alphanumerical
  33634. // order based on the resource name.
  33635. //
  33636. // You can also sort results in descending order based on the creation
  33637. // timestamp using orderBy="creationTimestamp desc". This sorts results
  33638. // based on the creationTimestamp field in reverse chronological order
  33639. // (newest result first). Use this to sort resources like operations so
  33640. // that the newest operation is returned first.
  33641. //
  33642. // Currently, only sorting by name or creationTimestamp desc is
  33643. // supported.
  33644. func (c *AutoscalersListCall) OrderBy(orderBy string) *AutoscalersListCall {
  33645. c.urlParams_.Set("orderBy", orderBy)
  33646. return c
  33647. }
  33648. // PageToken sets the optional parameter "pageToken": Specifies a page
  33649. // token to use. Set pageToken to the nextPageToken returned by a
  33650. // previous list request to get the next page of results.
  33651. func (c *AutoscalersListCall) PageToken(pageToken string) *AutoscalersListCall {
  33652. c.urlParams_.Set("pageToken", pageToken)
  33653. return c
  33654. }
  33655. // Fields allows partial responses to be retrieved. See
  33656. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33657. // for more information.
  33658. func (c *AutoscalersListCall) Fields(s ...googleapi.Field) *AutoscalersListCall {
  33659. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33660. return c
  33661. }
  33662. // IfNoneMatch sets the optional parameter which makes the operation
  33663. // fail if the object's ETag matches the given value. This is useful for
  33664. // getting updates only after the object has changed since the last
  33665. // request. Use googleapi.IsNotModified to check whether the response
  33666. // error from Do is the result of In-None-Match.
  33667. func (c *AutoscalersListCall) IfNoneMatch(entityTag string) *AutoscalersListCall {
  33668. c.ifNoneMatch_ = entityTag
  33669. return c
  33670. }
  33671. // Context sets the context to be used in this call's Do method. Any
  33672. // pending HTTP request will be aborted if the provided context is
  33673. // canceled.
  33674. func (c *AutoscalersListCall) Context(ctx context.Context) *AutoscalersListCall {
  33675. c.ctx_ = ctx
  33676. return c
  33677. }
  33678. // Header returns an http.Header that can be modified by the caller to
  33679. // add HTTP headers to the request.
  33680. func (c *AutoscalersListCall) Header() http.Header {
  33681. if c.header_ == nil {
  33682. c.header_ = make(http.Header)
  33683. }
  33684. return c.header_
  33685. }
  33686. func (c *AutoscalersListCall) doRequest(alt string) (*http.Response, error) {
  33687. reqHeaders := make(http.Header)
  33688. for k, v := range c.header_ {
  33689. reqHeaders[k] = v
  33690. }
  33691. reqHeaders.Set("User-Agent", c.s.userAgent())
  33692. if c.ifNoneMatch_ != "" {
  33693. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  33694. }
  33695. var body io.Reader = nil
  33696. c.urlParams_.Set("alt", alt)
  33697. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers")
  33698. urls += "?" + c.urlParams_.Encode()
  33699. req, _ := http.NewRequest("GET", urls, body)
  33700. req.Header = reqHeaders
  33701. googleapi.Expand(req.URL, map[string]string{
  33702. "project": c.project,
  33703. "zone": c.zone,
  33704. })
  33705. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33706. }
  33707. // Do executes the "compute.autoscalers.list" call.
  33708. // Exactly one of *AutoscalerList or error will be non-nil. Any non-2xx
  33709. // status code is an error. Response headers are in either
  33710. // *AutoscalerList.ServerResponse.Header or (if a response was returned
  33711. // at all) in error.(*googleapi.Error).Header. Use
  33712. // googleapi.IsNotModified to check whether the returned error was
  33713. // because http.StatusNotModified was returned.
  33714. func (c *AutoscalersListCall) Do(opts ...googleapi.CallOption) (*AutoscalerList, error) {
  33715. gensupport.SetOptions(c.urlParams_, opts...)
  33716. res, err := c.doRequest("json")
  33717. if res != nil && res.StatusCode == http.StatusNotModified {
  33718. if res.Body != nil {
  33719. res.Body.Close()
  33720. }
  33721. return nil, &googleapi.Error{
  33722. Code: res.StatusCode,
  33723. Header: res.Header,
  33724. }
  33725. }
  33726. if err != nil {
  33727. return nil, err
  33728. }
  33729. defer googleapi.CloseBody(res)
  33730. if err := googleapi.CheckResponse(res); err != nil {
  33731. return nil, err
  33732. }
  33733. ret := &AutoscalerList{
  33734. ServerResponse: googleapi.ServerResponse{
  33735. Header: res.Header,
  33736. HTTPStatusCode: res.StatusCode,
  33737. },
  33738. }
  33739. target := &ret
  33740. if err := gensupport.DecodeResponse(target, res); err != nil {
  33741. return nil, err
  33742. }
  33743. return ret, nil
  33744. // {
  33745. // "description": "Retrieves a list of autoscalers contained within the specified zone.",
  33746. // "httpMethod": "GET",
  33747. // "id": "compute.autoscalers.list",
  33748. // "parameterOrder": [
  33749. // "project",
  33750. // "zone"
  33751. // ],
  33752. // "parameters": {
  33753. // "filter": {
  33754. // "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).",
  33755. // "location": "query",
  33756. // "type": "string"
  33757. // },
  33758. // "maxResults": {
  33759. // "default": "500",
  33760. // "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)",
  33761. // "format": "uint32",
  33762. // "location": "query",
  33763. // "minimum": "0",
  33764. // "type": "integer"
  33765. // },
  33766. // "orderBy": {
  33767. // "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.",
  33768. // "location": "query",
  33769. // "type": "string"
  33770. // },
  33771. // "pageToken": {
  33772. // "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.",
  33773. // "location": "query",
  33774. // "type": "string"
  33775. // },
  33776. // "project": {
  33777. // "description": "Project ID for this request.",
  33778. // "location": "path",
  33779. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  33780. // "required": true,
  33781. // "type": "string"
  33782. // },
  33783. // "zone": {
  33784. // "description": "Name of the zone for this request.",
  33785. // "location": "path",
  33786. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33787. // "required": true,
  33788. // "type": "string"
  33789. // }
  33790. // },
  33791. // "path": "{project}/zones/{zone}/autoscalers",
  33792. // "response": {
  33793. // "$ref": "AutoscalerList"
  33794. // },
  33795. // "scopes": [
  33796. // "https://www.googleapis.com/auth/cloud-platform",
  33797. // "https://www.googleapis.com/auth/compute",
  33798. // "https://www.googleapis.com/auth/compute.readonly"
  33799. // ]
  33800. // }
  33801. }
  33802. // Pages invokes f for each page of results.
  33803. // A non-nil error returned from f will halt the iteration.
  33804. // The provided context supersedes any context provided to the Context method.
  33805. func (c *AutoscalersListCall) Pages(ctx context.Context, f func(*AutoscalerList) error) error {
  33806. c.ctx_ = ctx
  33807. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  33808. for {
  33809. x, err := c.Do()
  33810. if err != nil {
  33811. return err
  33812. }
  33813. if err := f(x); err != nil {
  33814. return err
  33815. }
  33816. if x.NextPageToken == "" {
  33817. return nil
  33818. }
  33819. c.PageToken(x.NextPageToken)
  33820. }
  33821. }
  33822. // method id "compute.autoscalers.patch":
  33823. type AutoscalersPatchCall struct {
  33824. s *Service
  33825. project string
  33826. zone string
  33827. autoscaler *Autoscaler
  33828. urlParams_ gensupport.URLParams
  33829. ctx_ context.Context
  33830. header_ http.Header
  33831. }
  33832. // Patch: Updates an autoscaler in the specified project using the data
  33833. // included in the request. This method supports PATCH semantics and
  33834. // uses the JSON merge patch format and processing rules.
  33835. func (r *AutoscalersService) Patch(project string, zone string, autoscaler *Autoscaler) *AutoscalersPatchCall {
  33836. c := &AutoscalersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33837. c.project = project
  33838. c.zone = zone
  33839. c.autoscaler = autoscaler
  33840. return c
  33841. }
  33842. // Autoscaler sets the optional parameter "autoscaler": Name of the
  33843. // autoscaler to patch.
  33844. func (c *AutoscalersPatchCall) Autoscaler(autoscaler string) *AutoscalersPatchCall {
  33845. c.urlParams_.Set("autoscaler", autoscaler)
  33846. return c
  33847. }
  33848. // RequestId sets the optional parameter "requestId": An optional
  33849. // request ID to identify requests. Specify a unique request ID so that
  33850. // if you must retry your request, the server will know to ignore the
  33851. // request if it has already been completed.
  33852. //
  33853. // For example, consider a situation where you make an initial request
  33854. // and the request times out. If you make the request again with the
  33855. // same request ID, the server can check if original operation with the
  33856. // same request ID was received, and if so, will ignore the second
  33857. // request. This prevents clients from accidentally creating duplicate
  33858. // commitments.
  33859. //
  33860. // The request ID must be a valid UUID with the exception that zero UUID
  33861. // is not supported (00000000-0000-0000-0000-000000000000).
  33862. func (c *AutoscalersPatchCall) RequestId(requestId string) *AutoscalersPatchCall {
  33863. c.urlParams_.Set("requestId", requestId)
  33864. return c
  33865. }
  33866. // Fields allows partial responses to be retrieved. See
  33867. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33868. // for more information.
  33869. func (c *AutoscalersPatchCall) Fields(s ...googleapi.Field) *AutoscalersPatchCall {
  33870. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33871. return c
  33872. }
  33873. // Context sets the context to be used in this call's Do method. Any
  33874. // pending HTTP request will be aborted if the provided context is
  33875. // canceled.
  33876. func (c *AutoscalersPatchCall) Context(ctx context.Context) *AutoscalersPatchCall {
  33877. c.ctx_ = ctx
  33878. return c
  33879. }
  33880. // Header returns an http.Header that can be modified by the caller to
  33881. // add HTTP headers to the request.
  33882. func (c *AutoscalersPatchCall) Header() http.Header {
  33883. if c.header_ == nil {
  33884. c.header_ = make(http.Header)
  33885. }
  33886. return c.header_
  33887. }
  33888. func (c *AutoscalersPatchCall) doRequest(alt string) (*http.Response, error) {
  33889. reqHeaders := make(http.Header)
  33890. for k, v := range c.header_ {
  33891. reqHeaders[k] = v
  33892. }
  33893. reqHeaders.Set("User-Agent", c.s.userAgent())
  33894. var body io.Reader = nil
  33895. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  33896. if err != nil {
  33897. return nil, err
  33898. }
  33899. reqHeaders.Set("Content-Type", "application/json")
  33900. c.urlParams_.Set("alt", alt)
  33901. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers")
  33902. urls += "?" + c.urlParams_.Encode()
  33903. req, _ := http.NewRequest("PATCH", urls, body)
  33904. req.Header = reqHeaders
  33905. googleapi.Expand(req.URL, map[string]string{
  33906. "project": c.project,
  33907. "zone": c.zone,
  33908. })
  33909. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33910. }
  33911. // Do executes the "compute.autoscalers.patch" call.
  33912. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  33913. // status code is an error. Response headers are in either
  33914. // *Operation.ServerResponse.Header or (if a response was returned at
  33915. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  33916. // to check whether the returned error was because
  33917. // http.StatusNotModified was returned.
  33918. func (c *AutoscalersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  33919. gensupport.SetOptions(c.urlParams_, opts...)
  33920. res, err := c.doRequest("json")
  33921. if res != nil && res.StatusCode == http.StatusNotModified {
  33922. if res.Body != nil {
  33923. res.Body.Close()
  33924. }
  33925. return nil, &googleapi.Error{
  33926. Code: res.StatusCode,
  33927. Header: res.Header,
  33928. }
  33929. }
  33930. if err != nil {
  33931. return nil, err
  33932. }
  33933. defer googleapi.CloseBody(res)
  33934. if err := googleapi.CheckResponse(res); err != nil {
  33935. return nil, err
  33936. }
  33937. ret := &Operation{
  33938. ServerResponse: googleapi.ServerResponse{
  33939. Header: res.Header,
  33940. HTTPStatusCode: res.StatusCode,
  33941. },
  33942. }
  33943. target := &ret
  33944. if err := gensupport.DecodeResponse(target, res); err != nil {
  33945. return nil, err
  33946. }
  33947. return ret, nil
  33948. // {
  33949. // "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.",
  33950. // "httpMethod": "PATCH",
  33951. // "id": "compute.autoscalers.patch",
  33952. // "parameterOrder": [
  33953. // "project",
  33954. // "zone"
  33955. // ],
  33956. // "parameters": {
  33957. // "autoscaler": {
  33958. // "description": "Name of the autoscaler to patch.",
  33959. // "location": "query",
  33960. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33961. // "type": "string"
  33962. // },
  33963. // "project": {
  33964. // "description": "Project ID for this request.",
  33965. // "location": "path",
  33966. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  33967. // "required": true,
  33968. // "type": "string"
  33969. // },
  33970. // "requestId": {
  33971. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  33972. // "location": "query",
  33973. // "type": "string"
  33974. // },
  33975. // "zone": {
  33976. // "description": "Name of the zone for this request.",
  33977. // "location": "path",
  33978. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33979. // "required": true,
  33980. // "type": "string"
  33981. // }
  33982. // },
  33983. // "path": "{project}/zones/{zone}/autoscalers",
  33984. // "request": {
  33985. // "$ref": "Autoscaler"
  33986. // },
  33987. // "response": {
  33988. // "$ref": "Operation"
  33989. // },
  33990. // "scopes": [
  33991. // "https://www.googleapis.com/auth/cloud-platform",
  33992. // "https://www.googleapis.com/auth/compute"
  33993. // ]
  33994. // }
  33995. }
  33996. // method id "compute.autoscalers.testIamPermissions":
  33997. type AutoscalersTestIamPermissionsCall struct {
  33998. s *Service
  33999. project string
  34000. zone string
  34001. resource string
  34002. testpermissionsrequest *TestPermissionsRequest
  34003. urlParams_ gensupport.URLParams
  34004. ctx_ context.Context
  34005. header_ http.Header
  34006. }
  34007. // TestIamPermissions: Returns permissions that a caller has on the
  34008. // specified resource.
  34009. func (r *AutoscalersService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *AutoscalersTestIamPermissionsCall {
  34010. c := &AutoscalersTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34011. c.project = project
  34012. c.zone = zone
  34013. c.resource = resource
  34014. c.testpermissionsrequest = testpermissionsrequest
  34015. return c
  34016. }
  34017. // Fields allows partial responses to be retrieved. See
  34018. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34019. // for more information.
  34020. func (c *AutoscalersTestIamPermissionsCall) Fields(s ...googleapi.Field) *AutoscalersTestIamPermissionsCall {
  34021. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34022. return c
  34023. }
  34024. // Context sets the context to be used in this call's Do method. Any
  34025. // pending HTTP request will be aborted if the provided context is
  34026. // canceled.
  34027. func (c *AutoscalersTestIamPermissionsCall) Context(ctx context.Context) *AutoscalersTestIamPermissionsCall {
  34028. c.ctx_ = ctx
  34029. return c
  34030. }
  34031. // Header returns an http.Header that can be modified by the caller to
  34032. // add HTTP headers to the request.
  34033. func (c *AutoscalersTestIamPermissionsCall) Header() http.Header {
  34034. if c.header_ == nil {
  34035. c.header_ = make(http.Header)
  34036. }
  34037. return c.header_
  34038. }
  34039. func (c *AutoscalersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  34040. reqHeaders := make(http.Header)
  34041. for k, v := range c.header_ {
  34042. reqHeaders[k] = v
  34043. }
  34044. reqHeaders.Set("User-Agent", c.s.userAgent())
  34045. var body io.Reader = nil
  34046. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  34047. if err != nil {
  34048. return nil, err
  34049. }
  34050. reqHeaders.Set("Content-Type", "application/json")
  34051. c.urlParams_.Set("alt", alt)
  34052. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers/{resource}/testIamPermissions")
  34053. urls += "?" + c.urlParams_.Encode()
  34054. req, _ := http.NewRequest("POST", urls, body)
  34055. req.Header = reqHeaders
  34056. googleapi.Expand(req.URL, map[string]string{
  34057. "project": c.project,
  34058. "zone": c.zone,
  34059. "resource": c.resource,
  34060. })
  34061. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34062. }
  34063. // Do executes the "compute.autoscalers.testIamPermissions" call.
  34064. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  34065. // non-2xx status code is an error. Response headers are in either
  34066. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  34067. // returned at all) in error.(*googleapi.Error).Header. Use
  34068. // googleapi.IsNotModified to check whether the returned error was
  34069. // because http.StatusNotModified was returned.
  34070. func (c *AutoscalersTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  34071. gensupport.SetOptions(c.urlParams_, opts...)
  34072. res, err := c.doRequest("json")
  34073. if res != nil && res.StatusCode == http.StatusNotModified {
  34074. if res.Body != nil {
  34075. res.Body.Close()
  34076. }
  34077. return nil, &googleapi.Error{
  34078. Code: res.StatusCode,
  34079. Header: res.Header,
  34080. }
  34081. }
  34082. if err != nil {
  34083. return nil, err
  34084. }
  34085. defer googleapi.CloseBody(res)
  34086. if err := googleapi.CheckResponse(res); err != nil {
  34087. return nil, err
  34088. }
  34089. ret := &TestPermissionsResponse{
  34090. ServerResponse: googleapi.ServerResponse{
  34091. Header: res.Header,
  34092. HTTPStatusCode: res.StatusCode,
  34093. },
  34094. }
  34095. target := &ret
  34096. if err := gensupport.DecodeResponse(target, res); err != nil {
  34097. return nil, err
  34098. }
  34099. return ret, nil
  34100. // {
  34101. // "description": "Returns permissions that a caller has on the specified resource.",
  34102. // "httpMethod": "POST",
  34103. // "id": "compute.autoscalers.testIamPermissions",
  34104. // "parameterOrder": [
  34105. // "project",
  34106. // "zone",
  34107. // "resource"
  34108. // ],
  34109. // "parameters": {
  34110. // "project": {
  34111. // "description": "Project ID for this request.",
  34112. // "location": "path",
  34113. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  34114. // "required": true,
  34115. // "type": "string"
  34116. // },
  34117. // "resource": {
  34118. // "description": "Name of the resource for this request.",
  34119. // "location": "path",
  34120. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  34121. // "required": true,
  34122. // "type": "string"
  34123. // },
  34124. // "zone": {
  34125. // "description": "The name of the zone for this request.",
  34126. // "location": "path",
  34127. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  34128. // "required": true,
  34129. // "type": "string"
  34130. // }
  34131. // },
  34132. // "path": "{project}/zones/{zone}/autoscalers/{resource}/testIamPermissions",
  34133. // "request": {
  34134. // "$ref": "TestPermissionsRequest"
  34135. // },
  34136. // "response": {
  34137. // "$ref": "TestPermissionsResponse"
  34138. // },
  34139. // "scopes": [
  34140. // "https://www.googleapis.com/auth/cloud-platform",
  34141. // "https://www.googleapis.com/auth/compute",
  34142. // "https://www.googleapis.com/auth/compute.readonly"
  34143. // ]
  34144. // }
  34145. }
  34146. // method id "compute.autoscalers.update":
  34147. type AutoscalersUpdateCall struct {
  34148. s *Service
  34149. project string
  34150. zone string
  34151. autoscaler *Autoscaler
  34152. urlParams_ gensupport.URLParams
  34153. ctx_ context.Context
  34154. header_ http.Header
  34155. }
  34156. // Update: Updates an autoscaler in the specified project using the data
  34157. // included in the request.
  34158. func (r *AutoscalersService) Update(project string, zone string, autoscaler *Autoscaler) *AutoscalersUpdateCall {
  34159. c := &AutoscalersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34160. c.project = project
  34161. c.zone = zone
  34162. c.autoscaler = autoscaler
  34163. return c
  34164. }
  34165. // Autoscaler sets the optional parameter "autoscaler": Name of the
  34166. // autoscaler to update.
  34167. func (c *AutoscalersUpdateCall) Autoscaler(autoscaler string) *AutoscalersUpdateCall {
  34168. c.urlParams_.Set("autoscaler", autoscaler)
  34169. return c
  34170. }
  34171. // RequestId sets the optional parameter "requestId": An optional
  34172. // request ID to identify requests. Specify a unique request ID so that
  34173. // if you must retry your request, the server will know to ignore the
  34174. // request if it has already been completed.
  34175. //
  34176. // For example, consider a situation where you make an initial request
  34177. // and the request times out. If you make the request again with the
  34178. // same request ID, the server can check if original operation with the
  34179. // same request ID was received, and if so, will ignore the second
  34180. // request. This prevents clients from accidentally creating duplicate
  34181. // commitments.
  34182. //
  34183. // The request ID must be a valid UUID with the exception that zero UUID
  34184. // is not supported (00000000-0000-0000-0000-000000000000).
  34185. func (c *AutoscalersUpdateCall) RequestId(requestId string) *AutoscalersUpdateCall {
  34186. c.urlParams_.Set("requestId", requestId)
  34187. return c
  34188. }
  34189. // Fields allows partial responses to be retrieved. See
  34190. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34191. // for more information.
  34192. func (c *AutoscalersUpdateCall) Fields(s ...googleapi.Field) *AutoscalersUpdateCall {
  34193. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34194. return c
  34195. }
  34196. // Context sets the context to be used in this call's Do method. Any
  34197. // pending HTTP request will be aborted if the provided context is
  34198. // canceled.
  34199. func (c *AutoscalersUpdateCall) Context(ctx context.Context) *AutoscalersUpdateCall {
  34200. c.ctx_ = ctx
  34201. return c
  34202. }
  34203. // Header returns an http.Header that can be modified by the caller to
  34204. // add HTTP headers to the request.
  34205. func (c *AutoscalersUpdateCall) Header() http.Header {
  34206. if c.header_ == nil {
  34207. c.header_ = make(http.Header)
  34208. }
  34209. return c.header_
  34210. }
  34211. func (c *AutoscalersUpdateCall) doRequest(alt string) (*http.Response, error) {
  34212. reqHeaders := make(http.Header)
  34213. for k, v := range c.header_ {
  34214. reqHeaders[k] = v
  34215. }
  34216. reqHeaders.Set("User-Agent", c.s.userAgent())
  34217. var body io.Reader = nil
  34218. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  34219. if err != nil {
  34220. return nil, err
  34221. }
  34222. reqHeaders.Set("Content-Type", "application/json")
  34223. c.urlParams_.Set("alt", alt)
  34224. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers")
  34225. urls += "?" + c.urlParams_.Encode()
  34226. req, _ := http.NewRequest("PUT", urls, body)
  34227. req.Header = reqHeaders
  34228. googleapi.Expand(req.URL, map[string]string{
  34229. "project": c.project,
  34230. "zone": c.zone,
  34231. })
  34232. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34233. }
  34234. // Do executes the "compute.autoscalers.update" call.
  34235. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  34236. // status code is an error. Response headers are in either
  34237. // *Operation.ServerResponse.Header or (if a response was returned at
  34238. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  34239. // to check whether the returned error was because
  34240. // http.StatusNotModified was returned.
  34241. func (c *AutoscalersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  34242. gensupport.SetOptions(c.urlParams_, opts...)
  34243. res, err := c.doRequest("json")
  34244. if res != nil && res.StatusCode == http.StatusNotModified {
  34245. if res.Body != nil {
  34246. res.Body.Close()
  34247. }
  34248. return nil, &googleapi.Error{
  34249. Code: res.StatusCode,
  34250. Header: res.Header,
  34251. }
  34252. }
  34253. if err != nil {
  34254. return nil, err
  34255. }
  34256. defer googleapi.CloseBody(res)
  34257. if err := googleapi.CheckResponse(res); err != nil {
  34258. return nil, err
  34259. }
  34260. ret := &Operation{
  34261. ServerResponse: googleapi.ServerResponse{
  34262. Header: res.Header,
  34263. HTTPStatusCode: res.StatusCode,
  34264. },
  34265. }
  34266. target := &ret
  34267. if err := gensupport.DecodeResponse(target, res); err != nil {
  34268. return nil, err
  34269. }
  34270. return ret, nil
  34271. // {
  34272. // "description": "Updates an autoscaler in the specified project using the data included in the request.",
  34273. // "httpMethod": "PUT",
  34274. // "id": "compute.autoscalers.update",
  34275. // "parameterOrder": [
  34276. // "project",
  34277. // "zone"
  34278. // ],
  34279. // "parameters": {
  34280. // "autoscaler": {
  34281. // "description": "Name of the autoscaler to update.",
  34282. // "location": "query",
  34283. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  34284. // "type": "string"
  34285. // },
  34286. // "project": {
  34287. // "description": "Project ID for this request.",
  34288. // "location": "path",
  34289. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  34290. // "required": true,
  34291. // "type": "string"
  34292. // },
  34293. // "requestId": {
  34294. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  34295. // "location": "query",
  34296. // "type": "string"
  34297. // },
  34298. // "zone": {
  34299. // "description": "Name of the zone for this request.",
  34300. // "location": "path",
  34301. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  34302. // "required": true,
  34303. // "type": "string"
  34304. // }
  34305. // },
  34306. // "path": "{project}/zones/{zone}/autoscalers",
  34307. // "request": {
  34308. // "$ref": "Autoscaler"
  34309. // },
  34310. // "response": {
  34311. // "$ref": "Operation"
  34312. // },
  34313. // "scopes": [
  34314. // "https://www.googleapis.com/auth/cloud-platform",
  34315. // "https://www.googleapis.com/auth/compute"
  34316. // ]
  34317. // }
  34318. }
  34319. // method id "compute.backendBuckets.addSignedUrlKey":
  34320. type BackendBucketsAddSignedUrlKeyCall struct {
  34321. s *Service
  34322. project string
  34323. backendBucket string
  34324. signedurlkey *SignedUrlKey
  34325. urlParams_ gensupport.URLParams
  34326. ctx_ context.Context
  34327. header_ http.Header
  34328. }
  34329. // AddSignedUrlKey: Adds the given Signed URL Key to the backend bucket.
  34330. func (r *BackendBucketsService) AddSignedUrlKey(project string, backendBucket string, signedurlkey *SignedUrlKey) *BackendBucketsAddSignedUrlKeyCall {
  34331. c := &BackendBucketsAddSignedUrlKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34332. c.project = project
  34333. c.backendBucket = backendBucket
  34334. c.signedurlkey = signedurlkey
  34335. return c
  34336. }
  34337. // RequestId sets the optional parameter "requestId": An optional
  34338. // request ID to identify requests. Specify a unique request ID so that
  34339. // if you must retry your request, the server will know to ignore the
  34340. // request if it has already been completed.
  34341. //
  34342. // For example, consider a situation where you make an initial request
  34343. // and the request times out. If you make the request again with the
  34344. // same request ID, the server can check if original operation with the
  34345. // same request ID was received, and if so, will ignore the second
  34346. // request. This prevents clients from accidentally creating duplicate
  34347. // commitments.
  34348. //
  34349. // The request ID must be a valid UUID with the exception that zero UUID
  34350. // is not supported (00000000-0000-0000-0000-000000000000).
  34351. func (c *BackendBucketsAddSignedUrlKeyCall) RequestId(requestId string) *BackendBucketsAddSignedUrlKeyCall {
  34352. c.urlParams_.Set("requestId", requestId)
  34353. return c
  34354. }
  34355. // Fields allows partial responses to be retrieved. See
  34356. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34357. // for more information.
  34358. func (c *BackendBucketsAddSignedUrlKeyCall) Fields(s ...googleapi.Field) *BackendBucketsAddSignedUrlKeyCall {
  34359. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34360. return c
  34361. }
  34362. // Context sets the context to be used in this call's Do method. Any
  34363. // pending HTTP request will be aborted if the provided context is
  34364. // canceled.
  34365. func (c *BackendBucketsAddSignedUrlKeyCall) Context(ctx context.Context) *BackendBucketsAddSignedUrlKeyCall {
  34366. c.ctx_ = ctx
  34367. return c
  34368. }
  34369. // Header returns an http.Header that can be modified by the caller to
  34370. // add HTTP headers to the request.
  34371. func (c *BackendBucketsAddSignedUrlKeyCall) Header() http.Header {
  34372. if c.header_ == nil {
  34373. c.header_ = make(http.Header)
  34374. }
  34375. return c.header_
  34376. }
  34377. func (c *BackendBucketsAddSignedUrlKeyCall) doRequest(alt string) (*http.Response, error) {
  34378. reqHeaders := make(http.Header)
  34379. for k, v := range c.header_ {
  34380. reqHeaders[k] = v
  34381. }
  34382. reqHeaders.Set("User-Agent", c.s.userAgent())
  34383. var body io.Reader = nil
  34384. body, err := googleapi.WithoutDataWrapper.JSONReader(c.signedurlkey)
  34385. if err != nil {
  34386. return nil, err
  34387. }
  34388. reqHeaders.Set("Content-Type", "application/json")
  34389. c.urlParams_.Set("alt", alt)
  34390. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{backendBucket}/addSignedUrlKey")
  34391. urls += "?" + c.urlParams_.Encode()
  34392. req, _ := http.NewRequest("POST", urls, body)
  34393. req.Header = reqHeaders
  34394. googleapi.Expand(req.URL, map[string]string{
  34395. "project": c.project,
  34396. "backendBucket": c.backendBucket,
  34397. })
  34398. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34399. }
  34400. // Do executes the "compute.backendBuckets.addSignedUrlKey" call.
  34401. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  34402. // status code is an error. Response headers are in either
  34403. // *Operation.ServerResponse.Header or (if a response was returned at
  34404. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  34405. // to check whether the returned error was because
  34406. // http.StatusNotModified was returned.
  34407. func (c *BackendBucketsAddSignedUrlKeyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  34408. gensupport.SetOptions(c.urlParams_, opts...)
  34409. res, err := c.doRequest("json")
  34410. if res != nil && res.StatusCode == http.StatusNotModified {
  34411. if res.Body != nil {
  34412. res.Body.Close()
  34413. }
  34414. return nil, &googleapi.Error{
  34415. Code: res.StatusCode,
  34416. Header: res.Header,
  34417. }
  34418. }
  34419. if err != nil {
  34420. return nil, err
  34421. }
  34422. defer googleapi.CloseBody(res)
  34423. if err := googleapi.CheckResponse(res); err != nil {
  34424. return nil, err
  34425. }
  34426. ret := &Operation{
  34427. ServerResponse: googleapi.ServerResponse{
  34428. Header: res.Header,
  34429. HTTPStatusCode: res.StatusCode,
  34430. },
  34431. }
  34432. target := &ret
  34433. if err := gensupport.DecodeResponse(target, res); err != nil {
  34434. return nil, err
  34435. }
  34436. return ret, nil
  34437. // {
  34438. // "description": "Adds the given Signed URL Key to the backend bucket.",
  34439. // "httpMethod": "POST",
  34440. // "id": "compute.backendBuckets.addSignedUrlKey",
  34441. // "parameterOrder": [
  34442. // "project",
  34443. // "backendBucket"
  34444. // ],
  34445. // "parameters": {
  34446. // "backendBucket": {
  34447. // "description": "Name of the BackendBucket resource to which the Signed URL Key should be added. The name should conform to RFC1035.",
  34448. // "location": "path",
  34449. // "required": true,
  34450. // "type": "string"
  34451. // },
  34452. // "project": {
  34453. // "description": "Project ID for this request.",
  34454. // "location": "path",
  34455. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  34456. // "required": true,
  34457. // "type": "string"
  34458. // },
  34459. // "requestId": {
  34460. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  34461. // "location": "query",
  34462. // "type": "string"
  34463. // }
  34464. // },
  34465. // "path": "{project}/global/backendBuckets/{backendBucket}/addSignedUrlKey",
  34466. // "request": {
  34467. // "$ref": "SignedUrlKey"
  34468. // },
  34469. // "response": {
  34470. // "$ref": "Operation"
  34471. // },
  34472. // "scopes": [
  34473. // "https://www.googleapis.com/auth/cloud-platform",
  34474. // "https://www.googleapis.com/auth/compute"
  34475. // ]
  34476. // }
  34477. }
  34478. // method id "compute.backendBuckets.delete":
  34479. type BackendBucketsDeleteCall struct {
  34480. s *Service
  34481. project string
  34482. backendBucket string
  34483. urlParams_ gensupport.URLParams
  34484. ctx_ context.Context
  34485. header_ http.Header
  34486. }
  34487. // Delete: Deletes the specified BackendBucket resource.
  34488. func (r *BackendBucketsService) Delete(project string, backendBucket string) *BackendBucketsDeleteCall {
  34489. c := &BackendBucketsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34490. c.project = project
  34491. c.backendBucket = backendBucket
  34492. return c
  34493. }
  34494. // RequestId sets the optional parameter "requestId": An optional
  34495. // request ID to identify requests. Specify a unique request ID so that
  34496. // if you must retry your request, the server will know to ignore the
  34497. // request if it has already been completed.
  34498. //
  34499. // For example, consider a situation where you make an initial request
  34500. // and the request times out. If you make the request again with the
  34501. // same request ID, the server can check if original operation with the
  34502. // same request ID was received, and if so, will ignore the second
  34503. // request. This prevents clients from accidentally creating duplicate
  34504. // commitments.
  34505. //
  34506. // The request ID must be a valid UUID with the exception that zero UUID
  34507. // is not supported (00000000-0000-0000-0000-000000000000).
  34508. func (c *BackendBucketsDeleteCall) RequestId(requestId string) *BackendBucketsDeleteCall {
  34509. c.urlParams_.Set("requestId", requestId)
  34510. return c
  34511. }
  34512. // Fields allows partial responses to be retrieved. See
  34513. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34514. // for more information.
  34515. func (c *BackendBucketsDeleteCall) Fields(s ...googleapi.Field) *BackendBucketsDeleteCall {
  34516. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34517. return c
  34518. }
  34519. // Context sets the context to be used in this call's Do method. Any
  34520. // pending HTTP request will be aborted if the provided context is
  34521. // canceled.
  34522. func (c *BackendBucketsDeleteCall) Context(ctx context.Context) *BackendBucketsDeleteCall {
  34523. c.ctx_ = ctx
  34524. return c
  34525. }
  34526. // Header returns an http.Header that can be modified by the caller to
  34527. // add HTTP headers to the request.
  34528. func (c *BackendBucketsDeleteCall) Header() http.Header {
  34529. if c.header_ == nil {
  34530. c.header_ = make(http.Header)
  34531. }
  34532. return c.header_
  34533. }
  34534. func (c *BackendBucketsDeleteCall) doRequest(alt string) (*http.Response, error) {
  34535. reqHeaders := make(http.Header)
  34536. for k, v := range c.header_ {
  34537. reqHeaders[k] = v
  34538. }
  34539. reqHeaders.Set("User-Agent", c.s.userAgent())
  34540. var body io.Reader = nil
  34541. c.urlParams_.Set("alt", alt)
  34542. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{backendBucket}")
  34543. urls += "?" + c.urlParams_.Encode()
  34544. req, _ := http.NewRequest("DELETE", urls, body)
  34545. req.Header = reqHeaders
  34546. googleapi.Expand(req.URL, map[string]string{
  34547. "project": c.project,
  34548. "backendBucket": c.backendBucket,
  34549. })
  34550. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34551. }
  34552. // Do executes the "compute.backendBuckets.delete" call.
  34553. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  34554. // status code is an error. Response headers are in either
  34555. // *Operation.ServerResponse.Header or (if a response was returned at
  34556. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  34557. // to check whether the returned error was because
  34558. // http.StatusNotModified was returned.
  34559. func (c *BackendBucketsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  34560. gensupport.SetOptions(c.urlParams_, opts...)
  34561. res, err := c.doRequest("json")
  34562. if res != nil && res.StatusCode == http.StatusNotModified {
  34563. if res.Body != nil {
  34564. res.Body.Close()
  34565. }
  34566. return nil, &googleapi.Error{
  34567. Code: res.StatusCode,
  34568. Header: res.Header,
  34569. }
  34570. }
  34571. if err != nil {
  34572. return nil, err
  34573. }
  34574. defer googleapi.CloseBody(res)
  34575. if err := googleapi.CheckResponse(res); err != nil {
  34576. return nil, err
  34577. }
  34578. ret := &Operation{
  34579. ServerResponse: googleapi.ServerResponse{
  34580. Header: res.Header,
  34581. HTTPStatusCode: res.StatusCode,
  34582. },
  34583. }
  34584. target := &ret
  34585. if err := gensupport.DecodeResponse(target, res); err != nil {
  34586. return nil, err
  34587. }
  34588. return ret, nil
  34589. // {
  34590. // "description": "Deletes the specified BackendBucket resource.",
  34591. // "httpMethod": "DELETE",
  34592. // "id": "compute.backendBuckets.delete",
  34593. // "parameterOrder": [
  34594. // "project",
  34595. // "backendBucket"
  34596. // ],
  34597. // "parameters": {
  34598. // "backendBucket": {
  34599. // "description": "Name of the BackendBucket resource to delete.",
  34600. // "location": "path",
  34601. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  34602. // "required": true,
  34603. // "type": "string"
  34604. // },
  34605. // "project": {
  34606. // "description": "Project ID for this request.",
  34607. // "location": "path",
  34608. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  34609. // "required": true,
  34610. // "type": "string"
  34611. // },
  34612. // "requestId": {
  34613. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  34614. // "location": "query",
  34615. // "type": "string"
  34616. // }
  34617. // },
  34618. // "path": "{project}/global/backendBuckets/{backendBucket}",
  34619. // "response": {
  34620. // "$ref": "Operation"
  34621. // },
  34622. // "scopes": [
  34623. // "https://www.googleapis.com/auth/cloud-platform",
  34624. // "https://www.googleapis.com/auth/compute"
  34625. // ]
  34626. // }
  34627. }
  34628. // method id "compute.backendBuckets.deleteSignedUrlKey":
  34629. type BackendBucketsDeleteSignedUrlKeyCall struct {
  34630. s *Service
  34631. project string
  34632. backendBucket string
  34633. urlParams_ gensupport.URLParams
  34634. ctx_ context.Context
  34635. header_ http.Header
  34636. }
  34637. // DeleteSignedUrlKey: Deletes the given Signed URL Key from the backend
  34638. // bucket.
  34639. func (r *BackendBucketsService) DeleteSignedUrlKey(project string, backendBucket string, keyName string) *BackendBucketsDeleteSignedUrlKeyCall {
  34640. c := &BackendBucketsDeleteSignedUrlKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34641. c.project = project
  34642. c.backendBucket = backendBucket
  34643. c.urlParams_.Set("keyName", keyName)
  34644. return c
  34645. }
  34646. // RequestId sets the optional parameter "requestId": An optional
  34647. // request ID to identify requests. Specify a unique request ID so that
  34648. // if you must retry your request, the server will know to ignore the
  34649. // request if it has already been completed.
  34650. //
  34651. // For example, consider a situation where you make an initial request
  34652. // and the request times out. If you make the request again with the
  34653. // same request ID, the server can check if original operation with the
  34654. // same request ID was received, and if so, will ignore the second
  34655. // request. This prevents clients from accidentally creating duplicate
  34656. // commitments.
  34657. //
  34658. // The request ID must be a valid UUID with the exception that zero UUID
  34659. // is not supported (00000000-0000-0000-0000-000000000000).
  34660. func (c *BackendBucketsDeleteSignedUrlKeyCall) RequestId(requestId string) *BackendBucketsDeleteSignedUrlKeyCall {
  34661. c.urlParams_.Set("requestId", requestId)
  34662. return c
  34663. }
  34664. // Fields allows partial responses to be retrieved. See
  34665. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34666. // for more information.
  34667. func (c *BackendBucketsDeleteSignedUrlKeyCall) Fields(s ...googleapi.Field) *BackendBucketsDeleteSignedUrlKeyCall {
  34668. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34669. return c
  34670. }
  34671. // Context sets the context to be used in this call's Do method. Any
  34672. // pending HTTP request will be aborted if the provided context is
  34673. // canceled.
  34674. func (c *BackendBucketsDeleteSignedUrlKeyCall) Context(ctx context.Context) *BackendBucketsDeleteSignedUrlKeyCall {
  34675. c.ctx_ = ctx
  34676. return c
  34677. }
  34678. // Header returns an http.Header that can be modified by the caller to
  34679. // add HTTP headers to the request.
  34680. func (c *BackendBucketsDeleteSignedUrlKeyCall) Header() http.Header {
  34681. if c.header_ == nil {
  34682. c.header_ = make(http.Header)
  34683. }
  34684. return c.header_
  34685. }
  34686. func (c *BackendBucketsDeleteSignedUrlKeyCall) doRequest(alt string) (*http.Response, error) {
  34687. reqHeaders := make(http.Header)
  34688. for k, v := range c.header_ {
  34689. reqHeaders[k] = v
  34690. }
  34691. reqHeaders.Set("User-Agent", c.s.userAgent())
  34692. var body io.Reader = nil
  34693. c.urlParams_.Set("alt", alt)
  34694. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{backendBucket}/deleteSignedUrlKey")
  34695. urls += "?" + c.urlParams_.Encode()
  34696. req, _ := http.NewRequest("POST", urls, body)
  34697. req.Header = reqHeaders
  34698. googleapi.Expand(req.URL, map[string]string{
  34699. "project": c.project,
  34700. "backendBucket": c.backendBucket,
  34701. })
  34702. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34703. }
  34704. // Do executes the "compute.backendBuckets.deleteSignedUrlKey" call.
  34705. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  34706. // status code is an error. Response headers are in either
  34707. // *Operation.ServerResponse.Header or (if a response was returned at
  34708. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  34709. // to check whether the returned error was because
  34710. // http.StatusNotModified was returned.
  34711. func (c *BackendBucketsDeleteSignedUrlKeyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  34712. gensupport.SetOptions(c.urlParams_, opts...)
  34713. res, err := c.doRequest("json")
  34714. if res != nil && res.StatusCode == http.StatusNotModified {
  34715. if res.Body != nil {
  34716. res.Body.Close()
  34717. }
  34718. return nil, &googleapi.Error{
  34719. Code: res.StatusCode,
  34720. Header: res.Header,
  34721. }
  34722. }
  34723. if err != nil {
  34724. return nil, err
  34725. }
  34726. defer googleapi.CloseBody(res)
  34727. if err := googleapi.CheckResponse(res); err != nil {
  34728. return nil, err
  34729. }
  34730. ret := &Operation{
  34731. ServerResponse: googleapi.ServerResponse{
  34732. Header: res.Header,
  34733. HTTPStatusCode: res.StatusCode,
  34734. },
  34735. }
  34736. target := &ret
  34737. if err := gensupport.DecodeResponse(target, res); err != nil {
  34738. return nil, err
  34739. }
  34740. return ret, nil
  34741. // {
  34742. // "description": "Deletes the given Signed URL Key from the backend bucket.",
  34743. // "httpMethod": "POST",
  34744. // "id": "compute.backendBuckets.deleteSignedUrlKey",
  34745. // "parameterOrder": [
  34746. // "project",
  34747. // "backendBucket",
  34748. // "keyName"
  34749. // ],
  34750. // "parameters": {
  34751. // "backendBucket": {
  34752. // "description": "Name of the BackendBucket resource to which the Signed URL Key should be added. The name should conform to RFC1035.",
  34753. // "location": "path",
  34754. // "required": true,
  34755. // "type": "string"
  34756. // },
  34757. // "keyName": {
  34758. // "description": "The name of the Signed URL Key to delete.",
  34759. // "location": "query",
  34760. // "required": true,
  34761. // "type": "string"
  34762. // },
  34763. // "project": {
  34764. // "description": "Project ID for this request.",
  34765. // "location": "path",
  34766. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  34767. // "required": true,
  34768. // "type": "string"
  34769. // },
  34770. // "requestId": {
  34771. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  34772. // "location": "query",
  34773. // "type": "string"
  34774. // }
  34775. // },
  34776. // "path": "{project}/global/backendBuckets/{backendBucket}/deleteSignedUrlKey",
  34777. // "response": {
  34778. // "$ref": "Operation"
  34779. // },
  34780. // "scopes": [
  34781. // "https://www.googleapis.com/auth/cloud-platform",
  34782. // "https://www.googleapis.com/auth/compute"
  34783. // ]
  34784. // }
  34785. }
  34786. // method id "compute.backendBuckets.get":
  34787. type BackendBucketsGetCall struct {
  34788. s *Service
  34789. project string
  34790. backendBucket string
  34791. urlParams_ gensupport.URLParams
  34792. ifNoneMatch_ string
  34793. ctx_ context.Context
  34794. header_ http.Header
  34795. }
  34796. // Get: Returns the specified BackendBucket resource. Gets a list of
  34797. // available backend buckets by making a list() request.
  34798. func (r *BackendBucketsService) Get(project string, backendBucket string) *BackendBucketsGetCall {
  34799. c := &BackendBucketsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34800. c.project = project
  34801. c.backendBucket = backendBucket
  34802. return c
  34803. }
  34804. // Fields allows partial responses to be retrieved. See
  34805. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34806. // for more information.
  34807. func (c *BackendBucketsGetCall) Fields(s ...googleapi.Field) *BackendBucketsGetCall {
  34808. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34809. return c
  34810. }
  34811. // IfNoneMatch sets the optional parameter which makes the operation
  34812. // fail if the object's ETag matches the given value. This is useful for
  34813. // getting updates only after the object has changed since the last
  34814. // request. Use googleapi.IsNotModified to check whether the response
  34815. // error from Do is the result of In-None-Match.
  34816. func (c *BackendBucketsGetCall) IfNoneMatch(entityTag string) *BackendBucketsGetCall {
  34817. c.ifNoneMatch_ = entityTag
  34818. return c
  34819. }
  34820. // Context sets the context to be used in this call's Do method. Any
  34821. // pending HTTP request will be aborted if the provided context is
  34822. // canceled.
  34823. func (c *BackendBucketsGetCall) Context(ctx context.Context) *BackendBucketsGetCall {
  34824. c.ctx_ = ctx
  34825. return c
  34826. }
  34827. // Header returns an http.Header that can be modified by the caller to
  34828. // add HTTP headers to the request.
  34829. func (c *BackendBucketsGetCall) Header() http.Header {
  34830. if c.header_ == nil {
  34831. c.header_ = make(http.Header)
  34832. }
  34833. return c.header_
  34834. }
  34835. func (c *BackendBucketsGetCall) doRequest(alt string) (*http.Response, error) {
  34836. reqHeaders := make(http.Header)
  34837. for k, v := range c.header_ {
  34838. reqHeaders[k] = v
  34839. }
  34840. reqHeaders.Set("User-Agent", c.s.userAgent())
  34841. if c.ifNoneMatch_ != "" {
  34842. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  34843. }
  34844. var body io.Reader = nil
  34845. c.urlParams_.Set("alt", alt)
  34846. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{backendBucket}")
  34847. urls += "?" + c.urlParams_.Encode()
  34848. req, _ := http.NewRequest("GET", urls, body)
  34849. req.Header = reqHeaders
  34850. googleapi.Expand(req.URL, map[string]string{
  34851. "project": c.project,
  34852. "backendBucket": c.backendBucket,
  34853. })
  34854. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34855. }
  34856. // Do executes the "compute.backendBuckets.get" call.
  34857. // Exactly one of *BackendBucket or error will be non-nil. Any non-2xx
  34858. // status code is an error. Response headers are in either
  34859. // *BackendBucket.ServerResponse.Header or (if a response was returned
  34860. // at all) in error.(*googleapi.Error).Header. Use
  34861. // googleapi.IsNotModified to check whether the returned error was
  34862. // because http.StatusNotModified was returned.
  34863. func (c *BackendBucketsGetCall) Do(opts ...googleapi.CallOption) (*BackendBucket, error) {
  34864. gensupport.SetOptions(c.urlParams_, opts...)
  34865. res, err := c.doRequest("json")
  34866. if res != nil && res.StatusCode == http.StatusNotModified {
  34867. if res.Body != nil {
  34868. res.Body.Close()
  34869. }
  34870. return nil, &googleapi.Error{
  34871. Code: res.StatusCode,
  34872. Header: res.Header,
  34873. }
  34874. }
  34875. if err != nil {
  34876. return nil, err
  34877. }
  34878. defer googleapi.CloseBody(res)
  34879. if err := googleapi.CheckResponse(res); err != nil {
  34880. return nil, err
  34881. }
  34882. ret := &BackendBucket{
  34883. ServerResponse: googleapi.ServerResponse{
  34884. Header: res.Header,
  34885. HTTPStatusCode: res.StatusCode,
  34886. },
  34887. }
  34888. target := &ret
  34889. if err := gensupport.DecodeResponse(target, res); err != nil {
  34890. return nil, err
  34891. }
  34892. return ret, nil
  34893. // {
  34894. // "description": "Returns the specified BackendBucket resource. Gets a list of available backend buckets by making a list() request.",
  34895. // "httpMethod": "GET",
  34896. // "id": "compute.backendBuckets.get",
  34897. // "parameterOrder": [
  34898. // "project",
  34899. // "backendBucket"
  34900. // ],
  34901. // "parameters": {
  34902. // "backendBucket": {
  34903. // "description": "Name of the BackendBucket resource to return.",
  34904. // "location": "path",
  34905. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  34906. // "required": true,
  34907. // "type": "string"
  34908. // },
  34909. // "project": {
  34910. // "description": "Project ID for this request.",
  34911. // "location": "path",
  34912. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  34913. // "required": true,
  34914. // "type": "string"
  34915. // }
  34916. // },
  34917. // "path": "{project}/global/backendBuckets/{backendBucket}",
  34918. // "response": {
  34919. // "$ref": "BackendBucket"
  34920. // },
  34921. // "scopes": [
  34922. // "https://www.googleapis.com/auth/cloud-platform",
  34923. // "https://www.googleapis.com/auth/compute",
  34924. // "https://www.googleapis.com/auth/compute.readonly"
  34925. // ]
  34926. // }
  34927. }
  34928. // method id "compute.backendBuckets.getIamPolicy":
  34929. type BackendBucketsGetIamPolicyCall struct {
  34930. s *Service
  34931. project string
  34932. resource string
  34933. urlParams_ gensupport.URLParams
  34934. ifNoneMatch_ string
  34935. ctx_ context.Context
  34936. header_ http.Header
  34937. }
  34938. // GetIamPolicy: Gets the access control policy for a resource. May be
  34939. // empty if no such policy or resource exists.
  34940. func (r *BackendBucketsService) GetIamPolicy(project string, resource string) *BackendBucketsGetIamPolicyCall {
  34941. c := &BackendBucketsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34942. c.project = project
  34943. c.resource = resource
  34944. return c
  34945. }
  34946. // Fields allows partial responses to be retrieved. See
  34947. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34948. // for more information.
  34949. func (c *BackendBucketsGetIamPolicyCall) Fields(s ...googleapi.Field) *BackendBucketsGetIamPolicyCall {
  34950. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34951. return c
  34952. }
  34953. // IfNoneMatch sets the optional parameter which makes the operation
  34954. // fail if the object's ETag matches the given value. This is useful for
  34955. // getting updates only after the object has changed since the last
  34956. // request. Use googleapi.IsNotModified to check whether the response
  34957. // error from Do is the result of In-None-Match.
  34958. func (c *BackendBucketsGetIamPolicyCall) IfNoneMatch(entityTag string) *BackendBucketsGetIamPolicyCall {
  34959. c.ifNoneMatch_ = entityTag
  34960. return c
  34961. }
  34962. // Context sets the context to be used in this call's Do method. Any
  34963. // pending HTTP request will be aborted if the provided context is
  34964. // canceled.
  34965. func (c *BackendBucketsGetIamPolicyCall) Context(ctx context.Context) *BackendBucketsGetIamPolicyCall {
  34966. c.ctx_ = ctx
  34967. return c
  34968. }
  34969. // Header returns an http.Header that can be modified by the caller to
  34970. // add HTTP headers to the request.
  34971. func (c *BackendBucketsGetIamPolicyCall) Header() http.Header {
  34972. if c.header_ == nil {
  34973. c.header_ = make(http.Header)
  34974. }
  34975. return c.header_
  34976. }
  34977. func (c *BackendBucketsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  34978. reqHeaders := make(http.Header)
  34979. for k, v := range c.header_ {
  34980. reqHeaders[k] = v
  34981. }
  34982. reqHeaders.Set("User-Agent", c.s.userAgent())
  34983. if c.ifNoneMatch_ != "" {
  34984. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  34985. }
  34986. var body io.Reader = nil
  34987. c.urlParams_.Set("alt", alt)
  34988. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{resource}/getIamPolicy")
  34989. urls += "?" + c.urlParams_.Encode()
  34990. req, _ := http.NewRequest("GET", urls, body)
  34991. req.Header = reqHeaders
  34992. googleapi.Expand(req.URL, map[string]string{
  34993. "project": c.project,
  34994. "resource": c.resource,
  34995. })
  34996. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34997. }
  34998. // Do executes the "compute.backendBuckets.getIamPolicy" call.
  34999. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  35000. // code is an error. Response headers are in either
  35001. // *Policy.ServerResponse.Header or (if a response was returned at all)
  35002. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  35003. // check whether the returned error was because http.StatusNotModified
  35004. // was returned.
  35005. func (c *BackendBucketsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  35006. gensupport.SetOptions(c.urlParams_, opts...)
  35007. res, err := c.doRequest("json")
  35008. if res != nil && res.StatusCode == http.StatusNotModified {
  35009. if res.Body != nil {
  35010. res.Body.Close()
  35011. }
  35012. return nil, &googleapi.Error{
  35013. Code: res.StatusCode,
  35014. Header: res.Header,
  35015. }
  35016. }
  35017. if err != nil {
  35018. return nil, err
  35019. }
  35020. defer googleapi.CloseBody(res)
  35021. if err := googleapi.CheckResponse(res); err != nil {
  35022. return nil, err
  35023. }
  35024. ret := &Policy{
  35025. ServerResponse: googleapi.ServerResponse{
  35026. Header: res.Header,
  35027. HTTPStatusCode: res.StatusCode,
  35028. },
  35029. }
  35030. target := &ret
  35031. if err := gensupport.DecodeResponse(target, res); err != nil {
  35032. return nil, err
  35033. }
  35034. return ret, nil
  35035. // {
  35036. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  35037. // "httpMethod": "GET",
  35038. // "id": "compute.backendBuckets.getIamPolicy",
  35039. // "parameterOrder": [
  35040. // "project",
  35041. // "resource"
  35042. // ],
  35043. // "parameters": {
  35044. // "project": {
  35045. // "description": "Project ID for this request.",
  35046. // "location": "path",
  35047. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  35048. // "required": true,
  35049. // "type": "string"
  35050. // },
  35051. // "resource": {
  35052. // "description": "Name of the resource for this request.",
  35053. // "location": "path",
  35054. // "pattern": "[a-z0-9](?:[-a-z0-9_]{0,61}[a-z0-9])?",
  35055. // "required": true,
  35056. // "type": "string"
  35057. // }
  35058. // },
  35059. // "path": "{project}/global/backendBuckets/{resource}/getIamPolicy",
  35060. // "response": {
  35061. // "$ref": "Policy"
  35062. // },
  35063. // "scopes": [
  35064. // "https://www.googleapis.com/auth/cloud-platform",
  35065. // "https://www.googleapis.com/auth/compute",
  35066. // "https://www.googleapis.com/auth/compute.readonly"
  35067. // ]
  35068. // }
  35069. }
  35070. // method id "compute.backendBuckets.insert":
  35071. type BackendBucketsInsertCall struct {
  35072. s *Service
  35073. project string
  35074. backendbucket *BackendBucket
  35075. urlParams_ gensupport.URLParams
  35076. ctx_ context.Context
  35077. header_ http.Header
  35078. }
  35079. // Insert: Creates a BackendBucket resource in the specified project
  35080. // using the data included in the request.
  35081. func (r *BackendBucketsService) Insert(project string, backendbucket *BackendBucket) *BackendBucketsInsertCall {
  35082. c := &BackendBucketsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35083. c.project = project
  35084. c.backendbucket = backendbucket
  35085. return c
  35086. }
  35087. // RequestId sets the optional parameter "requestId": An optional
  35088. // request ID to identify requests. Specify a unique request ID so that
  35089. // if you must retry your request, the server will know to ignore the
  35090. // request if it has already been completed.
  35091. //
  35092. // For example, consider a situation where you make an initial request
  35093. // and the request times out. If you make the request again with the
  35094. // same request ID, the server can check if original operation with the
  35095. // same request ID was received, and if so, will ignore the second
  35096. // request. This prevents clients from accidentally creating duplicate
  35097. // commitments.
  35098. //
  35099. // The request ID must be a valid UUID with the exception that zero UUID
  35100. // is not supported (00000000-0000-0000-0000-000000000000).
  35101. func (c *BackendBucketsInsertCall) RequestId(requestId string) *BackendBucketsInsertCall {
  35102. c.urlParams_.Set("requestId", requestId)
  35103. return c
  35104. }
  35105. // Fields allows partial responses to be retrieved. See
  35106. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35107. // for more information.
  35108. func (c *BackendBucketsInsertCall) Fields(s ...googleapi.Field) *BackendBucketsInsertCall {
  35109. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35110. return c
  35111. }
  35112. // Context sets the context to be used in this call's Do method. Any
  35113. // pending HTTP request will be aborted if the provided context is
  35114. // canceled.
  35115. func (c *BackendBucketsInsertCall) Context(ctx context.Context) *BackendBucketsInsertCall {
  35116. c.ctx_ = ctx
  35117. return c
  35118. }
  35119. // Header returns an http.Header that can be modified by the caller to
  35120. // add HTTP headers to the request.
  35121. func (c *BackendBucketsInsertCall) Header() http.Header {
  35122. if c.header_ == nil {
  35123. c.header_ = make(http.Header)
  35124. }
  35125. return c.header_
  35126. }
  35127. func (c *BackendBucketsInsertCall) doRequest(alt string) (*http.Response, error) {
  35128. reqHeaders := make(http.Header)
  35129. for k, v := range c.header_ {
  35130. reqHeaders[k] = v
  35131. }
  35132. reqHeaders.Set("User-Agent", c.s.userAgent())
  35133. var body io.Reader = nil
  35134. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendbucket)
  35135. if err != nil {
  35136. return nil, err
  35137. }
  35138. reqHeaders.Set("Content-Type", "application/json")
  35139. c.urlParams_.Set("alt", alt)
  35140. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets")
  35141. urls += "?" + c.urlParams_.Encode()
  35142. req, _ := http.NewRequest("POST", urls, body)
  35143. req.Header = reqHeaders
  35144. googleapi.Expand(req.URL, map[string]string{
  35145. "project": c.project,
  35146. })
  35147. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35148. }
  35149. // Do executes the "compute.backendBuckets.insert" call.
  35150. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  35151. // status code is an error. Response headers are in either
  35152. // *Operation.ServerResponse.Header or (if a response was returned at
  35153. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  35154. // to check whether the returned error was because
  35155. // http.StatusNotModified was returned.
  35156. func (c *BackendBucketsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  35157. gensupport.SetOptions(c.urlParams_, opts...)
  35158. res, err := c.doRequest("json")
  35159. if res != nil && res.StatusCode == http.StatusNotModified {
  35160. if res.Body != nil {
  35161. res.Body.Close()
  35162. }
  35163. return nil, &googleapi.Error{
  35164. Code: res.StatusCode,
  35165. Header: res.Header,
  35166. }
  35167. }
  35168. if err != nil {
  35169. return nil, err
  35170. }
  35171. defer googleapi.CloseBody(res)
  35172. if err := googleapi.CheckResponse(res); err != nil {
  35173. return nil, err
  35174. }
  35175. ret := &Operation{
  35176. ServerResponse: googleapi.ServerResponse{
  35177. Header: res.Header,
  35178. HTTPStatusCode: res.StatusCode,
  35179. },
  35180. }
  35181. target := &ret
  35182. if err := gensupport.DecodeResponse(target, res); err != nil {
  35183. return nil, err
  35184. }
  35185. return ret, nil
  35186. // {
  35187. // "description": "Creates a BackendBucket resource in the specified project using the data included in the request.",
  35188. // "httpMethod": "POST",
  35189. // "id": "compute.backendBuckets.insert",
  35190. // "parameterOrder": [
  35191. // "project"
  35192. // ],
  35193. // "parameters": {
  35194. // "project": {
  35195. // "description": "Project ID for this request.",
  35196. // "location": "path",
  35197. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  35198. // "required": true,
  35199. // "type": "string"
  35200. // },
  35201. // "requestId": {
  35202. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  35203. // "location": "query",
  35204. // "type": "string"
  35205. // }
  35206. // },
  35207. // "path": "{project}/global/backendBuckets",
  35208. // "request": {
  35209. // "$ref": "BackendBucket"
  35210. // },
  35211. // "response": {
  35212. // "$ref": "Operation"
  35213. // },
  35214. // "scopes": [
  35215. // "https://www.googleapis.com/auth/cloud-platform",
  35216. // "https://www.googleapis.com/auth/compute"
  35217. // ]
  35218. // }
  35219. }
  35220. // method id "compute.backendBuckets.list":
  35221. type BackendBucketsListCall struct {
  35222. s *Service
  35223. project string
  35224. urlParams_ gensupport.URLParams
  35225. ifNoneMatch_ string
  35226. ctx_ context.Context
  35227. header_ http.Header
  35228. }
  35229. // List: Retrieves the list of BackendBucket resources available to the
  35230. // specified project.
  35231. func (r *BackendBucketsService) List(project string) *BackendBucketsListCall {
  35232. c := &BackendBucketsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35233. c.project = project
  35234. return c
  35235. }
  35236. // Filter sets the optional parameter "filter": A filter expression that
  35237. // filters resources listed in the response. The expression must specify
  35238. // the field name, a comparison operator, and the value that you want to
  35239. // use for filtering. The value must be a string, a number, or a
  35240. // boolean. The comparison operator must be either =, !=, >, or <.
  35241. //
  35242. // For example, if you are filtering Compute Engine instances, you can
  35243. // exclude instances named example-instance by specifying name !=
  35244. // example-instance.
  35245. //
  35246. // You can also filter nested fields. For example, you could specify
  35247. // scheduling.automaticRestart = false to include instances only if they
  35248. // are not scheduled for automatic restarts. You can use filtering on
  35249. // nested fields to filter based on resource labels.
  35250. //
  35251. // To filter on multiple expressions, provide each separate expression
  35252. // within parentheses. For example, (scheduling.automaticRestart = true)
  35253. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  35254. // AND expression. However, you can include AND and OR expressions
  35255. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  35256. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  35257. // true).
  35258. func (c *BackendBucketsListCall) Filter(filter string) *BackendBucketsListCall {
  35259. c.urlParams_.Set("filter", filter)
  35260. return c
  35261. }
  35262. // MaxResults sets the optional parameter "maxResults": The maximum
  35263. // number of results per page that should be returned. If the number of
  35264. // available results is larger than maxResults, Compute Engine returns a
  35265. // nextPageToken that can be used to get the next page of results in
  35266. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  35267. // (Default: 500)
  35268. func (c *BackendBucketsListCall) MaxResults(maxResults int64) *BackendBucketsListCall {
  35269. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  35270. return c
  35271. }
  35272. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  35273. // a certain order. By default, results are returned in alphanumerical
  35274. // order based on the resource name.
  35275. //
  35276. // You can also sort results in descending order based on the creation
  35277. // timestamp using orderBy="creationTimestamp desc". This sorts results
  35278. // based on the creationTimestamp field in reverse chronological order
  35279. // (newest result first). Use this to sort resources like operations so
  35280. // that the newest operation is returned first.
  35281. //
  35282. // Currently, only sorting by name or creationTimestamp desc is
  35283. // supported.
  35284. func (c *BackendBucketsListCall) OrderBy(orderBy string) *BackendBucketsListCall {
  35285. c.urlParams_.Set("orderBy", orderBy)
  35286. return c
  35287. }
  35288. // PageToken sets the optional parameter "pageToken": Specifies a page
  35289. // token to use. Set pageToken to the nextPageToken returned by a
  35290. // previous list request to get the next page of results.
  35291. func (c *BackendBucketsListCall) PageToken(pageToken string) *BackendBucketsListCall {
  35292. c.urlParams_.Set("pageToken", pageToken)
  35293. return c
  35294. }
  35295. // Fields allows partial responses to be retrieved. See
  35296. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35297. // for more information.
  35298. func (c *BackendBucketsListCall) Fields(s ...googleapi.Field) *BackendBucketsListCall {
  35299. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35300. return c
  35301. }
  35302. // IfNoneMatch sets the optional parameter which makes the operation
  35303. // fail if the object's ETag matches the given value. This is useful for
  35304. // getting updates only after the object has changed since the last
  35305. // request. Use googleapi.IsNotModified to check whether the response
  35306. // error from Do is the result of In-None-Match.
  35307. func (c *BackendBucketsListCall) IfNoneMatch(entityTag string) *BackendBucketsListCall {
  35308. c.ifNoneMatch_ = entityTag
  35309. return c
  35310. }
  35311. // Context sets the context to be used in this call's Do method. Any
  35312. // pending HTTP request will be aborted if the provided context is
  35313. // canceled.
  35314. func (c *BackendBucketsListCall) Context(ctx context.Context) *BackendBucketsListCall {
  35315. c.ctx_ = ctx
  35316. return c
  35317. }
  35318. // Header returns an http.Header that can be modified by the caller to
  35319. // add HTTP headers to the request.
  35320. func (c *BackendBucketsListCall) Header() http.Header {
  35321. if c.header_ == nil {
  35322. c.header_ = make(http.Header)
  35323. }
  35324. return c.header_
  35325. }
  35326. func (c *BackendBucketsListCall) doRequest(alt string) (*http.Response, error) {
  35327. reqHeaders := make(http.Header)
  35328. for k, v := range c.header_ {
  35329. reqHeaders[k] = v
  35330. }
  35331. reqHeaders.Set("User-Agent", c.s.userAgent())
  35332. if c.ifNoneMatch_ != "" {
  35333. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  35334. }
  35335. var body io.Reader = nil
  35336. c.urlParams_.Set("alt", alt)
  35337. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets")
  35338. urls += "?" + c.urlParams_.Encode()
  35339. req, _ := http.NewRequest("GET", urls, body)
  35340. req.Header = reqHeaders
  35341. googleapi.Expand(req.URL, map[string]string{
  35342. "project": c.project,
  35343. })
  35344. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35345. }
  35346. // Do executes the "compute.backendBuckets.list" call.
  35347. // Exactly one of *BackendBucketList or error will be non-nil. Any
  35348. // non-2xx status code is an error. Response headers are in either
  35349. // *BackendBucketList.ServerResponse.Header or (if a response was
  35350. // returned at all) in error.(*googleapi.Error).Header. Use
  35351. // googleapi.IsNotModified to check whether the returned error was
  35352. // because http.StatusNotModified was returned.
  35353. func (c *BackendBucketsListCall) Do(opts ...googleapi.CallOption) (*BackendBucketList, error) {
  35354. gensupport.SetOptions(c.urlParams_, opts...)
  35355. res, err := c.doRequest("json")
  35356. if res != nil && res.StatusCode == http.StatusNotModified {
  35357. if res.Body != nil {
  35358. res.Body.Close()
  35359. }
  35360. return nil, &googleapi.Error{
  35361. Code: res.StatusCode,
  35362. Header: res.Header,
  35363. }
  35364. }
  35365. if err != nil {
  35366. return nil, err
  35367. }
  35368. defer googleapi.CloseBody(res)
  35369. if err := googleapi.CheckResponse(res); err != nil {
  35370. return nil, err
  35371. }
  35372. ret := &BackendBucketList{
  35373. ServerResponse: googleapi.ServerResponse{
  35374. Header: res.Header,
  35375. HTTPStatusCode: res.StatusCode,
  35376. },
  35377. }
  35378. target := &ret
  35379. if err := gensupport.DecodeResponse(target, res); err != nil {
  35380. return nil, err
  35381. }
  35382. return ret, nil
  35383. // {
  35384. // "description": "Retrieves the list of BackendBucket resources available to the specified project.",
  35385. // "httpMethod": "GET",
  35386. // "id": "compute.backendBuckets.list",
  35387. // "parameterOrder": [
  35388. // "project"
  35389. // ],
  35390. // "parameters": {
  35391. // "filter": {
  35392. // "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).",
  35393. // "location": "query",
  35394. // "type": "string"
  35395. // },
  35396. // "maxResults": {
  35397. // "default": "500",
  35398. // "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)",
  35399. // "format": "uint32",
  35400. // "location": "query",
  35401. // "minimum": "0",
  35402. // "type": "integer"
  35403. // },
  35404. // "orderBy": {
  35405. // "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.",
  35406. // "location": "query",
  35407. // "type": "string"
  35408. // },
  35409. // "pageToken": {
  35410. // "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.",
  35411. // "location": "query",
  35412. // "type": "string"
  35413. // },
  35414. // "project": {
  35415. // "description": "Project ID for this request.",
  35416. // "location": "path",
  35417. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  35418. // "required": true,
  35419. // "type": "string"
  35420. // }
  35421. // },
  35422. // "path": "{project}/global/backendBuckets",
  35423. // "response": {
  35424. // "$ref": "BackendBucketList"
  35425. // },
  35426. // "scopes": [
  35427. // "https://www.googleapis.com/auth/cloud-platform",
  35428. // "https://www.googleapis.com/auth/compute",
  35429. // "https://www.googleapis.com/auth/compute.readonly"
  35430. // ]
  35431. // }
  35432. }
  35433. // Pages invokes f for each page of results.
  35434. // A non-nil error returned from f will halt the iteration.
  35435. // The provided context supersedes any context provided to the Context method.
  35436. func (c *BackendBucketsListCall) Pages(ctx context.Context, f func(*BackendBucketList) error) error {
  35437. c.ctx_ = ctx
  35438. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  35439. for {
  35440. x, err := c.Do()
  35441. if err != nil {
  35442. return err
  35443. }
  35444. if err := f(x); err != nil {
  35445. return err
  35446. }
  35447. if x.NextPageToken == "" {
  35448. return nil
  35449. }
  35450. c.PageToken(x.NextPageToken)
  35451. }
  35452. }
  35453. // method id "compute.backendBuckets.patch":
  35454. type BackendBucketsPatchCall struct {
  35455. s *Service
  35456. project string
  35457. backendBucket string
  35458. backendbucket *BackendBucket
  35459. urlParams_ gensupport.URLParams
  35460. ctx_ context.Context
  35461. header_ http.Header
  35462. }
  35463. // Patch: Updates the specified BackendBucket resource with the data
  35464. // included in the request. This method supports PATCH semantics and
  35465. // uses the JSON merge patch format and processing rules.
  35466. func (r *BackendBucketsService) Patch(project string, backendBucket string, backendbucket *BackendBucket) *BackendBucketsPatchCall {
  35467. c := &BackendBucketsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35468. c.project = project
  35469. c.backendBucket = backendBucket
  35470. c.backendbucket = backendbucket
  35471. return c
  35472. }
  35473. // RequestId sets the optional parameter "requestId": An optional
  35474. // request ID to identify requests. Specify a unique request ID so that
  35475. // if you must retry your request, the server will know to ignore the
  35476. // request if it has already been completed.
  35477. //
  35478. // For example, consider a situation where you make an initial request
  35479. // and the request times out. If you make the request again with the
  35480. // same request ID, the server can check if original operation with the
  35481. // same request ID was received, and if so, will ignore the second
  35482. // request. This prevents clients from accidentally creating duplicate
  35483. // commitments.
  35484. //
  35485. // The request ID must be a valid UUID with the exception that zero UUID
  35486. // is not supported (00000000-0000-0000-0000-000000000000).
  35487. func (c *BackendBucketsPatchCall) RequestId(requestId string) *BackendBucketsPatchCall {
  35488. c.urlParams_.Set("requestId", requestId)
  35489. return c
  35490. }
  35491. // Fields allows partial responses to be retrieved. See
  35492. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35493. // for more information.
  35494. func (c *BackendBucketsPatchCall) Fields(s ...googleapi.Field) *BackendBucketsPatchCall {
  35495. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35496. return c
  35497. }
  35498. // Context sets the context to be used in this call's Do method. Any
  35499. // pending HTTP request will be aborted if the provided context is
  35500. // canceled.
  35501. func (c *BackendBucketsPatchCall) Context(ctx context.Context) *BackendBucketsPatchCall {
  35502. c.ctx_ = ctx
  35503. return c
  35504. }
  35505. // Header returns an http.Header that can be modified by the caller to
  35506. // add HTTP headers to the request.
  35507. func (c *BackendBucketsPatchCall) Header() http.Header {
  35508. if c.header_ == nil {
  35509. c.header_ = make(http.Header)
  35510. }
  35511. return c.header_
  35512. }
  35513. func (c *BackendBucketsPatchCall) doRequest(alt string) (*http.Response, error) {
  35514. reqHeaders := make(http.Header)
  35515. for k, v := range c.header_ {
  35516. reqHeaders[k] = v
  35517. }
  35518. reqHeaders.Set("User-Agent", c.s.userAgent())
  35519. var body io.Reader = nil
  35520. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendbucket)
  35521. if err != nil {
  35522. return nil, err
  35523. }
  35524. reqHeaders.Set("Content-Type", "application/json")
  35525. c.urlParams_.Set("alt", alt)
  35526. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{backendBucket}")
  35527. urls += "?" + c.urlParams_.Encode()
  35528. req, _ := http.NewRequest("PATCH", urls, body)
  35529. req.Header = reqHeaders
  35530. googleapi.Expand(req.URL, map[string]string{
  35531. "project": c.project,
  35532. "backendBucket": c.backendBucket,
  35533. })
  35534. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35535. }
  35536. // Do executes the "compute.backendBuckets.patch" call.
  35537. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  35538. // status code is an error. Response headers are in either
  35539. // *Operation.ServerResponse.Header or (if a response was returned at
  35540. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  35541. // to check whether the returned error was because
  35542. // http.StatusNotModified was returned.
  35543. func (c *BackendBucketsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  35544. gensupport.SetOptions(c.urlParams_, opts...)
  35545. res, err := c.doRequest("json")
  35546. if res != nil && res.StatusCode == http.StatusNotModified {
  35547. if res.Body != nil {
  35548. res.Body.Close()
  35549. }
  35550. return nil, &googleapi.Error{
  35551. Code: res.StatusCode,
  35552. Header: res.Header,
  35553. }
  35554. }
  35555. if err != nil {
  35556. return nil, err
  35557. }
  35558. defer googleapi.CloseBody(res)
  35559. if err := googleapi.CheckResponse(res); err != nil {
  35560. return nil, err
  35561. }
  35562. ret := &Operation{
  35563. ServerResponse: googleapi.ServerResponse{
  35564. Header: res.Header,
  35565. HTTPStatusCode: res.StatusCode,
  35566. },
  35567. }
  35568. target := &ret
  35569. if err := gensupport.DecodeResponse(target, res); err != nil {
  35570. return nil, err
  35571. }
  35572. return ret, nil
  35573. // {
  35574. // "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.",
  35575. // "httpMethod": "PATCH",
  35576. // "id": "compute.backendBuckets.patch",
  35577. // "parameterOrder": [
  35578. // "project",
  35579. // "backendBucket"
  35580. // ],
  35581. // "parameters": {
  35582. // "backendBucket": {
  35583. // "description": "Name of the BackendBucket resource to patch.",
  35584. // "location": "path",
  35585. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  35586. // "required": true,
  35587. // "type": "string"
  35588. // },
  35589. // "project": {
  35590. // "description": "Project ID for this request.",
  35591. // "location": "path",
  35592. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  35593. // "required": true,
  35594. // "type": "string"
  35595. // },
  35596. // "requestId": {
  35597. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  35598. // "location": "query",
  35599. // "type": "string"
  35600. // }
  35601. // },
  35602. // "path": "{project}/global/backendBuckets/{backendBucket}",
  35603. // "request": {
  35604. // "$ref": "BackendBucket"
  35605. // },
  35606. // "response": {
  35607. // "$ref": "Operation"
  35608. // },
  35609. // "scopes": [
  35610. // "https://www.googleapis.com/auth/cloud-platform",
  35611. // "https://www.googleapis.com/auth/compute"
  35612. // ]
  35613. // }
  35614. }
  35615. // method id "compute.backendBuckets.setIamPolicy":
  35616. type BackendBucketsSetIamPolicyCall struct {
  35617. s *Service
  35618. project string
  35619. resource string
  35620. globalsetpolicyrequest *GlobalSetPolicyRequest
  35621. urlParams_ gensupport.URLParams
  35622. ctx_ context.Context
  35623. header_ http.Header
  35624. }
  35625. // SetIamPolicy: Sets the access control policy on the specified
  35626. // resource. Replaces any existing policy.
  35627. func (r *BackendBucketsService) SetIamPolicy(project string, resource string, globalsetpolicyrequest *GlobalSetPolicyRequest) *BackendBucketsSetIamPolicyCall {
  35628. c := &BackendBucketsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35629. c.project = project
  35630. c.resource = resource
  35631. c.globalsetpolicyrequest = globalsetpolicyrequest
  35632. return c
  35633. }
  35634. // Fields allows partial responses to be retrieved. See
  35635. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35636. // for more information.
  35637. func (c *BackendBucketsSetIamPolicyCall) Fields(s ...googleapi.Field) *BackendBucketsSetIamPolicyCall {
  35638. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35639. return c
  35640. }
  35641. // Context sets the context to be used in this call's Do method. Any
  35642. // pending HTTP request will be aborted if the provided context is
  35643. // canceled.
  35644. func (c *BackendBucketsSetIamPolicyCall) Context(ctx context.Context) *BackendBucketsSetIamPolicyCall {
  35645. c.ctx_ = ctx
  35646. return c
  35647. }
  35648. // Header returns an http.Header that can be modified by the caller to
  35649. // add HTTP headers to the request.
  35650. func (c *BackendBucketsSetIamPolicyCall) Header() http.Header {
  35651. if c.header_ == nil {
  35652. c.header_ = make(http.Header)
  35653. }
  35654. return c.header_
  35655. }
  35656. func (c *BackendBucketsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  35657. reqHeaders := make(http.Header)
  35658. for k, v := range c.header_ {
  35659. reqHeaders[k] = v
  35660. }
  35661. reqHeaders.Set("User-Agent", c.s.userAgent())
  35662. var body io.Reader = nil
  35663. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest)
  35664. if err != nil {
  35665. return nil, err
  35666. }
  35667. reqHeaders.Set("Content-Type", "application/json")
  35668. c.urlParams_.Set("alt", alt)
  35669. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{resource}/setIamPolicy")
  35670. urls += "?" + c.urlParams_.Encode()
  35671. req, _ := http.NewRequest("POST", urls, body)
  35672. req.Header = reqHeaders
  35673. googleapi.Expand(req.URL, map[string]string{
  35674. "project": c.project,
  35675. "resource": c.resource,
  35676. })
  35677. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35678. }
  35679. // Do executes the "compute.backendBuckets.setIamPolicy" call.
  35680. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  35681. // code is an error. Response headers are in either
  35682. // *Policy.ServerResponse.Header or (if a response was returned at all)
  35683. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  35684. // check whether the returned error was because http.StatusNotModified
  35685. // was returned.
  35686. func (c *BackendBucketsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  35687. gensupport.SetOptions(c.urlParams_, opts...)
  35688. res, err := c.doRequest("json")
  35689. if res != nil && res.StatusCode == http.StatusNotModified {
  35690. if res.Body != nil {
  35691. res.Body.Close()
  35692. }
  35693. return nil, &googleapi.Error{
  35694. Code: res.StatusCode,
  35695. Header: res.Header,
  35696. }
  35697. }
  35698. if err != nil {
  35699. return nil, err
  35700. }
  35701. defer googleapi.CloseBody(res)
  35702. if err := googleapi.CheckResponse(res); err != nil {
  35703. return nil, err
  35704. }
  35705. ret := &Policy{
  35706. ServerResponse: googleapi.ServerResponse{
  35707. Header: res.Header,
  35708. HTTPStatusCode: res.StatusCode,
  35709. },
  35710. }
  35711. target := &ret
  35712. if err := gensupport.DecodeResponse(target, res); err != nil {
  35713. return nil, err
  35714. }
  35715. return ret, nil
  35716. // {
  35717. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  35718. // "httpMethod": "POST",
  35719. // "id": "compute.backendBuckets.setIamPolicy",
  35720. // "parameterOrder": [
  35721. // "project",
  35722. // "resource"
  35723. // ],
  35724. // "parameters": {
  35725. // "project": {
  35726. // "description": "Project ID for this request.",
  35727. // "location": "path",
  35728. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  35729. // "required": true,
  35730. // "type": "string"
  35731. // },
  35732. // "resource": {
  35733. // "description": "Name of the resource for this request.",
  35734. // "location": "path",
  35735. // "pattern": "[a-z0-9](?:[-a-z0-9_]{0,61}[a-z0-9])?",
  35736. // "required": true,
  35737. // "type": "string"
  35738. // }
  35739. // },
  35740. // "path": "{project}/global/backendBuckets/{resource}/setIamPolicy",
  35741. // "request": {
  35742. // "$ref": "GlobalSetPolicyRequest"
  35743. // },
  35744. // "response": {
  35745. // "$ref": "Policy"
  35746. // },
  35747. // "scopes": [
  35748. // "https://www.googleapis.com/auth/cloud-platform",
  35749. // "https://www.googleapis.com/auth/compute"
  35750. // ]
  35751. // }
  35752. }
  35753. // method id "compute.backendBuckets.testIamPermissions":
  35754. type BackendBucketsTestIamPermissionsCall struct {
  35755. s *Service
  35756. project string
  35757. resource string
  35758. testpermissionsrequest *TestPermissionsRequest
  35759. urlParams_ gensupport.URLParams
  35760. ctx_ context.Context
  35761. header_ http.Header
  35762. }
  35763. // TestIamPermissions: Returns permissions that a caller has on the
  35764. // specified resource.
  35765. func (r *BackendBucketsService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *BackendBucketsTestIamPermissionsCall {
  35766. c := &BackendBucketsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35767. c.project = project
  35768. c.resource = resource
  35769. c.testpermissionsrequest = testpermissionsrequest
  35770. return c
  35771. }
  35772. // Fields allows partial responses to be retrieved. See
  35773. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35774. // for more information.
  35775. func (c *BackendBucketsTestIamPermissionsCall) Fields(s ...googleapi.Field) *BackendBucketsTestIamPermissionsCall {
  35776. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35777. return c
  35778. }
  35779. // Context sets the context to be used in this call's Do method. Any
  35780. // pending HTTP request will be aborted if the provided context is
  35781. // canceled.
  35782. func (c *BackendBucketsTestIamPermissionsCall) Context(ctx context.Context) *BackendBucketsTestIamPermissionsCall {
  35783. c.ctx_ = ctx
  35784. return c
  35785. }
  35786. // Header returns an http.Header that can be modified by the caller to
  35787. // add HTTP headers to the request.
  35788. func (c *BackendBucketsTestIamPermissionsCall) Header() http.Header {
  35789. if c.header_ == nil {
  35790. c.header_ = make(http.Header)
  35791. }
  35792. return c.header_
  35793. }
  35794. func (c *BackendBucketsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  35795. reqHeaders := make(http.Header)
  35796. for k, v := range c.header_ {
  35797. reqHeaders[k] = v
  35798. }
  35799. reqHeaders.Set("User-Agent", c.s.userAgent())
  35800. var body io.Reader = nil
  35801. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  35802. if err != nil {
  35803. return nil, err
  35804. }
  35805. reqHeaders.Set("Content-Type", "application/json")
  35806. c.urlParams_.Set("alt", alt)
  35807. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{resource}/testIamPermissions")
  35808. urls += "?" + c.urlParams_.Encode()
  35809. req, _ := http.NewRequest("POST", urls, body)
  35810. req.Header = reqHeaders
  35811. googleapi.Expand(req.URL, map[string]string{
  35812. "project": c.project,
  35813. "resource": c.resource,
  35814. })
  35815. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35816. }
  35817. // Do executes the "compute.backendBuckets.testIamPermissions" call.
  35818. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  35819. // non-2xx status code is an error. Response headers are in either
  35820. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  35821. // returned at all) in error.(*googleapi.Error).Header. Use
  35822. // googleapi.IsNotModified to check whether the returned error was
  35823. // because http.StatusNotModified was returned.
  35824. func (c *BackendBucketsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  35825. gensupport.SetOptions(c.urlParams_, opts...)
  35826. res, err := c.doRequest("json")
  35827. if res != nil && res.StatusCode == http.StatusNotModified {
  35828. if res.Body != nil {
  35829. res.Body.Close()
  35830. }
  35831. return nil, &googleapi.Error{
  35832. Code: res.StatusCode,
  35833. Header: res.Header,
  35834. }
  35835. }
  35836. if err != nil {
  35837. return nil, err
  35838. }
  35839. defer googleapi.CloseBody(res)
  35840. if err := googleapi.CheckResponse(res); err != nil {
  35841. return nil, err
  35842. }
  35843. ret := &TestPermissionsResponse{
  35844. ServerResponse: googleapi.ServerResponse{
  35845. Header: res.Header,
  35846. HTTPStatusCode: res.StatusCode,
  35847. },
  35848. }
  35849. target := &ret
  35850. if err := gensupport.DecodeResponse(target, res); err != nil {
  35851. return nil, err
  35852. }
  35853. return ret, nil
  35854. // {
  35855. // "description": "Returns permissions that a caller has on the specified resource.",
  35856. // "httpMethod": "POST",
  35857. // "id": "compute.backendBuckets.testIamPermissions",
  35858. // "parameterOrder": [
  35859. // "project",
  35860. // "resource"
  35861. // ],
  35862. // "parameters": {
  35863. // "project": {
  35864. // "description": "Project ID for this request.",
  35865. // "location": "path",
  35866. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  35867. // "required": true,
  35868. // "type": "string"
  35869. // },
  35870. // "resource": {
  35871. // "description": "Name of the resource for this request.",
  35872. // "location": "path",
  35873. // "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?",
  35874. // "required": true,
  35875. // "type": "string"
  35876. // }
  35877. // },
  35878. // "path": "{project}/global/backendBuckets/{resource}/testIamPermissions",
  35879. // "request": {
  35880. // "$ref": "TestPermissionsRequest"
  35881. // },
  35882. // "response": {
  35883. // "$ref": "TestPermissionsResponse"
  35884. // },
  35885. // "scopes": [
  35886. // "https://www.googleapis.com/auth/cloud-platform",
  35887. // "https://www.googleapis.com/auth/compute",
  35888. // "https://www.googleapis.com/auth/compute.readonly"
  35889. // ]
  35890. // }
  35891. }
  35892. // method id "compute.backendBuckets.update":
  35893. type BackendBucketsUpdateCall struct {
  35894. s *Service
  35895. project string
  35896. backendBucket string
  35897. backendbucket *BackendBucket
  35898. urlParams_ gensupport.URLParams
  35899. ctx_ context.Context
  35900. header_ http.Header
  35901. }
  35902. // Update: Updates the specified BackendBucket resource with the data
  35903. // included in the request.
  35904. func (r *BackendBucketsService) Update(project string, backendBucket string, backendbucket *BackendBucket) *BackendBucketsUpdateCall {
  35905. c := &BackendBucketsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35906. c.project = project
  35907. c.backendBucket = backendBucket
  35908. c.backendbucket = backendbucket
  35909. return c
  35910. }
  35911. // RequestId sets the optional parameter "requestId": An optional
  35912. // request ID to identify requests. Specify a unique request ID so that
  35913. // if you must retry your request, the server will know to ignore the
  35914. // request if it has already been completed.
  35915. //
  35916. // For example, consider a situation where you make an initial request
  35917. // and the request times out. If you make the request again with the
  35918. // same request ID, the server can check if original operation with the
  35919. // same request ID was received, and if so, will ignore the second
  35920. // request. This prevents clients from accidentally creating duplicate
  35921. // commitments.
  35922. //
  35923. // The request ID must be a valid UUID with the exception that zero UUID
  35924. // is not supported (00000000-0000-0000-0000-000000000000).
  35925. func (c *BackendBucketsUpdateCall) RequestId(requestId string) *BackendBucketsUpdateCall {
  35926. c.urlParams_.Set("requestId", requestId)
  35927. return c
  35928. }
  35929. // Fields allows partial responses to be retrieved. See
  35930. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35931. // for more information.
  35932. func (c *BackendBucketsUpdateCall) Fields(s ...googleapi.Field) *BackendBucketsUpdateCall {
  35933. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35934. return c
  35935. }
  35936. // Context sets the context to be used in this call's Do method. Any
  35937. // pending HTTP request will be aborted if the provided context is
  35938. // canceled.
  35939. func (c *BackendBucketsUpdateCall) Context(ctx context.Context) *BackendBucketsUpdateCall {
  35940. c.ctx_ = ctx
  35941. return c
  35942. }
  35943. // Header returns an http.Header that can be modified by the caller to
  35944. // add HTTP headers to the request.
  35945. func (c *BackendBucketsUpdateCall) Header() http.Header {
  35946. if c.header_ == nil {
  35947. c.header_ = make(http.Header)
  35948. }
  35949. return c.header_
  35950. }
  35951. func (c *BackendBucketsUpdateCall) doRequest(alt string) (*http.Response, error) {
  35952. reqHeaders := make(http.Header)
  35953. for k, v := range c.header_ {
  35954. reqHeaders[k] = v
  35955. }
  35956. reqHeaders.Set("User-Agent", c.s.userAgent())
  35957. var body io.Reader = nil
  35958. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendbucket)
  35959. if err != nil {
  35960. return nil, err
  35961. }
  35962. reqHeaders.Set("Content-Type", "application/json")
  35963. c.urlParams_.Set("alt", alt)
  35964. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{backendBucket}")
  35965. urls += "?" + c.urlParams_.Encode()
  35966. req, _ := http.NewRequest("PUT", urls, body)
  35967. req.Header = reqHeaders
  35968. googleapi.Expand(req.URL, map[string]string{
  35969. "project": c.project,
  35970. "backendBucket": c.backendBucket,
  35971. })
  35972. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35973. }
  35974. // Do executes the "compute.backendBuckets.update" call.
  35975. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  35976. // status code is an error. Response headers are in either
  35977. // *Operation.ServerResponse.Header or (if a response was returned at
  35978. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  35979. // to check whether the returned error was because
  35980. // http.StatusNotModified was returned.
  35981. func (c *BackendBucketsUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  35982. gensupport.SetOptions(c.urlParams_, opts...)
  35983. res, err := c.doRequest("json")
  35984. if res != nil && res.StatusCode == http.StatusNotModified {
  35985. if res.Body != nil {
  35986. res.Body.Close()
  35987. }
  35988. return nil, &googleapi.Error{
  35989. Code: res.StatusCode,
  35990. Header: res.Header,
  35991. }
  35992. }
  35993. if err != nil {
  35994. return nil, err
  35995. }
  35996. defer googleapi.CloseBody(res)
  35997. if err := googleapi.CheckResponse(res); err != nil {
  35998. return nil, err
  35999. }
  36000. ret := &Operation{
  36001. ServerResponse: googleapi.ServerResponse{
  36002. Header: res.Header,
  36003. HTTPStatusCode: res.StatusCode,
  36004. },
  36005. }
  36006. target := &ret
  36007. if err := gensupport.DecodeResponse(target, res); err != nil {
  36008. return nil, err
  36009. }
  36010. return ret, nil
  36011. // {
  36012. // "description": "Updates the specified BackendBucket resource with the data included in the request.",
  36013. // "httpMethod": "PUT",
  36014. // "id": "compute.backendBuckets.update",
  36015. // "parameterOrder": [
  36016. // "project",
  36017. // "backendBucket"
  36018. // ],
  36019. // "parameters": {
  36020. // "backendBucket": {
  36021. // "description": "Name of the BackendBucket resource to update.",
  36022. // "location": "path",
  36023. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  36024. // "required": true,
  36025. // "type": "string"
  36026. // },
  36027. // "project": {
  36028. // "description": "Project ID for this request.",
  36029. // "location": "path",
  36030. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  36031. // "required": true,
  36032. // "type": "string"
  36033. // },
  36034. // "requestId": {
  36035. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  36036. // "location": "query",
  36037. // "type": "string"
  36038. // }
  36039. // },
  36040. // "path": "{project}/global/backendBuckets/{backendBucket}",
  36041. // "request": {
  36042. // "$ref": "BackendBucket"
  36043. // },
  36044. // "response": {
  36045. // "$ref": "Operation"
  36046. // },
  36047. // "scopes": [
  36048. // "https://www.googleapis.com/auth/cloud-platform",
  36049. // "https://www.googleapis.com/auth/compute"
  36050. // ]
  36051. // }
  36052. }
  36053. // method id "compute.backendServices.addSignedUrlKey":
  36054. type BackendServicesAddSignedUrlKeyCall struct {
  36055. s *Service
  36056. project string
  36057. backendService string
  36058. signedurlkey *SignedUrlKey
  36059. urlParams_ gensupport.URLParams
  36060. ctx_ context.Context
  36061. header_ http.Header
  36062. }
  36063. // AddSignedUrlKey: Adds the given Signed URL Key to the specified
  36064. // backend service.
  36065. func (r *BackendServicesService) AddSignedUrlKey(project string, backendService string, signedurlkey *SignedUrlKey) *BackendServicesAddSignedUrlKeyCall {
  36066. c := &BackendServicesAddSignedUrlKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36067. c.project = project
  36068. c.backendService = backendService
  36069. c.signedurlkey = signedurlkey
  36070. return c
  36071. }
  36072. // RequestId sets the optional parameter "requestId": An optional
  36073. // request ID to identify requests. Specify a unique request ID so that
  36074. // if you must retry your request, the server will know to ignore the
  36075. // request if it has already been completed.
  36076. //
  36077. // For example, consider a situation where you make an initial request
  36078. // and the request times out. If you make the request again with the
  36079. // same request ID, the server can check if original operation with the
  36080. // same request ID was received, and if so, will ignore the second
  36081. // request. This prevents clients from accidentally creating duplicate
  36082. // commitments.
  36083. //
  36084. // The request ID must be a valid UUID with the exception that zero UUID
  36085. // is not supported (00000000-0000-0000-0000-000000000000).
  36086. func (c *BackendServicesAddSignedUrlKeyCall) RequestId(requestId string) *BackendServicesAddSignedUrlKeyCall {
  36087. c.urlParams_.Set("requestId", requestId)
  36088. return c
  36089. }
  36090. // Fields allows partial responses to be retrieved. See
  36091. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36092. // for more information.
  36093. func (c *BackendServicesAddSignedUrlKeyCall) Fields(s ...googleapi.Field) *BackendServicesAddSignedUrlKeyCall {
  36094. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36095. return c
  36096. }
  36097. // Context sets the context to be used in this call's Do method. Any
  36098. // pending HTTP request will be aborted if the provided context is
  36099. // canceled.
  36100. func (c *BackendServicesAddSignedUrlKeyCall) Context(ctx context.Context) *BackendServicesAddSignedUrlKeyCall {
  36101. c.ctx_ = ctx
  36102. return c
  36103. }
  36104. // Header returns an http.Header that can be modified by the caller to
  36105. // add HTTP headers to the request.
  36106. func (c *BackendServicesAddSignedUrlKeyCall) Header() http.Header {
  36107. if c.header_ == nil {
  36108. c.header_ = make(http.Header)
  36109. }
  36110. return c.header_
  36111. }
  36112. func (c *BackendServicesAddSignedUrlKeyCall) doRequest(alt string) (*http.Response, error) {
  36113. reqHeaders := make(http.Header)
  36114. for k, v := range c.header_ {
  36115. reqHeaders[k] = v
  36116. }
  36117. reqHeaders.Set("User-Agent", c.s.userAgent())
  36118. var body io.Reader = nil
  36119. body, err := googleapi.WithoutDataWrapper.JSONReader(c.signedurlkey)
  36120. if err != nil {
  36121. return nil, err
  36122. }
  36123. reqHeaders.Set("Content-Type", "application/json")
  36124. c.urlParams_.Set("alt", alt)
  36125. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}/addSignedUrlKey")
  36126. urls += "?" + c.urlParams_.Encode()
  36127. req, _ := http.NewRequest("POST", urls, body)
  36128. req.Header = reqHeaders
  36129. googleapi.Expand(req.URL, map[string]string{
  36130. "project": c.project,
  36131. "backendService": c.backendService,
  36132. })
  36133. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36134. }
  36135. // Do executes the "compute.backendServices.addSignedUrlKey" call.
  36136. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  36137. // status code is an error. Response headers are in either
  36138. // *Operation.ServerResponse.Header or (if a response was returned at
  36139. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  36140. // to check whether the returned error was because
  36141. // http.StatusNotModified was returned.
  36142. func (c *BackendServicesAddSignedUrlKeyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  36143. gensupport.SetOptions(c.urlParams_, opts...)
  36144. res, err := c.doRequest("json")
  36145. if res != nil && res.StatusCode == http.StatusNotModified {
  36146. if res.Body != nil {
  36147. res.Body.Close()
  36148. }
  36149. return nil, &googleapi.Error{
  36150. Code: res.StatusCode,
  36151. Header: res.Header,
  36152. }
  36153. }
  36154. if err != nil {
  36155. return nil, err
  36156. }
  36157. defer googleapi.CloseBody(res)
  36158. if err := googleapi.CheckResponse(res); err != nil {
  36159. return nil, err
  36160. }
  36161. ret := &Operation{
  36162. ServerResponse: googleapi.ServerResponse{
  36163. Header: res.Header,
  36164. HTTPStatusCode: res.StatusCode,
  36165. },
  36166. }
  36167. target := &ret
  36168. if err := gensupport.DecodeResponse(target, res); err != nil {
  36169. return nil, err
  36170. }
  36171. return ret, nil
  36172. // {
  36173. // "description": "Adds the given Signed URL Key to the specified backend service.",
  36174. // "httpMethod": "POST",
  36175. // "id": "compute.backendServices.addSignedUrlKey",
  36176. // "parameterOrder": [
  36177. // "project",
  36178. // "backendService"
  36179. // ],
  36180. // "parameters": {
  36181. // "backendService": {
  36182. // "description": "Name of the BackendService resource to which the Signed URL Key should be added. The name should conform to RFC1035.",
  36183. // "location": "path",
  36184. // "required": true,
  36185. // "type": "string"
  36186. // },
  36187. // "project": {
  36188. // "description": "Project ID for this request.",
  36189. // "location": "path",
  36190. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  36191. // "required": true,
  36192. // "type": "string"
  36193. // },
  36194. // "requestId": {
  36195. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  36196. // "location": "query",
  36197. // "type": "string"
  36198. // }
  36199. // },
  36200. // "path": "{project}/global/backendServices/{backendService}/addSignedUrlKey",
  36201. // "request": {
  36202. // "$ref": "SignedUrlKey"
  36203. // },
  36204. // "response": {
  36205. // "$ref": "Operation"
  36206. // },
  36207. // "scopes": [
  36208. // "https://www.googleapis.com/auth/cloud-platform",
  36209. // "https://www.googleapis.com/auth/compute"
  36210. // ]
  36211. // }
  36212. }
  36213. // method id "compute.backendServices.aggregatedList":
  36214. type BackendServicesAggregatedListCall struct {
  36215. s *Service
  36216. project string
  36217. urlParams_ gensupport.URLParams
  36218. ifNoneMatch_ string
  36219. ctx_ context.Context
  36220. header_ http.Header
  36221. }
  36222. // AggregatedList: Retrieves the list of all BackendService resources,
  36223. // regional and global, available to the specified project.
  36224. func (r *BackendServicesService) AggregatedList(project string) *BackendServicesAggregatedListCall {
  36225. c := &BackendServicesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36226. c.project = project
  36227. return c
  36228. }
  36229. // Filter sets the optional parameter "filter": A filter expression that
  36230. // filters resources listed in the response. The expression must specify
  36231. // the field name, a comparison operator, and the value that you want to
  36232. // use for filtering. The value must be a string, a number, or a
  36233. // boolean. The comparison operator must be either =, !=, >, or <.
  36234. //
  36235. // For example, if you are filtering Compute Engine instances, you can
  36236. // exclude instances named example-instance by specifying name !=
  36237. // example-instance.
  36238. //
  36239. // You can also filter nested fields. For example, you could specify
  36240. // scheduling.automaticRestart = false to include instances only if they
  36241. // are not scheduled for automatic restarts. You can use filtering on
  36242. // nested fields to filter based on resource labels.
  36243. //
  36244. // To filter on multiple expressions, provide each separate expression
  36245. // within parentheses. For example, (scheduling.automaticRestart = true)
  36246. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  36247. // AND expression. However, you can include AND and OR expressions
  36248. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  36249. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  36250. // true).
  36251. func (c *BackendServicesAggregatedListCall) Filter(filter string) *BackendServicesAggregatedListCall {
  36252. c.urlParams_.Set("filter", filter)
  36253. return c
  36254. }
  36255. // MaxResults sets the optional parameter "maxResults": The maximum
  36256. // number of results per page that should be returned. If the number of
  36257. // available results is larger than maxResults, Compute Engine returns a
  36258. // nextPageToken that can be used to get the next page of results in
  36259. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  36260. // (Default: 500)
  36261. func (c *BackendServicesAggregatedListCall) MaxResults(maxResults int64) *BackendServicesAggregatedListCall {
  36262. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  36263. return c
  36264. }
  36265. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  36266. // a certain order. By default, results are returned in alphanumerical
  36267. // order based on the resource name.
  36268. //
  36269. // You can also sort results in descending order based on the creation
  36270. // timestamp using orderBy="creationTimestamp desc". This sorts results
  36271. // based on the creationTimestamp field in reverse chronological order
  36272. // (newest result first). Use this to sort resources like operations so
  36273. // that the newest operation is returned first.
  36274. //
  36275. // Currently, only sorting by name or creationTimestamp desc is
  36276. // supported.
  36277. func (c *BackendServicesAggregatedListCall) OrderBy(orderBy string) *BackendServicesAggregatedListCall {
  36278. c.urlParams_.Set("orderBy", orderBy)
  36279. return c
  36280. }
  36281. // PageToken sets the optional parameter "pageToken": Specifies a page
  36282. // token to use. Set pageToken to the nextPageToken returned by a
  36283. // previous list request to get the next page of results.
  36284. func (c *BackendServicesAggregatedListCall) PageToken(pageToken string) *BackendServicesAggregatedListCall {
  36285. c.urlParams_.Set("pageToken", pageToken)
  36286. return c
  36287. }
  36288. // Fields allows partial responses to be retrieved. See
  36289. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36290. // for more information.
  36291. func (c *BackendServicesAggregatedListCall) Fields(s ...googleapi.Field) *BackendServicesAggregatedListCall {
  36292. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36293. return c
  36294. }
  36295. // IfNoneMatch sets the optional parameter which makes the operation
  36296. // fail if the object's ETag matches the given value. This is useful for
  36297. // getting updates only after the object has changed since the last
  36298. // request. Use googleapi.IsNotModified to check whether the response
  36299. // error from Do is the result of In-None-Match.
  36300. func (c *BackendServicesAggregatedListCall) IfNoneMatch(entityTag string) *BackendServicesAggregatedListCall {
  36301. c.ifNoneMatch_ = entityTag
  36302. return c
  36303. }
  36304. // Context sets the context to be used in this call's Do method. Any
  36305. // pending HTTP request will be aborted if the provided context is
  36306. // canceled.
  36307. func (c *BackendServicesAggregatedListCall) Context(ctx context.Context) *BackendServicesAggregatedListCall {
  36308. c.ctx_ = ctx
  36309. return c
  36310. }
  36311. // Header returns an http.Header that can be modified by the caller to
  36312. // add HTTP headers to the request.
  36313. func (c *BackendServicesAggregatedListCall) Header() http.Header {
  36314. if c.header_ == nil {
  36315. c.header_ = make(http.Header)
  36316. }
  36317. return c.header_
  36318. }
  36319. func (c *BackendServicesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  36320. reqHeaders := make(http.Header)
  36321. for k, v := range c.header_ {
  36322. reqHeaders[k] = v
  36323. }
  36324. reqHeaders.Set("User-Agent", c.s.userAgent())
  36325. if c.ifNoneMatch_ != "" {
  36326. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  36327. }
  36328. var body io.Reader = nil
  36329. c.urlParams_.Set("alt", alt)
  36330. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/backendServices")
  36331. urls += "?" + c.urlParams_.Encode()
  36332. req, _ := http.NewRequest("GET", urls, body)
  36333. req.Header = reqHeaders
  36334. googleapi.Expand(req.URL, map[string]string{
  36335. "project": c.project,
  36336. })
  36337. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36338. }
  36339. // Do executes the "compute.backendServices.aggregatedList" call.
  36340. // Exactly one of *BackendServiceAggregatedList or error will be
  36341. // non-nil. Any non-2xx status code is an error. Response headers are in
  36342. // either *BackendServiceAggregatedList.ServerResponse.Header or (if a
  36343. // response was returned at all) in error.(*googleapi.Error).Header. Use
  36344. // googleapi.IsNotModified to check whether the returned error was
  36345. // because http.StatusNotModified was returned.
  36346. func (c *BackendServicesAggregatedListCall) Do(opts ...googleapi.CallOption) (*BackendServiceAggregatedList, error) {
  36347. gensupport.SetOptions(c.urlParams_, opts...)
  36348. res, err := c.doRequest("json")
  36349. if res != nil && res.StatusCode == http.StatusNotModified {
  36350. if res.Body != nil {
  36351. res.Body.Close()
  36352. }
  36353. return nil, &googleapi.Error{
  36354. Code: res.StatusCode,
  36355. Header: res.Header,
  36356. }
  36357. }
  36358. if err != nil {
  36359. return nil, err
  36360. }
  36361. defer googleapi.CloseBody(res)
  36362. if err := googleapi.CheckResponse(res); err != nil {
  36363. return nil, err
  36364. }
  36365. ret := &BackendServiceAggregatedList{
  36366. ServerResponse: googleapi.ServerResponse{
  36367. Header: res.Header,
  36368. HTTPStatusCode: res.StatusCode,
  36369. },
  36370. }
  36371. target := &ret
  36372. if err := gensupport.DecodeResponse(target, res); err != nil {
  36373. return nil, err
  36374. }
  36375. return ret, nil
  36376. // {
  36377. // "description": "Retrieves the list of all BackendService resources, regional and global, available to the specified project.",
  36378. // "httpMethod": "GET",
  36379. // "id": "compute.backendServices.aggregatedList",
  36380. // "parameterOrder": [
  36381. // "project"
  36382. // ],
  36383. // "parameters": {
  36384. // "filter": {
  36385. // "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).",
  36386. // "location": "query",
  36387. // "type": "string"
  36388. // },
  36389. // "maxResults": {
  36390. // "default": "500",
  36391. // "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)",
  36392. // "format": "uint32",
  36393. // "location": "query",
  36394. // "minimum": "0",
  36395. // "type": "integer"
  36396. // },
  36397. // "orderBy": {
  36398. // "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.",
  36399. // "location": "query",
  36400. // "type": "string"
  36401. // },
  36402. // "pageToken": {
  36403. // "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.",
  36404. // "location": "query",
  36405. // "type": "string"
  36406. // },
  36407. // "project": {
  36408. // "description": "Name of the project scoping this request.",
  36409. // "location": "path",
  36410. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  36411. // "required": true,
  36412. // "type": "string"
  36413. // }
  36414. // },
  36415. // "path": "{project}/aggregated/backendServices",
  36416. // "response": {
  36417. // "$ref": "BackendServiceAggregatedList"
  36418. // },
  36419. // "scopes": [
  36420. // "https://www.googleapis.com/auth/cloud-platform",
  36421. // "https://www.googleapis.com/auth/compute",
  36422. // "https://www.googleapis.com/auth/compute.readonly"
  36423. // ]
  36424. // }
  36425. }
  36426. // Pages invokes f for each page of results.
  36427. // A non-nil error returned from f will halt the iteration.
  36428. // The provided context supersedes any context provided to the Context method.
  36429. func (c *BackendServicesAggregatedListCall) Pages(ctx context.Context, f func(*BackendServiceAggregatedList) error) error {
  36430. c.ctx_ = ctx
  36431. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  36432. for {
  36433. x, err := c.Do()
  36434. if err != nil {
  36435. return err
  36436. }
  36437. if err := f(x); err != nil {
  36438. return err
  36439. }
  36440. if x.NextPageToken == "" {
  36441. return nil
  36442. }
  36443. c.PageToken(x.NextPageToken)
  36444. }
  36445. }
  36446. // method id "compute.backendServices.delete":
  36447. type BackendServicesDeleteCall struct {
  36448. s *Service
  36449. project string
  36450. backendService string
  36451. urlParams_ gensupport.URLParams
  36452. ctx_ context.Context
  36453. header_ http.Header
  36454. }
  36455. // Delete: Deletes the specified BackendService resource.
  36456. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/delete
  36457. func (r *BackendServicesService) Delete(project string, backendService string) *BackendServicesDeleteCall {
  36458. c := &BackendServicesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36459. c.project = project
  36460. c.backendService = backendService
  36461. return c
  36462. }
  36463. // RequestId sets the optional parameter "requestId": An optional
  36464. // request ID to identify requests. Specify a unique request ID so that
  36465. // if you must retry your request, the server will know to ignore the
  36466. // request if it has already been completed.
  36467. //
  36468. // For example, consider a situation where you make an initial request
  36469. // and the request times out. If you make the request again with the
  36470. // same request ID, the server can check if original operation with the
  36471. // same request ID was received, and if so, will ignore the second
  36472. // request. This prevents clients from accidentally creating duplicate
  36473. // commitments.
  36474. //
  36475. // The request ID must be a valid UUID with the exception that zero UUID
  36476. // is not supported (00000000-0000-0000-0000-000000000000).
  36477. func (c *BackendServicesDeleteCall) RequestId(requestId string) *BackendServicesDeleteCall {
  36478. c.urlParams_.Set("requestId", requestId)
  36479. return c
  36480. }
  36481. // Fields allows partial responses to be retrieved. See
  36482. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36483. // for more information.
  36484. func (c *BackendServicesDeleteCall) Fields(s ...googleapi.Field) *BackendServicesDeleteCall {
  36485. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36486. return c
  36487. }
  36488. // Context sets the context to be used in this call's Do method. Any
  36489. // pending HTTP request will be aborted if the provided context is
  36490. // canceled.
  36491. func (c *BackendServicesDeleteCall) Context(ctx context.Context) *BackendServicesDeleteCall {
  36492. c.ctx_ = ctx
  36493. return c
  36494. }
  36495. // Header returns an http.Header that can be modified by the caller to
  36496. // add HTTP headers to the request.
  36497. func (c *BackendServicesDeleteCall) Header() http.Header {
  36498. if c.header_ == nil {
  36499. c.header_ = make(http.Header)
  36500. }
  36501. return c.header_
  36502. }
  36503. func (c *BackendServicesDeleteCall) doRequest(alt string) (*http.Response, error) {
  36504. reqHeaders := make(http.Header)
  36505. for k, v := range c.header_ {
  36506. reqHeaders[k] = v
  36507. }
  36508. reqHeaders.Set("User-Agent", c.s.userAgent())
  36509. var body io.Reader = nil
  36510. c.urlParams_.Set("alt", alt)
  36511. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}")
  36512. urls += "?" + c.urlParams_.Encode()
  36513. req, _ := http.NewRequest("DELETE", urls, body)
  36514. req.Header = reqHeaders
  36515. googleapi.Expand(req.URL, map[string]string{
  36516. "project": c.project,
  36517. "backendService": c.backendService,
  36518. })
  36519. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36520. }
  36521. // Do executes the "compute.backendServices.delete" call.
  36522. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  36523. // status code is an error. Response headers are in either
  36524. // *Operation.ServerResponse.Header or (if a response was returned at
  36525. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  36526. // to check whether the returned error was because
  36527. // http.StatusNotModified was returned.
  36528. func (c *BackendServicesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  36529. gensupport.SetOptions(c.urlParams_, opts...)
  36530. res, err := c.doRequest("json")
  36531. if res != nil && res.StatusCode == http.StatusNotModified {
  36532. if res.Body != nil {
  36533. res.Body.Close()
  36534. }
  36535. return nil, &googleapi.Error{
  36536. Code: res.StatusCode,
  36537. Header: res.Header,
  36538. }
  36539. }
  36540. if err != nil {
  36541. return nil, err
  36542. }
  36543. defer googleapi.CloseBody(res)
  36544. if err := googleapi.CheckResponse(res); err != nil {
  36545. return nil, err
  36546. }
  36547. ret := &Operation{
  36548. ServerResponse: googleapi.ServerResponse{
  36549. Header: res.Header,
  36550. HTTPStatusCode: res.StatusCode,
  36551. },
  36552. }
  36553. target := &ret
  36554. if err := gensupport.DecodeResponse(target, res); err != nil {
  36555. return nil, err
  36556. }
  36557. return ret, nil
  36558. // {
  36559. // "description": "Deletes the specified BackendService resource.",
  36560. // "httpMethod": "DELETE",
  36561. // "id": "compute.backendServices.delete",
  36562. // "parameterOrder": [
  36563. // "project",
  36564. // "backendService"
  36565. // ],
  36566. // "parameters": {
  36567. // "backendService": {
  36568. // "description": "Name of the BackendService resource to delete.",
  36569. // "location": "path",
  36570. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  36571. // "required": true,
  36572. // "type": "string"
  36573. // },
  36574. // "project": {
  36575. // "description": "Project ID for this request.",
  36576. // "location": "path",
  36577. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  36578. // "required": true,
  36579. // "type": "string"
  36580. // },
  36581. // "requestId": {
  36582. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  36583. // "location": "query",
  36584. // "type": "string"
  36585. // }
  36586. // },
  36587. // "path": "{project}/global/backendServices/{backendService}",
  36588. // "response": {
  36589. // "$ref": "Operation"
  36590. // },
  36591. // "scopes": [
  36592. // "https://www.googleapis.com/auth/cloud-platform",
  36593. // "https://www.googleapis.com/auth/compute"
  36594. // ]
  36595. // }
  36596. }
  36597. // method id "compute.backendServices.deleteSignedUrlKey":
  36598. type BackendServicesDeleteSignedUrlKeyCall struct {
  36599. s *Service
  36600. project string
  36601. backendService string
  36602. urlParams_ gensupport.URLParams
  36603. ctx_ context.Context
  36604. header_ http.Header
  36605. }
  36606. // DeleteSignedUrlKey: Deletes the given Signed URL Key from the
  36607. // specified backend service.
  36608. func (r *BackendServicesService) DeleteSignedUrlKey(project string, backendService string, keyName string) *BackendServicesDeleteSignedUrlKeyCall {
  36609. c := &BackendServicesDeleteSignedUrlKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36610. c.project = project
  36611. c.backendService = backendService
  36612. c.urlParams_.Set("keyName", keyName)
  36613. return c
  36614. }
  36615. // RequestId sets the optional parameter "requestId": An optional
  36616. // request ID to identify requests. Specify a unique request ID so that
  36617. // if you must retry your request, the server will know to ignore the
  36618. // request if it has already been completed.
  36619. //
  36620. // For example, consider a situation where you make an initial request
  36621. // and the request times out. If you make the request again with the
  36622. // same request ID, the server can check if original operation with the
  36623. // same request ID was received, and if so, will ignore the second
  36624. // request. This prevents clients from accidentally creating duplicate
  36625. // commitments.
  36626. //
  36627. // The request ID must be a valid UUID with the exception that zero UUID
  36628. // is not supported (00000000-0000-0000-0000-000000000000).
  36629. func (c *BackendServicesDeleteSignedUrlKeyCall) RequestId(requestId string) *BackendServicesDeleteSignedUrlKeyCall {
  36630. c.urlParams_.Set("requestId", requestId)
  36631. return c
  36632. }
  36633. // Fields allows partial responses to be retrieved. See
  36634. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36635. // for more information.
  36636. func (c *BackendServicesDeleteSignedUrlKeyCall) Fields(s ...googleapi.Field) *BackendServicesDeleteSignedUrlKeyCall {
  36637. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36638. return c
  36639. }
  36640. // Context sets the context to be used in this call's Do method. Any
  36641. // pending HTTP request will be aborted if the provided context is
  36642. // canceled.
  36643. func (c *BackendServicesDeleteSignedUrlKeyCall) Context(ctx context.Context) *BackendServicesDeleteSignedUrlKeyCall {
  36644. c.ctx_ = ctx
  36645. return c
  36646. }
  36647. // Header returns an http.Header that can be modified by the caller to
  36648. // add HTTP headers to the request.
  36649. func (c *BackendServicesDeleteSignedUrlKeyCall) Header() http.Header {
  36650. if c.header_ == nil {
  36651. c.header_ = make(http.Header)
  36652. }
  36653. return c.header_
  36654. }
  36655. func (c *BackendServicesDeleteSignedUrlKeyCall) doRequest(alt string) (*http.Response, error) {
  36656. reqHeaders := make(http.Header)
  36657. for k, v := range c.header_ {
  36658. reqHeaders[k] = v
  36659. }
  36660. reqHeaders.Set("User-Agent", c.s.userAgent())
  36661. var body io.Reader = nil
  36662. c.urlParams_.Set("alt", alt)
  36663. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}/deleteSignedUrlKey")
  36664. urls += "?" + c.urlParams_.Encode()
  36665. req, _ := http.NewRequest("POST", urls, body)
  36666. req.Header = reqHeaders
  36667. googleapi.Expand(req.URL, map[string]string{
  36668. "project": c.project,
  36669. "backendService": c.backendService,
  36670. })
  36671. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36672. }
  36673. // Do executes the "compute.backendServices.deleteSignedUrlKey" call.
  36674. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  36675. // status code is an error. Response headers are in either
  36676. // *Operation.ServerResponse.Header or (if a response was returned at
  36677. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  36678. // to check whether the returned error was because
  36679. // http.StatusNotModified was returned.
  36680. func (c *BackendServicesDeleteSignedUrlKeyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  36681. gensupport.SetOptions(c.urlParams_, opts...)
  36682. res, err := c.doRequest("json")
  36683. if res != nil && res.StatusCode == http.StatusNotModified {
  36684. if res.Body != nil {
  36685. res.Body.Close()
  36686. }
  36687. return nil, &googleapi.Error{
  36688. Code: res.StatusCode,
  36689. Header: res.Header,
  36690. }
  36691. }
  36692. if err != nil {
  36693. return nil, err
  36694. }
  36695. defer googleapi.CloseBody(res)
  36696. if err := googleapi.CheckResponse(res); err != nil {
  36697. return nil, err
  36698. }
  36699. ret := &Operation{
  36700. ServerResponse: googleapi.ServerResponse{
  36701. Header: res.Header,
  36702. HTTPStatusCode: res.StatusCode,
  36703. },
  36704. }
  36705. target := &ret
  36706. if err := gensupport.DecodeResponse(target, res); err != nil {
  36707. return nil, err
  36708. }
  36709. return ret, nil
  36710. // {
  36711. // "description": "Deletes the given Signed URL Key from the specified backend service.",
  36712. // "httpMethod": "POST",
  36713. // "id": "compute.backendServices.deleteSignedUrlKey",
  36714. // "parameterOrder": [
  36715. // "project",
  36716. // "backendService",
  36717. // "keyName"
  36718. // ],
  36719. // "parameters": {
  36720. // "backendService": {
  36721. // "description": "Name of the BackendService resource to which the Signed URL Key should be added. The name should conform to RFC1035.",
  36722. // "location": "path",
  36723. // "required": true,
  36724. // "type": "string"
  36725. // },
  36726. // "keyName": {
  36727. // "description": "The name of the Signed URL Key to delete.",
  36728. // "location": "query",
  36729. // "required": true,
  36730. // "type": "string"
  36731. // },
  36732. // "project": {
  36733. // "description": "Project ID for this request.",
  36734. // "location": "path",
  36735. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  36736. // "required": true,
  36737. // "type": "string"
  36738. // },
  36739. // "requestId": {
  36740. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  36741. // "location": "query",
  36742. // "type": "string"
  36743. // }
  36744. // },
  36745. // "path": "{project}/global/backendServices/{backendService}/deleteSignedUrlKey",
  36746. // "response": {
  36747. // "$ref": "Operation"
  36748. // },
  36749. // "scopes": [
  36750. // "https://www.googleapis.com/auth/cloud-platform",
  36751. // "https://www.googleapis.com/auth/compute"
  36752. // ]
  36753. // }
  36754. }
  36755. // method id "compute.backendServices.get":
  36756. type BackendServicesGetCall struct {
  36757. s *Service
  36758. project string
  36759. backendService string
  36760. urlParams_ gensupport.URLParams
  36761. ifNoneMatch_ string
  36762. ctx_ context.Context
  36763. header_ http.Header
  36764. }
  36765. // Get: Returns the specified BackendService resource. Gets a list of
  36766. // available backend services by making a list() request.
  36767. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/get
  36768. func (r *BackendServicesService) Get(project string, backendService string) *BackendServicesGetCall {
  36769. c := &BackendServicesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36770. c.project = project
  36771. c.backendService = backendService
  36772. return c
  36773. }
  36774. // Fields allows partial responses to be retrieved. See
  36775. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36776. // for more information.
  36777. func (c *BackendServicesGetCall) Fields(s ...googleapi.Field) *BackendServicesGetCall {
  36778. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36779. return c
  36780. }
  36781. // IfNoneMatch sets the optional parameter which makes the operation
  36782. // fail if the object's ETag matches the given value. This is useful for
  36783. // getting updates only after the object has changed since the last
  36784. // request. Use googleapi.IsNotModified to check whether the response
  36785. // error from Do is the result of In-None-Match.
  36786. func (c *BackendServicesGetCall) IfNoneMatch(entityTag string) *BackendServicesGetCall {
  36787. c.ifNoneMatch_ = entityTag
  36788. return c
  36789. }
  36790. // Context sets the context to be used in this call's Do method. Any
  36791. // pending HTTP request will be aborted if the provided context is
  36792. // canceled.
  36793. func (c *BackendServicesGetCall) Context(ctx context.Context) *BackendServicesGetCall {
  36794. c.ctx_ = ctx
  36795. return c
  36796. }
  36797. // Header returns an http.Header that can be modified by the caller to
  36798. // add HTTP headers to the request.
  36799. func (c *BackendServicesGetCall) Header() http.Header {
  36800. if c.header_ == nil {
  36801. c.header_ = make(http.Header)
  36802. }
  36803. return c.header_
  36804. }
  36805. func (c *BackendServicesGetCall) doRequest(alt string) (*http.Response, error) {
  36806. reqHeaders := make(http.Header)
  36807. for k, v := range c.header_ {
  36808. reqHeaders[k] = v
  36809. }
  36810. reqHeaders.Set("User-Agent", c.s.userAgent())
  36811. if c.ifNoneMatch_ != "" {
  36812. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  36813. }
  36814. var body io.Reader = nil
  36815. c.urlParams_.Set("alt", alt)
  36816. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}")
  36817. urls += "?" + c.urlParams_.Encode()
  36818. req, _ := http.NewRequest("GET", urls, body)
  36819. req.Header = reqHeaders
  36820. googleapi.Expand(req.URL, map[string]string{
  36821. "project": c.project,
  36822. "backendService": c.backendService,
  36823. })
  36824. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36825. }
  36826. // Do executes the "compute.backendServices.get" call.
  36827. // Exactly one of *BackendService or error will be non-nil. Any non-2xx
  36828. // status code is an error. Response headers are in either
  36829. // *BackendService.ServerResponse.Header or (if a response was returned
  36830. // at all) in error.(*googleapi.Error).Header. Use
  36831. // googleapi.IsNotModified to check whether the returned error was
  36832. // because http.StatusNotModified was returned.
  36833. func (c *BackendServicesGetCall) Do(opts ...googleapi.CallOption) (*BackendService, error) {
  36834. gensupport.SetOptions(c.urlParams_, opts...)
  36835. res, err := c.doRequest("json")
  36836. if res != nil && res.StatusCode == http.StatusNotModified {
  36837. if res.Body != nil {
  36838. res.Body.Close()
  36839. }
  36840. return nil, &googleapi.Error{
  36841. Code: res.StatusCode,
  36842. Header: res.Header,
  36843. }
  36844. }
  36845. if err != nil {
  36846. return nil, err
  36847. }
  36848. defer googleapi.CloseBody(res)
  36849. if err := googleapi.CheckResponse(res); err != nil {
  36850. return nil, err
  36851. }
  36852. ret := &BackendService{
  36853. ServerResponse: googleapi.ServerResponse{
  36854. Header: res.Header,
  36855. HTTPStatusCode: res.StatusCode,
  36856. },
  36857. }
  36858. target := &ret
  36859. if err := gensupport.DecodeResponse(target, res); err != nil {
  36860. return nil, err
  36861. }
  36862. return ret, nil
  36863. // {
  36864. // "description": "Returns the specified BackendService resource. Gets a list of available backend services by making a list() request.",
  36865. // "httpMethod": "GET",
  36866. // "id": "compute.backendServices.get",
  36867. // "parameterOrder": [
  36868. // "project",
  36869. // "backendService"
  36870. // ],
  36871. // "parameters": {
  36872. // "backendService": {
  36873. // "description": "Name of the BackendService resource to return.",
  36874. // "location": "path",
  36875. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  36876. // "required": true,
  36877. // "type": "string"
  36878. // },
  36879. // "project": {
  36880. // "description": "Project ID for this request.",
  36881. // "location": "path",
  36882. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  36883. // "required": true,
  36884. // "type": "string"
  36885. // }
  36886. // },
  36887. // "path": "{project}/global/backendServices/{backendService}",
  36888. // "response": {
  36889. // "$ref": "BackendService"
  36890. // },
  36891. // "scopes": [
  36892. // "https://www.googleapis.com/auth/cloud-platform",
  36893. // "https://www.googleapis.com/auth/compute",
  36894. // "https://www.googleapis.com/auth/compute.readonly"
  36895. // ]
  36896. // }
  36897. }
  36898. // method id "compute.backendServices.getHealth":
  36899. type BackendServicesGetHealthCall struct {
  36900. s *Service
  36901. project string
  36902. backendService string
  36903. resourcegroupreference *ResourceGroupReference
  36904. urlParams_ gensupport.URLParams
  36905. ctx_ context.Context
  36906. header_ http.Header
  36907. }
  36908. // GetHealth: Gets the most recent health check results for this
  36909. // BackendService.
  36910. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/getHealth
  36911. func (r *BackendServicesService) GetHealth(project string, backendService string, resourcegroupreference *ResourceGroupReference) *BackendServicesGetHealthCall {
  36912. c := &BackendServicesGetHealthCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36913. c.project = project
  36914. c.backendService = backendService
  36915. c.resourcegroupreference = resourcegroupreference
  36916. return c
  36917. }
  36918. // Fields allows partial responses to be retrieved. See
  36919. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36920. // for more information.
  36921. func (c *BackendServicesGetHealthCall) Fields(s ...googleapi.Field) *BackendServicesGetHealthCall {
  36922. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36923. return c
  36924. }
  36925. // Context sets the context to be used in this call's Do method. Any
  36926. // pending HTTP request will be aborted if the provided context is
  36927. // canceled.
  36928. func (c *BackendServicesGetHealthCall) Context(ctx context.Context) *BackendServicesGetHealthCall {
  36929. c.ctx_ = ctx
  36930. return c
  36931. }
  36932. // Header returns an http.Header that can be modified by the caller to
  36933. // add HTTP headers to the request.
  36934. func (c *BackendServicesGetHealthCall) Header() http.Header {
  36935. if c.header_ == nil {
  36936. c.header_ = make(http.Header)
  36937. }
  36938. return c.header_
  36939. }
  36940. func (c *BackendServicesGetHealthCall) doRequest(alt string) (*http.Response, error) {
  36941. reqHeaders := make(http.Header)
  36942. for k, v := range c.header_ {
  36943. reqHeaders[k] = v
  36944. }
  36945. reqHeaders.Set("User-Agent", c.s.userAgent())
  36946. var body io.Reader = nil
  36947. body, err := googleapi.WithoutDataWrapper.JSONReader(c.resourcegroupreference)
  36948. if err != nil {
  36949. return nil, err
  36950. }
  36951. reqHeaders.Set("Content-Type", "application/json")
  36952. c.urlParams_.Set("alt", alt)
  36953. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}/getHealth")
  36954. urls += "?" + c.urlParams_.Encode()
  36955. req, _ := http.NewRequest("POST", urls, body)
  36956. req.Header = reqHeaders
  36957. googleapi.Expand(req.URL, map[string]string{
  36958. "project": c.project,
  36959. "backendService": c.backendService,
  36960. })
  36961. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36962. }
  36963. // Do executes the "compute.backendServices.getHealth" call.
  36964. // Exactly one of *BackendServiceGroupHealth or error will be non-nil.
  36965. // Any non-2xx status code is an error. Response headers are in either
  36966. // *BackendServiceGroupHealth.ServerResponse.Header or (if a response
  36967. // was returned at all) in error.(*googleapi.Error).Header. Use
  36968. // googleapi.IsNotModified to check whether the returned error was
  36969. // because http.StatusNotModified was returned.
  36970. func (c *BackendServicesGetHealthCall) Do(opts ...googleapi.CallOption) (*BackendServiceGroupHealth, error) {
  36971. gensupport.SetOptions(c.urlParams_, opts...)
  36972. res, err := c.doRequest("json")
  36973. if res != nil && res.StatusCode == http.StatusNotModified {
  36974. if res.Body != nil {
  36975. res.Body.Close()
  36976. }
  36977. return nil, &googleapi.Error{
  36978. Code: res.StatusCode,
  36979. Header: res.Header,
  36980. }
  36981. }
  36982. if err != nil {
  36983. return nil, err
  36984. }
  36985. defer googleapi.CloseBody(res)
  36986. if err := googleapi.CheckResponse(res); err != nil {
  36987. return nil, err
  36988. }
  36989. ret := &BackendServiceGroupHealth{
  36990. ServerResponse: googleapi.ServerResponse{
  36991. Header: res.Header,
  36992. HTTPStatusCode: res.StatusCode,
  36993. },
  36994. }
  36995. target := &ret
  36996. if err := gensupport.DecodeResponse(target, res); err != nil {
  36997. return nil, err
  36998. }
  36999. return ret, nil
  37000. // {
  37001. // "description": "Gets the most recent health check results for this BackendService.",
  37002. // "httpMethod": "POST",
  37003. // "id": "compute.backendServices.getHealth",
  37004. // "parameterOrder": [
  37005. // "project",
  37006. // "backendService"
  37007. // ],
  37008. // "parameters": {
  37009. // "backendService": {
  37010. // "description": "Name of the BackendService resource to which the queried instance belongs.",
  37011. // "location": "path",
  37012. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  37013. // "required": true,
  37014. // "type": "string"
  37015. // },
  37016. // "project": {
  37017. // "location": "path",
  37018. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  37019. // "required": true,
  37020. // "type": "string"
  37021. // }
  37022. // },
  37023. // "path": "{project}/global/backendServices/{backendService}/getHealth",
  37024. // "request": {
  37025. // "$ref": "ResourceGroupReference"
  37026. // },
  37027. // "response": {
  37028. // "$ref": "BackendServiceGroupHealth"
  37029. // },
  37030. // "scopes": [
  37031. // "https://www.googleapis.com/auth/cloud-platform",
  37032. // "https://www.googleapis.com/auth/compute",
  37033. // "https://www.googleapis.com/auth/compute.readonly"
  37034. // ]
  37035. // }
  37036. }
  37037. // method id "compute.backendServices.insert":
  37038. type BackendServicesInsertCall struct {
  37039. s *Service
  37040. project string
  37041. backendservice *BackendService
  37042. urlParams_ gensupport.URLParams
  37043. ctx_ context.Context
  37044. header_ http.Header
  37045. }
  37046. // Insert: Creates a BackendService resource in the specified project
  37047. // using the data included in the request. There are several
  37048. // restrictions and guidelines to keep in mind when creating a backend
  37049. // service. Read Restrictions and Guidelines for more information.
  37050. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/insert
  37051. func (r *BackendServicesService) Insert(project string, backendservice *BackendService) *BackendServicesInsertCall {
  37052. c := &BackendServicesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37053. c.project = project
  37054. c.backendservice = backendservice
  37055. return c
  37056. }
  37057. // RequestId sets the optional parameter "requestId": An optional
  37058. // request ID to identify requests. Specify a unique request ID so that
  37059. // if you must retry your request, the server will know to ignore the
  37060. // request if it has already been completed.
  37061. //
  37062. // For example, consider a situation where you make an initial request
  37063. // and the request times out. If you make the request again with the
  37064. // same request ID, the server can check if original operation with the
  37065. // same request ID was received, and if so, will ignore the second
  37066. // request. This prevents clients from accidentally creating duplicate
  37067. // commitments.
  37068. //
  37069. // The request ID must be a valid UUID with the exception that zero UUID
  37070. // is not supported (00000000-0000-0000-0000-000000000000).
  37071. func (c *BackendServicesInsertCall) RequestId(requestId string) *BackendServicesInsertCall {
  37072. c.urlParams_.Set("requestId", requestId)
  37073. return c
  37074. }
  37075. // Fields allows partial responses to be retrieved. See
  37076. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37077. // for more information.
  37078. func (c *BackendServicesInsertCall) Fields(s ...googleapi.Field) *BackendServicesInsertCall {
  37079. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37080. return c
  37081. }
  37082. // Context sets the context to be used in this call's Do method. Any
  37083. // pending HTTP request will be aborted if the provided context is
  37084. // canceled.
  37085. func (c *BackendServicesInsertCall) Context(ctx context.Context) *BackendServicesInsertCall {
  37086. c.ctx_ = ctx
  37087. return c
  37088. }
  37089. // Header returns an http.Header that can be modified by the caller to
  37090. // add HTTP headers to the request.
  37091. func (c *BackendServicesInsertCall) Header() http.Header {
  37092. if c.header_ == nil {
  37093. c.header_ = make(http.Header)
  37094. }
  37095. return c.header_
  37096. }
  37097. func (c *BackendServicesInsertCall) doRequest(alt string) (*http.Response, error) {
  37098. reqHeaders := make(http.Header)
  37099. for k, v := range c.header_ {
  37100. reqHeaders[k] = v
  37101. }
  37102. reqHeaders.Set("User-Agent", c.s.userAgent())
  37103. var body io.Reader = nil
  37104. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  37105. if err != nil {
  37106. return nil, err
  37107. }
  37108. reqHeaders.Set("Content-Type", "application/json")
  37109. c.urlParams_.Set("alt", alt)
  37110. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices")
  37111. urls += "?" + c.urlParams_.Encode()
  37112. req, _ := http.NewRequest("POST", urls, body)
  37113. req.Header = reqHeaders
  37114. googleapi.Expand(req.URL, map[string]string{
  37115. "project": c.project,
  37116. })
  37117. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37118. }
  37119. // Do executes the "compute.backendServices.insert" call.
  37120. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  37121. // status code is an error. Response headers are in either
  37122. // *Operation.ServerResponse.Header or (if a response was returned at
  37123. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  37124. // to check whether the returned error was because
  37125. // http.StatusNotModified was returned.
  37126. func (c *BackendServicesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  37127. gensupport.SetOptions(c.urlParams_, opts...)
  37128. res, err := c.doRequest("json")
  37129. if res != nil && res.StatusCode == http.StatusNotModified {
  37130. if res.Body != nil {
  37131. res.Body.Close()
  37132. }
  37133. return nil, &googleapi.Error{
  37134. Code: res.StatusCode,
  37135. Header: res.Header,
  37136. }
  37137. }
  37138. if err != nil {
  37139. return nil, err
  37140. }
  37141. defer googleapi.CloseBody(res)
  37142. if err := googleapi.CheckResponse(res); err != nil {
  37143. return nil, err
  37144. }
  37145. ret := &Operation{
  37146. ServerResponse: googleapi.ServerResponse{
  37147. Header: res.Header,
  37148. HTTPStatusCode: res.StatusCode,
  37149. },
  37150. }
  37151. target := &ret
  37152. if err := gensupport.DecodeResponse(target, res); err != nil {
  37153. return nil, err
  37154. }
  37155. return ret, nil
  37156. // {
  37157. // "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.",
  37158. // "httpMethod": "POST",
  37159. // "id": "compute.backendServices.insert",
  37160. // "parameterOrder": [
  37161. // "project"
  37162. // ],
  37163. // "parameters": {
  37164. // "project": {
  37165. // "description": "Project ID for this request.",
  37166. // "location": "path",
  37167. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  37168. // "required": true,
  37169. // "type": "string"
  37170. // },
  37171. // "requestId": {
  37172. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  37173. // "location": "query",
  37174. // "type": "string"
  37175. // }
  37176. // },
  37177. // "path": "{project}/global/backendServices",
  37178. // "request": {
  37179. // "$ref": "BackendService"
  37180. // },
  37181. // "response": {
  37182. // "$ref": "Operation"
  37183. // },
  37184. // "scopes": [
  37185. // "https://www.googleapis.com/auth/cloud-platform",
  37186. // "https://www.googleapis.com/auth/compute"
  37187. // ]
  37188. // }
  37189. }
  37190. // method id "compute.backendServices.list":
  37191. type BackendServicesListCall struct {
  37192. s *Service
  37193. project string
  37194. urlParams_ gensupport.URLParams
  37195. ifNoneMatch_ string
  37196. ctx_ context.Context
  37197. header_ http.Header
  37198. }
  37199. // List: Retrieves the list of BackendService resources available to the
  37200. // specified project.
  37201. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/list
  37202. func (r *BackendServicesService) List(project string) *BackendServicesListCall {
  37203. c := &BackendServicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37204. c.project = project
  37205. return c
  37206. }
  37207. // Filter sets the optional parameter "filter": A filter expression that
  37208. // filters resources listed in the response. The expression must specify
  37209. // the field name, a comparison operator, and the value that you want to
  37210. // use for filtering. The value must be a string, a number, or a
  37211. // boolean. The comparison operator must be either =, !=, >, or <.
  37212. //
  37213. // For example, if you are filtering Compute Engine instances, you can
  37214. // exclude instances named example-instance by specifying name !=
  37215. // example-instance.
  37216. //
  37217. // You can also filter nested fields. For example, you could specify
  37218. // scheduling.automaticRestart = false to include instances only if they
  37219. // are not scheduled for automatic restarts. You can use filtering on
  37220. // nested fields to filter based on resource labels.
  37221. //
  37222. // To filter on multiple expressions, provide each separate expression
  37223. // within parentheses. For example, (scheduling.automaticRestart = true)
  37224. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  37225. // AND expression. However, you can include AND and OR expressions
  37226. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  37227. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  37228. // true).
  37229. func (c *BackendServicesListCall) Filter(filter string) *BackendServicesListCall {
  37230. c.urlParams_.Set("filter", filter)
  37231. return c
  37232. }
  37233. // MaxResults sets the optional parameter "maxResults": The maximum
  37234. // number of results per page that should be returned. If the number of
  37235. // available results is larger than maxResults, Compute Engine returns a
  37236. // nextPageToken that can be used to get the next page of results in
  37237. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  37238. // (Default: 500)
  37239. func (c *BackendServicesListCall) MaxResults(maxResults int64) *BackendServicesListCall {
  37240. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  37241. return c
  37242. }
  37243. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  37244. // a certain order. By default, results are returned in alphanumerical
  37245. // order based on the resource name.
  37246. //
  37247. // You can also sort results in descending order based on the creation
  37248. // timestamp using orderBy="creationTimestamp desc". This sorts results
  37249. // based on the creationTimestamp field in reverse chronological order
  37250. // (newest result first). Use this to sort resources like operations so
  37251. // that the newest operation is returned first.
  37252. //
  37253. // Currently, only sorting by name or creationTimestamp desc is
  37254. // supported.
  37255. func (c *BackendServicesListCall) OrderBy(orderBy string) *BackendServicesListCall {
  37256. c.urlParams_.Set("orderBy", orderBy)
  37257. return c
  37258. }
  37259. // PageToken sets the optional parameter "pageToken": Specifies a page
  37260. // token to use. Set pageToken to the nextPageToken returned by a
  37261. // previous list request to get the next page of results.
  37262. func (c *BackendServicesListCall) PageToken(pageToken string) *BackendServicesListCall {
  37263. c.urlParams_.Set("pageToken", pageToken)
  37264. return c
  37265. }
  37266. // Fields allows partial responses to be retrieved. See
  37267. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37268. // for more information.
  37269. func (c *BackendServicesListCall) Fields(s ...googleapi.Field) *BackendServicesListCall {
  37270. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37271. return c
  37272. }
  37273. // IfNoneMatch sets the optional parameter which makes the operation
  37274. // fail if the object's ETag matches the given value. This is useful for
  37275. // getting updates only after the object has changed since the last
  37276. // request. Use googleapi.IsNotModified to check whether the response
  37277. // error from Do is the result of In-None-Match.
  37278. func (c *BackendServicesListCall) IfNoneMatch(entityTag string) *BackendServicesListCall {
  37279. c.ifNoneMatch_ = entityTag
  37280. return c
  37281. }
  37282. // Context sets the context to be used in this call's Do method. Any
  37283. // pending HTTP request will be aborted if the provided context is
  37284. // canceled.
  37285. func (c *BackendServicesListCall) Context(ctx context.Context) *BackendServicesListCall {
  37286. c.ctx_ = ctx
  37287. return c
  37288. }
  37289. // Header returns an http.Header that can be modified by the caller to
  37290. // add HTTP headers to the request.
  37291. func (c *BackendServicesListCall) Header() http.Header {
  37292. if c.header_ == nil {
  37293. c.header_ = make(http.Header)
  37294. }
  37295. return c.header_
  37296. }
  37297. func (c *BackendServicesListCall) doRequest(alt string) (*http.Response, error) {
  37298. reqHeaders := make(http.Header)
  37299. for k, v := range c.header_ {
  37300. reqHeaders[k] = v
  37301. }
  37302. reqHeaders.Set("User-Agent", c.s.userAgent())
  37303. if c.ifNoneMatch_ != "" {
  37304. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  37305. }
  37306. var body io.Reader = nil
  37307. c.urlParams_.Set("alt", alt)
  37308. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices")
  37309. urls += "?" + c.urlParams_.Encode()
  37310. req, _ := http.NewRequest("GET", urls, body)
  37311. req.Header = reqHeaders
  37312. googleapi.Expand(req.URL, map[string]string{
  37313. "project": c.project,
  37314. })
  37315. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37316. }
  37317. // Do executes the "compute.backendServices.list" call.
  37318. // Exactly one of *BackendServiceList or error will be non-nil. Any
  37319. // non-2xx status code is an error. Response headers are in either
  37320. // *BackendServiceList.ServerResponse.Header or (if a response was
  37321. // returned at all) in error.(*googleapi.Error).Header. Use
  37322. // googleapi.IsNotModified to check whether the returned error was
  37323. // because http.StatusNotModified was returned.
  37324. func (c *BackendServicesListCall) Do(opts ...googleapi.CallOption) (*BackendServiceList, error) {
  37325. gensupport.SetOptions(c.urlParams_, opts...)
  37326. res, err := c.doRequest("json")
  37327. if res != nil && res.StatusCode == http.StatusNotModified {
  37328. if res.Body != nil {
  37329. res.Body.Close()
  37330. }
  37331. return nil, &googleapi.Error{
  37332. Code: res.StatusCode,
  37333. Header: res.Header,
  37334. }
  37335. }
  37336. if err != nil {
  37337. return nil, err
  37338. }
  37339. defer googleapi.CloseBody(res)
  37340. if err := googleapi.CheckResponse(res); err != nil {
  37341. return nil, err
  37342. }
  37343. ret := &BackendServiceList{
  37344. ServerResponse: googleapi.ServerResponse{
  37345. Header: res.Header,
  37346. HTTPStatusCode: res.StatusCode,
  37347. },
  37348. }
  37349. target := &ret
  37350. if err := gensupport.DecodeResponse(target, res); err != nil {
  37351. return nil, err
  37352. }
  37353. return ret, nil
  37354. // {
  37355. // "description": "Retrieves the list of BackendService resources available to the specified project.",
  37356. // "httpMethod": "GET",
  37357. // "id": "compute.backendServices.list",
  37358. // "parameterOrder": [
  37359. // "project"
  37360. // ],
  37361. // "parameters": {
  37362. // "filter": {
  37363. // "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).",
  37364. // "location": "query",
  37365. // "type": "string"
  37366. // },
  37367. // "maxResults": {
  37368. // "default": "500",
  37369. // "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)",
  37370. // "format": "uint32",
  37371. // "location": "query",
  37372. // "minimum": "0",
  37373. // "type": "integer"
  37374. // },
  37375. // "orderBy": {
  37376. // "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.",
  37377. // "location": "query",
  37378. // "type": "string"
  37379. // },
  37380. // "pageToken": {
  37381. // "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.",
  37382. // "location": "query",
  37383. // "type": "string"
  37384. // },
  37385. // "project": {
  37386. // "description": "Project ID for this request.",
  37387. // "location": "path",
  37388. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  37389. // "required": true,
  37390. // "type": "string"
  37391. // }
  37392. // },
  37393. // "path": "{project}/global/backendServices",
  37394. // "response": {
  37395. // "$ref": "BackendServiceList"
  37396. // },
  37397. // "scopes": [
  37398. // "https://www.googleapis.com/auth/cloud-platform",
  37399. // "https://www.googleapis.com/auth/compute",
  37400. // "https://www.googleapis.com/auth/compute.readonly"
  37401. // ]
  37402. // }
  37403. }
  37404. // Pages invokes f for each page of results.
  37405. // A non-nil error returned from f will halt the iteration.
  37406. // The provided context supersedes any context provided to the Context method.
  37407. func (c *BackendServicesListCall) Pages(ctx context.Context, f func(*BackendServiceList) error) error {
  37408. c.ctx_ = ctx
  37409. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  37410. for {
  37411. x, err := c.Do()
  37412. if err != nil {
  37413. return err
  37414. }
  37415. if err := f(x); err != nil {
  37416. return err
  37417. }
  37418. if x.NextPageToken == "" {
  37419. return nil
  37420. }
  37421. c.PageToken(x.NextPageToken)
  37422. }
  37423. }
  37424. // method id "compute.backendServices.patch":
  37425. type BackendServicesPatchCall struct {
  37426. s *Service
  37427. project string
  37428. backendService string
  37429. backendservice *BackendService
  37430. urlParams_ gensupport.URLParams
  37431. ctx_ context.Context
  37432. header_ http.Header
  37433. }
  37434. // Patch: Patches the specified BackendService resource with the data
  37435. // included in the request. There are several restrictions and
  37436. // guidelines to keep in mind when updating a backend service. Read
  37437. // Restrictions and Guidelines for more information. This method
  37438. // supports PATCH semantics and uses the JSON merge patch format and
  37439. // processing rules.
  37440. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/patch
  37441. func (r *BackendServicesService) Patch(project string, backendService string, backendservice *BackendService) *BackendServicesPatchCall {
  37442. c := &BackendServicesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37443. c.project = project
  37444. c.backendService = backendService
  37445. c.backendservice = backendservice
  37446. return c
  37447. }
  37448. // RequestId sets the optional parameter "requestId": An optional
  37449. // request ID to identify requests. Specify a unique request ID so that
  37450. // if you must retry your request, the server will know to ignore the
  37451. // request if it has already been completed.
  37452. //
  37453. // For example, consider a situation where you make an initial request
  37454. // and the request times out. If you make the request again with the
  37455. // same request ID, the server can check if original operation with the
  37456. // same request ID was received, and if so, will ignore the second
  37457. // request. This prevents clients from accidentally creating duplicate
  37458. // commitments.
  37459. //
  37460. // The request ID must be a valid UUID with the exception that zero UUID
  37461. // is not supported (00000000-0000-0000-0000-000000000000).
  37462. func (c *BackendServicesPatchCall) RequestId(requestId string) *BackendServicesPatchCall {
  37463. c.urlParams_.Set("requestId", requestId)
  37464. return c
  37465. }
  37466. // Fields allows partial responses to be retrieved. See
  37467. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37468. // for more information.
  37469. func (c *BackendServicesPatchCall) Fields(s ...googleapi.Field) *BackendServicesPatchCall {
  37470. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37471. return c
  37472. }
  37473. // Context sets the context to be used in this call's Do method. Any
  37474. // pending HTTP request will be aborted if the provided context is
  37475. // canceled.
  37476. func (c *BackendServicesPatchCall) Context(ctx context.Context) *BackendServicesPatchCall {
  37477. c.ctx_ = ctx
  37478. return c
  37479. }
  37480. // Header returns an http.Header that can be modified by the caller to
  37481. // add HTTP headers to the request.
  37482. func (c *BackendServicesPatchCall) Header() http.Header {
  37483. if c.header_ == nil {
  37484. c.header_ = make(http.Header)
  37485. }
  37486. return c.header_
  37487. }
  37488. func (c *BackendServicesPatchCall) doRequest(alt string) (*http.Response, error) {
  37489. reqHeaders := make(http.Header)
  37490. for k, v := range c.header_ {
  37491. reqHeaders[k] = v
  37492. }
  37493. reqHeaders.Set("User-Agent", c.s.userAgent())
  37494. var body io.Reader = nil
  37495. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  37496. if err != nil {
  37497. return nil, err
  37498. }
  37499. reqHeaders.Set("Content-Type", "application/json")
  37500. c.urlParams_.Set("alt", alt)
  37501. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}")
  37502. urls += "?" + c.urlParams_.Encode()
  37503. req, _ := http.NewRequest("PATCH", urls, body)
  37504. req.Header = reqHeaders
  37505. googleapi.Expand(req.URL, map[string]string{
  37506. "project": c.project,
  37507. "backendService": c.backendService,
  37508. })
  37509. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37510. }
  37511. // Do executes the "compute.backendServices.patch" call.
  37512. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  37513. // status code is an error. Response headers are in either
  37514. // *Operation.ServerResponse.Header or (if a response was returned at
  37515. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  37516. // to check whether the returned error was because
  37517. // http.StatusNotModified was returned.
  37518. func (c *BackendServicesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  37519. gensupport.SetOptions(c.urlParams_, opts...)
  37520. res, err := c.doRequest("json")
  37521. if res != nil && res.StatusCode == http.StatusNotModified {
  37522. if res.Body != nil {
  37523. res.Body.Close()
  37524. }
  37525. return nil, &googleapi.Error{
  37526. Code: res.StatusCode,
  37527. Header: res.Header,
  37528. }
  37529. }
  37530. if err != nil {
  37531. return nil, err
  37532. }
  37533. defer googleapi.CloseBody(res)
  37534. if err := googleapi.CheckResponse(res); err != nil {
  37535. return nil, err
  37536. }
  37537. ret := &Operation{
  37538. ServerResponse: googleapi.ServerResponse{
  37539. Header: res.Header,
  37540. HTTPStatusCode: res.StatusCode,
  37541. },
  37542. }
  37543. target := &ret
  37544. if err := gensupport.DecodeResponse(target, res); err != nil {
  37545. return nil, err
  37546. }
  37547. return ret, nil
  37548. // {
  37549. // "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.",
  37550. // "httpMethod": "PATCH",
  37551. // "id": "compute.backendServices.patch",
  37552. // "parameterOrder": [
  37553. // "project",
  37554. // "backendService"
  37555. // ],
  37556. // "parameters": {
  37557. // "backendService": {
  37558. // "description": "Name of the BackendService resource to patch.",
  37559. // "location": "path",
  37560. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  37561. // "required": true,
  37562. // "type": "string"
  37563. // },
  37564. // "project": {
  37565. // "description": "Project ID for this request.",
  37566. // "location": "path",
  37567. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  37568. // "required": true,
  37569. // "type": "string"
  37570. // },
  37571. // "requestId": {
  37572. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  37573. // "location": "query",
  37574. // "type": "string"
  37575. // }
  37576. // },
  37577. // "path": "{project}/global/backendServices/{backendService}",
  37578. // "request": {
  37579. // "$ref": "BackendService"
  37580. // },
  37581. // "response": {
  37582. // "$ref": "Operation"
  37583. // },
  37584. // "scopes": [
  37585. // "https://www.googleapis.com/auth/cloud-platform",
  37586. // "https://www.googleapis.com/auth/compute"
  37587. // ]
  37588. // }
  37589. }
  37590. // method id "compute.backendServices.setSecurityPolicy":
  37591. type BackendServicesSetSecurityPolicyCall struct {
  37592. s *Service
  37593. project string
  37594. backendService string
  37595. securitypolicyreference *SecurityPolicyReference
  37596. urlParams_ gensupport.URLParams
  37597. ctx_ context.Context
  37598. header_ http.Header
  37599. }
  37600. // SetSecurityPolicy: Sets the security policy for the specified backend
  37601. // service.
  37602. func (r *BackendServicesService) SetSecurityPolicy(project string, backendService string, securitypolicyreference *SecurityPolicyReference) *BackendServicesSetSecurityPolicyCall {
  37603. c := &BackendServicesSetSecurityPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37604. c.project = project
  37605. c.backendService = backendService
  37606. c.securitypolicyreference = securitypolicyreference
  37607. return c
  37608. }
  37609. // RequestId sets the optional parameter "requestId": An optional
  37610. // request ID to identify requests. Specify a unique request ID so that
  37611. // if you must retry your request, the server will know to ignore the
  37612. // request if it has already been completed.
  37613. //
  37614. // For example, consider a situation where you make an initial request
  37615. // and the request times out. If you make the request again with the
  37616. // same request ID, the server can check if original operation with the
  37617. // same request ID was received, and if so, will ignore the second
  37618. // request. This prevents clients from accidentally creating duplicate
  37619. // commitments.
  37620. //
  37621. // The request ID must be a valid UUID with the exception that zero UUID
  37622. // is not supported (00000000-0000-0000-0000-000000000000).
  37623. func (c *BackendServicesSetSecurityPolicyCall) RequestId(requestId string) *BackendServicesSetSecurityPolicyCall {
  37624. c.urlParams_.Set("requestId", requestId)
  37625. return c
  37626. }
  37627. // Fields allows partial responses to be retrieved. See
  37628. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37629. // for more information.
  37630. func (c *BackendServicesSetSecurityPolicyCall) Fields(s ...googleapi.Field) *BackendServicesSetSecurityPolicyCall {
  37631. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37632. return c
  37633. }
  37634. // Context sets the context to be used in this call's Do method. Any
  37635. // pending HTTP request will be aborted if the provided context is
  37636. // canceled.
  37637. func (c *BackendServicesSetSecurityPolicyCall) Context(ctx context.Context) *BackendServicesSetSecurityPolicyCall {
  37638. c.ctx_ = ctx
  37639. return c
  37640. }
  37641. // Header returns an http.Header that can be modified by the caller to
  37642. // add HTTP headers to the request.
  37643. func (c *BackendServicesSetSecurityPolicyCall) Header() http.Header {
  37644. if c.header_ == nil {
  37645. c.header_ = make(http.Header)
  37646. }
  37647. return c.header_
  37648. }
  37649. func (c *BackendServicesSetSecurityPolicyCall) doRequest(alt string) (*http.Response, error) {
  37650. reqHeaders := make(http.Header)
  37651. for k, v := range c.header_ {
  37652. reqHeaders[k] = v
  37653. }
  37654. reqHeaders.Set("User-Agent", c.s.userAgent())
  37655. var body io.Reader = nil
  37656. body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyreference)
  37657. if err != nil {
  37658. return nil, err
  37659. }
  37660. reqHeaders.Set("Content-Type", "application/json")
  37661. c.urlParams_.Set("alt", alt)
  37662. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}/setSecurityPolicy")
  37663. urls += "?" + c.urlParams_.Encode()
  37664. req, _ := http.NewRequest("POST", urls, body)
  37665. req.Header = reqHeaders
  37666. googleapi.Expand(req.URL, map[string]string{
  37667. "project": c.project,
  37668. "backendService": c.backendService,
  37669. })
  37670. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37671. }
  37672. // Do executes the "compute.backendServices.setSecurityPolicy" call.
  37673. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  37674. // status code is an error. Response headers are in either
  37675. // *Operation.ServerResponse.Header or (if a response was returned at
  37676. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  37677. // to check whether the returned error was because
  37678. // http.StatusNotModified was returned.
  37679. func (c *BackendServicesSetSecurityPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  37680. gensupport.SetOptions(c.urlParams_, opts...)
  37681. res, err := c.doRequest("json")
  37682. if res != nil && res.StatusCode == http.StatusNotModified {
  37683. if res.Body != nil {
  37684. res.Body.Close()
  37685. }
  37686. return nil, &googleapi.Error{
  37687. Code: res.StatusCode,
  37688. Header: res.Header,
  37689. }
  37690. }
  37691. if err != nil {
  37692. return nil, err
  37693. }
  37694. defer googleapi.CloseBody(res)
  37695. if err := googleapi.CheckResponse(res); err != nil {
  37696. return nil, err
  37697. }
  37698. ret := &Operation{
  37699. ServerResponse: googleapi.ServerResponse{
  37700. Header: res.Header,
  37701. HTTPStatusCode: res.StatusCode,
  37702. },
  37703. }
  37704. target := &ret
  37705. if err := gensupport.DecodeResponse(target, res); err != nil {
  37706. return nil, err
  37707. }
  37708. return ret, nil
  37709. // {
  37710. // "description": "Sets the security policy for the specified backend service.",
  37711. // "httpMethod": "POST",
  37712. // "id": "compute.backendServices.setSecurityPolicy",
  37713. // "parameterOrder": [
  37714. // "project",
  37715. // "backendService"
  37716. // ],
  37717. // "parameters": {
  37718. // "backendService": {
  37719. // "description": "Name of the BackendService resource to which the security policy should be set. The name should conform to RFC1035.",
  37720. // "location": "path",
  37721. // "required": true,
  37722. // "type": "string"
  37723. // },
  37724. // "project": {
  37725. // "description": "Project ID for this request.",
  37726. // "location": "path",
  37727. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  37728. // "required": true,
  37729. // "type": "string"
  37730. // },
  37731. // "requestId": {
  37732. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  37733. // "location": "query",
  37734. // "type": "string"
  37735. // }
  37736. // },
  37737. // "path": "{project}/global/backendServices/{backendService}/setSecurityPolicy",
  37738. // "request": {
  37739. // "$ref": "SecurityPolicyReference"
  37740. // },
  37741. // "response": {
  37742. // "$ref": "Operation"
  37743. // },
  37744. // "scopes": [
  37745. // "https://www.googleapis.com/auth/cloud-platform",
  37746. // "https://www.googleapis.com/auth/compute"
  37747. // ]
  37748. // }
  37749. }
  37750. // method id "compute.backendServices.testIamPermissions":
  37751. type BackendServicesTestIamPermissionsCall struct {
  37752. s *Service
  37753. project string
  37754. resource string
  37755. testpermissionsrequest *TestPermissionsRequest
  37756. urlParams_ gensupport.URLParams
  37757. ctx_ context.Context
  37758. header_ http.Header
  37759. }
  37760. // TestIamPermissions: Returns permissions that a caller has on the
  37761. // specified resource.
  37762. func (r *BackendServicesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *BackendServicesTestIamPermissionsCall {
  37763. c := &BackendServicesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37764. c.project = project
  37765. c.resource = resource
  37766. c.testpermissionsrequest = testpermissionsrequest
  37767. return c
  37768. }
  37769. // Fields allows partial responses to be retrieved. See
  37770. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37771. // for more information.
  37772. func (c *BackendServicesTestIamPermissionsCall) Fields(s ...googleapi.Field) *BackendServicesTestIamPermissionsCall {
  37773. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37774. return c
  37775. }
  37776. // Context sets the context to be used in this call's Do method. Any
  37777. // pending HTTP request will be aborted if the provided context is
  37778. // canceled.
  37779. func (c *BackendServicesTestIamPermissionsCall) Context(ctx context.Context) *BackendServicesTestIamPermissionsCall {
  37780. c.ctx_ = ctx
  37781. return c
  37782. }
  37783. // Header returns an http.Header that can be modified by the caller to
  37784. // add HTTP headers to the request.
  37785. func (c *BackendServicesTestIamPermissionsCall) Header() http.Header {
  37786. if c.header_ == nil {
  37787. c.header_ = make(http.Header)
  37788. }
  37789. return c.header_
  37790. }
  37791. func (c *BackendServicesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  37792. reqHeaders := make(http.Header)
  37793. for k, v := range c.header_ {
  37794. reqHeaders[k] = v
  37795. }
  37796. reqHeaders.Set("User-Agent", c.s.userAgent())
  37797. var body io.Reader = nil
  37798. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  37799. if err != nil {
  37800. return nil, err
  37801. }
  37802. reqHeaders.Set("Content-Type", "application/json")
  37803. c.urlParams_.Set("alt", alt)
  37804. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{resource}/testIamPermissions")
  37805. urls += "?" + c.urlParams_.Encode()
  37806. req, _ := http.NewRequest("POST", urls, body)
  37807. req.Header = reqHeaders
  37808. googleapi.Expand(req.URL, map[string]string{
  37809. "project": c.project,
  37810. "resource": c.resource,
  37811. })
  37812. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37813. }
  37814. // Do executes the "compute.backendServices.testIamPermissions" call.
  37815. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  37816. // non-2xx status code is an error. Response headers are in either
  37817. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  37818. // returned at all) in error.(*googleapi.Error).Header. Use
  37819. // googleapi.IsNotModified to check whether the returned error was
  37820. // because http.StatusNotModified was returned.
  37821. func (c *BackendServicesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  37822. gensupport.SetOptions(c.urlParams_, opts...)
  37823. res, err := c.doRequest("json")
  37824. if res != nil && res.StatusCode == http.StatusNotModified {
  37825. if res.Body != nil {
  37826. res.Body.Close()
  37827. }
  37828. return nil, &googleapi.Error{
  37829. Code: res.StatusCode,
  37830. Header: res.Header,
  37831. }
  37832. }
  37833. if err != nil {
  37834. return nil, err
  37835. }
  37836. defer googleapi.CloseBody(res)
  37837. if err := googleapi.CheckResponse(res); err != nil {
  37838. return nil, err
  37839. }
  37840. ret := &TestPermissionsResponse{
  37841. ServerResponse: googleapi.ServerResponse{
  37842. Header: res.Header,
  37843. HTTPStatusCode: res.StatusCode,
  37844. },
  37845. }
  37846. target := &ret
  37847. if err := gensupport.DecodeResponse(target, res); err != nil {
  37848. return nil, err
  37849. }
  37850. return ret, nil
  37851. // {
  37852. // "description": "Returns permissions that a caller has on the specified resource.",
  37853. // "httpMethod": "POST",
  37854. // "id": "compute.backendServices.testIamPermissions",
  37855. // "parameterOrder": [
  37856. // "project",
  37857. // "resource"
  37858. // ],
  37859. // "parameters": {
  37860. // "project": {
  37861. // "description": "Project ID for this request.",
  37862. // "location": "path",
  37863. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  37864. // "required": true,
  37865. // "type": "string"
  37866. // },
  37867. // "resource": {
  37868. // "description": "Name of the resource for this request.",
  37869. // "location": "path",
  37870. // "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?",
  37871. // "required": true,
  37872. // "type": "string"
  37873. // }
  37874. // },
  37875. // "path": "{project}/global/backendServices/{resource}/testIamPermissions",
  37876. // "request": {
  37877. // "$ref": "TestPermissionsRequest"
  37878. // },
  37879. // "response": {
  37880. // "$ref": "TestPermissionsResponse"
  37881. // },
  37882. // "scopes": [
  37883. // "https://www.googleapis.com/auth/cloud-platform",
  37884. // "https://www.googleapis.com/auth/compute",
  37885. // "https://www.googleapis.com/auth/compute.readonly"
  37886. // ]
  37887. // }
  37888. }
  37889. // method id "compute.backendServices.update":
  37890. type BackendServicesUpdateCall struct {
  37891. s *Service
  37892. project string
  37893. backendService string
  37894. backendservice *BackendService
  37895. urlParams_ gensupport.URLParams
  37896. ctx_ context.Context
  37897. header_ http.Header
  37898. }
  37899. // Update: Updates the specified BackendService resource with the data
  37900. // included in the request. There are several restrictions and
  37901. // guidelines to keep in mind when updating a backend service. Read
  37902. // Restrictions and Guidelines for more information.
  37903. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/update
  37904. func (r *BackendServicesService) Update(project string, backendService string, backendservice *BackendService) *BackendServicesUpdateCall {
  37905. c := &BackendServicesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37906. c.project = project
  37907. c.backendService = backendService
  37908. c.backendservice = backendservice
  37909. return c
  37910. }
  37911. // RequestId sets the optional parameter "requestId": An optional
  37912. // request ID to identify requests. Specify a unique request ID so that
  37913. // if you must retry your request, the server will know to ignore the
  37914. // request if it has already been completed.
  37915. //
  37916. // For example, consider a situation where you make an initial request
  37917. // and the request times out. If you make the request again with the
  37918. // same request ID, the server can check if original operation with the
  37919. // same request ID was received, and if so, will ignore the second
  37920. // request. This prevents clients from accidentally creating duplicate
  37921. // commitments.
  37922. //
  37923. // The request ID must be a valid UUID with the exception that zero UUID
  37924. // is not supported (00000000-0000-0000-0000-000000000000).
  37925. func (c *BackendServicesUpdateCall) RequestId(requestId string) *BackendServicesUpdateCall {
  37926. c.urlParams_.Set("requestId", requestId)
  37927. return c
  37928. }
  37929. // Fields allows partial responses to be retrieved. See
  37930. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37931. // for more information.
  37932. func (c *BackendServicesUpdateCall) Fields(s ...googleapi.Field) *BackendServicesUpdateCall {
  37933. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37934. return c
  37935. }
  37936. // Context sets the context to be used in this call's Do method. Any
  37937. // pending HTTP request will be aborted if the provided context is
  37938. // canceled.
  37939. func (c *BackendServicesUpdateCall) Context(ctx context.Context) *BackendServicesUpdateCall {
  37940. c.ctx_ = ctx
  37941. return c
  37942. }
  37943. // Header returns an http.Header that can be modified by the caller to
  37944. // add HTTP headers to the request.
  37945. func (c *BackendServicesUpdateCall) Header() http.Header {
  37946. if c.header_ == nil {
  37947. c.header_ = make(http.Header)
  37948. }
  37949. return c.header_
  37950. }
  37951. func (c *BackendServicesUpdateCall) doRequest(alt string) (*http.Response, error) {
  37952. reqHeaders := make(http.Header)
  37953. for k, v := range c.header_ {
  37954. reqHeaders[k] = v
  37955. }
  37956. reqHeaders.Set("User-Agent", c.s.userAgent())
  37957. var body io.Reader = nil
  37958. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  37959. if err != nil {
  37960. return nil, err
  37961. }
  37962. reqHeaders.Set("Content-Type", "application/json")
  37963. c.urlParams_.Set("alt", alt)
  37964. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}")
  37965. urls += "?" + c.urlParams_.Encode()
  37966. req, _ := http.NewRequest("PUT", urls, body)
  37967. req.Header = reqHeaders
  37968. googleapi.Expand(req.URL, map[string]string{
  37969. "project": c.project,
  37970. "backendService": c.backendService,
  37971. })
  37972. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37973. }
  37974. // Do executes the "compute.backendServices.update" call.
  37975. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  37976. // status code is an error. Response headers are in either
  37977. // *Operation.ServerResponse.Header or (if a response was returned at
  37978. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  37979. // to check whether the returned error was because
  37980. // http.StatusNotModified was returned.
  37981. func (c *BackendServicesUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  37982. gensupport.SetOptions(c.urlParams_, opts...)
  37983. res, err := c.doRequest("json")
  37984. if res != nil && res.StatusCode == http.StatusNotModified {
  37985. if res.Body != nil {
  37986. res.Body.Close()
  37987. }
  37988. return nil, &googleapi.Error{
  37989. Code: res.StatusCode,
  37990. Header: res.Header,
  37991. }
  37992. }
  37993. if err != nil {
  37994. return nil, err
  37995. }
  37996. defer googleapi.CloseBody(res)
  37997. if err := googleapi.CheckResponse(res); err != nil {
  37998. return nil, err
  37999. }
  38000. ret := &Operation{
  38001. ServerResponse: googleapi.ServerResponse{
  38002. Header: res.Header,
  38003. HTTPStatusCode: res.StatusCode,
  38004. },
  38005. }
  38006. target := &ret
  38007. if err := gensupport.DecodeResponse(target, res); err != nil {
  38008. return nil, err
  38009. }
  38010. return ret, nil
  38011. // {
  38012. // "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.",
  38013. // "httpMethod": "PUT",
  38014. // "id": "compute.backendServices.update",
  38015. // "parameterOrder": [
  38016. // "project",
  38017. // "backendService"
  38018. // ],
  38019. // "parameters": {
  38020. // "backendService": {
  38021. // "description": "Name of the BackendService resource to update.",
  38022. // "location": "path",
  38023. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  38024. // "required": true,
  38025. // "type": "string"
  38026. // },
  38027. // "project": {
  38028. // "description": "Project ID for this request.",
  38029. // "location": "path",
  38030. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  38031. // "required": true,
  38032. // "type": "string"
  38033. // },
  38034. // "requestId": {
  38035. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  38036. // "location": "query",
  38037. // "type": "string"
  38038. // }
  38039. // },
  38040. // "path": "{project}/global/backendServices/{backendService}",
  38041. // "request": {
  38042. // "$ref": "BackendService"
  38043. // },
  38044. // "response": {
  38045. // "$ref": "Operation"
  38046. // },
  38047. // "scopes": [
  38048. // "https://www.googleapis.com/auth/cloud-platform",
  38049. // "https://www.googleapis.com/auth/compute"
  38050. // ]
  38051. // }
  38052. }
  38053. // method id "compute.diskTypes.aggregatedList":
  38054. type DiskTypesAggregatedListCall struct {
  38055. s *Service
  38056. project string
  38057. urlParams_ gensupport.URLParams
  38058. ifNoneMatch_ string
  38059. ctx_ context.Context
  38060. header_ http.Header
  38061. }
  38062. // AggregatedList: Retrieves an aggregated list of disk types.
  38063. // For details, see https://cloud.google.com/compute/docs/reference/latest/diskTypes/aggregatedList
  38064. func (r *DiskTypesService) AggregatedList(project string) *DiskTypesAggregatedListCall {
  38065. c := &DiskTypesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38066. c.project = project
  38067. return c
  38068. }
  38069. // Filter sets the optional parameter "filter": A filter expression that
  38070. // filters resources listed in the response. The expression must specify
  38071. // the field name, a comparison operator, and the value that you want to
  38072. // use for filtering. The value must be a string, a number, or a
  38073. // boolean. The comparison operator must be either =, !=, >, or <.
  38074. //
  38075. // For example, if you are filtering Compute Engine instances, you can
  38076. // exclude instances named example-instance by specifying name !=
  38077. // example-instance.
  38078. //
  38079. // You can also filter nested fields. For example, you could specify
  38080. // scheduling.automaticRestart = false to include instances only if they
  38081. // are not scheduled for automatic restarts. You can use filtering on
  38082. // nested fields to filter based on resource labels.
  38083. //
  38084. // To filter on multiple expressions, provide each separate expression
  38085. // within parentheses. For example, (scheduling.automaticRestart = true)
  38086. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  38087. // AND expression. However, you can include AND and OR expressions
  38088. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  38089. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  38090. // true).
  38091. func (c *DiskTypesAggregatedListCall) Filter(filter string) *DiskTypesAggregatedListCall {
  38092. c.urlParams_.Set("filter", filter)
  38093. return c
  38094. }
  38095. // MaxResults sets the optional parameter "maxResults": The maximum
  38096. // number of results per page that should be returned. If the number of
  38097. // available results is larger than maxResults, Compute Engine returns a
  38098. // nextPageToken that can be used to get the next page of results in
  38099. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  38100. // (Default: 500)
  38101. func (c *DiskTypesAggregatedListCall) MaxResults(maxResults int64) *DiskTypesAggregatedListCall {
  38102. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  38103. return c
  38104. }
  38105. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  38106. // a certain order. By default, results are returned in alphanumerical
  38107. // order based on the resource name.
  38108. //
  38109. // You can also sort results in descending order based on the creation
  38110. // timestamp using orderBy="creationTimestamp desc". This sorts results
  38111. // based on the creationTimestamp field in reverse chronological order
  38112. // (newest result first). Use this to sort resources like operations so
  38113. // that the newest operation is returned first.
  38114. //
  38115. // Currently, only sorting by name or creationTimestamp desc is
  38116. // supported.
  38117. func (c *DiskTypesAggregatedListCall) OrderBy(orderBy string) *DiskTypesAggregatedListCall {
  38118. c.urlParams_.Set("orderBy", orderBy)
  38119. return c
  38120. }
  38121. // PageToken sets the optional parameter "pageToken": Specifies a page
  38122. // token to use. Set pageToken to the nextPageToken returned by a
  38123. // previous list request to get the next page of results.
  38124. func (c *DiskTypesAggregatedListCall) PageToken(pageToken string) *DiskTypesAggregatedListCall {
  38125. c.urlParams_.Set("pageToken", pageToken)
  38126. return c
  38127. }
  38128. // Fields allows partial responses to be retrieved. See
  38129. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38130. // for more information.
  38131. func (c *DiskTypesAggregatedListCall) Fields(s ...googleapi.Field) *DiskTypesAggregatedListCall {
  38132. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38133. return c
  38134. }
  38135. // IfNoneMatch sets the optional parameter which makes the operation
  38136. // fail if the object's ETag matches the given value. This is useful for
  38137. // getting updates only after the object has changed since the last
  38138. // request. Use googleapi.IsNotModified to check whether the response
  38139. // error from Do is the result of In-None-Match.
  38140. func (c *DiskTypesAggregatedListCall) IfNoneMatch(entityTag string) *DiskTypesAggregatedListCall {
  38141. c.ifNoneMatch_ = entityTag
  38142. return c
  38143. }
  38144. // Context sets the context to be used in this call's Do method. Any
  38145. // pending HTTP request will be aborted if the provided context is
  38146. // canceled.
  38147. func (c *DiskTypesAggregatedListCall) Context(ctx context.Context) *DiskTypesAggregatedListCall {
  38148. c.ctx_ = ctx
  38149. return c
  38150. }
  38151. // Header returns an http.Header that can be modified by the caller to
  38152. // add HTTP headers to the request.
  38153. func (c *DiskTypesAggregatedListCall) Header() http.Header {
  38154. if c.header_ == nil {
  38155. c.header_ = make(http.Header)
  38156. }
  38157. return c.header_
  38158. }
  38159. func (c *DiskTypesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  38160. reqHeaders := make(http.Header)
  38161. for k, v := range c.header_ {
  38162. reqHeaders[k] = v
  38163. }
  38164. reqHeaders.Set("User-Agent", c.s.userAgent())
  38165. if c.ifNoneMatch_ != "" {
  38166. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  38167. }
  38168. var body io.Reader = nil
  38169. c.urlParams_.Set("alt", alt)
  38170. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/diskTypes")
  38171. urls += "?" + c.urlParams_.Encode()
  38172. req, _ := http.NewRequest("GET", urls, body)
  38173. req.Header = reqHeaders
  38174. googleapi.Expand(req.URL, map[string]string{
  38175. "project": c.project,
  38176. })
  38177. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38178. }
  38179. // Do executes the "compute.diskTypes.aggregatedList" call.
  38180. // Exactly one of *DiskTypeAggregatedList or error will be non-nil. Any
  38181. // non-2xx status code is an error. Response headers are in either
  38182. // *DiskTypeAggregatedList.ServerResponse.Header or (if a response was
  38183. // returned at all) in error.(*googleapi.Error).Header. Use
  38184. // googleapi.IsNotModified to check whether the returned error was
  38185. // because http.StatusNotModified was returned.
  38186. func (c *DiskTypesAggregatedListCall) Do(opts ...googleapi.CallOption) (*DiskTypeAggregatedList, error) {
  38187. gensupport.SetOptions(c.urlParams_, opts...)
  38188. res, err := c.doRequest("json")
  38189. if res != nil && res.StatusCode == http.StatusNotModified {
  38190. if res.Body != nil {
  38191. res.Body.Close()
  38192. }
  38193. return nil, &googleapi.Error{
  38194. Code: res.StatusCode,
  38195. Header: res.Header,
  38196. }
  38197. }
  38198. if err != nil {
  38199. return nil, err
  38200. }
  38201. defer googleapi.CloseBody(res)
  38202. if err := googleapi.CheckResponse(res); err != nil {
  38203. return nil, err
  38204. }
  38205. ret := &DiskTypeAggregatedList{
  38206. ServerResponse: googleapi.ServerResponse{
  38207. Header: res.Header,
  38208. HTTPStatusCode: res.StatusCode,
  38209. },
  38210. }
  38211. target := &ret
  38212. if err := gensupport.DecodeResponse(target, res); err != nil {
  38213. return nil, err
  38214. }
  38215. return ret, nil
  38216. // {
  38217. // "description": "Retrieves an aggregated list of disk types.",
  38218. // "httpMethod": "GET",
  38219. // "id": "compute.diskTypes.aggregatedList",
  38220. // "parameterOrder": [
  38221. // "project"
  38222. // ],
  38223. // "parameters": {
  38224. // "filter": {
  38225. // "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).",
  38226. // "location": "query",
  38227. // "type": "string"
  38228. // },
  38229. // "maxResults": {
  38230. // "default": "500",
  38231. // "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)",
  38232. // "format": "uint32",
  38233. // "location": "query",
  38234. // "minimum": "0",
  38235. // "type": "integer"
  38236. // },
  38237. // "orderBy": {
  38238. // "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.",
  38239. // "location": "query",
  38240. // "type": "string"
  38241. // },
  38242. // "pageToken": {
  38243. // "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.",
  38244. // "location": "query",
  38245. // "type": "string"
  38246. // },
  38247. // "project": {
  38248. // "description": "Project ID for this request.",
  38249. // "location": "path",
  38250. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  38251. // "required": true,
  38252. // "type": "string"
  38253. // }
  38254. // },
  38255. // "path": "{project}/aggregated/diskTypes",
  38256. // "response": {
  38257. // "$ref": "DiskTypeAggregatedList"
  38258. // },
  38259. // "scopes": [
  38260. // "https://www.googleapis.com/auth/cloud-platform",
  38261. // "https://www.googleapis.com/auth/compute",
  38262. // "https://www.googleapis.com/auth/compute.readonly"
  38263. // ]
  38264. // }
  38265. }
  38266. // Pages invokes f for each page of results.
  38267. // A non-nil error returned from f will halt the iteration.
  38268. // The provided context supersedes any context provided to the Context method.
  38269. func (c *DiskTypesAggregatedListCall) Pages(ctx context.Context, f func(*DiskTypeAggregatedList) error) error {
  38270. c.ctx_ = ctx
  38271. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  38272. for {
  38273. x, err := c.Do()
  38274. if err != nil {
  38275. return err
  38276. }
  38277. if err := f(x); err != nil {
  38278. return err
  38279. }
  38280. if x.NextPageToken == "" {
  38281. return nil
  38282. }
  38283. c.PageToken(x.NextPageToken)
  38284. }
  38285. }
  38286. // method id "compute.diskTypes.get":
  38287. type DiskTypesGetCall struct {
  38288. s *Service
  38289. project string
  38290. zone string
  38291. diskType string
  38292. urlParams_ gensupport.URLParams
  38293. ifNoneMatch_ string
  38294. ctx_ context.Context
  38295. header_ http.Header
  38296. }
  38297. // Get: Returns the specified disk type. Gets a list of available disk
  38298. // types by making a list() request.
  38299. // For details, see https://cloud.google.com/compute/docs/reference/latest/diskTypes/get
  38300. func (r *DiskTypesService) Get(project string, zone string, diskType string) *DiskTypesGetCall {
  38301. c := &DiskTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38302. c.project = project
  38303. c.zone = zone
  38304. c.diskType = diskType
  38305. return c
  38306. }
  38307. // Fields allows partial responses to be retrieved. See
  38308. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38309. // for more information.
  38310. func (c *DiskTypesGetCall) Fields(s ...googleapi.Field) *DiskTypesGetCall {
  38311. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38312. return c
  38313. }
  38314. // IfNoneMatch sets the optional parameter which makes the operation
  38315. // fail if the object's ETag matches the given value. This is useful for
  38316. // getting updates only after the object has changed since the last
  38317. // request. Use googleapi.IsNotModified to check whether the response
  38318. // error from Do is the result of In-None-Match.
  38319. func (c *DiskTypesGetCall) IfNoneMatch(entityTag string) *DiskTypesGetCall {
  38320. c.ifNoneMatch_ = entityTag
  38321. return c
  38322. }
  38323. // Context sets the context to be used in this call's Do method. Any
  38324. // pending HTTP request will be aborted if the provided context is
  38325. // canceled.
  38326. func (c *DiskTypesGetCall) Context(ctx context.Context) *DiskTypesGetCall {
  38327. c.ctx_ = ctx
  38328. return c
  38329. }
  38330. // Header returns an http.Header that can be modified by the caller to
  38331. // add HTTP headers to the request.
  38332. func (c *DiskTypesGetCall) Header() http.Header {
  38333. if c.header_ == nil {
  38334. c.header_ = make(http.Header)
  38335. }
  38336. return c.header_
  38337. }
  38338. func (c *DiskTypesGetCall) doRequest(alt string) (*http.Response, error) {
  38339. reqHeaders := make(http.Header)
  38340. for k, v := range c.header_ {
  38341. reqHeaders[k] = v
  38342. }
  38343. reqHeaders.Set("User-Agent", c.s.userAgent())
  38344. if c.ifNoneMatch_ != "" {
  38345. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  38346. }
  38347. var body io.Reader = nil
  38348. c.urlParams_.Set("alt", alt)
  38349. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/diskTypes/{diskType}")
  38350. urls += "?" + c.urlParams_.Encode()
  38351. req, _ := http.NewRequest("GET", urls, body)
  38352. req.Header = reqHeaders
  38353. googleapi.Expand(req.URL, map[string]string{
  38354. "project": c.project,
  38355. "zone": c.zone,
  38356. "diskType": c.diskType,
  38357. })
  38358. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38359. }
  38360. // Do executes the "compute.diskTypes.get" call.
  38361. // Exactly one of *DiskType or error will be non-nil. Any non-2xx status
  38362. // code is an error. Response headers are in either
  38363. // *DiskType.ServerResponse.Header or (if a response was returned at
  38364. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  38365. // to check whether the returned error was because
  38366. // http.StatusNotModified was returned.
  38367. func (c *DiskTypesGetCall) Do(opts ...googleapi.CallOption) (*DiskType, error) {
  38368. gensupport.SetOptions(c.urlParams_, opts...)
  38369. res, err := c.doRequest("json")
  38370. if res != nil && res.StatusCode == http.StatusNotModified {
  38371. if res.Body != nil {
  38372. res.Body.Close()
  38373. }
  38374. return nil, &googleapi.Error{
  38375. Code: res.StatusCode,
  38376. Header: res.Header,
  38377. }
  38378. }
  38379. if err != nil {
  38380. return nil, err
  38381. }
  38382. defer googleapi.CloseBody(res)
  38383. if err := googleapi.CheckResponse(res); err != nil {
  38384. return nil, err
  38385. }
  38386. ret := &DiskType{
  38387. ServerResponse: googleapi.ServerResponse{
  38388. Header: res.Header,
  38389. HTTPStatusCode: res.StatusCode,
  38390. },
  38391. }
  38392. target := &ret
  38393. if err := gensupport.DecodeResponse(target, res); err != nil {
  38394. return nil, err
  38395. }
  38396. return ret, nil
  38397. // {
  38398. // "description": "Returns the specified disk type. Gets a list of available disk types by making a list() request.",
  38399. // "httpMethod": "GET",
  38400. // "id": "compute.diskTypes.get",
  38401. // "parameterOrder": [
  38402. // "project",
  38403. // "zone",
  38404. // "diskType"
  38405. // ],
  38406. // "parameters": {
  38407. // "diskType": {
  38408. // "description": "Name of the disk type to return.",
  38409. // "location": "path",
  38410. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  38411. // "required": true,
  38412. // "type": "string"
  38413. // },
  38414. // "project": {
  38415. // "description": "Project ID for this request.",
  38416. // "location": "path",
  38417. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  38418. // "required": true,
  38419. // "type": "string"
  38420. // },
  38421. // "zone": {
  38422. // "description": "The name of the zone for this request.",
  38423. // "location": "path",
  38424. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  38425. // "required": true,
  38426. // "type": "string"
  38427. // }
  38428. // },
  38429. // "path": "{project}/zones/{zone}/diskTypes/{diskType}",
  38430. // "response": {
  38431. // "$ref": "DiskType"
  38432. // },
  38433. // "scopes": [
  38434. // "https://www.googleapis.com/auth/cloud-platform",
  38435. // "https://www.googleapis.com/auth/compute",
  38436. // "https://www.googleapis.com/auth/compute.readonly"
  38437. // ]
  38438. // }
  38439. }
  38440. // method id "compute.diskTypes.list":
  38441. type DiskTypesListCall struct {
  38442. s *Service
  38443. project string
  38444. zone string
  38445. urlParams_ gensupport.URLParams
  38446. ifNoneMatch_ string
  38447. ctx_ context.Context
  38448. header_ http.Header
  38449. }
  38450. // List: Retrieves a list of disk types available to the specified
  38451. // project.
  38452. // For details, see https://cloud.google.com/compute/docs/reference/latest/diskTypes/list
  38453. func (r *DiskTypesService) List(project string, zone string) *DiskTypesListCall {
  38454. c := &DiskTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38455. c.project = project
  38456. c.zone = zone
  38457. return c
  38458. }
  38459. // Filter sets the optional parameter "filter": A filter expression that
  38460. // filters resources listed in the response. The expression must specify
  38461. // the field name, a comparison operator, and the value that you want to
  38462. // use for filtering. The value must be a string, a number, or a
  38463. // boolean. The comparison operator must be either =, !=, >, or <.
  38464. //
  38465. // For example, if you are filtering Compute Engine instances, you can
  38466. // exclude instances named example-instance by specifying name !=
  38467. // example-instance.
  38468. //
  38469. // You can also filter nested fields. For example, you could specify
  38470. // scheduling.automaticRestart = false to include instances only if they
  38471. // are not scheduled for automatic restarts. You can use filtering on
  38472. // nested fields to filter based on resource labels.
  38473. //
  38474. // To filter on multiple expressions, provide each separate expression
  38475. // within parentheses. For example, (scheduling.automaticRestart = true)
  38476. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  38477. // AND expression. However, you can include AND and OR expressions
  38478. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  38479. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  38480. // true).
  38481. func (c *DiskTypesListCall) Filter(filter string) *DiskTypesListCall {
  38482. c.urlParams_.Set("filter", filter)
  38483. return c
  38484. }
  38485. // MaxResults sets the optional parameter "maxResults": The maximum
  38486. // number of results per page that should be returned. If the number of
  38487. // available results is larger than maxResults, Compute Engine returns a
  38488. // nextPageToken that can be used to get the next page of results in
  38489. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  38490. // (Default: 500)
  38491. func (c *DiskTypesListCall) MaxResults(maxResults int64) *DiskTypesListCall {
  38492. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  38493. return c
  38494. }
  38495. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  38496. // a certain order. By default, results are returned in alphanumerical
  38497. // order based on the resource name.
  38498. //
  38499. // You can also sort results in descending order based on the creation
  38500. // timestamp using orderBy="creationTimestamp desc". This sorts results
  38501. // based on the creationTimestamp field in reverse chronological order
  38502. // (newest result first). Use this to sort resources like operations so
  38503. // that the newest operation is returned first.
  38504. //
  38505. // Currently, only sorting by name or creationTimestamp desc is
  38506. // supported.
  38507. func (c *DiskTypesListCall) OrderBy(orderBy string) *DiskTypesListCall {
  38508. c.urlParams_.Set("orderBy", orderBy)
  38509. return c
  38510. }
  38511. // PageToken sets the optional parameter "pageToken": Specifies a page
  38512. // token to use. Set pageToken to the nextPageToken returned by a
  38513. // previous list request to get the next page of results.
  38514. func (c *DiskTypesListCall) PageToken(pageToken string) *DiskTypesListCall {
  38515. c.urlParams_.Set("pageToken", pageToken)
  38516. return c
  38517. }
  38518. // Fields allows partial responses to be retrieved. See
  38519. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38520. // for more information.
  38521. func (c *DiskTypesListCall) Fields(s ...googleapi.Field) *DiskTypesListCall {
  38522. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38523. return c
  38524. }
  38525. // IfNoneMatch sets the optional parameter which makes the operation
  38526. // fail if the object's ETag matches the given value. This is useful for
  38527. // getting updates only after the object has changed since the last
  38528. // request. Use googleapi.IsNotModified to check whether the response
  38529. // error from Do is the result of In-None-Match.
  38530. func (c *DiskTypesListCall) IfNoneMatch(entityTag string) *DiskTypesListCall {
  38531. c.ifNoneMatch_ = entityTag
  38532. return c
  38533. }
  38534. // Context sets the context to be used in this call's Do method. Any
  38535. // pending HTTP request will be aborted if the provided context is
  38536. // canceled.
  38537. func (c *DiskTypesListCall) Context(ctx context.Context) *DiskTypesListCall {
  38538. c.ctx_ = ctx
  38539. return c
  38540. }
  38541. // Header returns an http.Header that can be modified by the caller to
  38542. // add HTTP headers to the request.
  38543. func (c *DiskTypesListCall) Header() http.Header {
  38544. if c.header_ == nil {
  38545. c.header_ = make(http.Header)
  38546. }
  38547. return c.header_
  38548. }
  38549. func (c *DiskTypesListCall) doRequest(alt string) (*http.Response, error) {
  38550. reqHeaders := make(http.Header)
  38551. for k, v := range c.header_ {
  38552. reqHeaders[k] = v
  38553. }
  38554. reqHeaders.Set("User-Agent", c.s.userAgent())
  38555. if c.ifNoneMatch_ != "" {
  38556. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  38557. }
  38558. var body io.Reader = nil
  38559. c.urlParams_.Set("alt", alt)
  38560. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/diskTypes")
  38561. urls += "?" + c.urlParams_.Encode()
  38562. req, _ := http.NewRequest("GET", urls, body)
  38563. req.Header = reqHeaders
  38564. googleapi.Expand(req.URL, map[string]string{
  38565. "project": c.project,
  38566. "zone": c.zone,
  38567. })
  38568. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38569. }
  38570. // Do executes the "compute.diskTypes.list" call.
  38571. // Exactly one of *DiskTypeList or error will be non-nil. Any non-2xx
  38572. // status code is an error. Response headers are in either
  38573. // *DiskTypeList.ServerResponse.Header or (if a response was returned at
  38574. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  38575. // to check whether the returned error was because
  38576. // http.StatusNotModified was returned.
  38577. func (c *DiskTypesListCall) Do(opts ...googleapi.CallOption) (*DiskTypeList, error) {
  38578. gensupport.SetOptions(c.urlParams_, opts...)
  38579. res, err := c.doRequest("json")
  38580. if res != nil && res.StatusCode == http.StatusNotModified {
  38581. if res.Body != nil {
  38582. res.Body.Close()
  38583. }
  38584. return nil, &googleapi.Error{
  38585. Code: res.StatusCode,
  38586. Header: res.Header,
  38587. }
  38588. }
  38589. if err != nil {
  38590. return nil, err
  38591. }
  38592. defer googleapi.CloseBody(res)
  38593. if err := googleapi.CheckResponse(res); err != nil {
  38594. return nil, err
  38595. }
  38596. ret := &DiskTypeList{
  38597. ServerResponse: googleapi.ServerResponse{
  38598. Header: res.Header,
  38599. HTTPStatusCode: res.StatusCode,
  38600. },
  38601. }
  38602. target := &ret
  38603. if err := gensupport.DecodeResponse(target, res); err != nil {
  38604. return nil, err
  38605. }
  38606. return ret, nil
  38607. // {
  38608. // "description": "Retrieves a list of disk types available to the specified project.",
  38609. // "httpMethod": "GET",
  38610. // "id": "compute.diskTypes.list",
  38611. // "parameterOrder": [
  38612. // "project",
  38613. // "zone"
  38614. // ],
  38615. // "parameters": {
  38616. // "filter": {
  38617. // "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).",
  38618. // "location": "query",
  38619. // "type": "string"
  38620. // },
  38621. // "maxResults": {
  38622. // "default": "500",
  38623. // "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)",
  38624. // "format": "uint32",
  38625. // "location": "query",
  38626. // "minimum": "0",
  38627. // "type": "integer"
  38628. // },
  38629. // "orderBy": {
  38630. // "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.",
  38631. // "location": "query",
  38632. // "type": "string"
  38633. // },
  38634. // "pageToken": {
  38635. // "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.",
  38636. // "location": "query",
  38637. // "type": "string"
  38638. // },
  38639. // "project": {
  38640. // "description": "Project ID for this request.",
  38641. // "location": "path",
  38642. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  38643. // "required": true,
  38644. // "type": "string"
  38645. // },
  38646. // "zone": {
  38647. // "description": "The name of the zone for this request.",
  38648. // "location": "path",
  38649. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  38650. // "required": true,
  38651. // "type": "string"
  38652. // }
  38653. // },
  38654. // "path": "{project}/zones/{zone}/diskTypes",
  38655. // "response": {
  38656. // "$ref": "DiskTypeList"
  38657. // },
  38658. // "scopes": [
  38659. // "https://www.googleapis.com/auth/cloud-platform",
  38660. // "https://www.googleapis.com/auth/compute",
  38661. // "https://www.googleapis.com/auth/compute.readonly"
  38662. // ]
  38663. // }
  38664. }
  38665. // Pages invokes f for each page of results.
  38666. // A non-nil error returned from f will halt the iteration.
  38667. // The provided context supersedes any context provided to the Context method.
  38668. func (c *DiskTypesListCall) Pages(ctx context.Context, f func(*DiskTypeList) error) error {
  38669. c.ctx_ = ctx
  38670. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  38671. for {
  38672. x, err := c.Do()
  38673. if err != nil {
  38674. return err
  38675. }
  38676. if err := f(x); err != nil {
  38677. return err
  38678. }
  38679. if x.NextPageToken == "" {
  38680. return nil
  38681. }
  38682. c.PageToken(x.NextPageToken)
  38683. }
  38684. }
  38685. // method id "compute.disks.addResourcePolicies":
  38686. type DisksAddResourcePoliciesCall struct {
  38687. s *Service
  38688. project string
  38689. zone string
  38690. disk string
  38691. disksaddresourcepoliciesrequest *DisksAddResourcePoliciesRequest
  38692. urlParams_ gensupport.URLParams
  38693. ctx_ context.Context
  38694. header_ http.Header
  38695. }
  38696. // AddResourcePolicies: Adds existing resource policies to a disk. You
  38697. // can only add one policy which will be applied to this disk for
  38698. // scheduling snapshot creation.
  38699. func (r *DisksService) AddResourcePolicies(project string, zone string, disk string, disksaddresourcepoliciesrequest *DisksAddResourcePoliciesRequest) *DisksAddResourcePoliciesCall {
  38700. c := &DisksAddResourcePoliciesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38701. c.project = project
  38702. c.zone = zone
  38703. c.disk = disk
  38704. c.disksaddresourcepoliciesrequest = disksaddresourcepoliciesrequest
  38705. return c
  38706. }
  38707. // RequestId sets the optional parameter "requestId": An optional
  38708. // request ID to identify requests. Specify a unique request ID so that
  38709. // if you must retry your request, the server will know to ignore the
  38710. // request if it has already been completed.
  38711. //
  38712. // For example, consider a situation where you make an initial request
  38713. // and the request times out. If you make the request again with the
  38714. // same request ID, the server can check if original operation with the
  38715. // same request ID was received, and if so, will ignore the second
  38716. // request. This prevents clients from accidentally creating duplicate
  38717. // commitments.
  38718. //
  38719. // The request ID must be a valid UUID with the exception that zero UUID
  38720. // is not supported (00000000-0000-0000-0000-000000000000).
  38721. func (c *DisksAddResourcePoliciesCall) RequestId(requestId string) *DisksAddResourcePoliciesCall {
  38722. c.urlParams_.Set("requestId", requestId)
  38723. return c
  38724. }
  38725. // Fields allows partial responses to be retrieved. See
  38726. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38727. // for more information.
  38728. func (c *DisksAddResourcePoliciesCall) Fields(s ...googleapi.Field) *DisksAddResourcePoliciesCall {
  38729. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38730. return c
  38731. }
  38732. // Context sets the context to be used in this call's Do method. Any
  38733. // pending HTTP request will be aborted if the provided context is
  38734. // canceled.
  38735. func (c *DisksAddResourcePoliciesCall) Context(ctx context.Context) *DisksAddResourcePoliciesCall {
  38736. c.ctx_ = ctx
  38737. return c
  38738. }
  38739. // Header returns an http.Header that can be modified by the caller to
  38740. // add HTTP headers to the request.
  38741. func (c *DisksAddResourcePoliciesCall) Header() http.Header {
  38742. if c.header_ == nil {
  38743. c.header_ = make(http.Header)
  38744. }
  38745. return c.header_
  38746. }
  38747. func (c *DisksAddResourcePoliciesCall) doRequest(alt string) (*http.Response, error) {
  38748. reqHeaders := make(http.Header)
  38749. for k, v := range c.header_ {
  38750. reqHeaders[k] = v
  38751. }
  38752. reqHeaders.Set("User-Agent", c.s.userAgent())
  38753. var body io.Reader = nil
  38754. body, err := googleapi.WithoutDataWrapper.JSONReader(c.disksaddresourcepoliciesrequest)
  38755. if err != nil {
  38756. return nil, err
  38757. }
  38758. reqHeaders.Set("Content-Type", "application/json")
  38759. c.urlParams_.Set("alt", alt)
  38760. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}/addResourcePolicies")
  38761. urls += "?" + c.urlParams_.Encode()
  38762. req, _ := http.NewRequest("POST", urls, body)
  38763. req.Header = reqHeaders
  38764. googleapi.Expand(req.URL, map[string]string{
  38765. "project": c.project,
  38766. "zone": c.zone,
  38767. "disk": c.disk,
  38768. })
  38769. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38770. }
  38771. // Do executes the "compute.disks.addResourcePolicies" call.
  38772. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  38773. // status code is an error. Response headers are in either
  38774. // *Operation.ServerResponse.Header or (if a response was returned at
  38775. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  38776. // to check whether the returned error was because
  38777. // http.StatusNotModified was returned.
  38778. func (c *DisksAddResourcePoliciesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  38779. gensupport.SetOptions(c.urlParams_, opts...)
  38780. res, err := c.doRequest("json")
  38781. if res != nil && res.StatusCode == http.StatusNotModified {
  38782. if res.Body != nil {
  38783. res.Body.Close()
  38784. }
  38785. return nil, &googleapi.Error{
  38786. Code: res.StatusCode,
  38787. Header: res.Header,
  38788. }
  38789. }
  38790. if err != nil {
  38791. return nil, err
  38792. }
  38793. defer googleapi.CloseBody(res)
  38794. if err := googleapi.CheckResponse(res); err != nil {
  38795. return nil, err
  38796. }
  38797. ret := &Operation{
  38798. ServerResponse: googleapi.ServerResponse{
  38799. Header: res.Header,
  38800. HTTPStatusCode: res.StatusCode,
  38801. },
  38802. }
  38803. target := &ret
  38804. if err := gensupport.DecodeResponse(target, res); err != nil {
  38805. return nil, err
  38806. }
  38807. return ret, nil
  38808. // {
  38809. // "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.",
  38810. // "httpMethod": "POST",
  38811. // "id": "compute.disks.addResourcePolicies",
  38812. // "parameterOrder": [
  38813. // "project",
  38814. // "zone",
  38815. // "disk"
  38816. // ],
  38817. // "parameters": {
  38818. // "disk": {
  38819. // "description": "The disk name for this request.",
  38820. // "location": "path",
  38821. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  38822. // "required": true,
  38823. // "type": "string"
  38824. // },
  38825. // "project": {
  38826. // "description": "Project ID for this request.",
  38827. // "location": "path",
  38828. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  38829. // "required": true,
  38830. // "type": "string"
  38831. // },
  38832. // "requestId": {
  38833. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  38834. // "location": "query",
  38835. // "type": "string"
  38836. // },
  38837. // "zone": {
  38838. // "description": "The name of the zone for this request.",
  38839. // "location": "path",
  38840. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  38841. // "required": true,
  38842. // "type": "string"
  38843. // }
  38844. // },
  38845. // "path": "{project}/zones/{zone}/disks/{disk}/addResourcePolicies",
  38846. // "request": {
  38847. // "$ref": "DisksAddResourcePoliciesRequest"
  38848. // },
  38849. // "response": {
  38850. // "$ref": "Operation"
  38851. // },
  38852. // "scopes": [
  38853. // "https://www.googleapis.com/auth/cloud-platform",
  38854. // "https://www.googleapis.com/auth/compute"
  38855. // ]
  38856. // }
  38857. }
  38858. // method id "compute.disks.aggregatedList":
  38859. type DisksAggregatedListCall struct {
  38860. s *Service
  38861. project string
  38862. urlParams_ gensupport.URLParams
  38863. ifNoneMatch_ string
  38864. ctx_ context.Context
  38865. header_ http.Header
  38866. }
  38867. // AggregatedList: Retrieves an aggregated list of persistent disks.
  38868. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/aggregatedList
  38869. func (r *DisksService) AggregatedList(project string) *DisksAggregatedListCall {
  38870. c := &DisksAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38871. c.project = project
  38872. return c
  38873. }
  38874. // Filter sets the optional parameter "filter": A filter expression that
  38875. // filters resources listed in the response. The expression must specify
  38876. // the field name, a comparison operator, and the value that you want to
  38877. // use for filtering. The value must be a string, a number, or a
  38878. // boolean. The comparison operator must be either =, !=, >, or <.
  38879. //
  38880. // For example, if you are filtering Compute Engine instances, you can
  38881. // exclude instances named example-instance by specifying name !=
  38882. // example-instance.
  38883. //
  38884. // You can also filter nested fields. For example, you could specify
  38885. // scheduling.automaticRestart = false to include instances only if they
  38886. // are not scheduled for automatic restarts. You can use filtering on
  38887. // nested fields to filter based on resource labels.
  38888. //
  38889. // To filter on multiple expressions, provide each separate expression
  38890. // within parentheses. For example, (scheduling.automaticRestart = true)
  38891. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  38892. // AND expression. However, you can include AND and OR expressions
  38893. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  38894. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  38895. // true).
  38896. func (c *DisksAggregatedListCall) Filter(filter string) *DisksAggregatedListCall {
  38897. c.urlParams_.Set("filter", filter)
  38898. return c
  38899. }
  38900. // MaxResults sets the optional parameter "maxResults": The maximum
  38901. // number of results per page that should be returned. If the number of
  38902. // available results is larger than maxResults, Compute Engine returns a
  38903. // nextPageToken that can be used to get the next page of results in
  38904. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  38905. // (Default: 500)
  38906. func (c *DisksAggregatedListCall) MaxResults(maxResults int64) *DisksAggregatedListCall {
  38907. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  38908. return c
  38909. }
  38910. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  38911. // a certain order. By default, results are returned in alphanumerical
  38912. // order based on the resource name.
  38913. //
  38914. // You can also sort results in descending order based on the creation
  38915. // timestamp using orderBy="creationTimestamp desc". This sorts results
  38916. // based on the creationTimestamp field in reverse chronological order
  38917. // (newest result first). Use this to sort resources like operations so
  38918. // that the newest operation is returned first.
  38919. //
  38920. // Currently, only sorting by name or creationTimestamp desc is
  38921. // supported.
  38922. func (c *DisksAggregatedListCall) OrderBy(orderBy string) *DisksAggregatedListCall {
  38923. c.urlParams_.Set("orderBy", orderBy)
  38924. return c
  38925. }
  38926. // PageToken sets the optional parameter "pageToken": Specifies a page
  38927. // token to use. Set pageToken to the nextPageToken returned by a
  38928. // previous list request to get the next page of results.
  38929. func (c *DisksAggregatedListCall) PageToken(pageToken string) *DisksAggregatedListCall {
  38930. c.urlParams_.Set("pageToken", pageToken)
  38931. return c
  38932. }
  38933. // Fields allows partial responses to be retrieved. See
  38934. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38935. // for more information.
  38936. func (c *DisksAggregatedListCall) Fields(s ...googleapi.Field) *DisksAggregatedListCall {
  38937. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38938. return c
  38939. }
  38940. // IfNoneMatch sets the optional parameter which makes the operation
  38941. // fail if the object's ETag matches the given value. This is useful for
  38942. // getting updates only after the object has changed since the last
  38943. // request. Use googleapi.IsNotModified to check whether the response
  38944. // error from Do is the result of In-None-Match.
  38945. func (c *DisksAggregatedListCall) IfNoneMatch(entityTag string) *DisksAggregatedListCall {
  38946. c.ifNoneMatch_ = entityTag
  38947. return c
  38948. }
  38949. // Context sets the context to be used in this call's Do method. Any
  38950. // pending HTTP request will be aborted if the provided context is
  38951. // canceled.
  38952. func (c *DisksAggregatedListCall) Context(ctx context.Context) *DisksAggregatedListCall {
  38953. c.ctx_ = ctx
  38954. return c
  38955. }
  38956. // Header returns an http.Header that can be modified by the caller to
  38957. // add HTTP headers to the request.
  38958. func (c *DisksAggregatedListCall) Header() http.Header {
  38959. if c.header_ == nil {
  38960. c.header_ = make(http.Header)
  38961. }
  38962. return c.header_
  38963. }
  38964. func (c *DisksAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  38965. reqHeaders := make(http.Header)
  38966. for k, v := range c.header_ {
  38967. reqHeaders[k] = v
  38968. }
  38969. reqHeaders.Set("User-Agent", c.s.userAgent())
  38970. if c.ifNoneMatch_ != "" {
  38971. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  38972. }
  38973. var body io.Reader = nil
  38974. c.urlParams_.Set("alt", alt)
  38975. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/disks")
  38976. urls += "?" + c.urlParams_.Encode()
  38977. req, _ := http.NewRequest("GET", urls, body)
  38978. req.Header = reqHeaders
  38979. googleapi.Expand(req.URL, map[string]string{
  38980. "project": c.project,
  38981. })
  38982. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38983. }
  38984. // Do executes the "compute.disks.aggregatedList" call.
  38985. // Exactly one of *DiskAggregatedList or error will be non-nil. Any
  38986. // non-2xx status code is an error. Response headers are in either
  38987. // *DiskAggregatedList.ServerResponse.Header or (if a response was
  38988. // returned at all) in error.(*googleapi.Error).Header. Use
  38989. // googleapi.IsNotModified to check whether the returned error was
  38990. // because http.StatusNotModified was returned.
  38991. func (c *DisksAggregatedListCall) Do(opts ...googleapi.CallOption) (*DiskAggregatedList, error) {
  38992. gensupport.SetOptions(c.urlParams_, opts...)
  38993. res, err := c.doRequest("json")
  38994. if res != nil && res.StatusCode == http.StatusNotModified {
  38995. if res.Body != nil {
  38996. res.Body.Close()
  38997. }
  38998. return nil, &googleapi.Error{
  38999. Code: res.StatusCode,
  39000. Header: res.Header,
  39001. }
  39002. }
  39003. if err != nil {
  39004. return nil, err
  39005. }
  39006. defer googleapi.CloseBody(res)
  39007. if err := googleapi.CheckResponse(res); err != nil {
  39008. return nil, err
  39009. }
  39010. ret := &DiskAggregatedList{
  39011. ServerResponse: googleapi.ServerResponse{
  39012. Header: res.Header,
  39013. HTTPStatusCode: res.StatusCode,
  39014. },
  39015. }
  39016. target := &ret
  39017. if err := gensupport.DecodeResponse(target, res); err != nil {
  39018. return nil, err
  39019. }
  39020. return ret, nil
  39021. // {
  39022. // "description": "Retrieves an aggregated list of persistent disks.",
  39023. // "httpMethod": "GET",
  39024. // "id": "compute.disks.aggregatedList",
  39025. // "parameterOrder": [
  39026. // "project"
  39027. // ],
  39028. // "parameters": {
  39029. // "filter": {
  39030. // "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).",
  39031. // "location": "query",
  39032. // "type": "string"
  39033. // },
  39034. // "maxResults": {
  39035. // "default": "500",
  39036. // "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)",
  39037. // "format": "uint32",
  39038. // "location": "query",
  39039. // "minimum": "0",
  39040. // "type": "integer"
  39041. // },
  39042. // "orderBy": {
  39043. // "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.",
  39044. // "location": "query",
  39045. // "type": "string"
  39046. // },
  39047. // "pageToken": {
  39048. // "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.",
  39049. // "location": "query",
  39050. // "type": "string"
  39051. // },
  39052. // "project": {
  39053. // "description": "Project ID for this request.",
  39054. // "location": "path",
  39055. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  39056. // "required": true,
  39057. // "type": "string"
  39058. // }
  39059. // },
  39060. // "path": "{project}/aggregated/disks",
  39061. // "response": {
  39062. // "$ref": "DiskAggregatedList"
  39063. // },
  39064. // "scopes": [
  39065. // "https://www.googleapis.com/auth/cloud-platform",
  39066. // "https://www.googleapis.com/auth/compute",
  39067. // "https://www.googleapis.com/auth/compute.readonly"
  39068. // ]
  39069. // }
  39070. }
  39071. // Pages invokes f for each page of results.
  39072. // A non-nil error returned from f will halt the iteration.
  39073. // The provided context supersedes any context provided to the Context method.
  39074. func (c *DisksAggregatedListCall) Pages(ctx context.Context, f func(*DiskAggregatedList) error) error {
  39075. c.ctx_ = ctx
  39076. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  39077. for {
  39078. x, err := c.Do()
  39079. if err != nil {
  39080. return err
  39081. }
  39082. if err := f(x); err != nil {
  39083. return err
  39084. }
  39085. if x.NextPageToken == "" {
  39086. return nil
  39087. }
  39088. c.PageToken(x.NextPageToken)
  39089. }
  39090. }
  39091. // method id "compute.disks.createSnapshot":
  39092. type DisksCreateSnapshotCall struct {
  39093. s *Service
  39094. project string
  39095. zone string
  39096. disk string
  39097. snapshot *Snapshot
  39098. urlParams_ gensupport.URLParams
  39099. ctx_ context.Context
  39100. header_ http.Header
  39101. }
  39102. // CreateSnapshot: Creates a snapshot of a specified persistent disk.
  39103. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/createSnapshot
  39104. func (r *DisksService) CreateSnapshot(project string, zone string, disk string, snapshot *Snapshot) *DisksCreateSnapshotCall {
  39105. c := &DisksCreateSnapshotCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39106. c.project = project
  39107. c.zone = zone
  39108. c.disk = disk
  39109. c.snapshot = snapshot
  39110. return c
  39111. }
  39112. // GuestFlush sets the optional parameter "guestFlush":
  39113. func (c *DisksCreateSnapshotCall) GuestFlush(guestFlush bool) *DisksCreateSnapshotCall {
  39114. c.urlParams_.Set("guestFlush", fmt.Sprint(guestFlush))
  39115. return c
  39116. }
  39117. // RequestId sets the optional parameter "requestId": An optional
  39118. // request ID to identify requests. Specify a unique request ID so that
  39119. // if you must retry your request, the server will know to ignore the
  39120. // request if it has already been completed.
  39121. //
  39122. // For example, consider a situation where you make an initial request
  39123. // and the request times out. If you make the request again with the
  39124. // same request ID, the server can check if original operation with the
  39125. // same request ID was received, and if so, will ignore the second
  39126. // request. This prevents clients from accidentally creating duplicate
  39127. // commitments.
  39128. //
  39129. // The request ID must be a valid UUID with the exception that zero UUID
  39130. // is not supported (00000000-0000-0000-0000-000000000000).
  39131. func (c *DisksCreateSnapshotCall) RequestId(requestId string) *DisksCreateSnapshotCall {
  39132. c.urlParams_.Set("requestId", requestId)
  39133. return c
  39134. }
  39135. // Fields allows partial responses to be retrieved. See
  39136. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39137. // for more information.
  39138. func (c *DisksCreateSnapshotCall) Fields(s ...googleapi.Field) *DisksCreateSnapshotCall {
  39139. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39140. return c
  39141. }
  39142. // Context sets the context to be used in this call's Do method. Any
  39143. // pending HTTP request will be aborted if the provided context is
  39144. // canceled.
  39145. func (c *DisksCreateSnapshotCall) Context(ctx context.Context) *DisksCreateSnapshotCall {
  39146. c.ctx_ = ctx
  39147. return c
  39148. }
  39149. // Header returns an http.Header that can be modified by the caller to
  39150. // add HTTP headers to the request.
  39151. func (c *DisksCreateSnapshotCall) Header() http.Header {
  39152. if c.header_ == nil {
  39153. c.header_ = make(http.Header)
  39154. }
  39155. return c.header_
  39156. }
  39157. func (c *DisksCreateSnapshotCall) doRequest(alt string) (*http.Response, error) {
  39158. reqHeaders := make(http.Header)
  39159. for k, v := range c.header_ {
  39160. reqHeaders[k] = v
  39161. }
  39162. reqHeaders.Set("User-Agent", c.s.userAgent())
  39163. var body io.Reader = nil
  39164. body, err := googleapi.WithoutDataWrapper.JSONReader(c.snapshot)
  39165. if err != nil {
  39166. return nil, err
  39167. }
  39168. reqHeaders.Set("Content-Type", "application/json")
  39169. c.urlParams_.Set("alt", alt)
  39170. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}/createSnapshot")
  39171. urls += "?" + c.urlParams_.Encode()
  39172. req, _ := http.NewRequest("POST", urls, body)
  39173. req.Header = reqHeaders
  39174. googleapi.Expand(req.URL, map[string]string{
  39175. "project": c.project,
  39176. "zone": c.zone,
  39177. "disk": c.disk,
  39178. })
  39179. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39180. }
  39181. // Do executes the "compute.disks.createSnapshot" call.
  39182. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  39183. // status code is an error. Response headers are in either
  39184. // *Operation.ServerResponse.Header or (if a response was returned at
  39185. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  39186. // to check whether the returned error was because
  39187. // http.StatusNotModified was returned.
  39188. func (c *DisksCreateSnapshotCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  39189. gensupport.SetOptions(c.urlParams_, opts...)
  39190. res, err := c.doRequest("json")
  39191. if res != nil && res.StatusCode == http.StatusNotModified {
  39192. if res.Body != nil {
  39193. res.Body.Close()
  39194. }
  39195. return nil, &googleapi.Error{
  39196. Code: res.StatusCode,
  39197. Header: res.Header,
  39198. }
  39199. }
  39200. if err != nil {
  39201. return nil, err
  39202. }
  39203. defer googleapi.CloseBody(res)
  39204. if err := googleapi.CheckResponse(res); err != nil {
  39205. return nil, err
  39206. }
  39207. ret := &Operation{
  39208. ServerResponse: googleapi.ServerResponse{
  39209. Header: res.Header,
  39210. HTTPStatusCode: res.StatusCode,
  39211. },
  39212. }
  39213. target := &ret
  39214. if err := gensupport.DecodeResponse(target, res); err != nil {
  39215. return nil, err
  39216. }
  39217. return ret, nil
  39218. // {
  39219. // "description": "Creates a snapshot of a specified persistent disk.",
  39220. // "httpMethod": "POST",
  39221. // "id": "compute.disks.createSnapshot",
  39222. // "parameterOrder": [
  39223. // "project",
  39224. // "zone",
  39225. // "disk"
  39226. // ],
  39227. // "parameters": {
  39228. // "disk": {
  39229. // "description": "Name of the persistent disk to snapshot.",
  39230. // "location": "path",
  39231. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  39232. // "required": true,
  39233. // "type": "string"
  39234. // },
  39235. // "guestFlush": {
  39236. // "location": "query",
  39237. // "type": "boolean"
  39238. // },
  39239. // "project": {
  39240. // "description": "Project ID for this request.",
  39241. // "location": "path",
  39242. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  39243. // "required": true,
  39244. // "type": "string"
  39245. // },
  39246. // "requestId": {
  39247. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  39248. // "location": "query",
  39249. // "type": "string"
  39250. // },
  39251. // "zone": {
  39252. // "description": "The name of the zone for this request.",
  39253. // "location": "path",
  39254. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  39255. // "required": true,
  39256. // "type": "string"
  39257. // }
  39258. // },
  39259. // "path": "{project}/zones/{zone}/disks/{disk}/createSnapshot",
  39260. // "request": {
  39261. // "$ref": "Snapshot"
  39262. // },
  39263. // "response": {
  39264. // "$ref": "Operation"
  39265. // },
  39266. // "scopes": [
  39267. // "https://www.googleapis.com/auth/cloud-platform",
  39268. // "https://www.googleapis.com/auth/compute"
  39269. // ]
  39270. // }
  39271. }
  39272. // method id "compute.disks.delete":
  39273. type DisksDeleteCall struct {
  39274. s *Service
  39275. project string
  39276. zone string
  39277. disk string
  39278. urlParams_ gensupport.URLParams
  39279. ctx_ context.Context
  39280. header_ http.Header
  39281. }
  39282. // Delete: Deletes the specified persistent disk. Deleting a disk
  39283. // removes its data permanently and is irreversible. However, deleting a
  39284. // disk does not delete any snapshots previously made from the disk. You
  39285. // must separately delete snapshots.
  39286. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/delete
  39287. func (r *DisksService) Delete(project string, zone string, disk string) *DisksDeleteCall {
  39288. c := &DisksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39289. c.project = project
  39290. c.zone = zone
  39291. c.disk = disk
  39292. return c
  39293. }
  39294. // RequestId sets the optional parameter "requestId": An optional
  39295. // request ID to identify requests. Specify a unique request ID so that
  39296. // if you must retry your request, the server will know to ignore the
  39297. // request if it has already been completed.
  39298. //
  39299. // For example, consider a situation where you make an initial request
  39300. // and the request times out. If you make the request again with the
  39301. // same request ID, the server can check if original operation with the
  39302. // same request ID was received, and if so, will ignore the second
  39303. // request. This prevents clients from accidentally creating duplicate
  39304. // commitments.
  39305. //
  39306. // The request ID must be a valid UUID with the exception that zero UUID
  39307. // is not supported (00000000-0000-0000-0000-000000000000).
  39308. func (c *DisksDeleteCall) RequestId(requestId string) *DisksDeleteCall {
  39309. c.urlParams_.Set("requestId", requestId)
  39310. return c
  39311. }
  39312. // Fields allows partial responses to be retrieved. See
  39313. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39314. // for more information.
  39315. func (c *DisksDeleteCall) Fields(s ...googleapi.Field) *DisksDeleteCall {
  39316. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39317. return c
  39318. }
  39319. // Context sets the context to be used in this call's Do method. Any
  39320. // pending HTTP request will be aborted if the provided context is
  39321. // canceled.
  39322. func (c *DisksDeleteCall) Context(ctx context.Context) *DisksDeleteCall {
  39323. c.ctx_ = ctx
  39324. return c
  39325. }
  39326. // Header returns an http.Header that can be modified by the caller to
  39327. // add HTTP headers to the request.
  39328. func (c *DisksDeleteCall) Header() http.Header {
  39329. if c.header_ == nil {
  39330. c.header_ = make(http.Header)
  39331. }
  39332. return c.header_
  39333. }
  39334. func (c *DisksDeleteCall) doRequest(alt string) (*http.Response, error) {
  39335. reqHeaders := make(http.Header)
  39336. for k, v := range c.header_ {
  39337. reqHeaders[k] = v
  39338. }
  39339. reqHeaders.Set("User-Agent", c.s.userAgent())
  39340. var body io.Reader = nil
  39341. c.urlParams_.Set("alt", alt)
  39342. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}")
  39343. urls += "?" + c.urlParams_.Encode()
  39344. req, _ := http.NewRequest("DELETE", urls, body)
  39345. req.Header = reqHeaders
  39346. googleapi.Expand(req.URL, map[string]string{
  39347. "project": c.project,
  39348. "zone": c.zone,
  39349. "disk": c.disk,
  39350. })
  39351. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39352. }
  39353. // Do executes the "compute.disks.delete" call.
  39354. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  39355. // status code is an error. Response headers are in either
  39356. // *Operation.ServerResponse.Header or (if a response was returned at
  39357. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  39358. // to check whether the returned error was because
  39359. // http.StatusNotModified was returned.
  39360. func (c *DisksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  39361. gensupport.SetOptions(c.urlParams_, opts...)
  39362. res, err := c.doRequest("json")
  39363. if res != nil && res.StatusCode == http.StatusNotModified {
  39364. if res.Body != nil {
  39365. res.Body.Close()
  39366. }
  39367. return nil, &googleapi.Error{
  39368. Code: res.StatusCode,
  39369. Header: res.Header,
  39370. }
  39371. }
  39372. if err != nil {
  39373. return nil, err
  39374. }
  39375. defer googleapi.CloseBody(res)
  39376. if err := googleapi.CheckResponse(res); err != nil {
  39377. return nil, err
  39378. }
  39379. ret := &Operation{
  39380. ServerResponse: googleapi.ServerResponse{
  39381. Header: res.Header,
  39382. HTTPStatusCode: res.StatusCode,
  39383. },
  39384. }
  39385. target := &ret
  39386. if err := gensupport.DecodeResponse(target, res); err != nil {
  39387. return nil, err
  39388. }
  39389. return ret, nil
  39390. // {
  39391. // "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.",
  39392. // "httpMethod": "DELETE",
  39393. // "id": "compute.disks.delete",
  39394. // "parameterOrder": [
  39395. // "project",
  39396. // "zone",
  39397. // "disk"
  39398. // ],
  39399. // "parameters": {
  39400. // "disk": {
  39401. // "description": "Name of the persistent disk to delete.",
  39402. // "location": "path",
  39403. // "required": true,
  39404. // "type": "string"
  39405. // },
  39406. // "project": {
  39407. // "description": "Project ID for this request.",
  39408. // "location": "path",
  39409. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  39410. // "required": true,
  39411. // "type": "string"
  39412. // },
  39413. // "requestId": {
  39414. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  39415. // "location": "query",
  39416. // "type": "string"
  39417. // },
  39418. // "zone": {
  39419. // "description": "The name of the zone for this request.",
  39420. // "location": "path",
  39421. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  39422. // "required": true,
  39423. // "type": "string"
  39424. // }
  39425. // },
  39426. // "path": "{project}/zones/{zone}/disks/{disk}",
  39427. // "response": {
  39428. // "$ref": "Operation"
  39429. // },
  39430. // "scopes": [
  39431. // "https://www.googleapis.com/auth/cloud-platform",
  39432. // "https://www.googleapis.com/auth/compute"
  39433. // ]
  39434. // }
  39435. }
  39436. // method id "compute.disks.get":
  39437. type DisksGetCall struct {
  39438. s *Service
  39439. project string
  39440. zone string
  39441. disk string
  39442. urlParams_ gensupport.URLParams
  39443. ifNoneMatch_ string
  39444. ctx_ context.Context
  39445. header_ http.Header
  39446. }
  39447. // Get: Returns a specified persistent disk. Gets a list of available
  39448. // persistent disks by making a list() request.
  39449. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/get
  39450. func (r *DisksService) Get(project string, zone string, disk string) *DisksGetCall {
  39451. c := &DisksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39452. c.project = project
  39453. c.zone = zone
  39454. c.disk = disk
  39455. return c
  39456. }
  39457. // Fields allows partial responses to be retrieved. See
  39458. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39459. // for more information.
  39460. func (c *DisksGetCall) Fields(s ...googleapi.Field) *DisksGetCall {
  39461. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39462. return c
  39463. }
  39464. // IfNoneMatch sets the optional parameter which makes the operation
  39465. // fail if the object's ETag matches the given value. This is useful for
  39466. // getting updates only after the object has changed since the last
  39467. // request. Use googleapi.IsNotModified to check whether the response
  39468. // error from Do is the result of In-None-Match.
  39469. func (c *DisksGetCall) IfNoneMatch(entityTag string) *DisksGetCall {
  39470. c.ifNoneMatch_ = entityTag
  39471. return c
  39472. }
  39473. // Context sets the context to be used in this call's Do method. Any
  39474. // pending HTTP request will be aborted if the provided context is
  39475. // canceled.
  39476. func (c *DisksGetCall) Context(ctx context.Context) *DisksGetCall {
  39477. c.ctx_ = ctx
  39478. return c
  39479. }
  39480. // Header returns an http.Header that can be modified by the caller to
  39481. // add HTTP headers to the request.
  39482. func (c *DisksGetCall) Header() http.Header {
  39483. if c.header_ == nil {
  39484. c.header_ = make(http.Header)
  39485. }
  39486. return c.header_
  39487. }
  39488. func (c *DisksGetCall) doRequest(alt string) (*http.Response, error) {
  39489. reqHeaders := make(http.Header)
  39490. for k, v := range c.header_ {
  39491. reqHeaders[k] = v
  39492. }
  39493. reqHeaders.Set("User-Agent", c.s.userAgent())
  39494. if c.ifNoneMatch_ != "" {
  39495. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  39496. }
  39497. var body io.Reader = nil
  39498. c.urlParams_.Set("alt", alt)
  39499. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}")
  39500. urls += "?" + c.urlParams_.Encode()
  39501. req, _ := http.NewRequest("GET", urls, body)
  39502. req.Header = reqHeaders
  39503. googleapi.Expand(req.URL, map[string]string{
  39504. "project": c.project,
  39505. "zone": c.zone,
  39506. "disk": c.disk,
  39507. })
  39508. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39509. }
  39510. // Do executes the "compute.disks.get" call.
  39511. // Exactly one of *Disk or error will be non-nil. Any non-2xx status
  39512. // code is an error. Response headers are in either
  39513. // *Disk.ServerResponse.Header or (if a response was returned at all) in
  39514. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  39515. // whether the returned error was because http.StatusNotModified was
  39516. // returned.
  39517. func (c *DisksGetCall) Do(opts ...googleapi.CallOption) (*Disk, error) {
  39518. gensupport.SetOptions(c.urlParams_, opts...)
  39519. res, err := c.doRequest("json")
  39520. if res != nil && res.StatusCode == http.StatusNotModified {
  39521. if res.Body != nil {
  39522. res.Body.Close()
  39523. }
  39524. return nil, &googleapi.Error{
  39525. Code: res.StatusCode,
  39526. Header: res.Header,
  39527. }
  39528. }
  39529. if err != nil {
  39530. return nil, err
  39531. }
  39532. defer googleapi.CloseBody(res)
  39533. if err := googleapi.CheckResponse(res); err != nil {
  39534. return nil, err
  39535. }
  39536. ret := &Disk{
  39537. ServerResponse: googleapi.ServerResponse{
  39538. Header: res.Header,
  39539. HTTPStatusCode: res.StatusCode,
  39540. },
  39541. }
  39542. target := &ret
  39543. if err := gensupport.DecodeResponse(target, res); err != nil {
  39544. return nil, err
  39545. }
  39546. return ret, nil
  39547. // {
  39548. // "description": "Returns a specified persistent disk. Gets a list of available persistent disks by making a list() request.",
  39549. // "httpMethod": "GET",
  39550. // "id": "compute.disks.get",
  39551. // "parameterOrder": [
  39552. // "project",
  39553. // "zone",
  39554. // "disk"
  39555. // ],
  39556. // "parameters": {
  39557. // "disk": {
  39558. // "description": "Name of the persistent disk to return.",
  39559. // "location": "path",
  39560. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  39561. // "required": true,
  39562. // "type": "string"
  39563. // },
  39564. // "project": {
  39565. // "description": "Project ID for this request.",
  39566. // "location": "path",
  39567. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  39568. // "required": true,
  39569. // "type": "string"
  39570. // },
  39571. // "zone": {
  39572. // "description": "The name of the zone for this request.",
  39573. // "location": "path",
  39574. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  39575. // "required": true,
  39576. // "type": "string"
  39577. // }
  39578. // },
  39579. // "path": "{project}/zones/{zone}/disks/{disk}",
  39580. // "response": {
  39581. // "$ref": "Disk"
  39582. // },
  39583. // "scopes": [
  39584. // "https://www.googleapis.com/auth/cloud-platform",
  39585. // "https://www.googleapis.com/auth/compute",
  39586. // "https://www.googleapis.com/auth/compute.readonly"
  39587. // ]
  39588. // }
  39589. }
  39590. // method id "compute.disks.getIamPolicy":
  39591. type DisksGetIamPolicyCall struct {
  39592. s *Service
  39593. project string
  39594. zone string
  39595. resource string
  39596. urlParams_ gensupport.URLParams
  39597. ifNoneMatch_ string
  39598. ctx_ context.Context
  39599. header_ http.Header
  39600. }
  39601. // GetIamPolicy: Gets the access control policy for a resource. May be
  39602. // empty if no such policy or resource exists.
  39603. func (r *DisksService) GetIamPolicy(project string, zone string, resource string) *DisksGetIamPolicyCall {
  39604. c := &DisksGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39605. c.project = project
  39606. c.zone = zone
  39607. c.resource = resource
  39608. return c
  39609. }
  39610. // Fields allows partial responses to be retrieved. See
  39611. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39612. // for more information.
  39613. func (c *DisksGetIamPolicyCall) Fields(s ...googleapi.Field) *DisksGetIamPolicyCall {
  39614. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39615. return c
  39616. }
  39617. // IfNoneMatch sets the optional parameter which makes the operation
  39618. // fail if the object's ETag matches the given value. This is useful for
  39619. // getting updates only after the object has changed since the last
  39620. // request. Use googleapi.IsNotModified to check whether the response
  39621. // error from Do is the result of In-None-Match.
  39622. func (c *DisksGetIamPolicyCall) IfNoneMatch(entityTag string) *DisksGetIamPolicyCall {
  39623. c.ifNoneMatch_ = entityTag
  39624. return c
  39625. }
  39626. // Context sets the context to be used in this call's Do method. Any
  39627. // pending HTTP request will be aborted if the provided context is
  39628. // canceled.
  39629. func (c *DisksGetIamPolicyCall) Context(ctx context.Context) *DisksGetIamPolicyCall {
  39630. c.ctx_ = ctx
  39631. return c
  39632. }
  39633. // Header returns an http.Header that can be modified by the caller to
  39634. // add HTTP headers to the request.
  39635. func (c *DisksGetIamPolicyCall) Header() http.Header {
  39636. if c.header_ == nil {
  39637. c.header_ = make(http.Header)
  39638. }
  39639. return c.header_
  39640. }
  39641. func (c *DisksGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  39642. reqHeaders := make(http.Header)
  39643. for k, v := range c.header_ {
  39644. reqHeaders[k] = v
  39645. }
  39646. reqHeaders.Set("User-Agent", c.s.userAgent())
  39647. if c.ifNoneMatch_ != "" {
  39648. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  39649. }
  39650. var body io.Reader = nil
  39651. c.urlParams_.Set("alt", alt)
  39652. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{resource}/getIamPolicy")
  39653. urls += "?" + c.urlParams_.Encode()
  39654. req, _ := http.NewRequest("GET", urls, body)
  39655. req.Header = reqHeaders
  39656. googleapi.Expand(req.URL, map[string]string{
  39657. "project": c.project,
  39658. "zone": c.zone,
  39659. "resource": c.resource,
  39660. })
  39661. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39662. }
  39663. // Do executes the "compute.disks.getIamPolicy" call.
  39664. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  39665. // code is an error. Response headers are in either
  39666. // *Policy.ServerResponse.Header or (if a response was returned at all)
  39667. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  39668. // check whether the returned error was because http.StatusNotModified
  39669. // was returned.
  39670. func (c *DisksGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  39671. gensupport.SetOptions(c.urlParams_, opts...)
  39672. res, err := c.doRequest("json")
  39673. if res != nil && res.StatusCode == http.StatusNotModified {
  39674. if res.Body != nil {
  39675. res.Body.Close()
  39676. }
  39677. return nil, &googleapi.Error{
  39678. Code: res.StatusCode,
  39679. Header: res.Header,
  39680. }
  39681. }
  39682. if err != nil {
  39683. return nil, err
  39684. }
  39685. defer googleapi.CloseBody(res)
  39686. if err := googleapi.CheckResponse(res); err != nil {
  39687. return nil, err
  39688. }
  39689. ret := &Policy{
  39690. ServerResponse: googleapi.ServerResponse{
  39691. Header: res.Header,
  39692. HTTPStatusCode: res.StatusCode,
  39693. },
  39694. }
  39695. target := &ret
  39696. if err := gensupport.DecodeResponse(target, res); err != nil {
  39697. return nil, err
  39698. }
  39699. return ret, nil
  39700. // {
  39701. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  39702. // "httpMethod": "GET",
  39703. // "id": "compute.disks.getIamPolicy",
  39704. // "parameterOrder": [
  39705. // "project",
  39706. // "zone",
  39707. // "resource"
  39708. // ],
  39709. // "parameters": {
  39710. // "project": {
  39711. // "description": "Project ID for this request.",
  39712. // "location": "path",
  39713. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  39714. // "required": true,
  39715. // "type": "string"
  39716. // },
  39717. // "resource": {
  39718. // "description": "Name of the resource for this request.",
  39719. // "location": "path",
  39720. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  39721. // "required": true,
  39722. // "type": "string"
  39723. // },
  39724. // "zone": {
  39725. // "description": "The name of the zone for this request.",
  39726. // "location": "path",
  39727. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  39728. // "required": true,
  39729. // "type": "string"
  39730. // }
  39731. // },
  39732. // "path": "{project}/zones/{zone}/disks/{resource}/getIamPolicy",
  39733. // "response": {
  39734. // "$ref": "Policy"
  39735. // },
  39736. // "scopes": [
  39737. // "https://www.googleapis.com/auth/cloud-platform",
  39738. // "https://www.googleapis.com/auth/compute",
  39739. // "https://www.googleapis.com/auth/compute.readonly"
  39740. // ]
  39741. // }
  39742. }
  39743. // method id "compute.disks.insert":
  39744. type DisksInsertCall struct {
  39745. s *Service
  39746. project string
  39747. zone string
  39748. disk *Disk
  39749. urlParams_ gensupport.URLParams
  39750. ctx_ context.Context
  39751. header_ http.Header
  39752. }
  39753. // Insert: Creates a persistent disk in the specified project using the
  39754. // data in the request. You can create a disk with a sourceImage, a
  39755. // sourceSnapshot, or create an empty 500 GB data disk by omitting all
  39756. // properties. You can also create a disk that is larger than the
  39757. // default size by specifying the sizeGb property.
  39758. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/insert
  39759. func (r *DisksService) Insert(project string, zone string, disk *Disk) *DisksInsertCall {
  39760. c := &DisksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39761. c.project = project
  39762. c.zone = zone
  39763. c.disk = disk
  39764. return c
  39765. }
  39766. // RequestId sets the optional parameter "requestId": An optional
  39767. // request ID to identify requests. Specify a unique request ID so that
  39768. // if you must retry your request, the server will know to ignore the
  39769. // request if it has already been completed.
  39770. //
  39771. // For example, consider a situation where you make an initial request
  39772. // and the request times out. If you make the request again with the
  39773. // same request ID, the server can check if original operation with the
  39774. // same request ID was received, and if so, will ignore the second
  39775. // request. This prevents clients from accidentally creating duplicate
  39776. // commitments.
  39777. //
  39778. // The request ID must be a valid UUID with the exception that zero UUID
  39779. // is not supported (00000000-0000-0000-0000-000000000000).
  39780. func (c *DisksInsertCall) RequestId(requestId string) *DisksInsertCall {
  39781. c.urlParams_.Set("requestId", requestId)
  39782. return c
  39783. }
  39784. // SourceImage sets the optional parameter "sourceImage": Source image
  39785. // to restore onto a disk.
  39786. func (c *DisksInsertCall) SourceImage(sourceImage string) *DisksInsertCall {
  39787. c.urlParams_.Set("sourceImage", sourceImage)
  39788. return c
  39789. }
  39790. // Fields allows partial responses to be retrieved. See
  39791. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39792. // for more information.
  39793. func (c *DisksInsertCall) Fields(s ...googleapi.Field) *DisksInsertCall {
  39794. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39795. return c
  39796. }
  39797. // Context sets the context to be used in this call's Do method. Any
  39798. // pending HTTP request will be aborted if the provided context is
  39799. // canceled.
  39800. func (c *DisksInsertCall) Context(ctx context.Context) *DisksInsertCall {
  39801. c.ctx_ = ctx
  39802. return c
  39803. }
  39804. // Header returns an http.Header that can be modified by the caller to
  39805. // add HTTP headers to the request.
  39806. func (c *DisksInsertCall) Header() http.Header {
  39807. if c.header_ == nil {
  39808. c.header_ = make(http.Header)
  39809. }
  39810. return c.header_
  39811. }
  39812. func (c *DisksInsertCall) doRequest(alt string) (*http.Response, error) {
  39813. reqHeaders := make(http.Header)
  39814. for k, v := range c.header_ {
  39815. reqHeaders[k] = v
  39816. }
  39817. reqHeaders.Set("User-Agent", c.s.userAgent())
  39818. var body io.Reader = nil
  39819. body, err := googleapi.WithoutDataWrapper.JSONReader(c.disk)
  39820. if err != nil {
  39821. return nil, err
  39822. }
  39823. reqHeaders.Set("Content-Type", "application/json")
  39824. c.urlParams_.Set("alt", alt)
  39825. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks")
  39826. urls += "?" + c.urlParams_.Encode()
  39827. req, _ := http.NewRequest("POST", urls, body)
  39828. req.Header = reqHeaders
  39829. googleapi.Expand(req.URL, map[string]string{
  39830. "project": c.project,
  39831. "zone": c.zone,
  39832. })
  39833. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39834. }
  39835. // Do executes the "compute.disks.insert" call.
  39836. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  39837. // status code is an error. Response headers are in either
  39838. // *Operation.ServerResponse.Header or (if a response was returned at
  39839. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  39840. // to check whether the returned error was because
  39841. // http.StatusNotModified was returned.
  39842. func (c *DisksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  39843. gensupport.SetOptions(c.urlParams_, opts...)
  39844. res, err := c.doRequest("json")
  39845. if res != nil && res.StatusCode == http.StatusNotModified {
  39846. if res.Body != nil {
  39847. res.Body.Close()
  39848. }
  39849. return nil, &googleapi.Error{
  39850. Code: res.StatusCode,
  39851. Header: res.Header,
  39852. }
  39853. }
  39854. if err != nil {
  39855. return nil, err
  39856. }
  39857. defer googleapi.CloseBody(res)
  39858. if err := googleapi.CheckResponse(res); err != nil {
  39859. return nil, err
  39860. }
  39861. ret := &Operation{
  39862. ServerResponse: googleapi.ServerResponse{
  39863. Header: res.Header,
  39864. HTTPStatusCode: res.StatusCode,
  39865. },
  39866. }
  39867. target := &ret
  39868. if err := gensupport.DecodeResponse(target, res); err != nil {
  39869. return nil, err
  39870. }
  39871. return ret, nil
  39872. // {
  39873. // "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.",
  39874. // "httpMethod": "POST",
  39875. // "id": "compute.disks.insert",
  39876. // "parameterOrder": [
  39877. // "project",
  39878. // "zone"
  39879. // ],
  39880. // "parameters": {
  39881. // "project": {
  39882. // "description": "Project ID for this request.",
  39883. // "location": "path",
  39884. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  39885. // "required": true,
  39886. // "type": "string"
  39887. // },
  39888. // "requestId": {
  39889. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  39890. // "location": "query",
  39891. // "type": "string"
  39892. // },
  39893. // "sourceImage": {
  39894. // "description": "Optional. Source image to restore onto a disk.",
  39895. // "location": "query",
  39896. // "type": "string"
  39897. // },
  39898. // "zone": {
  39899. // "description": "The name of the zone for this request.",
  39900. // "location": "path",
  39901. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  39902. // "required": true,
  39903. // "type": "string"
  39904. // }
  39905. // },
  39906. // "path": "{project}/zones/{zone}/disks",
  39907. // "request": {
  39908. // "$ref": "Disk"
  39909. // },
  39910. // "response": {
  39911. // "$ref": "Operation"
  39912. // },
  39913. // "scopes": [
  39914. // "https://www.googleapis.com/auth/cloud-platform",
  39915. // "https://www.googleapis.com/auth/compute"
  39916. // ]
  39917. // }
  39918. }
  39919. // method id "compute.disks.list":
  39920. type DisksListCall struct {
  39921. s *Service
  39922. project string
  39923. zone string
  39924. urlParams_ gensupport.URLParams
  39925. ifNoneMatch_ string
  39926. ctx_ context.Context
  39927. header_ http.Header
  39928. }
  39929. // List: Retrieves a list of persistent disks contained within the
  39930. // specified zone.
  39931. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/list
  39932. func (r *DisksService) List(project string, zone string) *DisksListCall {
  39933. c := &DisksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39934. c.project = project
  39935. c.zone = zone
  39936. return c
  39937. }
  39938. // Filter sets the optional parameter "filter": A filter expression that
  39939. // filters resources listed in the response. The expression must specify
  39940. // the field name, a comparison operator, and the value that you want to
  39941. // use for filtering. The value must be a string, a number, or a
  39942. // boolean. The comparison operator must be either =, !=, >, or <.
  39943. //
  39944. // For example, if you are filtering Compute Engine instances, you can
  39945. // exclude instances named example-instance by specifying name !=
  39946. // example-instance.
  39947. //
  39948. // You can also filter nested fields. For example, you could specify
  39949. // scheduling.automaticRestart = false to include instances only if they
  39950. // are not scheduled for automatic restarts. You can use filtering on
  39951. // nested fields to filter based on resource labels.
  39952. //
  39953. // To filter on multiple expressions, provide each separate expression
  39954. // within parentheses. For example, (scheduling.automaticRestart = true)
  39955. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  39956. // AND expression. However, you can include AND and OR expressions
  39957. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  39958. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  39959. // true).
  39960. func (c *DisksListCall) Filter(filter string) *DisksListCall {
  39961. c.urlParams_.Set("filter", filter)
  39962. return c
  39963. }
  39964. // MaxResults sets the optional parameter "maxResults": The maximum
  39965. // number of results per page that should be returned. If the number of
  39966. // available results is larger than maxResults, Compute Engine returns a
  39967. // nextPageToken that can be used to get the next page of results in
  39968. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  39969. // (Default: 500)
  39970. func (c *DisksListCall) MaxResults(maxResults int64) *DisksListCall {
  39971. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  39972. return c
  39973. }
  39974. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  39975. // a certain order. By default, results are returned in alphanumerical
  39976. // order based on the resource name.
  39977. //
  39978. // You can also sort results in descending order based on the creation
  39979. // timestamp using orderBy="creationTimestamp desc". This sorts results
  39980. // based on the creationTimestamp field in reverse chronological order
  39981. // (newest result first). Use this to sort resources like operations so
  39982. // that the newest operation is returned first.
  39983. //
  39984. // Currently, only sorting by name or creationTimestamp desc is
  39985. // supported.
  39986. func (c *DisksListCall) OrderBy(orderBy string) *DisksListCall {
  39987. c.urlParams_.Set("orderBy", orderBy)
  39988. return c
  39989. }
  39990. // PageToken sets the optional parameter "pageToken": Specifies a page
  39991. // token to use. Set pageToken to the nextPageToken returned by a
  39992. // previous list request to get the next page of results.
  39993. func (c *DisksListCall) PageToken(pageToken string) *DisksListCall {
  39994. c.urlParams_.Set("pageToken", pageToken)
  39995. return c
  39996. }
  39997. // Fields allows partial responses to be retrieved. See
  39998. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39999. // for more information.
  40000. func (c *DisksListCall) Fields(s ...googleapi.Field) *DisksListCall {
  40001. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40002. return c
  40003. }
  40004. // IfNoneMatch sets the optional parameter which makes the operation
  40005. // fail if the object's ETag matches the given value. This is useful for
  40006. // getting updates only after the object has changed since the last
  40007. // request. Use googleapi.IsNotModified to check whether the response
  40008. // error from Do is the result of In-None-Match.
  40009. func (c *DisksListCall) IfNoneMatch(entityTag string) *DisksListCall {
  40010. c.ifNoneMatch_ = entityTag
  40011. return c
  40012. }
  40013. // Context sets the context to be used in this call's Do method. Any
  40014. // pending HTTP request will be aborted if the provided context is
  40015. // canceled.
  40016. func (c *DisksListCall) Context(ctx context.Context) *DisksListCall {
  40017. c.ctx_ = ctx
  40018. return c
  40019. }
  40020. // Header returns an http.Header that can be modified by the caller to
  40021. // add HTTP headers to the request.
  40022. func (c *DisksListCall) Header() http.Header {
  40023. if c.header_ == nil {
  40024. c.header_ = make(http.Header)
  40025. }
  40026. return c.header_
  40027. }
  40028. func (c *DisksListCall) doRequest(alt string) (*http.Response, error) {
  40029. reqHeaders := make(http.Header)
  40030. for k, v := range c.header_ {
  40031. reqHeaders[k] = v
  40032. }
  40033. reqHeaders.Set("User-Agent", c.s.userAgent())
  40034. if c.ifNoneMatch_ != "" {
  40035. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  40036. }
  40037. var body io.Reader = nil
  40038. c.urlParams_.Set("alt", alt)
  40039. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks")
  40040. urls += "?" + c.urlParams_.Encode()
  40041. req, _ := http.NewRequest("GET", urls, body)
  40042. req.Header = reqHeaders
  40043. googleapi.Expand(req.URL, map[string]string{
  40044. "project": c.project,
  40045. "zone": c.zone,
  40046. })
  40047. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40048. }
  40049. // Do executes the "compute.disks.list" call.
  40050. // Exactly one of *DiskList or error will be non-nil. Any non-2xx status
  40051. // code is an error. Response headers are in either
  40052. // *DiskList.ServerResponse.Header or (if a response was returned at
  40053. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  40054. // to check whether the returned error was because
  40055. // http.StatusNotModified was returned.
  40056. func (c *DisksListCall) Do(opts ...googleapi.CallOption) (*DiskList, error) {
  40057. gensupport.SetOptions(c.urlParams_, opts...)
  40058. res, err := c.doRequest("json")
  40059. if res != nil && res.StatusCode == http.StatusNotModified {
  40060. if res.Body != nil {
  40061. res.Body.Close()
  40062. }
  40063. return nil, &googleapi.Error{
  40064. Code: res.StatusCode,
  40065. Header: res.Header,
  40066. }
  40067. }
  40068. if err != nil {
  40069. return nil, err
  40070. }
  40071. defer googleapi.CloseBody(res)
  40072. if err := googleapi.CheckResponse(res); err != nil {
  40073. return nil, err
  40074. }
  40075. ret := &DiskList{
  40076. ServerResponse: googleapi.ServerResponse{
  40077. Header: res.Header,
  40078. HTTPStatusCode: res.StatusCode,
  40079. },
  40080. }
  40081. target := &ret
  40082. if err := gensupport.DecodeResponse(target, res); err != nil {
  40083. return nil, err
  40084. }
  40085. return ret, nil
  40086. // {
  40087. // "description": "Retrieves a list of persistent disks contained within the specified zone.",
  40088. // "httpMethod": "GET",
  40089. // "id": "compute.disks.list",
  40090. // "parameterOrder": [
  40091. // "project",
  40092. // "zone"
  40093. // ],
  40094. // "parameters": {
  40095. // "filter": {
  40096. // "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).",
  40097. // "location": "query",
  40098. // "type": "string"
  40099. // },
  40100. // "maxResults": {
  40101. // "default": "500",
  40102. // "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)",
  40103. // "format": "uint32",
  40104. // "location": "query",
  40105. // "minimum": "0",
  40106. // "type": "integer"
  40107. // },
  40108. // "orderBy": {
  40109. // "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.",
  40110. // "location": "query",
  40111. // "type": "string"
  40112. // },
  40113. // "pageToken": {
  40114. // "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.",
  40115. // "location": "query",
  40116. // "type": "string"
  40117. // },
  40118. // "project": {
  40119. // "description": "Project ID for this request.",
  40120. // "location": "path",
  40121. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  40122. // "required": true,
  40123. // "type": "string"
  40124. // },
  40125. // "zone": {
  40126. // "description": "The name of the zone for this request.",
  40127. // "location": "path",
  40128. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  40129. // "required": true,
  40130. // "type": "string"
  40131. // }
  40132. // },
  40133. // "path": "{project}/zones/{zone}/disks",
  40134. // "response": {
  40135. // "$ref": "DiskList"
  40136. // },
  40137. // "scopes": [
  40138. // "https://www.googleapis.com/auth/cloud-platform",
  40139. // "https://www.googleapis.com/auth/compute",
  40140. // "https://www.googleapis.com/auth/compute.readonly"
  40141. // ]
  40142. // }
  40143. }
  40144. // Pages invokes f for each page of results.
  40145. // A non-nil error returned from f will halt the iteration.
  40146. // The provided context supersedes any context provided to the Context method.
  40147. func (c *DisksListCall) Pages(ctx context.Context, f func(*DiskList) error) error {
  40148. c.ctx_ = ctx
  40149. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  40150. for {
  40151. x, err := c.Do()
  40152. if err != nil {
  40153. return err
  40154. }
  40155. if err := f(x); err != nil {
  40156. return err
  40157. }
  40158. if x.NextPageToken == "" {
  40159. return nil
  40160. }
  40161. c.PageToken(x.NextPageToken)
  40162. }
  40163. }
  40164. // method id "compute.disks.removeResourcePolicies":
  40165. type DisksRemoveResourcePoliciesCall struct {
  40166. s *Service
  40167. project string
  40168. zone string
  40169. disk string
  40170. disksremoveresourcepoliciesrequest *DisksRemoveResourcePoliciesRequest
  40171. urlParams_ gensupport.URLParams
  40172. ctx_ context.Context
  40173. header_ http.Header
  40174. }
  40175. // RemoveResourcePolicies: Removes resource policies from a disk.
  40176. func (r *DisksService) RemoveResourcePolicies(project string, zone string, disk string, disksremoveresourcepoliciesrequest *DisksRemoveResourcePoliciesRequest) *DisksRemoveResourcePoliciesCall {
  40177. c := &DisksRemoveResourcePoliciesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40178. c.project = project
  40179. c.zone = zone
  40180. c.disk = disk
  40181. c.disksremoveresourcepoliciesrequest = disksremoveresourcepoliciesrequest
  40182. return c
  40183. }
  40184. // RequestId sets the optional parameter "requestId": An optional
  40185. // request ID to identify requests. Specify a unique request ID so that
  40186. // if you must retry your request, the server will know to ignore the
  40187. // request if it has already been completed.
  40188. //
  40189. // For example, consider a situation where you make an initial request
  40190. // and the request times out. If you make the request again with the
  40191. // same request ID, the server can check if original operation with the
  40192. // same request ID was received, and if so, will ignore the second
  40193. // request. This prevents clients from accidentally creating duplicate
  40194. // commitments.
  40195. //
  40196. // The request ID must be a valid UUID with the exception that zero UUID
  40197. // is not supported (00000000-0000-0000-0000-000000000000).
  40198. func (c *DisksRemoveResourcePoliciesCall) RequestId(requestId string) *DisksRemoveResourcePoliciesCall {
  40199. c.urlParams_.Set("requestId", requestId)
  40200. return c
  40201. }
  40202. // Fields allows partial responses to be retrieved. See
  40203. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40204. // for more information.
  40205. func (c *DisksRemoveResourcePoliciesCall) Fields(s ...googleapi.Field) *DisksRemoveResourcePoliciesCall {
  40206. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40207. return c
  40208. }
  40209. // Context sets the context to be used in this call's Do method. Any
  40210. // pending HTTP request will be aborted if the provided context is
  40211. // canceled.
  40212. func (c *DisksRemoveResourcePoliciesCall) Context(ctx context.Context) *DisksRemoveResourcePoliciesCall {
  40213. c.ctx_ = ctx
  40214. return c
  40215. }
  40216. // Header returns an http.Header that can be modified by the caller to
  40217. // add HTTP headers to the request.
  40218. func (c *DisksRemoveResourcePoliciesCall) Header() http.Header {
  40219. if c.header_ == nil {
  40220. c.header_ = make(http.Header)
  40221. }
  40222. return c.header_
  40223. }
  40224. func (c *DisksRemoveResourcePoliciesCall) doRequest(alt string) (*http.Response, error) {
  40225. reqHeaders := make(http.Header)
  40226. for k, v := range c.header_ {
  40227. reqHeaders[k] = v
  40228. }
  40229. reqHeaders.Set("User-Agent", c.s.userAgent())
  40230. var body io.Reader = nil
  40231. body, err := googleapi.WithoutDataWrapper.JSONReader(c.disksremoveresourcepoliciesrequest)
  40232. if err != nil {
  40233. return nil, err
  40234. }
  40235. reqHeaders.Set("Content-Type", "application/json")
  40236. c.urlParams_.Set("alt", alt)
  40237. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}/removeResourcePolicies")
  40238. urls += "?" + c.urlParams_.Encode()
  40239. req, _ := http.NewRequest("POST", urls, body)
  40240. req.Header = reqHeaders
  40241. googleapi.Expand(req.URL, map[string]string{
  40242. "project": c.project,
  40243. "zone": c.zone,
  40244. "disk": c.disk,
  40245. })
  40246. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40247. }
  40248. // Do executes the "compute.disks.removeResourcePolicies" call.
  40249. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  40250. // status code is an error. Response headers are in either
  40251. // *Operation.ServerResponse.Header or (if a response was returned at
  40252. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  40253. // to check whether the returned error was because
  40254. // http.StatusNotModified was returned.
  40255. func (c *DisksRemoveResourcePoliciesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  40256. gensupport.SetOptions(c.urlParams_, opts...)
  40257. res, err := c.doRequest("json")
  40258. if res != nil && res.StatusCode == http.StatusNotModified {
  40259. if res.Body != nil {
  40260. res.Body.Close()
  40261. }
  40262. return nil, &googleapi.Error{
  40263. Code: res.StatusCode,
  40264. Header: res.Header,
  40265. }
  40266. }
  40267. if err != nil {
  40268. return nil, err
  40269. }
  40270. defer googleapi.CloseBody(res)
  40271. if err := googleapi.CheckResponse(res); err != nil {
  40272. return nil, err
  40273. }
  40274. ret := &Operation{
  40275. ServerResponse: googleapi.ServerResponse{
  40276. Header: res.Header,
  40277. HTTPStatusCode: res.StatusCode,
  40278. },
  40279. }
  40280. target := &ret
  40281. if err := gensupport.DecodeResponse(target, res); err != nil {
  40282. return nil, err
  40283. }
  40284. return ret, nil
  40285. // {
  40286. // "description": "Removes resource policies from a disk.",
  40287. // "httpMethod": "POST",
  40288. // "id": "compute.disks.removeResourcePolicies",
  40289. // "parameterOrder": [
  40290. // "project",
  40291. // "zone",
  40292. // "disk"
  40293. // ],
  40294. // "parameters": {
  40295. // "disk": {
  40296. // "description": "The disk name for this request.",
  40297. // "location": "path",
  40298. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  40299. // "required": true,
  40300. // "type": "string"
  40301. // },
  40302. // "project": {
  40303. // "description": "Project ID for this request.",
  40304. // "location": "path",
  40305. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  40306. // "required": true,
  40307. // "type": "string"
  40308. // },
  40309. // "requestId": {
  40310. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  40311. // "location": "query",
  40312. // "type": "string"
  40313. // },
  40314. // "zone": {
  40315. // "description": "The name of the zone for this request.",
  40316. // "location": "path",
  40317. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  40318. // "required": true,
  40319. // "type": "string"
  40320. // }
  40321. // },
  40322. // "path": "{project}/zones/{zone}/disks/{disk}/removeResourcePolicies",
  40323. // "request": {
  40324. // "$ref": "DisksRemoveResourcePoliciesRequest"
  40325. // },
  40326. // "response": {
  40327. // "$ref": "Operation"
  40328. // },
  40329. // "scopes": [
  40330. // "https://www.googleapis.com/auth/cloud-platform",
  40331. // "https://www.googleapis.com/auth/compute"
  40332. // ]
  40333. // }
  40334. }
  40335. // method id "compute.disks.resize":
  40336. type DisksResizeCall struct {
  40337. s *Service
  40338. project string
  40339. zone string
  40340. disk string
  40341. disksresizerequest *DisksResizeRequest
  40342. urlParams_ gensupport.URLParams
  40343. ctx_ context.Context
  40344. header_ http.Header
  40345. }
  40346. // Resize: Resizes the specified persistent disk. You can only increase
  40347. // the size of the disk.
  40348. func (r *DisksService) Resize(project string, zone string, disk string, disksresizerequest *DisksResizeRequest) *DisksResizeCall {
  40349. c := &DisksResizeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40350. c.project = project
  40351. c.zone = zone
  40352. c.disk = disk
  40353. c.disksresizerequest = disksresizerequest
  40354. return c
  40355. }
  40356. // RequestId sets the optional parameter "requestId": An optional
  40357. // request ID to identify requests. Specify a unique request ID so that
  40358. // if you must retry your request, the server will know to ignore the
  40359. // request if it has already been completed.
  40360. //
  40361. // For example, consider a situation where you make an initial request
  40362. // and the request times out. If you make the request again with the
  40363. // same request ID, the server can check if original operation with the
  40364. // same request ID was received, and if so, will ignore the second
  40365. // request. This prevents clients from accidentally creating duplicate
  40366. // commitments.
  40367. //
  40368. // The request ID must be a valid UUID with the exception that zero UUID
  40369. // is not supported (00000000-0000-0000-0000-000000000000).
  40370. func (c *DisksResizeCall) RequestId(requestId string) *DisksResizeCall {
  40371. c.urlParams_.Set("requestId", requestId)
  40372. return c
  40373. }
  40374. // Fields allows partial responses to be retrieved. See
  40375. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40376. // for more information.
  40377. func (c *DisksResizeCall) Fields(s ...googleapi.Field) *DisksResizeCall {
  40378. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40379. return c
  40380. }
  40381. // Context sets the context to be used in this call's Do method. Any
  40382. // pending HTTP request will be aborted if the provided context is
  40383. // canceled.
  40384. func (c *DisksResizeCall) Context(ctx context.Context) *DisksResizeCall {
  40385. c.ctx_ = ctx
  40386. return c
  40387. }
  40388. // Header returns an http.Header that can be modified by the caller to
  40389. // add HTTP headers to the request.
  40390. func (c *DisksResizeCall) Header() http.Header {
  40391. if c.header_ == nil {
  40392. c.header_ = make(http.Header)
  40393. }
  40394. return c.header_
  40395. }
  40396. func (c *DisksResizeCall) doRequest(alt string) (*http.Response, error) {
  40397. reqHeaders := make(http.Header)
  40398. for k, v := range c.header_ {
  40399. reqHeaders[k] = v
  40400. }
  40401. reqHeaders.Set("User-Agent", c.s.userAgent())
  40402. var body io.Reader = nil
  40403. body, err := googleapi.WithoutDataWrapper.JSONReader(c.disksresizerequest)
  40404. if err != nil {
  40405. return nil, err
  40406. }
  40407. reqHeaders.Set("Content-Type", "application/json")
  40408. c.urlParams_.Set("alt", alt)
  40409. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}/resize")
  40410. urls += "?" + c.urlParams_.Encode()
  40411. req, _ := http.NewRequest("POST", urls, body)
  40412. req.Header = reqHeaders
  40413. googleapi.Expand(req.URL, map[string]string{
  40414. "project": c.project,
  40415. "zone": c.zone,
  40416. "disk": c.disk,
  40417. })
  40418. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40419. }
  40420. // Do executes the "compute.disks.resize" call.
  40421. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  40422. // status code is an error. Response headers are in either
  40423. // *Operation.ServerResponse.Header or (if a response was returned at
  40424. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  40425. // to check whether the returned error was because
  40426. // http.StatusNotModified was returned.
  40427. func (c *DisksResizeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  40428. gensupport.SetOptions(c.urlParams_, opts...)
  40429. res, err := c.doRequest("json")
  40430. if res != nil && res.StatusCode == http.StatusNotModified {
  40431. if res.Body != nil {
  40432. res.Body.Close()
  40433. }
  40434. return nil, &googleapi.Error{
  40435. Code: res.StatusCode,
  40436. Header: res.Header,
  40437. }
  40438. }
  40439. if err != nil {
  40440. return nil, err
  40441. }
  40442. defer googleapi.CloseBody(res)
  40443. if err := googleapi.CheckResponse(res); err != nil {
  40444. return nil, err
  40445. }
  40446. ret := &Operation{
  40447. ServerResponse: googleapi.ServerResponse{
  40448. Header: res.Header,
  40449. HTTPStatusCode: res.StatusCode,
  40450. },
  40451. }
  40452. target := &ret
  40453. if err := gensupport.DecodeResponse(target, res); err != nil {
  40454. return nil, err
  40455. }
  40456. return ret, nil
  40457. // {
  40458. // "description": "Resizes the specified persistent disk. You can only increase the size of the disk.",
  40459. // "httpMethod": "POST",
  40460. // "id": "compute.disks.resize",
  40461. // "parameterOrder": [
  40462. // "project",
  40463. // "zone",
  40464. // "disk"
  40465. // ],
  40466. // "parameters": {
  40467. // "disk": {
  40468. // "description": "The name of the persistent disk.",
  40469. // "location": "path",
  40470. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  40471. // "required": true,
  40472. // "type": "string"
  40473. // },
  40474. // "project": {
  40475. // "description": "Project ID for this request.",
  40476. // "location": "path",
  40477. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  40478. // "required": true,
  40479. // "type": "string"
  40480. // },
  40481. // "requestId": {
  40482. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  40483. // "location": "query",
  40484. // "type": "string"
  40485. // },
  40486. // "zone": {
  40487. // "description": "The name of the zone for this request.",
  40488. // "location": "path",
  40489. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  40490. // "required": true,
  40491. // "type": "string"
  40492. // }
  40493. // },
  40494. // "path": "{project}/zones/{zone}/disks/{disk}/resize",
  40495. // "request": {
  40496. // "$ref": "DisksResizeRequest"
  40497. // },
  40498. // "response": {
  40499. // "$ref": "Operation"
  40500. // },
  40501. // "scopes": [
  40502. // "https://www.googleapis.com/auth/cloud-platform",
  40503. // "https://www.googleapis.com/auth/compute"
  40504. // ]
  40505. // }
  40506. }
  40507. // method id "compute.disks.setIamPolicy":
  40508. type DisksSetIamPolicyCall struct {
  40509. s *Service
  40510. project string
  40511. zone string
  40512. resource string
  40513. zonesetpolicyrequest *ZoneSetPolicyRequest
  40514. urlParams_ gensupport.URLParams
  40515. ctx_ context.Context
  40516. header_ http.Header
  40517. }
  40518. // SetIamPolicy: Sets the access control policy on the specified
  40519. // resource. Replaces any existing policy.
  40520. func (r *DisksService) SetIamPolicy(project string, zone string, resource string, zonesetpolicyrequest *ZoneSetPolicyRequest) *DisksSetIamPolicyCall {
  40521. c := &DisksSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40522. c.project = project
  40523. c.zone = zone
  40524. c.resource = resource
  40525. c.zonesetpolicyrequest = zonesetpolicyrequest
  40526. return c
  40527. }
  40528. // Fields allows partial responses to be retrieved. See
  40529. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40530. // for more information.
  40531. func (c *DisksSetIamPolicyCall) Fields(s ...googleapi.Field) *DisksSetIamPolicyCall {
  40532. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40533. return c
  40534. }
  40535. // Context sets the context to be used in this call's Do method. Any
  40536. // pending HTTP request will be aborted if the provided context is
  40537. // canceled.
  40538. func (c *DisksSetIamPolicyCall) Context(ctx context.Context) *DisksSetIamPolicyCall {
  40539. c.ctx_ = ctx
  40540. return c
  40541. }
  40542. // Header returns an http.Header that can be modified by the caller to
  40543. // add HTTP headers to the request.
  40544. func (c *DisksSetIamPolicyCall) Header() http.Header {
  40545. if c.header_ == nil {
  40546. c.header_ = make(http.Header)
  40547. }
  40548. return c.header_
  40549. }
  40550. func (c *DisksSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  40551. reqHeaders := make(http.Header)
  40552. for k, v := range c.header_ {
  40553. reqHeaders[k] = v
  40554. }
  40555. reqHeaders.Set("User-Agent", c.s.userAgent())
  40556. var body io.Reader = nil
  40557. body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetpolicyrequest)
  40558. if err != nil {
  40559. return nil, err
  40560. }
  40561. reqHeaders.Set("Content-Type", "application/json")
  40562. c.urlParams_.Set("alt", alt)
  40563. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{resource}/setIamPolicy")
  40564. urls += "?" + c.urlParams_.Encode()
  40565. req, _ := http.NewRequest("POST", urls, body)
  40566. req.Header = reqHeaders
  40567. googleapi.Expand(req.URL, map[string]string{
  40568. "project": c.project,
  40569. "zone": c.zone,
  40570. "resource": c.resource,
  40571. })
  40572. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40573. }
  40574. // Do executes the "compute.disks.setIamPolicy" call.
  40575. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  40576. // code is an error. Response headers are in either
  40577. // *Policy.ServerResponse.Header or (if a response was returned at all)
  40578. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  40579. // check whether the returned error was because http.StatusNotModified
  40580. // was returned.
  40581. func (c *DisksSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  40582. gensupport.SetOptions(c.urlParams_, opts...)
  40583. res, err := c.doRequest("json")
  40584. if res != nil && res.StatusCode == http.StatusNotModified {
  40585. if res.Body != nil {
  40586. res.Body.Close()
  40587. }
  40588. return nil, &googleapi.Error{
  40589. Code: res.StatusCode,
  40590. Header: res.Header,
  40591. }
  40592. }
  40593. if err != nil {
  40594. return nil, err
  40595. }
  40596. defer googleapi.CloseBody(res)
  40597. if err := googleapi.CheckResponse(res); err != nil {
  40598. return nil, err
  40599. }
  40600. ret := &Policy{
  40601. ServerResponse: googleapi.ServerResponse{
  40602. Header: res.Header,
  40603. HTTPStatusCode: res.StatusCode,
  40604. },
  40605. }
  40606. target := &ret
  40607. if err := gensupport.DecodeResponse(target, res); err != nil {
  40608. return nil, err
  40609. }
  40610. return ret, nil
  40611. // {
  40612. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  40613. // "httpMethod": "POST",
  40614. // "id": "compute.disks.setIamPolicy",
  40615. // "parameterOrder": [
  40616. // "project",
  40617. // "zone",
  40618. // "resource"
  40619. // ],
  40620. // "parameters": {
  40621. // "project": {
  40622. // "description": "Project ID for this request.",
  40623. // "location": "path",
  40624. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  40625. // "required": true,
  40626. // "type": "string"
  40627. // },
  40628. // "resource": {
  40629. // "description": "Name of the resource for this request.",
  40630. // "location": "path",
  40631. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  40632. // "required": true,
  40633. // "type": "string"
  40634. // },
  40635. // "zone": {
  40636. // "description": "The name of the zone for this request.",
  40637. // "location": "path",
  40638. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  40639. // "required": true,
  40640. // "type": "string"
  40641. // }
  40642. // },
  40643. // "path": "{project}/zones/{zone}/disks/{resource}/setIamPolicy",
  40644. // "request": {
  40645. // "$ref": "ZoneSetPolicyRequest"
  40646. // },
  40647. // "response": {
  40648. // "$ref": "Policy"
  40649. // },
  40650. // "scopes": [
  40651. // "https://www.googleapis.com/auth/cloud-platform",
  40652. // "https://www.googleapis.com/auth/compute"
  40653. // ]
  40654. // }
  40655. }
  40656. // method id "compute.disks.setLabels":
  40657. type DisksSetLabelsCall struct {
  40658. s *Service
  40659. project string
  40660. zone string
  40661. resource string
  40662. zonesetlabelsrequest *ZoneSetLabelsRequest
  40663. urlParams_ gensupport.URLParams
  40664. ctx_ context.Context
  40665. header_ http.Header
  40666. }
  40667. // SetLabels: Sets the labels on a disk. To learn more about labels,
  40668. // read the Labeling Resources documentation.
  40669. func (r *DisksService) SetLabels(project string, zone string, resource string, zonesetlabelsrequest *ZoneSetLabelsRequest) *DisksSetLabelsCall {
  40670. c := &DisksSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40671. c.project = project
  40672. c.zone = zone
  40673. c.resource = resource
  40674. c.zonesetlabelsrequest = zonesetlabelsrequest
  40675. return c
  40676. }
  40677. // RequestId sets the optional parameter "requestId": An optional
  40678. // request ID to identify requests. Specify a unique request ID so that
  40679. // if you must retry your request, the server will know to ignore the
  40680. // request if it has already been completed.
  40681. //
  40682. // For example, consider a situation where you make an initial request
  40683. // and the request times out. If you make the request again with the
  40684. // same request ID, the server can check if original operation with the
  40685. // same request ID was received, and if so, will ignore the second
  40686. // request. This prevents clients from accidentally creating duplicate
  40687. // commitments.
  40688. //
  40689. // The request ID must be a valid UUID with the exception that zero UUID
  40690. // is not supported (00000000-0000-0000-0000-000000000000).
  40691. func (c *DisksSetLabelsCall) RequestId(requestId string) *DisksSetLabelsCall {
  40692. c.urlParams_.Set("requestId", requestId)
  40693. return c
  40694. }
  40695. // Fields allows partial responses to be retrieved. See
  40696. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40697. // for more information.
  40698. func (c *DisksSetLabelsCall) Fields(s ...googleapi.Field) *DisksSetLabelsCall {
  40699. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40700. return c
  40701. }
  40702. // Context sets the context to be used in this call's Do method. Any
  40703. // pending HTTP request will be aborted if the provided context is
  40704. // canceled.
  40705. func (c *DisksSetLabelsCall) Context(ctx context.Context) *DisksSetLabelsCall {
  40706. c.ctx_ = ctx
  40707. return c
  40708. }
  40709. // Header returns an http.Header that can be modified by the caller to
  40710. // add HTTP headers to the request.
  40711. func (c *DisksSetLabelsCall) Header() http.Header {
  40712. if c.header_ == nil {
  40713. c.header_ = make(http.Header)
  40714. }
  40715. return c.header_
  40716. }
  40717. func (c *DisksSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  40718. reqHeaders := make(http.Header)
  40719. for k, v := range c.header_ {
  40720. reqHeaders[k] = v
  40721. }
  40722. reqHeaders.Set("User-Agent", c.s.userAgent())
  40723. var body io.Reader = nil
  40724. body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetlabelsrequest)
  40725. if err != nil {
  40726. return nil, err
  40727. }
  40728. reqHeaders.Set("Content-Type", "application/json")
  40729. c.urlParams_.Set("alt", alt)
  40730. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{resource}/setLabels")
  40731. urls += "?" + c.urlParams_.Encode()
  40732. req, _ := http.NewRequest("POST", urls, body)
  40733. req.Header = reqHeaders
  40734. googleapi.Expand(req.URL, map[string]string{
  40735. "project": c.project,
  40736. "zone": c.zone,
  40737. "resource": c.resource,
  40738. })
  40739. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40740. }
  40741. // Do executes the "compute.disks.setLabels" call.
  40742. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  40743. // status code is an error. Response headers are in either
  40744. // *Operation.ServerResponse.Header or (if a response was returned at
  40745. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  40746. // to check whether the returned error was because
  40747. // http.StatusNotModified was returned.
  40748. func (c *DisksSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  40749. gensupport.SetOptions(c.urlParams_, opts...)
  40750. res, err := c.doRequest("json")
  40751. if res != nil && res.StatusCode == http.StatusNotModified {
  40752. if res.Body != nil {
  40753. res.Body.Close()
  40754. }
  40755. return nil, &googleapi.Error{
  40756. Code: res.StatusCode,
  40757. Header: res.Header,
  40758. }
  40759. }
  40760. if err != nil {
  40761. return nil, err
  40762. }
  40763. defer googleapi.CloseBody(res)
  40764. if err := googleapi.CheckResponse(res); err != nil {
  40765. return nil, err
  40766. }
  40767. ret := &Operation{
  40768. ServerResponse: googleapi.ServerResponse{
  40769. Header: res.Header,
  40770. HTTPStatusCode: res.StatusCode,
  40771. },
  40772. }
  40773. target := &ret
  40774. if err := gensupport.DecodeResponse(target, res); err != nil {
  40775. return nil, err
  40776. }
  40777. return ret, nil
  40778. // {
  40779. // "description": "Sets the labels on a disk. To learn more about labels, read the Labeling Resources documentation.",
  40780. // "httpMethod": "POST",
  40781. // "id": "compute.disks.setLabels",
  40782. // "parameterOrder": [
  40783. // "project",
  40784. // "zone",
  40785. // "resource"
  40786. // ],
  40787. // "parameters": {
  40788. // "project": {
  40789. // "description": "Project ID for this request.",
  40790. // "location": "path",
  40791. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  40792. // "required": true,
  40793. // "type": "string"
  40794. // },
  40795. // "requestId": {
  40796. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  40797. // "location": "query",
  40798. // "type": "string"
  40799. // },
  40800. // "resource": {
  40801. // "description": "Name of the resource for this request.",
  40802. // "location": "path",
  40803. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  40804. // "required": true,
  40805. // "type": "string"
  40806. // },
  40807. // "zone": {
  40808. // "description": "The name of the zone for this request.",
  40809. // "location": "path",
  40810. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  40811. // "required": true,
  40812. // "type": "string"
  40813. // }
  40814. // },
  40815. // "path": "{project}/zones/{zone}/disks/{resource}/setLabels",
  40816. // "request": {
  40817. // "$ref": "ZoneSetLabelsRequest"
  40818. // },
  40819. // "response": {
  40820. // "$ref": "Operation"
  40821. // },
  40822. // "scopes": [
  40823. // "https://www.googleapis.com/auth/cloud-platform",
  40824. // "https://www.googleapis.com/auth/compute"
  40825. // ]
  40826. // }
  40827. }
  40828. // method id "compute.disks.testIamPermissions":
  40829. type DisksTestIamPermissionsCall struct {
  40830. s *Service
  40831. project string
  40832. zone string
  40833. resource string
  40834. testpermissionsrequest *TestPermissionsRequest
  40835. urlParams_ gensupport.URLParams
  40836. ctx_ context.Context
  40837. header_ http.Header
  40838. }
  40839. // TestIamPermissions: Returns permissions that a caller has on the
  40840. // specified resource.
  40841. func (r *DisksService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *DisksTestIamPermissionsCall {
  40842. c := &DisksTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40843. c.project = project
  40844. c.zone = zone
  40845. c.resource = resource
  40846. c.testpermissionsrequest = testpermissionsrequest
  40847. return c
  40848. }
  40849. // Fields allows partial responses to be retrieved. See
  40850. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40851. // for more information.
  40852. func (c *DisksTestIamPermissionsCall) Fields(s ...googleapi.Field) *DisksTestIamPermissionsCall {
  40853. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40854. return c
  40855. }
  40856. // Context sets the context to be used in this call's Do method. Any
  40857. // pending HTTP request will be aborted if the provided context is
  40858. // canceled.
  40859. func (c *DisksTestIamPermissionsCall) Context(ctx context.Context) *DisksTestIamPermissionsCall {
  40860. c.ctx_ = ctx
  40861. return c
  40862. }
  40863. // Header returns an http.Header that can be modified by the caller to
  40864. // add HTTP headers to the request.
  40865. func (c *DisksTestIamPermissionsCall) Header() http.Header {
  40866. if c.header_ == nil {
  40867. c.header_ = make(http.Header)
  40868. }
  40869. return c.header_
  40870. }
  40871. func (c *DisksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  40872. reqHeaders := make(http.Header)
  40873. for k, v := range c.header_ {
  40874. reqHeaders[k] = v
  40875. }
  40876. reqHeaders.Set("User-Agent", c.s.userAgent())
  40877. var body io.Reader = nil
  40878. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  40879. if err != nil {
  40880. return nil, err
  40881. }
  40882. reqHeaders.Set("Content-Type", "application/json")
  40883. c.urlParams_.Set("alt", alt)
  40884. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{resource}/testIamPermissions")
  40885. urls += "?" + c.urlParams_.Encode()
  40886. req, _ := http.NewRequest("POST", urls, body)
  40887. req.Header = reqHeaders
  40888. googleapi.Expand(req.URL, map[string]string{
  40889. "project": c.project,
  40890. "zone": c.zone,
  40891. "resource": c.resource,
  40892. })
  40893. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40894. }
  40895. // Do executes the "compute.disks.testIamPermissions" call.
  40896. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  40897. // non-2xx status code is an error. Response headers are in either
  40898. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  40899. // returned at all) in error.(*googleapi.Error).Header. Use
  40900. // googleapi.IsNotModified to check whether the returned error was
  40901. // because http.StatusNotModified was returned.
  40902. func (c *DisksTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  40903. gensupport.SetOptions(c.urlParams_, opts...)
  40904. res, err := c.doRequest("json")
  40905. if res != nil && res.StatusCode == http.StatusNotModified {
  40906. if res.Body != nil {
  40907. res.Body.Close()
  40908. }
  40909. return nil, &googleapi.Error{
  40910. Code: res.StatusCode,
  40911. Header: res.Header,
  40912. }
  40913. }
  40914. if err != nil {
  40915. return nil, err
  40916. }
  40917. defer googleapi.CloseBody(res)
  40918. if err := googleapi.CheckResponse(res); err != nil {
  40919. return nil, err
  40920. }
  40921. ret := &TestPermissionsResponse{
  40922. ServerResponse: googleapi.ServerResponse{
  40923. Header: res.Header,
  40924. HTTPStatusCode: res.StatusCode,
  40925. },
  40926. }
  40927. target := &ret
  40928. if err := gensupport.DecodeResponse(target, res); err != nil {
  40929. return nil, err
  40930. }
  40931. return ret, nil
  40932. // {
  40933. // "description": "Returns permissions that a caller has on the specified resource.",
  40934. // "httpMethod": "POST",
  40935. // "id": "compute.disks.testIamPermissions",
  40936. // "parameterOrder": [
  40937. // "project",
  40938. // "zone",
  40939. // "resource"
  40940. // ],
  40941. // "parameters": {
  40942. // "project": {
  40943. // "description": "Project ID for this request.",
  40944. // "location": "path",
  40945. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  40946. // "required": true,
  40947. // "type": "string"
  40948. // },
  40949. // "resource": {
  40950. // "description": "Name of the resource for this request.",
  40951. // "location": "path",
  40952. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  40953. // "required": true,
  40954. // "type": "string"
  40955. // },
  40956. // "zone": {
  40957. // "description": "The name of the zone for this request.",
  40958. // "location": "path",
  40959. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  40960. // "required": true,
  40961. // "type": "string"
  40962. // }
  40963. // },
  40964. // "path": "{project}/zones/{zone}/disks/{resource}/testIamPermissions",
  40965. // "request": {
  40966. // "$ref": "TestPermissionsRequest"
  40967. // },
  40968. // "response": {
  40969. // "$ref": "TestPermissionsResponse"
  40970. // },
  40971. // "scopes": [
  40972. // "https://www.googleapis.com/auth/cloud-platform",
  40973. // "https://www.googleapis.com/auth/compute",
  40974. // "https://www.googleapis.com/auth/compute.readonly"
  40975. // ]
  40976. // }
  40977. }
  40978. // method id "compute.firewalls.delete":
  40979. type FirewallsDeleteCall struct {
  40980. s *Service
  40981. project string
  40982. firewall string
  40983. urlParams_ gensupport.URLParams
  40984. ctx_ context.Context
  40985. header_ http.Header
  40986. }
  40987. // Delete: Deletes the specified firewall.
  40988. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/delete
  40989. func (r *FirewallsService) Delete(project string, firewall string) *FirewallsDeleteCall {
  40990. c := &FirewallsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40991. c.project = project
  40992. c.firewall = firewall
  40993. return c
  40994. }
  40995. // RequestId sets the optional parameter "requestId": An optional
  40996. // request ID to identify requests. Specify a unique request ID so that
  40997. // if you must retry your request, the server will know to ignore the
  40998. // request if it has already been completed.
  40999. //
  41000. // For example, consider a situation where you make an initial request
  41001. // and the request times out. If you make the request again with the
  41002. // same request ID, the server can check if original operation with the
  41003. // same request ID was received, and if so, will ignore the second
  41004. // request. This prevents clients from accidentally creating duplicate
  41005. // commitments.
  41006. //
  41007. // The request ID must be a valid UUID with the exception that zero UUID
  41008. // is not supported (00000000-0000-0000-0000-000000000000).
  41009. func (c *FirewallsDeleteCall) RequestId(requestId string) *FirewallsDeleteCall {
  41010. c.urlParams_.Set("requestId", requestId)
  41011. return c
  41012. }
  41013. // Fields allows partial responses to be retrieved. See
  41014. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41015. // for more information.
  41016. func (c *FirewallsDeleteCall) Fields(s ...googleapi.Field) *FirewallsDeleteCall {
  41017. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41018. return c
  41019. }
  41020. // Context sets the context to be used in this call's Do method. Any
  41021. // pending HTTP request will be aborted if the provided context is
  41022. // canceled.
  41023. func (c *FirewallsDeleteCall) Context(ctx context.Context) *FirewallsDeleteCall {
  41024. c.ctx_ = ctx
  41025. return c
  41026. }
  41027. // Header returns an http.Header that can be modified by the caller to
  41028. // add HTTP headers to the request.
  41029. func (c *FirewallsDeleteCall) Header() http.Header {
  41030. if c.header_ == nil {
  41031. c.header_ = make(http.Header)
  41032. }
  41033. return c.header_
  41034. }
  41035. func (c *FirewallsDeleteCall) doRequest(alt string) (*http.Response, error) {
  41036. reqHeaders := make(http.Header)
  41037. for k, v := range c.header_ {
  41038. reqHeaders[k] = v
  41039. }
  41040. reqHeaders.Set("User-Agent", c.s.userAgent())
  41041. var body io.Reader = nil
  41042. c.urlParams_.Set("alt", alt)
  41043. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{firewall}")
  41044. urls += "?" + c.urlParams_.Encode()
  41045. req, _ := http.NewRequest("DELETE", urls, body)
  41046. req.Header = reqHeaders
  41047. googleapi.Expand(req.URL, map[string]string{
  41048. "project": c.project,
  41049. "firewall": c.firewall,
  41050. })
  41051. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41052. }
  41053. // Do executes the "compute.firewalls.delete" call.
  41054. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  41055. // status code is an error. Response headers are in either
  41056. // *Operation.ServerResponse.Header or (if a response was returned at
  41057. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  41058. // to check whether the returned error was because
  41059. // http.StatusNotModified was returned.
  41060. func (c *FirewallsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  41061. gensupport.SetOptions(c.urlParams_, opts...)
  41062. res, err := c.doRequest("json")
  41063. if res != nil && res.StatusCode == http.StatusNotModified {
  41064. if res.Body != nil {
  41065. res.Body.Close()
  41066. }
  41067. return nil, &googleapi.Error{
  41068. Code: res.StatusCode,
  41069. Header: res.Header,
  41070. }
  41071. }
  41072. if err != nil {
  41073. return nil, err
  41074. }
  41075. defer googleapi.CloseBody(res)
  41076. if err := googleapi.CheckResponse(res); err != nil {
  41077. return nil, err
  41078. }
  41079. ret := &Operation{
  41080. ServerResponse: googleapi.ServerResponse{
  41081. Header: res.Header,
  41082. HTTPStatusCode: res.StatusCode,
  41083. },
  41084. }
  41085. target := &ret
  41086. if err := gensupport.DecodeResponse(target, res); err != nil {
  41087. return nil, err
  41088. }
  41089. return ret, nil
  41090. // {
  41091. // "description": "Deletes the specified firewall.",
  41092. // "httpMethod": "DELETE",
  41093. // "id": "compute.firewalls.delete",
  41094. // "parameterOrder": [
  41095. // "project",
  41096. // "firewall"
  41097. // ],
  41098. // "parameters": {
  41099. // "firewall": {
  41100. // "description": "Name of the firewall rule to delete.",
  41101. // "location": "path",
  41102. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  41103. // "required": true,
  41104. // "type": "string"
  41105. // },
  41106. // "project": {
  41107. // "description": "Project ID for this request.",
  41108. // "location": "path",
  41109. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  41110. // "required": true,
  41111. // "type": "string"
  41112. // },
  41113. // "requestId": {
  41114. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  41115. // "location": "query",
  41116. // "type": "string"
  41117. // }
  41118. // },
  41119. // "path": "{project}/global/firewalls/{firewall}",
  41120. // "response": {
  41121. // "$ref": "Operation"
  41122. // },
  41123. // "scopes": [
  41124. // "https://www.googleapis.com/auth/cloud-platform",
  41125. // "https://www.googleapis.com/auth/compute"
  41126. // ]
  41127. // }
  41128. }
  41129. // method id "compute.firewalls.get":
  41130. type FirewallsGetCall struct {
  41131. s *Service
  41132. project string
  41133. firewall string
  41134. urlParams_ gensupport.URLParams
  41135. ifNoneMatch_ string
  41136. ctx_ context.Context
  41137. header_ http.Header
  41138. }
  41139. // Get: Returns the specified firewall.
  41140. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/get
  41141. func (r *FirewallsService) Get(project string, firewall string) *FirewallsGetCall {
  41142. c := &FirewallsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41143. c.project = project
  41144. c.firewall = firewall
  41145. return c
  41146. }
  41147. // Fields allows partial responses to be retrieved. See
  41148. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41149. // for more information.
  41150. func (c *FirewallsGetCall) Fields(s ...googleapi.Field) *FirewallsGetCall {
  41151. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41152. return c
  41153. }
  41154. // IfNoneMatch sets the optional parameter which makes the operation
  41155. // fail if the object's ETag matches the given value. This is useful for
  41156. // getting updates only after the object has changed since the last
  41157. // request. Use googleapi.IsNotModified to check whether the response
  41158. // error from Do is the result of In-None-Match.
  41159. func (c *FirewallsGetCall) IfNoneMatch(entityTag string) *FirewallsGetCall {
  41160. c.ifNoneMatch_ = entityTag
  41161. return c
  41162. }
  41163. // Context sets the context to be used in this call's Do method. Any
  41164. // pending HTTP request will be aborted if the provided context is
  41165. // canceled.
  41166. func (c *FirewallsGetCall) Context(ctx context.Context) *FirewallsGetCall {
  41167. c.ctx_ = ctx
  41168. return c
  41169. }
  41170. // Header returns an http.Header that can be modified by the caller to
  41171. // add HTTP headers to the request.
  41172. func (c *FirewallsGetCall) Header() http.Header {
  41173. if c.header_ == nil {
  41174. c.header_ = make(http.Header)
  41175. }
  41176. return c.header_
  41177. }
  41178. func (c *FirewallsGetCall) doRequest(alt string) (*http.Response, error) {
  41179. reqHeaders := make(http.Header)
  41180. for k, v := range c.header_ {
  41181. reqHeaders[k] = v
  41182. }
  41183. reqHeaders.Set("User-Agent", c.s.userAgent())
  41184. if c.ifNoneMatch_ != "" {
  41185. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  41186. }
  41187. var body io.Reader = nil
  41188. c.urlParams_.Set("alt", alt)
  41189. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{firewall}")
  41190. urls += "?" + c.urlParams_.Encode()
  41191. req, _ := http.NewRequest("GET", urls, body)
  41192. req.Header = reqHeaders
  41193. googleapi.Expand(req.URL, map[string]string{
  41194. "project": c.project,
  41195. "firewall": c.firewall,
  41196. })
  41197. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41198. }
  41199. // Do executes the "compute.firewalls.get" call.
  41200. // Exactly one of *Firewall or error will be non-nil. Any non-2xx status
  41201. // code is an error. Response headers are in either
  41202. // *Firewall.ServerResponse.Header or (if a response was returned at
  41203. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  41204. // to check whether the returned error was because
  41205. // http.StatusNotModified was returned.
  41206. func (c *FirewallsGetCall) Do(opts ...googleapi.CallOption) (*Firewall, error) {
  41207. gensupport.SetOptions(c.urlParams_, opts...)
  41208. res, err := c.doRequest("json")
  41209. if res != nil && res.StatusCode == http.StatusNotModified {
  41210. if res.Body != nil {
  41211. res.Body.Close()
  41212. }
  41213. return nil, &googleapi.Error{
  41214. Code: res.StatusCode,
  41215. Header: res.Header,
  41216. }
  41217. }
  41218. if err != nil {
  41219. return nil, err
  41220. }
  41221. defer googleapi.CloseBody(res)
  41222. if err := googleapi.CheckResponse(res); err != nil {
  41223. return nil, err
  41224. }
  41225. ret := &Firewall{
  41226. ServerResponse: googleapi.ServerResponse{
  41227. Header: res.Header,
  41228. HTTPStatusCode: res.StatusCode,
  41229. },
  41230. }
  41231. target := &ret
  41232. if err := gensupport.DecodeResponse(target, res); err != nil {
  41233. return nil, err
  41234. }
  41235. return ret, nil
  41236. // {
  41237. // "description": "Returns the specified firewall.",
  41238. // "httpMethod": "GET",
  41239. // "id": "compute.firewalls.get",
  41240. // "parameterOrder": [
  41241. // "project",
  41242. // "firewall"
  41243. // ],
  41244. // "parameters": {
  41245. // "firewall": {
  41246. // "description": "Name of the firewall rule to return.",
  41247. // "location": "path",
  41248. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  41249. // "required": true,
  41250. // "type": "string"
  41251. // },
  41252. // "project": {
  41253. // "description": "Project ID for this request.",
  41254. // "location": "path",
  41255. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  41256. // "required": true,
  41257. // "type": "string"
  41258. // }
  41259. // },
  41260. // "path": "{project}/global/firewalls/{firewall}",
  41261. // "response": {
  41262. // "$ref": "Firewall"
  41263. // },
  41264. // "scopes": [
  41265. // "https://www.googleapis.com/auth/cloud-platform",
  41266. // "https://www.googleapis.com/auth/compute",
  41267. // "https://www.googleapis.com/auth/compute.readonly"
  41268. // ]
  41269. // }
  41270. }
  41271. // method id "compute.firewalls.insert":
  41272. type FirewallsInsertCall struct {
  41273. s *Service
  41274. project string
  41275. firewall *Firewall
  41276. urlParams_ gensupport.URLParams
  41277. ctx_ context.Context
  41278. header_ http.Header
  41279. }
  41280. // Insert: Creates a firewall rule in the specified project using the
  41281. // data included in the request.
  41282. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/insert
  41283. func (r *FirewallsService) Insert(project string, firewall *Firewall) *FirewallsInsertCall {
  41284. c := &FirewallsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41285. c.project = project
  41286. c.firewall = firewall
  41287. return c
  41288. }
  41289. // RequestId sets the optional parameter "requestId": An optional
  41290. // request ID to identify requests. Specify a unique request ID so that
  41291. // if you must retry your request, the server will know to ignore the
  41292. // request if it has already been completed.
  41293. //
  41294. // For example, consider a situation where you make an initial request
  41295. // and the request times out. If you make the request again with the
  41296. // same request ID, the server can check if original operation with the
  41297. // same request ID was received, and if so, will ignore the second
  41298. // request. This prevents clients from accidentally creating duplicate
  41299. // commitments.
  41300. //
  41301. // The request ID must be a valid UUID with the exception that zero UUID
  41302. // is not supported (00000000-0000-0000-0000-000000000000).
  41303. func (c *FirewallsInsertCall) RequestId(requestId string) *FirewallsInsertCall {
  41304. c.urlParams_.Set("requestId", requestId)
  41305. return c
  41306. }
  41307. // Fields allows partial responses to be retrieved. See
  41308. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41309. // for more information.
  41310. func (c *FirewallsInsertCall) Fields(s ...googleapi.Field) *FirewallsInsertCall {
  41311. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41312. return c
  41313. }
  41314. // Context sets the context to be used in this call's Do method. Any
  41315. // pending HTTP request will be aborted if the provided context is
  41316. // canceled.
  41317. func (c *FirewallsInsertCall) Context(ctx context.Context) *FirewallsInsertCall {
  41318. c.ctx_ = ctx
  41319. return c
  41320. }
  41321. // Header returns an http.Header that can be modified by the caller to
  41322. // add HTTP headers to the request.
  41323. func (c *FirewallsInsertCall) Header() http.Header {
  41324. if c.header_ == nil {
  41325. c.header_ = make(http.Header)
  41326. }
  41327. return c.header_
  41328. }
  41329. func (c *FirewallsInsertCall) doRequest(alt string) (*http.Response, error) {
  41330. reqHeaders := make(http.Header)
  41331. for k, v := range c.header_ {
  41332. reqHeaders[k] = v
  41333. }
  41334. reqHeaders.Set("User-Agent", c.s.userAgent())
  41335. var body io.Reader = nil
  41336. body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall)
  41337. if err != nil {
  41338. return nil, err
  41339. }
  41340. reqHeaders.Set("Content-Type", "application/json")
  41341. c.urlParams_.Set("alt", alt)
  41342. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls")
  41343. urls += "?" + c.urlParams_.Encode()
  41344. req, _ := http.NewRequest("POST", urls, body)
  41345. req.Header = reqHeaders
  41346. googleapi.Expand(req.URL, map[string]string{
  41347. "project": c.project,
  41348. })
  41349. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41350. }
  41351. // Do executes the "compute.firewalls.insert" call.
  41352. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  41353. // status code is an error. Response headers are in either
  41354. // *Operation.ServerResponse.Header or (if a response was returned at
  41355. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  41356. // to check whether the returned error was because
  41357. // http.StatusNotModified was returned.
  41358. func (c *FirewallsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  41359. gensupport.SetOptions(c.urlParams_, opts...)
  41360. res, err := c.doRequest("json")
  41361. if res != nil && res.StatusCode == http.StatusNotModified {
  41362. if res.Body != nil {
  41363. res.Body.Close()
  41364. }
  41365. return nil, &googleapi.Error{
  41366. Code: res.StatusCode,
  41367. Header: res.Header,
  41368. }
  41369. }
  41370. if err != nil {
  41371. return nil, err
  41372. }
  41373. defer googleapi.CloseBody(res)
  41374. if err := googleapi.CheckResponse(res); err != nil {
  41375. return nil, err
  41376. }
  41377. ret := &Operation{
  41378. ServerResponse: googleapi.ServerResponse{
  41379. Header: res.Header,
  41380. HTTPStatusCode: res.StatusCode,
  41381. },
  41382. }
  41383. target := &ret
  41384. if err := gensupport.DecodeResponse(target, res); err != nil {
  41385. return nil, err
  41386. }
  41387. return ret, nil
  41388. // {
  41389. // "description": "Creates a firewall rule in the specified project using the data included in the request.",
  41390. // "httpMethod": "POST",
  41391. // "id": "compute.firewalls.insert",
  41392. // "parameterOrder": [
  41393. // "project"
  41394. // ],
  41395. // "parameters": {
  41396. // "project": {
  41397. // "description": "Project ID for this request.",
  41398. // "location": "path",
  41399. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  41400. // "required": true,
  41401. // "type": "string"
  41402. // },
  41403. // "requestId": {
  41404. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  41405. // "location": "query",
  41406. // "type": "string"
  41407. // }
  41408. // },
  41409. // "path": "{project}/global/firewalls",
  41410. // "request": {
  41411. // "$ref": "Firewall"
  41412. // },
  41413. // "response": {
  41414. // "$ref": "Operation"
  41415. // },
  41416. // "scopes": [
  41417. // "https://www.googleapis.com/auth/cloud-platform",
  41418. // "https://www.googleapis.com/auth/compute"
  41419. // ]
  41420. // }
  41421. }
  41422. // method id "compute.firewalls.list":
  41423. type FirewallsListCall struct {
  41424. s *Service
  41425. project string
  41426. urlParams_ gensupport.URLParams
  41427. ifNoneMatch_ string
  41428. ctx_ context.Context
  41429. header_ http.Header
  41430. }
  41431. // List: Retrieves the list of firewall rules available to the specified
  41432. // project.
  41433. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/list
  41434. func (r *FirewallsService) List(project string) *FirewallsListCall {
  41435. c := &FirewallsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41436. c.project = project
  41437. return c
  41438. }
  41439. // Filter sets the optional parameter "filter": A filter expression that
  41440. // filters resources listed in the response. The expression must specify
  41441. // the field name, a comparison operator, and the value that you want to
  41442. // use for filtering. The value must be a string, a number, or a
  41443. // boolean. The comparison operator must be either =, !=, >, or <.
  41444. //
  41445. // For example, if you are filtering Compute Engine instances, you can
  41446. // exclude instances named example-instance by specifying name !=
  41447. // example-instance.
  41448. //
  41449. // You can also filter nested fields. For example, you could specify
  41450. // scheduling.automaticRestart = false to include instances only if they
  41451. // are not scheduled for automatic restarts. You can use filtering on
  41452. // nested fields to filter based on resource labels.
  41453. //
  41454. // To filter on multiple expressions, provide each separate expression
  41455. // within parentheses. For example, (scheduling.automaticRestart = true)
  41456. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  41457. // AND expression. However, you can include AND and OR expressions
  41458. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  41459. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  41460. // true).
  41461. func (c *FirewallsListCall) Filter(filter string) *FirewallsListCall {
  41462. c.urlParams_.Set("filter", filter)
  41463. return c
  41464. }
  41465. // MaxResults sets the optional parameter "maxResults": The maximum
  41466. // number of results per page that should be returned. If the number of
  41467. // available results is larger than maxResults, Compute Engine returns a
  41468. // nextPageToken that can be used to get the next page of results in
  41469. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  41470. // (Default: 500)
  41471. func (c *FirewallsListCall) MaxResults(maxResults int64) *FirewallsListCall {
  41472. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  41473. return c
  41474. }
  41475. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  41476. // a certain order. By default, results are returned in alphanumerical
  41477. // order based on the resource name.
  41478. //
  41479. // You can also sort results in descending order based on the creation
  41480. // timestamp using orderBy="creationTimestamp desc". This sorts results
  41481. // based on the creationTimestamp field in reverse chronological order
  41482. // (newest result first). Use this to sort resources like operations so
  41483. // that the newest operation is returned first.
  41484. //
  41485. // Currently, only sorting by name or creationTimestamp desc is
  41486. // supported.
  41487. func (c *FirewallsListCall) OrderBy(orderBy string) *FirewallsListCall {
  41488. c.urlParams_.Set("orderBy", orderBy)
  41489. return c
  41490. }
  41491. // PageToken sets the optional parameter "pageToken": Specifies a page
  41492. // token to use. Set pageToken to the nextPageToken returned by a
  41493. // previous list request to get the next page of results.
  41494. func (c *FirewallsListCall) PageToken(pageToken string) *FirewallsListCall {
  41495. c.urlParams_.Set("pageToken", pageToken)
  41496. return c
  41497. }
  41498. // Fields allows partial responses to be retrieved. See
  41499. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41500. // for more information.
  41501. func (c *FirewallsListCall) Fields(s ...googleapi.Field) *FirewallsListCall {
  41502. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41503. return c
  41504. }
  41505. // IfNoneMatch sets the optional parameter which makes the operation
  41506. // fail if the object's ETag matches the given value. This is useful for
  41507. // getting updates only after the object has changed since the last
  41508. // request. Use googleapi.IsNotModified to check whether the response
  41509. // error from Do is the result of In-None-Match.
  41510. func (c *FirewallsListCall) IfNoneMatch(entityTag string) *FirewallsListCall {
  41511. c.ifNoneMatch_ = entityTag
  41512. return c
  41513. }
  41514. // Context sets the context to be used in this call's Do method. Any
  41515. // pending HTTP request will be aborted if the provided context is
  41516. // canceled.
  41517. func (c *FirewallsListCall) Context(ctx context.Context) *FirewallsListCall {
  41518. c.ctx_ = ctx
  41519. return c
  41520. }
  41521. // Header returns an http.Header that can be modified by the caller to
  41522. // add HTTP headers to the request.
  41523. func (c *FirewallsListCall) Header() http.Header {
  41524. if c.header_ == nil {
  41525. c.header_ = make(http.Header)
  41526. }
  41527. return c.header_
  41528. }
  41529. func (c *FirewallsListCall) doRequest(alt string) (*http.Response, error) {
  41530. reqHeaders := make(http.Header)
  41531. for k, v := range c.header_ {
  41532. reqHeaders[k] = v
  41533. }
  41534. reqHeaders.Set("User-Agent", c.s.userAgent())
  41535. if c.ifNoneMatch_ != "" {
  41536. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  41537. }
  41538. var body io.Reader = nil
  41539. c.urlParams_.Set("alt", alt)
  41540. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls")
  41541. urls += "?" + c.urlParams_.Encode()
  41542. req, _ := http.NewRequest("GET", urls, body)
  41543. req.Header = reqHeaders
  41544. googleapi.Expand(req.URL, map[string]string{
  41545. "project": c.project,
  41546. })
  41547. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41548. }
  41549. // Do executes the "compute.firewalls.list" call.
  41550. // Exactly one of *FirewallList or error will be non-nil. Any non-2xx
  41551. // status code is an error. Response headers are in either
  41552. // *FirewallList.ServerResponse.Header or (if a response was returned at
  41553. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  41554. // to check whether the returned error was because
  41555. // http.StatusNotModified was returned.
  41556. func (c *FirewallsListCall) Do(opts ...googleapi.CallOption) (*FirewallList, error) {
  41557. gensupport.SetOptions(c.urlParams_, opts...)
  41558. res, err := c.doRequest("json")
  41559. if res != nil && res.StatusCode == http.StatusNotModified {
  41560. if res.Body != nil {
  41561. res.Body.Close()
  41562. }
  41563. return nil, &googleapi.Error{
  41564. Code: res.StatusCode,
  41565. Header: res.Header,
  41566. }
  41567. }
  41568. if err != nil {
  41569. return nil, err
  41570. }
  41571. defer googleapi.CloseBody(res)
  41572. if err := googleapi.CheckResponse(res); err != nil {
  41573. return nil, err
  41574. }
  41575. ret := &FirewallList{
  41576. ServerResponse: googleapi.ServerResponse{
  41577. Header: res.Header,
  41578. HTTPStatusCode: res.StatusCode,
  41579. },
  41580. }
  41581. target := &ret
  41582. if err := gensupport.DecodeResponse(target, res); err != nil {
  41583. return nil, err
  41584. }
  41585. return ret, nil
  41586. // {
  41587. // "description": "Retrieves the list of firewall rules available to the specified project.",
  41588. // "httpMethod": "GET",
  41589. // "id": "compute.firewalls.list",
  41590. // "parameterOrder": [
  41591. // "project"
  41592. // ],
  41593. // "parameters": {
  41594. // "filter": {
  41595. // "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).",
  41596. // "location": "query",
  41597. // "type": "string"
  41598. // },
  41599. // "maxResults": {
  41600. // "default": "500",
  41601. // "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)",
  41602. // "format": "uint32",
  41603. // "location": "query",
  41604. // "minimum": "0",
  41605. // "type": "integer"
  41606. // },
  41607. // "orderBy": {
  41608. // "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.",
  41609. // "location": "query",
  41610. // "type": "string"
  41611. // },
  41612. // "pageToken": {
  41613. // "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.",
  41614. // "location": "query",
  41615. // "type": "string"
  41616. // },
  41617. // "project": {
  41618. // "description": "Project ID for this request.",
  41619. // "location": "path",
  41620. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  41621. // "required": true,
  41622. // "type": "string"
  41623. // }
  41624. // },
  41625. // "path": "{project}/global/firewalls",
  41626. // "response": {
  41627. // "$ref": "FirewallList"
  41628. // },
  41629. // "scopes": [
  41630. // "https://www.googleapis.com/auth/cloud-platform",
  41631. // "https://www.googleapis.com/auth/compute",
  41632. // "https://www.googleapis.com/auth/compute.readonly"
  41633. // ]
  41634. // }
  41635. }
  41636. // Pages invokes f for each page of results.
  41637. // A non-nil error returned from f will halt the iteration.
  41638. // The provided context supersedes any context provided to the Context method.
  41639. func (c *FirewallsListCall) Pages(ctx context.Context, f func(*FirewallList) error) error {
  41640. c.ctx_ = ctx
  41641. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  41642. for {
  41643. x, err := c.Do()
  41644. if err != nil {
  41645. return err
  41646. }
  41647. if err := f(x); err != nil {
  41648. return err
  41649. }
  41650. if x.NextPageToken == "" {
  41651. return nil
  41652. }
  41653. c.PageToken(x.NextPageToken)
  41654. }
  41655. }
  41656. // method id "compute.firewalls.patch":
  41657. type FirewallsPatchCall struct {
  41658. s *Service
  41659. project string
  41660. firewall string
  41661. firewall2 *Firewall
  41662. urlParams_ gensupport.URLParams
  41663. ctx_ context.Context
  41664. header_ http.Header
  41665. }
  41666. // Patch: Updates the specified firewall rule with the data included in
  41667. // the request. This method supports PATCH semantics and uses the JSON
  41668. // merge patch format and processing rules.
  41669. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/patch
  41670. func (r *FirewallsService) Patch(project string, firewall string, firewall2 *Firewall) *FirewallsPatchCall {
  41671. c := &FirewallsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41672. c.project = project
  41673. c.firewall = firewall
  41674. c.firewall2 = firewall2
  41675. return c
  41676. }
  41677. // RequestId sets the optional parameter "requestId": An optional
  41678. // request ID to identify requests. Specify a unique request ID so that
  41679. // if you must retry your request, the server will know to ignore the
  41680. // request if it has already been completed.
  41681. //
  41682. // For example, consider a situation where you make an initial request
  41683. // and the request times out. If you make the request again with the
  41684. // same request ID, the server can check if original operation with the
  41685. // same request ID was received, and if so, will ignore the second
  41686. // request. This prevents clients from accidentally creating duplicate
  41687. // commitments.
  41688. //
  41689. // The request ID must be a valid UUID with the exception that zero UUID
  41690. // is not supported (00000000-0000-0000-0000-000000000000).
  41691. func (c *FirewallsPatchCall) RequestId(requestId string) *FirewallsPatchCall {
  41692. c.urlParams_.Set("requestId", requestId)
  41693. return c
  41694. }
  41695. // Fields allows partial responses to be retrieved. See
  41696. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41697. // for more information.
  41698. func (c *FirewallsPatchCall) Fields(s ...googleapi.Field) *FirewallsPatchCall {
  41699. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41700. return c
  41701. }
  41702. // Context sets the context to be used in this call's Do method. Any
  41703. // pending HTTP request will be aborted if the provided context is
  41704. // canceled.
  41705. func (c *FirewallsPatchCall) Context(ctx context.Context) *FirewallsPatchCall {
  41706. c.ctx_ = ctx
  41707. return c
  41708. }
  41709. // Header returns an http.Header that can be modified by the caller to
  41710. // add HTTP headers to the request.
  41711. func (c *FirewallsPatchCall) Header() http.Header {
  41712. if c.header_ == nil {
  41713. c.header_ = make(http.Header)
  41714. }
  41715. return c.header_
  41716. }
  41717. func (c *FirewallsPatchCall) doRequest(alt string) (*http.Response, error) {
  41718. reqHeaders := make(http.Header)
  41719. for k, v := range c.header_ {
  41720. reqHeaders[k] = v
  41721. }
  41722. reqHeaders.Set("User-Agent", c.s.userAgent())
  41723. var body io.Reader = nil
  41724. body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall2)
  41725. if err != nil {
  41726. return nil, err
  41727. }
  41728. reqHeaders.Set("Content-Type", "application/json")
  41729. c.urlParams_.Set("alt", alt)
  41730. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{firewall}")
  41731. urls += "?" + c.urlParams_.Encode()
  41732. req, _ := http.NewRequest("PATCH", urls, body)
  41733. req.Header = reqHeaders
  41734. googleapi.Expand(req.URL, map[string]string{
  41735. "project": c.project,
  41736. "firewall": c.firewall,
  41737. })
  41738. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41739. }
  41740. // Do executes the "compute.firewalls.patch" call.
  41741. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  41742. // status code is an error. Response headers are in either
  41743. // *Operation.ServerResponse.Header or (if a response was returned at
  41744. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  41745. // to check whether the returned error was because
  41746. // http.StatusNotModified was returned.
  41747. func (c *FirewallsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  41748. gensupport.SetOptions(c.urlParams_, opts...)
  41749. res, err := c.doRequest("json")
  41750. if res != nil && res.StatusCode == http.StatusNotModified {
  41751. if res.Body != nil {
  41752. res.Body.Close()
  41753. }
  41754. return nil, &googleapi.Error{
  41755. Code: res.StatusCode,
  41756. Header: res.Header,
  41757. }
  41758. }
  41759. if err != nil {
  41760. return nil, err
  41761. }
  41762. defer googleapi.CloseBody(res)
  41763. if err := googleapi.CheckResponse(res); err != nil {
  41764. return nil, err
  41765. }
  41766. ret := &Operation{
  41767. ServerResponse: googleapi.ServerResponse{
  41768. Header: res.Header,
  41769. HTTPStatusCode: res.StatusCode,
  41770. },
  41771. }
  41772. target := &ret
  41773. if err := gensupport.DecodeResponse(target, res); err != nil {
  41774. return nil, err
  41775. }
  41776. return ret, nil
  41777. // {
  41778. // "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.",
  41779. // "httpMethod": "PATCH",
  41780. // "id": "compute.firewalls.patch",
  41781. // "parameterOrder": [
  41782. // "project",
  41783. // "firewall"
  41784. // ],
  41785. // "parameters": {
  41786. // "firewall": {
  41787. // "description": "Name of the firewall rule to patch.",
  41788. // "location": "path",
  41789. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  41790. // "required": true,
  41791. // "type": "string"
  41792. // },
  41793. // "project": {
  41794. // "description": "Project ID for this request.",
  41795. // "location": "path",
  41796. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  41797. // "required": true,
  41798. // "type": "string"
  41799. // },
  41800. // "requestId": {
  41801. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  41802. // "location": "query",
  41803. // "type": "string"
  41804. // }
  41805. // },
  41806. // "path": "{project}/global/firewalls/{firewall}",
  41807. // "request": {
  41808. // "$ref": "Firewall"
  41809. // },
  41810. // "response": {
  41811. // "$ref": "Operation"
  41812. // },
  41813. // "scopes": [
  41814. // "https://www.googleapis.com/auth/cloud-platform",
  41815. // "https://www.googleapis.com/auth/compute"
  41816. // ]
  41817. // }
  41818. }
  41819. // method id "compute.firewalls.testIamPermissions":
  41820. type FirewallsTestIamPermissionsCall struct {
  41821. s *Service
  41822. project string
  41823. resource string
  41824. testpermissionsrequest *TestPermissionsRequest
  41825. urlParams_ gensupport.URLParams
  41826. ctx_ context.Context
  41827. header_ http.Header
  41828. }
  41829. // TestIamPermissions: Returns permissions that a caller has on the
  41830. // specified resource.
  41831. func (r *FirewallsService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *FirewallsTestIamPermissionsCall {
  41832. c := &FirewallsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41833. c.project = project
  41834. c.resource = resource
  41835. c.testpermissionsrequest = testpermissionsrequest
  41836. return c
  41837. }
  41838. // Fields allows partial responses to be retrieved. See
  41839. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41840. // for more information.
  41841. func (c *FirewallsTestIamPermissionsCall) Fields(s ...googleapi.Field) *FirewallsTestIamPermissionsCall {
  41842. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41843. return c
  41844. }
  41845. // Context sets the context to be used in this call's Do method. Any
  41846. // pending HTTP request will be aborted if the provided context is
  41847. // canceled.
  41848. func (c *FirewallsTestIamPermissionsCall) Context(ctx context.Context) *FirewallsTestIamPermissionsCall {
  41849. c.ctx_ = ctx
  41850. return c
  41851. }
  41852. // Header returns an http.Header that can be modified by the caller to
  41853. // add HTTP headers to the request.
  41854. func (c *FirewallsTestIamPermissionsCall) Header() http.Header {
  41855. if c.header_ == nil {
  41856. c.header_ = make(http.Header)
  41857. }
  41858. return c.header_
  41859. }
  41860. func (c *FirewallsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  41861. reqHeaders := make(http.Header)
  41862. for k, v := range c.header_ {
  41863. reqHeaders[k] = v
  41864. }
  41865. reqHeaders.Set("User-Agent", c.s.userAgent())
  41866. var body io.Reader = nil
  41867. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  41868. if err != nil {
  41869. return nil, err
  41870. }
  41871. reqHeaders.Set("Content-Type", "application/json")
  41872. c.urlParams_.Set("alt", alt)
  41873. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{resource}/testIamPermissions")
  41874. urls += "?" + c.urlParams_.Encode()
  41875. req, _ := http.NewRequest("POST", urls, body)
  41876. req.Header = reqHeaders
  41877. googleapi.Expand(req.URL, map[string]string{
  41878. "project": c.project,
  41879. "resource": c.resource,
  41880. })
  41881. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41882. }
  41883. // Do executes the "compute.firewalls.testIamPermissions" call.
  41884. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  41885. // non-2xx status code is an error. Response headers are in either
  41886. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  41887. // returned at all) in error.(*googleapi.Error).Header. Use
  41888. // googleapi.IsNotModified to check whether the returned error was
  41889. // because http.StatusNotModified was returned.
  41890. func (c *FirewallsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  41891. gensupport.SetOptions(c.urlParams_, opts...)
  41892. res, err := c.doRequest("json")
  41893. if res != nil && res.StatusCode == http.StatusNotModified {
  41894. if res.Body != nil {
  41895. res.Body.Close()
  41896. }
  41897. return nil, &googleapi.Error{
  41898. Code: res.StatusCode,
  41899. Header: res.Header,
  41900. }
  41901. }
  41902. if err != nil {
  41903. return nil, err
  41904. }
  41905. defer googleapi.CloseBody(res)
  41906. if err := googleapi.CheckResponse(res); err != nil {
  41907. return nil, err
  41908. }
  41909. ret := &TestPermissionsResponse{
  41910. ServerResponse: googleapi.ServerResponse{
  41911. Header: res.Header,
  41912. HTTPStatusCode: res.StatusCode,
  41913. },
  41914. }
  41915. target := &ret
  41916. if err := gensupport.DecodeResponse(target, res); err != nil {
  41917. return nil, err
  41918. }
  41919. return ret, nil
  41920. // {
  41921. // "description": "Returns permissions that a caller has on the specified resource.",
  41922. // "httpMethod": "POST",
  41923. // "id": "compute.firewalls.testIamPermissions",
  41924. // "parameterOrder": [
  41925. // "project",
  41926. // "resource"
  41927. // ],
  41928. // "parameters": {
  41929. // "project": {
  41930. // "description": "Project ID for this request.",
  41931. // "location": "path",
  41932. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  41933. // "required": true,
  41934. // "type": "string"
  41935. // },
  41936. // "resource": {
  41937. // "description": "Name of the resource for this request.",
  41938. // "location": "path",
  41939. // "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?",
  41940. // "required": true,
  41941. // "type": "string"
  41942. // }
  41943. // },
  41944. // "path": "{project}/global/firewalls/{resource}/testIamPermissions",
  41945. // "request": {
  41946. // "$ref": "TestPermissionsRequest"
  41947. // },
  41948. // "response": {
  41949. // "$ref": "TestPermissionsResponse"
  41950. // },
  41951. // "scopes": [
  41952. // "https://www.googleapis.com/auth/cloud-platform",
  41953. // "https://www.googleapis.com/auth/compute",
  41954. // "https://www.googleapis.com/auth/compute.readonly"
  41955. // ]
  41956. // }
  41957. }
  41958. // method id "compute.firewalls.update":
  41959. type FirewallsUpdateCall struct {
  41960. s *Service
  41961. project string
  41962. firewall string
  41963. firewall2 *Firewall
  41964. urlParams_ gensupport.URLParams
  41965. ctx_ context.Context
  41966. header_ http.Header
  41967. }
  41968. // Update: Updates the specified firewall rule with the data included in
  41969. // the request. The PUT method can only update the following fields of
  41970. // firewall rule: allowed, description, sourceRanges, sourceTags,
  41971. // targetTags.
  41972. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/update
  41973. func (r *FirewallsService) Update(project string, firewall string, firewall2 *Firewall) *FirewallsUpdateCall {
  41974. c := &FirewallsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41975. c.project = project
  41976. c.firewall = firewall
  41977. c.firewall2 = firewall2
  41978. return c
  41979. }
  41980. // RequestId sets the optional parameter "requestId": An optional
  41981. // request ID to identify requests. Specify a unique request ID so that
  41982. // if you must retry your request, the server will know to ignore the
  41983. // request if it has already been completed.
  41984. //
  41985. // For example, consider a situation where you make an initial request
  41986. // and the request times out. If you make the request again with the
  41987. // same request ID, the server can check if original operation with the
  41988. // same request ID was received, and if so, will ignore the second
  41989. // request. This prevents clients from accidentally creating duplicate
  41990. // commitments.
  41991. //
  41992. // The request ID must be a valid UUID with the exception that zero UUID
  41993. // is not supported (00000000-0000-0000-0000-000000000000).
  41994. func (c *FirewallsUpdateCall) RequestId(requestId string) *FirewallsUpdateCall {
  41995. c.urlParams_.Set("requestId", requestId)
  41996. return c
  41997. }
  41998. // Fields allows partial responses to be retrieved. See
  41999. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42000. // for more information.
  42001. func (c *FirewallsUpdateCall) Fields(s ...googleapi.Field) *FirewallsUpdateCall {
  42002. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42003. return c
  42004. }
  42005. // Context sets the context to be used in this call's Do method. Any
  42006. // pending HTTP request will be aborted if the provided context is
  42007. // canceled.
  42008. func (c *FirewallsUpdateCall) Context(ctx context.Context) *FirewallsUpdateCall {
  42009. c.ctx_ = ctx
  42010. return c
  42011. }
  42012. // Header returns an http.Header that can be modified by the caller to
  42013. // add HTTP headers to the request.
  42014. func (c *FirewallsUpdateCall) Header() http.Header {
  42015. if c.header_ == nil {
  42016. c.header_ = make(http.Header)
  42017. }
  42018. return c.header_
  42019. }
  42020. func (c *FirewallsUpdateCall) doRequest(alt string) (*http.Response, error) {
  42021. reqHeaders := make(http.Header)
  42022. for k, v := range c.header_ {
  42023. reqHeaders[k] = v
  42024. }
  42025. reqHeaders.Set("User-Agent", c.s.userAgent())
  42026. var body io.Reader = nil
  42027. body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall2)
  42028. if err != nil {
  42029. return nil, err
  42030. }
  42031. reqHeaders.Set("Content-Type", "application/json")
  42032. c.urlParams_.Set("alt", alt)
  42033. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{firewall}")
  42034. urls += "?" + c.urlParams_.Encode()
  42035. req, _ := http.NewRequest("PUT", urls, body)
  42036. req.Header = reqHeaders
  42037. googleapi.Expand(req.URL, map[string]string{
  42038. "project": c.project,
  42039. "firewall": c.firewall,
  42040. })
  42041. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42042. }
  42043. // Do executes the "compute.firewalls.update" call.
  42044. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  42045. // status code is an error. Response headers are in either
  42046. // *Operation.ServerResponse.Header or (if a response was returned at
  42047. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  42048. // to check whether the returned error was because
  42049. // http.StatusNotModified was returned.
  42050. func (c *FirewallsUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  42051. gensupport.SetOptions(c.urlParams_, opts...)
  42052. res, err := c.doRequest("json")
  42053. if res != nil && res.StatusCode == http.StatusNotModified {
  42054. if res.Body != nil {
  42055. res.Body.Close()
  42056. }
  42057. return nil, &googleapi.Error{
  42058. Code: res.StatusCode,
  42059. Header: res.Header,
  42060. }
  42061. }
  42062. if err != nil {
  42063. return nil, err
  42064. }
  42065. defer googleapi.CloseBody(res)
  42066. if err := googleapi.CheckResponse(res); err != nil {
  42067. return nil, err
  42068. }
  42069. ret := &Operation{
  42070. ServerResponse: googleapi.ServerResponse{
  42071. Header: res.Header,
  42072. HTTPStatusCode: res.StatusCode,
  42073. },
  42074. }
  42075. target := &ret
  42076. if err := gensupport.DecodeResponse(target, res); err != nil {
  42077. return nil, err
  42078. }
  42079. return ret, nil
  42080. // {
  42081. // "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.",
  42082. // "httpMethod": "PUT",
  42083. // "id": "compute.firewalls.update",
  42084. // "parameterOrder": [
  42085. // "project",
  42086. // "firewall"
  42087. // ],
  42088. // "parameters": {
  42089. // "firewall": {
  42090. // "description": "Name of the firewall rule to update.",
  42091. // "location": "path",
  42092. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  42093. // "required": true,
  42094. // "type": "string"
  42095. // },
  42096. // "project": {
  42097. // "description": "Project ID for this request.",
  42098. // "location": "path",
  42099. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  42100. // "required": true,
  42101. // "type": "string"
  42102. // },
  42103. // "requestId": {
  42104. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  42105. // "location": "query",
  42106. // "type": "string"
  42107. // }
  42108. // },
  42109. // "path": "{project}/global/firewalls/{firewall}",
  42110. // "request": {
  42111. // "$ref": "Firewall"
  42112. // },
  42113. // "response": {
  42114. // "$ref": "Operation"
  42115. // },
  42116. // "scopes": [
  42117. // "https://www.googleapis.com/auth/cloud-platform",
  42118. // "https://www.googleapis.com/auth/compute"
  42119. // ]
  42120. // }
  42121. }
  42122. // method id "compute.forwardingRules.aggregatedList":
  42123. type ForwardingRulesAggregatedListCall struct {
  42124. s *Service
  42125. project string
  42126. urlParams_ gensupport.URLParams
  42127. ifNoneMatch_ string
  42128. ctx_ context.Context
  42129. header_ http.Header
  42130. }
  42131. // AggregatedList: Retrieves an aggregated list of forwarding rules.
  42132. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/aggregatedList
  42133. func (r *ForwardingRulesService) AggregatedList(project string) *ForwardingRulesAggregatedListCall {
  42134. c := &ForwardingRulesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42135. c.project = project
  42136. return c
  42137. }
  42138. // Filter sets the optional parameter "filter": A filter expression that
  42139. // filters resources listed in the response. The expression must specify
  42140. // the field name, a comparison operator, and the value that you want to
  42141. // use for filtering. The value must be a string, a number, or a
  42142. // boolean. The comparison operator must be either =, !=, >, or <.
  42143. //
  42144. // For example, if you are filtering Compute Engine instances, you can
  42145. // exclude instances named example-instance by specifying name !=
  42146. // example-instance.
  42147. //
  42148. // You can also filter nested fields. For example, you could specify
  42149. // scheduling.automaticRestart = false to include instances only if they
  42150. // are not scheduled for automatic restarts. You can use filtering on
  42151. // nested fields to filter based on resource labels.
  42152. //
  42153. // To filter on multiple expressions, provide each separate expression
  42154. // within parentheses. For example, (scheduling.automaticRestart = true)
  42155. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  42156. // AND expression. However, you can include AND and OR expressions
  42157. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  42158. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  42159. // true).
  42160. func (c *ForwardingRulesAggregatedListCall) Filter(filter string) *ForwardingRulesAggregatedListCall {
  42161. c.urlParams_.Set("filter", filter)
  42162. return c
  42163. }
  42164. // MaxResults sets the optional parameter "maxResults": The maximum
  42165. // number of results per page that should be returned. If the number of
  42166. // available results is larger than maxResults, Compute Engine returns a
  42167. // nextPageToken that can be used to get the next page of results in
  42168. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  42169. // (Default: 500)
  42170. func (c *ForwardingRulesAggregatedListCall) MaxResults(maxResults int64) *ForwardingRulesAggregatedListCall {
  42171. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  42172. return c
  42173. }
  42174. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  42175. // a certain order. By default, results are returned in alphanumerical
  42176. // order based on the resource name.
  42177. //
  42178. // You can also sort results in descending order based on the creation
  42179. // timestamp using orderBy="creationTimestamp desc". This sorts results
  42180. // based on the creationTimestamp field in reverse chronological order
  42181. // (newest result first). Use this to sort resources like operations so
  42182. // that the newest operation is returned first.
  42183. //
  42184. // Currently, only sorting by name or creationTimestamp desc is
  42185. // supported.
  42186. func (c *ForwardingRulesAggregatedListCall) OrderBy(orderBy string) *ForwardingRulesAggregatedListCall {
  42187. c.urlParams_.Set("orderBy", orderBy)
  42188. return c
  42189. }
  42190. // PageToken sets the optional parameter "pageToken": Specifies a page
  42191. // token to use. Set pageToken to the nextPageToken returned by a
  42192. // previous list request to get the next page of results.
  42193. func (c *ForwardingRulesAggregatedListCall) PageToken(pageToken string) *ForwardingRulesAggregatedListCall {
  42194. c.urlParams_.Set("pageToken", pageToken)
  42195. return c
  42196. }
  42197. // Fields allows partial responses to be retrieved. See
  42198. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42199. // for more information.
  42200. func (c *ForwardingRulesAggregatedListCall) Fields(s ...googleapi.Field) *ForwardingRulesAggregatedListCall {
  42201. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42202. return c
  42203. }
  42204. // IfNoneMatch sets the optional parameter which makes the operation
  42205. // fail if the object's ETag matches the given value. This is useful for
  42206. // getting updates only after the object has changed since the last
  42207. // request. Use googleapi.IsNotModified to check whether the response
  42208. // error from Do is the result of In-None-Match.
  42209. func (c *ForwardingRulesAggregatedListCall) IfNoneMatch(entityTag string) *ForwardingRulesAggregatedListCall {
  42210. c.ifNoneMatch_ = entityTag
  42211. return c
  42212. }
  42213. // Context sets the context to be used in this call's Do method. Any
  42214. // pending HTTP request will be aborted if the provided context is
  42215. // canceled.
  42216. func (c *ForwardingRulesAggregatedListCall) Context(ctx context.Context) *ForwardingRulesAggregatedListCall {
  42217. c.ctx_ = ctx
  42218. return c
  42219. }
  42220. // Header returns an http.Header that can be modified by the caller to
  42221. // add HTTP headers to the request.
  42222. func (c *ForwardingRulesAggregatedListCall) Header() http.Header {
  42223. if c.header_ == nil {
  42224. c.header_ = make(http.Header)
  42225. }
  42226. return c.header_
  42227. }
  42228. func (c *ForwardingRulesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  42229. reqHeaders := make(http.Header)
  42230. for k, v := range c.header_ {
  42231. reqHeaders[k] = v
  42232. }
  42233. reqHeaders.Set("User-Agent", c.s.userAgent())
  42234. if c.ifNoneMatch_ != "" {
  42235. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  42236. }
  42237. var body io.Reader = nil
  42238. c.urlParams_.Set("alt", alt)
  42239. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/forwardingRules")
  42240. urls += "?" + c.urlParams_.Encode()
  42241. req, _ := http.NewRequest("GET", urls, body)
  42242. req.Header = reqHeaders
  42243. googleapi.Expand(req.URL, map[string]string{
  42244. "project": c.project,
  42245. })
  42246. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42247. }
  42248. // Do executes the "compute.forwardingRules.aggregatedList" call.
  42249. // Exactly one of *ForwardingRuleAggregatedList or error will be
  42250. // non-nil. Any non-2xx status code is an error. Response headers are in
  42251. // either *ForwardingRuleAggregatedList.ServerResponse.Header or (if a
  42252. // response was returned at all) in error.(*googleapi.Error).Header. Use
  42253. // googleapi.IsNotModified to check whether the returned error was
  42254. // because http.StatusNotModified was returned.
  42255. func (c *ForwardingRulesAggregatedListCall) Do(opts ...googleapi.CallOption) (*ForwardingRuleAggregatedList, error) {
  42256. gensupport.SetOptions(c.urlParams_, opts...)
  42257. res, err := c.doRequest("json")
  42258. if res != nil && res.StatusCode == http.StatusNotModified {
  42259. if res.Body != nil {
  42260. res.Body.Close()
  42261. }
  42262. return nil, &googleapi.Error{
  42263. Code: res.StatusCode,
  42264. Header: res.Header,
  42265. }
  42266. }
  42267. if err != nil {
  42268. return nil, err
  42269. }
  42270. defer googleapi.CloseBody(res)
  42271. if err := googleapi.CheckResponse(res); err != nil {
  42272. return nil, err
  42273. }
  42274. ret := &ForwardingRuleAggregatedList{
  42275. ServerResponse: googleapi.ServerResponse{
  42276. Header: res.Header,
  42277. HTTPStatusCode: res.StatusCode,
  42278. },
  42279. }
  42280. target := &ret
  42281. if err := gensupport.DecodeResponse(target, res); err != nil {
  42282. return nil, err
  42283. }
  42284. return ret, nil
  42285. // {
  42286. // "description": "Retrieves an aggregated list of forwarding rules.",
  42287. // "httpMethod": "GET",
  42288. // "id": "compute.forwardingRules.aggregatedList",
  42289. // "parameterOrder": [
  42290. // "project"
  42291. // ],
  42292. // "parameters": {
  42293. // "filter": {
  42294. // "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).",
  42295. // "location": "query",
  42296. // "type": "string"
  42297. // },
  42298. // "maxResults": {
  42299. // "default": "500",
  42300. // "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)",
  42301. // "format": "uint32",
  42302. // "location": "query",
  42303. // "minimum": "0",
  42304. // "type": "integer"
  42305. // },
  42306. // "orderBy": {
  42307. // "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.",
  42308. // "location": "query",
  42309. // "type": "string"
  42310. // },
  42311. // "pageToken": {
  42312. // "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.",
  42313. // "location": "query",
  42314. // "type": "string"
  42315. // },
  42316. // "project": {
  42317. // "description": "Project ID for this request.",
  42318. // "location": "path",
  42319. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  42320. // "required": true,
  42321. // "type": "string"
  42322. // }
  42323. // },
  42324. // "path": "{project}/aggregated/forwardingRules",
  42325. // "response": {
  42326. // "$ref": "ForwardingRuleAggregatedList"
  42327. // },
  42328. // "scopes": [
  42329. // "https://www.googleapis.com/auth/cloud-platform",
  42330. // "https://www.googleapis.com/auth/compute",
  42331. // "https://www.googleapis.com/auth/compute.readonly"
  42332. // ]
  42333. // }
  42334. }
  42335. // Pages invokes f for each page of results.
  42336. // A non-nil error returned from f will halt the iteration.
  42337. // The provided context supersedes any context provided to the Context method.
  42338. func (c *ForwardingRulesAggregatedListCall) Pages(ctx context.Context, f func(*ForwardingRuleAggregatedList) error) error {
  42339. c.ctx_ = ctx
  42340. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  42341. for {
  42342. x, err := c.Do()
  42343. if err != nil {
  42344. return err
  42345. }
  42346. if err := f(x); err != nil {
  42347. return err
  42348. }
  42349. if x.NextPageToken == "" {
  42350. return nil
  42351. }
  42352. c.PageToken(x.NextPageToken)
  42353. }
  42354. }
  42355. // method id "compute.forwardingRules.delete":
  42356. type ForwardingRulesDeleteCall struct {
  42357. s *Service
  42358. project string
  42359. region string
  42360. forwardingRule string
  42361. urlParams_ gensupport.URLParams
  42362. ctx_ context.Context
  42363. header_ http.Header
  42364. }
  42365. // Delete: Deletes the specified ForwardingRule resource.
  42366. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/delete
  42367. func (r *ForwardingRulesService) Delete(project string, region string, forwardingRule string) *ForwardingRulesDeleteCall {
  42368. c := &ForwardingRulesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42369. c.project = project
  42370. c.region = region
  42371. c.forwardingRule = forwardingRule
  42372. return c
  42373. }
  42374. // RequestId sets the optional parameter "requestId": An optional
  42375. // request ID to identify requests. Specify a unique request ID so that
  42376. // if you must retry your request, the server will know to ignore the
  42377. // request if it has already been completed.
  42378. //
  42379. // For example, consider a situation where you make an initial request
  42380. // and the request times out. If you make the request again with the
  42381. // same request ID, the server can check if original operation with the
  42382. // same request ID was received, and if so, will ignore the second
  42383. // request. This prevents clients from accidentally creating duplicate
  42384. // commitments.
  42385. //
  42386. // The request ID must be a valid UUID with the exception that zero UUID
  42387. // is not supported (00000000-0000-0000-0000-000000000000).
  42388. func (c *ForwardingRulesDeleteCall) RequestId(requestId string) *ForwardingRulesDeleteCall {
  42389. c.urlParams_.Set("requestId", requestId)
  42390. return c
  42391. }
  42392. // Fields allows partial responses to be retrieved. See
  42393. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42394. // for more information.
  42395. func (c *ForwardingRulesDeleteCall) Fields(s ...googleapi.Field) *ForwardingRulesDeleteCall {
  42396. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42397. return c
  42398. }
  42399. // Context sets the context to be used in this call's Do method. Any
  42400. // pending HTTP request will be aborted if the provided context is
  42401. // canceled.
  42402. func (c *ForwardingRulesDeleteCall) Context(ctx context.Context) *ForwardingRulesDeleteCall {
  42403. c.ctx_ = ctx
  42404. return c
  42405. }
  42406. // Header returns an http.Header that can be modified by the caller to
  42407. // add HTTP headers to the request.
  42408. func (c *ForwardingRulesDeleteCall) Header() http.Header {
  42409. if c.header_ == nil {
  42410. c.header_ = make(http.Header)
  42411. }
  42412. return c.header_
  42413. }
  42414. func (c *ForwardingRulesDeleteCall) doRequest(alt string) (*http.Response, error) {
  42415. reqHeaders := make(http.Header)
  42416. for k, v := range c.header_ {
  42417. reqHeaders[k] = v
  42418. }
  42419. reqHeaders.Set("User-Agent", c.s.userAgent())
  42420. var body io.Reader = nil
  42421. c.urlParams_.Set("alt", alt)
  42422. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules/{forwardingRule}")
  42423. urls += "?" + c.urlParams_.Encode()
  42424. req, _ := http.NewRequest("DELETE", urls, body)
  42425. req.Header = reqHeaders
  42426. googleapi.Expand(req.URL, map[string]string{
  42427. "project": c.project,
  42428. "region": c.region,
  42429. "forwardingRule": c.forwardingRule,
  42430. })
  42431. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42432. }
  42433. // Do executes the "compute.forwardingRules.delete" call.
  42434. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  42435. // status code is an error. Response headers are in either
  42436. // *Operation.ServerResponse.Header or (if a response was returned at
  42437. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  42438. // to check whether the returned error was because
  42439. // http.StatusNotModified was returned.
  42440. func (c *ForwardingRulesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  42441. gensupport.SetOptions(c.urlParams_, opts...)
  42442. res, err := c.doRequest("json")
  42443. if res != nil && res.StatusCode == http.StatusNotModified {
  42444. if res.Body != nil {
  42445. res.Body.Close()
  42446. }
  42447. return nil, &googleapi.Error{
  42448. Code: res.StatusCode,
  42449. Header: res.Header,
  42450. }
  42451. }
  42452. if err != nil {
  42453. return nil, err
  42454. }
  42455. defer googleapi.CloseBody(res)
  42456. if err := googleapi.CheckResponse(res); err != nil {
  42457. return nil, err
  42458. }
  42459. ret := &Operation{
  42460. ServerResponse: googleapi.ServerResponse{
  42461. Header: res.Header,
  42462. HTTPStatusCode: res.StatusCode,
  42463. },
  42464. }
  42465. target := &ret
  42466. if err := gensupport.DecodeResponse(target, res); err != nil {
  42467. return nil, err
  42468. }
  42469. return ret, nil
  42470. // {
  42471. // "description": "Deletes the specified ForwardingRule resource.",
  42472. // "httpMethod": "DELETE",
  42473. // "id": "compute.forwardingRules.delete",
  42474. // "parameterOrder": [
  42475. // "project",
  42476. // "region",
  42477. // "forwardingRule"
  42478. // ],
  42479. // "parameters": {
  42480. // "forwardingRule": {
  42481. // "description": "Name of the ForwardingRule resource to delete.",
  42482. // "location": "path",
  42483. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  42484. // "required": true,
  42485. // "type": "string"
  42486. // },
  42487. // "project": {
  42488. // "description": "Project ID for this request.",
  42489. // "location": "path",
  42490. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  42491. // "required": true,
  42492. // "type": "string"
  42493. // },
  42494. // "region": {
  42495. // "description": "Name of the region scoping this request.",
  42496. // "location": "path",
  42497. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  42498. // "required": true,
  42499. // "type": "string"
  42500. // },
  42501. // "requestId": {
  42502. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  42503. // "location": "query",
  42504. // "type": "string"
  42505. // }
  42506. // },
  42507. // "path": "{project}/regions/{region}/forwardingRules/{forwardingRule}",
  42508. // "response": {
  42509. // "$ref": "Operation"
  42510. // },
  42511. // "scopes": [
  42512. // "https://www.googleapis.com/auth/cloud-platform",
  42513. // "https://www.googleapis.com/auth/compute"
  42514. // ]
  42515. // }
  42516. }
  42517. // method id "compute.forwardingRules.get":
  42518. type ForwardingRulesGetCall struct {
  42519. s *Service
  42520. project string
  42521. region string
  42522. forwardingRule string
  42523. urlParams_ gensupport.URLParams
  42524. ifNoneMatch_ string
  42525. ctx_ context.Context
  42526. header_ http.Header
  42527. }
  42528. // Get: Returns the specified ForwardingRule resource.
  42529. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/get
  42530. func (r *ForwardingRulesService) Get(project string, region string, forwardingRule string) *ForwardingRulesGetCall {
  42531. c := &ForwardingRulesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42532. c.project = project
  42533. c.region = region
  42534. c.forwardingRule = forwardingRule
  42535. return c
  42536. }
  42537. // Fields allows partial responses to be retrieved. See
  42538. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42539. // for more information.
  42540. func (c *ForwardingRulesGetCall) Fields(s ...googleapi.Field) *ForwardingRulesGetCall {
  42541. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42542. return c
  42543. }
  42544. // IfNoneMatch sets the optional parameter which makes the operation
  42545. // fail if the object's ETag matches the given value. This is useful for
  42546. // getting updates only after the object has changed since the last
  42547. // request. Use googleapi.IsNotModified to check whether the response
  42548. // error from Do is the result of In-None-Match.
  42549. func (c *ForwardingRulesGetCall) IfNoneMatch(entityTag string) *ForwardingRulesGetCall {
  42550. c.ifNoneMatch_ = entityTag
  42551. return c
  42552. }
  42553. // Context sets the context to be used in this call's Do method. Any
  42554. // pending HTTP request will be aborted if the provided context is
  42555. // canceled.
  42556. func (c *ForwardingRulesGetCall) Context(ctx context.Context) *ForwardingRulesGetCall {
  42557. c.ctx_ = ctx
  42558. return c
  42559. }
  42560. // Header returns an http.Header that can be modified by the caller to
  42561. // add HTTP headers to the request.
  42562. func (c *ForwardingRulesGetCall) Header() http.Header {
  42563. if c.header_ == nil {
  42564. c.header_ = make(http.Header)
  42565. }
  42566. return c.header_
  42567. }
  42568. func (c *ForwardingRulesGetCall) doRequest(alt string) (*http.Response, error) {
  42569. reqHeaders := make(http.Header)
  42570. for k, v := range c.header_ {
  42571. reqHeaders[k] = v
  42572. }
  42573. reqHeaders.Set("User-Agent", c.s.userAgent())
  42574. if c.ifNoneMatch_ != "" {
  42575. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  42576. }
  42577. var body io.Reader = nil
  42578. c.urlParams_.Set("alt", alt)
  42579. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules/{forwardingRule}")
  42580. urls += "?" + c.urlParams_.Encode()
  42581. req, _ := http.NewRequest("GET", urls, body)
  42582. req.Header = reqHeaders
  42583. googleapi.Expand(req.URL, map[string]string{
  42584. "project": c.project,
  42585. "region": c.region,
  42586. "forwardingRule": c.forwardingRule,
  42587. })
  42588. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42589. }
  42590. // Do executes the "compute.forwardingRules.get" call.
  42591. // Exactly one of *ForwardingRule or error will be non-nil. Any non-2xx
  42592. // status code is an error. Response headers are in either
  42593. // *ForwardingRule.ServerResponse.Header or (if a response was returned
  42594. // at all) in error.(*googleapi.Error).Header. Use
  42595. // googleapi.IsNotModified to check whether the returned error was
  42596. // because http.StatusNotModified was returned.
  42597. func (c *ForwardingRulesGetCall) Do(opts ...googleapi.CallOption) (*ForwardingRule, error) {
  42598. gensupport.SetOptions(c.urlParams_, opts...)
  42599. res, err := c.doRequest("json")
  42600. if res != nil && res.StatusCode == http.StatusNotModified {
  42601. if res.Body != nil {
  42602. res.Body.Close()
  42603. }
  42604. return nil, &googleapi.Error{
  42605. Code: res.StatusCode,
  42606. Header: res.Header,
  42607. }
  42608. }
  42609. if err != nil {
  42610. return nil, err
  42611. }
  42612. defer googleapi.CloseBody(res)
  42613. if err := googleapi.CheckResponse(res); err != nil {
  42614. return nil, err
  42615. }
  42616. ret := &ForwardingRule{
  42617. ServerResponse: googleapi.ServerResponse{
  42618. Header: res.Header,
  42619. HTTPStatusCode: res.StatusCode,
  42620. },
  42621. }
  42622. target := &ret
  42623. if err := gensupport.DecodeResponse(target, res); err != nil {
  42624. return nil, err
  42625. }
  42626. return ret, nil
  42627. // {
  42628. // "description": "Returns the specified ForwardingRule resource.",
  42629. // "httpMethod": "GET",
  42630. // "id": "compute.forwardingRules.get",
  42631. // "parameterOrder": [
  42632. // "project",
  42633. // "region",
  42634. // "forwardingRule"
  42635. // ],
  42636. // "parameters": {
  42637. // "forwardingRule": {
  42638. // "description": "Name of the ForwardingRule resource to return.",
  42639. // "location": "path",
  42640. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  42641. // "required": true,
  42642. // "type": "string"
  42643. // },
  42644. // "project": {
  42645. // "description": "Project ID for this request.",
  42646. // "location": "path",
  42647. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  42648. // "required": true,
  42649. // "type": "string"
  42650. // },
  42651. // "region": {
  42652. // "description": "Name of the region scoping this request.",
  42653. // "location": "path",
  42654. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  42655. // "required": true,
  42656. // "type": "string"
  42657. // }
  42658. // },
  42659. // "path": "{project}/regions/{region}/forwardingRules/{forwardingRule}",
  42660. // "response": {
  42661. // "$ref": "ForwardingRule"
  42662. // },
  42663. // "scopes": [
  42664. // "https://www.googleapis.com/auth/cloud-platform",
  42665. // "https://www.googleapis.com/auth/compute",
  42666. // "https://www.googleapis.com/auth/compute.readonly"
  42667. // ]
  42668. // }
  42669. }
  42670. // method id "compute.forwardingRules.insert":
  42671. type ForwardingRulesInsertCall struct {
  42672. s *Service
  42673. project string
  42674. region string
  42675. forwardingrule *ForwardingRule
  42676. urlParams_ gensupport.URLParams
  42677. ctx_ context.Context
  42678. header_ http.Header
  42679. }
  42680. // Insert: Creates a ForwardingRule resource in the specified project
  42681. // and region using the data included in the request.
  42682. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/insert
  42683. func (r *ForwardingRulesService) Insert(project string, region string, forwardingrule *ForwardingRule) *ForwardingRulesInsertCall {
  42684. c := &ForwardingRulesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42685. c.project = project
  42686. c.region = region
  42687. c.forwardingrule = forwardingrule
  42688. return c
  42689. }
  42690. // RequestId sets the optional parameter "requestId": An optional
  42691. // request ID to identify requests. Specify a unique request ID so that
  42692. // if you must retry your request, the server will know to ignore the
  42693. // request if it has already been completed.
  42694. //
  42695. // For example, consider a situation where you make an initial request
  42696. // and the request times out. If you make the request again with the
  42697. // same request ID, the server can check if original operation with the
  42698. // same request ID was received, and if so, will ignore the second
  42699. // request. This prevents clients from accidentally creating duplicate
  42700. // commitments.
  42701. //
  42702. // The request ID must be a valid UUID with the exception that zero UUID
  42703. // is not supported (00000000-0000-0000-0000-000000000000).
  42704. func (c *ForwardingRulesInsertCall) RequestId(requestId string) *ForwardingRulesInsertCall {
  42705. c.urlParams_.Set("requestId", requestId)
  42706. return c
  42707. }
  42708. // Fields allows partial responses to be retrieved. See
  42709. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42710. // for more information.
  42711. func (c *ForwardingRulesInsertCall) Fields(s ...googleapi.Field) *ForwardingRulesInsertCall {
  42712. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42713. return c
  42714. }
  42715. // Context sets the context to be used in this call's Do method. Any
  42716. // pending HTTP request will be aborted if the provided context is
  42717. // canceled.
  42718. func (c *ForwardingRulesInsertCall) Context(ctx context.Context) *ForwardingRulesInsertCall {
  42719. c.ctx_ = ctx
  42720. return c
  42721. }
  42722. // Header returns an http.Header that can be modified by the caller to
  42723. // add HTTP headers to the request.
  42724. func (c *ForwardingRulesInsertCall) Header() http.Header {
  42725. if c.header_ == nil {
  42726. c.header_ = make(http.Header)
  42727. }
  42728. return c.header_
  42729. }
  42730. func (c *ForwardingRulesInsertCall) doRequest(alt string) (*http.Response, error) {
  42731. reqHeaders := make(http.Header)
  42732. for k, v := range c.header_ {
  42733. reqHeaders[k] = v
  42734. }
  42735. reqHeaders.Set("User-Agent", c.s.userAgent())
  42736. var body io.Reader = nil
  42737. body, err := googleapi.WithoutDataWrapper.JSONReader(c.forwardingrule)
  42738. if err != nil {
  42739. return nil, err
  42740. }
  42741. reqHeaders.Set("Content-Type", "application/json")
  42742. c.urlParams_.Set("alt", alt)
  42743. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules")
  42744. urls += "?" + c.urlParams_.Encode()
  42745. req, _ := http.NewRequest("POST", urls, body)
  42746. req.Header = reqHeaders
  42747. googleapi.Expand(req.URL, map[string]string{
  42748. "project": c.project,
  42749. "region": c.region,
  42750. })
  42751. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42752. }
  42753. // Do executes the "compute.forwardingRules.insert" call.
  42754. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  42755. // status code is an error. Response headers are in either
  42756. // *Operation.ServerResponse.Header or (if a response was returned at
  42757. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  42758. // to check whether the returned error was because
  42759. // http.StatusNotModified was returned.
  42760. func (c *ForwardingRulesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  42761. gensupport.SetOptions(c.urlParams_, opts...)
  42762. res, err := c.doRequest("json")
  42763. if res != nil && res.StatusCode == http.StatusNotModified {
  42764. if res.Body != nil {
  42765. res.Body.Close()
  42766. }
  42767. return nil, &googleapi.Error{
  42768. Code: res.StatusCode,
  42769. Header: res.Header,
  42770. }
  42771. }
  42772. if err != nil {
  42773. return nil, err
  42774. }
  42775. defer googleapi.CloseBody(res)
  42776. if err := googleapi.CheckResponse(res); err != nil {
  42777. return nil, err
  42778. }
  42779. ret := &Operation{
  42780. ServerResponse: googleapi.ServerResponse{
  42781. Header: res.Header,
  42782. HTTPStatusCode: res.StatusCode,
  42783. },
  42784. }
  42785. target := &ret
  42786. if err := gensupport.DecodeResponse(target, res); err != nil {
  42787. return nil, err
  42788. }
  42789. return ret, nil
  42790. // {
  42791. // "description": "Creates a ForwardingRule resource in the specified project and region using the data included in the request.",
  42792. // "httpMethod": "POST",
  42793. // "id": "compute.forwardingRules.insert",
  42794. // "parameterOrder": [
  42795. // "project",
  42796. // "region"
  42797. // ],
  42798. // "parameters": {
  42799. // "project": {
  42800. // "description": "Project ID for this request.",
  42801. // "location": "path",
  42802. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  42803. // "required": true,
  42804. // "type": "string"
  42805. // },
  42806. // "region": {
  42807. // "description": "Name of the region scoping this request.",
  42808. // "location": "path",
  42809. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  42810. // "required": true,
  42811. // "type": "string"
  42812. // },
  42813. // "requestId": {
  42814. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  42815. // "location": "query",
  42816. // "type": "string"
  42817. // }
  42818. // },
  42819. // "path": "{project}/regions/{region}/forwardingRules",
  42820. // "request": {
  42821. // "$ref": "ForwardingRule"
  42822. // },
  42823. // "response": {
  42824. // "$ref": "Operation"
  42825. // },
  42826. // "scopes": [
  42827. // "https://www.googleapis.com/auth/cloud-platform",
  42828. // "https://www.googleapis.com/auth/compute"
  42829. // ]
  42830. // }
  42831. }
  42832. // method id "compute.forwardingRules.list":
  42833. type ForwardingRulesListCall struct {
  42834. s *Service
  42835. project string
  42836. region string
  42837. urlParams_ gensupport.URLParams
  42838. ifNoneMatch_ string
  42839. ctx_ context.Context
  42840. header_ http.Header
  42841. }
  42842. // List: Retrieves a list of ForwardingRule resources available to the
  42843. // specified project and region.
  42844. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/list
  42845. func (r *ForwardingRulesService) List(project string, region string) *ForwardingRulesListCall {
  42846. c := &ForwardingRulesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42847. c.project = project
  42848. c.region = region
  42849. return c
  42850. }
  42851. // Filter sets the optional parameter "filter": A filter expression that
  42852. // filters resources listed in the response. The expression must specify
  42853. // the field name, a comparison operator, and the value that you want to
  42854. // use for filtering. The value must be a string, a number, or a
  42855. // boolean. The comparison operator must be either =, !=, >, or <.
  42856. //
  42857. // For example, if you are filtering Compute Engine instances, you can
  42858. // exclude instances named example-instance by specifying name !=
  42859. // example-instance.
  42860. //
  42861. // You can also filter nested fields. For example, you could specify
  42862. // scheduling.automaticRestart = false to include instances only if they
  42863. // are not scheduled for automatic restarts. You can use filtering on
  42864. // nested fields to filter based on resource labels.
  42865. //
  42866. // To filter on multiple expressions, provide each separate expression
  42867. // within parentheses. For example, (scheduling.automaticRestart = true)
  42868. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  42869. // AND expression. However, you can include AND and OR expressions
  42870. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  42871. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  42872. // true).
  42873. func (c *ForwardingRulesListCall) Filter(filter string) *ForwardingRulesListCall {
  42874. c.urlParams_.Set("filter", filter)
  42875. return c
  42876. }
  42877. // MaxResults sets the optional parameter "maxResults": The maximum
  42878. // number of results per page that should be returned. If the number of
  42879. // available results is larger than maxResults, Compute Engine returns a
  42880. // nextPageToken that can be used to get the next page of results in
  42881. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  42882. // (Default: 500)
  42883. func (c *ForwardingRulesListCall) MaxResults(maxResults int64) *ForwardingRulesListCall {
  42884. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  42885. return c
  42886. }
  42887. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  42888. // a certain order. By default, results are returned in alphanumerical
  42889. // order based on the resource name.
  42890. //
  42891. // You can also sort results in descending order based on the creation
  42892. // timestamp using orderBy="creationTimestamp desc". This sorts results
  42893. // based on the creationTimestamp field in reverse chronological order
  42894. // (newest result first). Use this to sort resources like operations so
  42895. // that the newest operation is returned first.
  42896. //
  42897. // Currently, only sorting by name or creationTimestamp desc is
  42898. // supported.
  42899. func (c *ForwardingRulesListCall) OrderBy(orderBy string) *ForwardingRulesListCall {
  42900. c.urlParams_.Set("orderBy", orderBy)
  42901. return c
  42902. }
  42903. // PageToken sets the optional parameter "pageToken": Specifies a page
  42904. // token to use. Set pageToken to the nextPageToken returned by a
  42905. // previous list request to get the next page of results.
  42906. func (c *ForwardingRulesListCall) PageToken(pageToken string) *ForwardingRulesListCall {
  42907. c.urlParams_.Set("pageToken", pageToken)
  42908. return c
  42909. }
  42910. // Fields allows partial responses to be retrieved. See
  42911. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42912. // for more information.
  42913. func (c *ForwardingRulesListCall) Fields(s ...googleapi.Field) *ForwardingRulesListCall {
  42914. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42915. return c
  42916. }
  42917. // IfNoneMatch sets the optional parameter which makes the operation
  42918. // fail if the object's ETag matches the given value. This is useful for
  42919. // getting updates only after the object has changed since the last
  42920. // request. Use googleapi.IsNotModified to check whether the response
  42921. // error from Do is the result of In-None-Match.
  42922. func (c *ForwardingRulesListCall) IfNoneMatch(entityTag string) *ForwardingRulesListCall {
  42923. c.ifNoneMatch_ = entityTag
  42924. return c
  42925. }
  42926. // Context sets the context to be used in this call's Do method. Any
  42927. // pending HTTP request will be aborted if the provided context is
  42928. // canceled.
  42929. func (c *ForwardingRulesListCall) Context(ctx context.Context) *ForwardingRulesListCall {
  42930. c.ctx_ = ctx
  42931. return c
  42932. }
  42933. // Header returns an http.Header that can be modified by the caller to
  42934. // add HTTP headers to the request.
  42935. func (c *ForwardingRulesListCall) Header() http.Header {
  42936. if c.header_ == nil {
  42937. c.header_ = make(http.Header)
  42938. }
  42939. return c.header_
  42940. }
  42941. func (c *ForwardingRulesListCall) doRequest(alt string) (*http.Response, error) {
  42942. reqHeaders := make(http.Header)
  42943. for k, v := range c.header_ {
  42944. reqHeaders[k] = v
  42945. }
  42946. reqHeaders.Set("User-Agent", c.s.userAgent())
  42947. if c.ifNoneMatch_ != "" {
  42948. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  42949. }
  42950. var body io.Reader = nil
  42951. c.urlParams_.Set("alt", alt)
  42952. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules")
  42953. urls += "?" + c.urlParams_.Encode()
  42954. req, _ := http.NewRequest("GET", urls, body)
  42955. req.Header = reqHeaders
  42956. googleapi.Expand(req.URL, map[string]string{
  42957. "project": c.project,
  42958. "region": c.region,
  42959. })
  42960. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42961. }
  42962. // Do executes the "compute.forwardingRules.list" call.
  42963. // Exactly one of *ForwardingRuleList or error will be non-nil. Any
  42964. // non-2xx status code is an error. Response headers are in either
  42965. // *ForwardingRuleList.ServerResponse.Header or (if a response was
  42966. // returned at all) in error.(*googleapi.Error).Header. Use
  42967. // googleapi.IsNotModified to check whether the returned error was
  42968. // because http.StatusNotModified was returned.
  42969. func (c *ForwardingRulesListCall) Do(opts ...googleapi.CallOption) (*ForwardingRuleList, error) {
  42970. gensupport.SetOptions(c.urlParams_, opts...)
  42971. res, err := c.doRequest("json")
  42972. if res != nil && res.StatusCode == http.StatusNotModified {
  42973. if res.Body != nil {
  42974. res.Body.Close()
  42975. }
  42976. return nil, &googleapi.Error{
  42977. Code: res.StatusCode,
  42978. Header: res.Header,
  42979. }
  42980. }
  42981. if err != nil {
  42982. return nil, err
  42983. }
  42984. defer googleapi.CloseBody(res)
  42985. if err := googleapi.CheckResponse(res); err != nil {
  42986. return nil, err
  42987. }
  42988. ret := &ForwardingRuleList{
  42989. ServerResponse: googleapi.ServerResponse{
  42990. Header: res.Header,
  42991. HTTPStatusCode: res.StatusCode,
  42992. },
  42993. }
  42994. target := &ret
  42995. if err := gensupport.DecodeResponse(target, res); err != nil {
  42996. return nil, err
  42997. }
  42998. return ret, nil
  42999. // {
  43000. // "description": "Retrieves a list of ForwardingRule resources available to the specified project and region.",
  43001. // "httpMethod": "GET",
  43002. // "id": "compute.forwardingRules.list",
  43003. // "parameterOrder": [
  43004. // "project",
  43005. // "region"
  43006. // ],
  43007. // "parameters": {
  43008. // "filter": {
  43009. // "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).",
  43010. // "location": "query",
  43011. // "type": "string"
  43012. // },
  43013. // "maxResults": {
  43014. // "default": "500",
  43015. // "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)",
  43016. // "format": "uint32",
  43017. // "location": "query",
  43018. // "minimum": "0",
  43019. // "type": "integer"
  43020. // },
  43021. // "orderBy": {
  43022. // "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.",
  43023. // "location": "query",
  43024. // "type": "string"
  43025. // },
  43026. // "pageToken": {
  43027. // "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.",
  43028. // "location": "query",
  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. // "region": {
  43039. // "description": "Name of the region scoping this request.",
  43040. // "location": "path",
  43041. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  43042. // "required": true,
  43043. // "type": "string"
  43044. // }
  43045. // },
  43046. // "path": "{project}/regions/{region}/forwardingRules",
  43047. // "response": {
  43048. // "$ref": "ForwardingRuleList"
  43049. // },
  43050. // "scopes": [
  43051. // "https://www.googleapis.com/auth/cloud-platform",
  43052. // "https://www.googleapis.com/auth/compute",
  43053. // "https://www.googleapis.com/auth/compute.readonly"
  43054. // ]
  43055. // }
  43056. }
  43057. // Pages invokes f for each page of results.
  43058. // A non-nil error returned from f will halt the iteration.
  43059. // The provided context supersedes any context provided to the Context method.
  43060. func (c *ForwardingRulesListCall) Pages(ctx context.Context, f func(*ForwardingRuleList) error) error {
  43061. c.ctx_ = ctx
  43062. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  43063. for {
  43064. x, err := c.Do()
  43065. if err != nil {
  43066. return err
  43067. }
  43068. if err := f(x); err != nil {
  43069. return err
  43070. }
  43071. if x.NextPageToken == "" {
  43072. return nil
  43073. }
  43074. c.PageToken(x.NextPageToken)
  43075. }
  43076. }
  43077. // method id "compute.forwardingRules.patch":
  43078. type ForwardingRulesPatchCall struct {
  43079. s *Service
  43080. project string
  43081. region string
  43082. forwardingRule string
  43083. forwardingrule *ForwardingRule
  43084. urlParams_ gensupport.URLParams
  43085. ctx_ context.Context
  43086. header_ http.Header
  43087. }
  43088. // Patch: Updates the specified forwarding rule with the data included
  43089. // in the request. This method supports PATCH semantics and uses the
  43090. // JSON merge patch format and processing rules. Currently, you can only
  43091. // patch the network_tier field.
  43092. func (r *ForwardingRulesService) Patch(project string, region string, forwardingRule string, forwardingrule *ForwardingRule) *ForwardingRulesPatchCall {
  43093. c := &ForwardingRulesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43094. c.project = project
  43095. c.region = region
  43096. c.forwardingRule = forwardingRule
  43097. c.forwardingrule = forwardingrule
  43098. return c
  43099. }
  43100. // RequestId sets the optional parameter "requestId": An optional
  43101. // request ID to identify requests. Specify a unique request ID so that
  43102. // if you must retry your request, the server will know to ignore the
  43103. // request if it has already been completed.
  43104. //
  43105. // For example, consider a situation where you make an initial request
  43106. // and the request times out. If you make the request again with the
  43107. // same request ID, the server can check if original operation with the
  43108. // same request ID was received, and if so, will ignore the second
  43109. // request. This prevents clients from accidentally creating duplicate
  43110. // commitments.
  43111. //
  43112. // The request ID must be a valid UUID with the exception that zero UUID
  43113. // is not supported (00000000-0000-0000-0000-000000000000).
  43114. func (c *ForwardingRulesPatchCall) RequestId(requestId string) *ForwardingRulesPatchCall {
  43115. c.urlParams_.Set("requestId", requestId)
  43116. return c
  43117. }
  43118. // Fields allows partial responses to be retrieved. See
  43119. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43120. // for more information.
  43121. func (c *ForwardingRulesPatchCall) Fields(s ...googleapi.Field) *ForwardingRulesPatchCall {
  43122. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43123. return c
  43124. }
  43125. // Context sets the context to be used in this call's Do method. Any
  43126. // pending HTTP request will be aborted if the provided context is
  43127. // canceled.
  43128. func (c *ForwardingRulesPatchCall) Context(ctx context.Context) *ForwardingRulesPatchCall {
  43129. c.ctx_ = ctx
  43130. return c
  43131. }
  43132. // Header returns an http.Header that can be modified by the caller to
  43133. // add HTTP headers to the request.
  43134. func (c *ForwardingRulesPatchCall) Header() http.Header {
  43135. if c.header_ == nil {
  43136. c.header_ = make(http.Header)
  43137. }
  43138. return c.header_
  43139. }
  43140. func (c *ForwardingRulesPatchCall) doRequest(alt string) (*http.Response, error) {
  43141. reqHeaders := make(http.Header)
  43142. for k, v := range c.header_ {
  43143. reqHeaders[k] = v
  43144. }
  43145. reqHeaders.Set("User-Agent", c.s.userAgent())
  43146. var body io.Reader = nil
  43147. body, err := googleapi.WithoutDataWrapper.JSONReader(c.forwardingrule)
  43148. if err != nil {
  43149. return nil, err
  43150. }
  43151. reqHeaders.Set("Content-Type", "application/json")
  43152. c.urlParams_.Set("alt", alt)
  43153. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules/{forwardingRule}")
  43154. urls += "?" + c.urlParams_.Encode()
  43155. req, _ := http.NewRequest("PATCH", urls, body)
  43156. req.Header = reqHeaders
  43157. googleapi.Expand(req.URL, map[string]string{
  43158. "project": c.project,
  43159. "region": c.region,
  43160. "forwardingRule": c.forwardingRule,
  43161. })
  43162. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43163. }
  43164. // Do executes the "compute.forwardingRules.patch" call.
  43165. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  43166. // status code is an error. Response headers are in either
  43167. // *Operation.ServerResponse.Header or (if a response was returned at
  43168. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  43169. // to check whether the returned error was because
  43170. // http.StatusNotModified was returned.
  43171. func (c *ForwardingRulesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  43172. gensupport.SetOptions(c.urlParams_, opts...)
  43173. res, err := c.doRequest("json")
  43174. if res != nil && res.StatusCode == http.StatusNotModified {
  43175. if res.Body != nil {
  43176. res.Body.Close()
  43177. }
  43178. return nil, &googleapi.Error{
  43179. Code: res.StatusCode,
  43180. Header: res.Header,
  43181. }
  43182. }
  43183. if err != nil {
  43184. return nil, err
  43185. }
  43186. defer googleapi.CloseBody(res)
  43187. if err := googleapi.CheckResponse(res); err != nil {
  43188. return nil, err
  43189. }
  43190. ret := &Operation{
  43191. ServerResponse: googleapi.ServerResponse{
  43192. Header: res.Header,
  43193. HTTPStatusCode: res.StatusCode,
  43194. },
  43195. }
  43196. target := &ret
  43197. if err := gensupport.DecodeResponse(target, res); err != nil {
  43198. return nil, err
  43199. }
  43200. return ret, nil
  43201. // {
  43202. // "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.",
  43203. // "httpMethod": "PATCH",
  43204. // "id": "compute.forwardingRules.patch",
  43205. // "parameterOrder": [
  43206. // "project",
  43207. // "region",
  43208. // "forwardingRule"
  43209. // ],
  43210. // "parameters": {
  43211. // "forwardingRule": {
  43212. // "description": "Name of the ForwardingRule resource to patch.",
  43213. // "location": "path",
  43214. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  43215. // "required": true,
  43216. // "type": "string"
  43217. // },
  43218. // "project": {
  43219. // "description": "Project ID for this request.",
  43220. // "location": "path",
  43221. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  43222. // "required": true,
  43223. // "type": "string"
  43224. // },
  43225. // "region": {
  43226. // "description": "Name of the region scoping this request.",
  43227. // "location": "path",
  43228. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  43229. // "required": true,
  43230. // "type": "string"
  43231. // },
  43232. // "requestId": {
  43233. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  43234. // "location": "query",
  43235. // "type": "string"
  43236. // }
  43237. // },
  43238. // "path": "{project}/regions/{region}/forwardingRules/{forwardingRule}",
  43239. // "request": {
  43240. // "$ref": "ForwardingRule"
  43241. // },
  43242. // "response": {
  43243. // "$ref": "Operation"
  43244. // },
  43245. // "scopes": [
  43246. // "https://www.googleapis.com/auth/cloud-platform",
  43247. // "https://www.googleapis.com/auth/compute"
  43248. // ]
  43249. // }
  43250. }
  43251. // method id "compute.forwardingRules.setLabels":
  43252. type ForwardingRulesSetLabelsCall struct {
  43253. s *Service
  43254. project string
  43255. region string
  43256. resource string
  43257. regionsetlabelsrequest *RegionSetLabelsRequest
  43258. urlParams_ gensupport.URLParams
  43259. ctx_ context.Context
  43260. header_ http.Header
  43261. }
  43262. // SetLabels: Sets the labels on the specified resource. To learn more
  43263. // about labels, read the Labeling Resources documentation.
  43264. func (r *ForwardingRulesService) SetLabels(project string, region string, resource string, regionsetlabelsrequest *RegionSetLabelsRequest) *ForwardingRulesSetLabelsCall {
  43265. c := &ForwardingRulesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43266. c.project = project
  43267. c.region = region
  43268. c.resource = resource
  43269. c.regionsetlabelsrequest = regionsetlabelsrequest
  43270. return c
  43271. }
  43272. // RequestId sets the optional parameter "requestId": An optional
  43273. // request ID to identify requests. Specify a unique request ID so that
  43274. // if you must retry your request, the server will know to ignore the
  43275. // request if it has already been completed.
  43276. //
  43277. // For example, consider a situation where you make an initial request
  43278. // and the request times out. If you make the request again with the
  43279. // same request ID, the server can check if original operation with the
  43280. // same request ID was received, and if so, will ignore the second
  43281. // request. This prevents clients from accidentally creating duplicate
  43282. // commitments.
  43283. //
  43284. // The request ID must be a valid UUID with the exception that zero UUID
  43285. // is not supported (00000000-0000-0000-0000-000000000000).
  43286. func (c *ForwardingRulesSetLabelsCall) RequestId(requestId string) *ForwardingRulesSetLabelsCall {
  43287. c.urlParams_.Set("requestId", requestId)
  43288. return c
  43289. }
  43290. // Fields allows partial responses to be retrieved. See
  43291. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43292. // for more information.
  43293. func (c *ForwardingRulesSetLabelsCall) Fields(s ...googleapi.Field) *ForwardingRulesSetLabelsCall {
  43294. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43295. return c
  43296. }
  43297. // Context sets the context to be used in this call's Do method. Any
  43298. // pending HTTP request will be aborted if the provided context is
  43299. // canceled.
  43300. func (c *ForwardingRulesSetLabelsCall) Context(ctx context.Context) *ForwardingRulesSetLabelsCall {
  43301. c.ctx_ = ctx
  43302. return c
  43303. }
  43304. // Header returns an http.Header that can be modified by the caller to
  43305. // add HTTP headers to the request.
  43306. func (c *ForwardingRulesSetLabelsCall) Header() http.Header {
  43307. if c.header_ == nil {
  43308. c.header_ = make(http.Header)
  43309. }
  43310. return c.header_
  43311. }
  43312. func (c *ForwardingRulesSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  43313. reqHeaders := make(http.Header)
  43314. for k, v := range c.header_ {
  43315. reqHeaders[k] = v
  43316. }
  43317. reqHeaders.Set("User-Agent", c.s.userAgent())
  43318. var body io.Reader = nil
  43319. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest)
  43320. if err != nil {
  43321. return nil, err
  43322. }
  43323. reqHeaders.Set("Content-Type", "application/json")
  43324. c.urlParams_.Set("alt", alt)
  43325. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules/{resource}/setLabels")
  43326. urls += "?" + c.urlParams_.Encode()
  43327. req, _ := http.NewRequest("POST", urls, body)
  43328. req.Header = reqHeaders
  43329. googleapi.Expand(req.URL, map[string]string{
  43330. "project": c.project,
  43331. "region": c.region,
  43332. "resource": c.resource,
  43333. })
  43334. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43335. }
  43336. // Do executes the "compute.forwardingRules.setLabels" call.
  43337. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  43338. // status code is an error. Response headers are in either
  43339. // *Operation.ServerResponse.Header or (if a response was returned at
  43340. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  43341. // to check whether the returned error was because
  43342. // http.StatusNotModified was returned.
  43343. func (c *ForwardingRulesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  43344. gensupport.SetOptions(c.urlParams_, opts...)
  43345. res, err := c.doRequest("json")
  43346. if res != nil && res.StatusCode == http.StatusNotModified {
  43347. if res.Body != nil {
  43348. res.Body.Close()
  43349. }
  43350. return nil, &googleapi.Error{
  43351. Code: res.StatusCode,
  43352. Header: res.Header,
  43353. }
  43354. }
  43355. if err != nil {
  43356. return nil, err
  43357. }
  43358. defer googleapi.CloseBody(res)
  43359. if err := googleapi.CheckResponse(res); err != nil {
  43360. return nil, err
  43361. }
  43362. ret := &Operation{
  43363. ServerResponse: googleapi.ServerResponse{
  43364. Header: res.Header,
  43365. HTTPStatusCode: res.StatusCode,
  43366. },
  43367. }
  43368. target := &ret
  43369. if err := gensupport.DecodeResponse(target, res); err != nil {
  43370. return nil, err
  43371. }
  43372. return ret, nil
  43373. // {
  43374. // "description": "Sets the labels on the specified resource. To learn more about labels, read the Labeling Resources documentation.",
  43375. // "httpMethod": "POST",
  43376. // "id": "compute.forwardingRules.setLabels",
  43377. // "parameterOrder": [
  43378. // "project",
  43379. // "region",
  43380. // "resource"
  43381. // ],
  43382. // "parameters": {
  43383. // "project": {
  43384. // "description": "Project ID for this request.",
  43385. // "location": "path",
  43386. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  43387. // "required": true,
  43388. // "type": "string"
  43389. // },
  43390. // "region": {
  43391. // "description": "The region for this request.",
  43392. // "location": "path",
  43393. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  43394. // "required": true,
  43395. // "type": "string"
  43396. // },
  43397. // "requestId": {
  43398. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  43399. // "location": "query",
  43400. // "type": "string"
  43401. // },
  43402. // "resource": {
  43403. // "description": "Name of the resource for this request.",
  43404. // "location": "path",
  43405. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  43406. // "required": true,
  43407. // "type": "string"
  43408. // }
  43409. // },
  43410. // "path": "{project}/regions/{region}/forwardingRules/{resource}/setLabels",
  43411. // "request": {
  43412. // "$ref": "RegionSetLabelsRequest"
  43413. // },
  43414. // "response": {
  43415. // "$ref": "Operation"
  43416. // },
  43417. // "scopes": [
  43418. // "https://www.googleapis.com/auth/cloud-platform",
  43419. // "https://www.googleapis.com/auth/compute"
  43420. // ]
  43421. // }
  43422. }
  43423. // method id "compute.forwardingRules.setTarget":
  43424. type ForwardingRulesSetTargetCall struct {
  43425. s *Service
  43426. project string
  43427. region string
  43428. forwardingRule string
  43429. targetreference *TargetReference
  43430. urlParams_ gensupport.URLParams
  43431. ctx_ context.Context
  43432. header_ http.Header
  43433. }
  43434. // SetTarget: Changes target URL for forwarding rule. The new target
  43435. // should be of the same type as the old target.
  43436. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/setTarget
  43437. func (r *ForwardingRulesService) SetTarget(project string, region string, forwardingRule string, targetreference *TargetReference) *ForwardingRulesSetTargetCall {
  43438. c := &ForwardingRulesSetTargetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43439. c.project = project
  43440. c.region = region
  43441. c.forwardingRule = forwardingRule
  43442. c.targetreference = targetreference
  43443. return c
  43444. }
  43445. // RequestId sets the optional parameter "requestId": An optional
  43446. // request ID to identify requests. Specify a unique request ID so that
  43447. // if you must retry your request, the server will know to ignore the
  43448. // request if it has already been completed.
  43449. //
  43450. // For example, consider a situation where you make an initial request
  43451. // and the request times out. If you make the request again with the
  43452. // same request ID, the server can check if original operation with the
  43453. // same request ID was received, and if so, will ignore the second
  43454. // request. This prevents clients from accidentally creating duplicate
  43455. // commitments.
  43456. //
  43457. // The request ID must be a valid UUID with the exception that zero UUID
  43458. // is not supported (00000000-0000-0000-0000-000000000000).
  43459. func (c *ForwardingRulesSetTargetCall) RequestId(requestId string) *ForwardingRulesSetTargetCall {
  43460. c.urlParams_.Set("requestId", requestId)
  43461. return c
  43462. }
  43463. // Fields allows partial responses to be retrieved. See
  43464. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43465. // for more information.
  43466. func (c *ForwardingRulesSetTargetCall) Fields(s ...googleapi.Field) *ForwardingRulesSetTargetCall {
  43467. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43468. return c
  43469. }
  43470. // Context sets the context to be used in this call's Do method. Any
  43471. // pending HTTP request will be aborted if the provided context is
  43472. // canceled.
  43473. func (c *ForwardingRulesSetTargetCall) Context(ctx context.Context) *ForwardingRulesSetTargetCall {
  43474. c.ctx_ = ctx
  43475. return c
  43476. }
  43477. // Header returns an http.Header that can be modified by the caller to
  43478. // add HTTP headers to the request.
  43479. func (c *ForwardingRulesSetTargetCall) Header() http.Header {
  43480. if c.header_ == nil {
  43481. c.header_ = make(http.Header)
  43482. }
  43483. return c.header_
  43484. }
  43485. func (c *ForwardingRulesSetTargetCall) doRequest(alt string) (*http.Response, error) {
  43486. reqHeaders := make(http.Header)
  43487. for k, v := range c.header_ {
  43488. reqHeaders[k] = v
  43489. }
  43490. reqHeaders.Set("User-Agent", c.s.userAgent())
  43491. var body io.Reader = nil
  43492. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetreference)
  43493. if err != nil {
  43494. return nil, err
  43495. }
  43496. reqHeaders.Set("Content-Type", "application/json")
  43497. c.urlParams_.Set("alt", alt)
  43498. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules/{forwardingRule}/setTarget")
  43499. urls += "?" + c.urlParams_.Encode()
  43500. req, _ := http.NewRequest("POST", urls, body)
  43501. req.Header = reqHeaders
  43502. googleapi.Expand(req.URL, map[string]string{
  43503. "project": c.project,
  43504. "region": c.region,
  43505. "forwardingRule": c.forwardingRule,
  43506. })
  43507. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43508. }
  43509. // Do executes the "compute.forwardingRules.setTarget" call.
  43510. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  43511. // status code is an error. Response headers are in either
  43512. // *Operation.ServerResponse.Header or (if a response was returned at
  43513. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  43514. // to check whether the returned error was because
  43515. // http.StatusNotModified was returned.
  43516. func (c *ForwardingRulesSetTargetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  43517. gensupport.SetOptions(c.urlParams_, opts...)
  43518. res, err := c.doRequest("json")
  43519. if res != nil && res.StatusCode == http.StatusNotModified {
  43520. if res.Body != nil {
  43521. res.Body.Close()
  43522. }
  43523. return nil, &googleapi.Error{
  43524. Code: res.StatusCode,
  43525. Header: res.Header,
  43526. }
  43527. }
  43528. if err != nil {
  43529. return nil, err
  43530. }
  43531. defer googleapi.CloseBody(res)
  43532. if err := googleapi.CheckResponse(res); err != nil {
  43533. return nil, err
  43534. }
  43535. ret := &Operation{
  43536. ServerResponse: googleapi.ServerResponse{
  43537. Header: res.Header,
  43538. HTTPStatusCode: res.StatusCode,
  43539. },
  43540. }
  43541. target := &ret
  43542. if err := gensupport.DecodeResponse(target, res); err != nil {
  43543. return nil, err
  43544. }
  43545. return ret, nil
  43546. // {
  43547. // "description": "Changes target URL for forwarding rule. The new target should be of the same type as the old target.",
  43548. // "httpMethod": "POST",
  43549. // "id": "compute.forwardingRules.setTarget",
  43550. // "parameterOrder": [
  43551. // "project",
  43552. // "region",
  43553. // "forwardingRule"
  43554. // ],
  43555. // "parameters": {
  43556. // "forwardingRule": {
  43557. // "description": "Name of the ForwardingRule resource in which target is to be set.",
  43558. // "location": "path",
  43559. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  43560. // "required": true,
  43561. // "type": "string"
  43562. // },
  43563. // "project": {
  43564. // "description": "Project ID for this request.",
  43565. // "location": "path",
  43566. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  43567. // "required": true,
  43568. // "type": "string"
  43569. // },
  43570. // "region": {
  43571. // "description": "Name of the region scoping this request.",
  43572. // "location": "path",
  43573. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  43574. // "required": true,
  43575. // "type": "string"
  43576. // },
  43577. // "requestId": {
  43578. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  43579. // "location": "query",
  43580. // "type": "string"
  43581. // }
  43582. // },
  43583. // "path": "{project}/regions/{region}/forwardingRules/{forwardingRule}/setTarget",
  43584. // "request": {
  43585. // "$ref": "TargetReference"
  43586. // },
  43587. // "response": {
  43588. // "$ref": "Operation"
  43589. // },
  43590. // "scopes": [
  43591. // "https://www.googleapis.com/auth/cloud-platform",
  43592. // "https://www.googleapis.com/auth/compute"
  43593. // ]
  43594. // }
  43595. }
  43596. // method id "compute.forwardingRules.testIamPermissions":
  43597. type ForwardingRulesTestIamPermissionsCall struct {
  43598. s *Service
  43599. project string
  43600. region string
  43601. resource string
  43602. testpermissionsrequest *TestPermissionsRequest
  43603. urlParams_ gensupport.URLParams
  43604. ctx_ context.Context
  43605. header_ http.Header
  43606. }
  43607. // TestIamPermissions: Returns permissions that a caller has on the
  43608. // specified resource.
  43609. func (r *ForwardingRulesService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *ForwardingRulesTestIamPermissionsCall {
  43610. c := &ForwardingRulesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43611. c.project = project
  43612. c.region = region
  43613. c.resource = resource
  43614. c.testpermissionsrequest = testpermissionsrequest
  43615. return c
  43616. }
  43617. // Fields allows partial responses to be retrieved. See
  43618. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43619. // for more information.
  43620. func (c *ForwardingRulesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ForwardingRulesTestIamPermissionsCall {
  43621. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43622. return c
  43623. }
  43624. // Context sets the context to be used in this call's Do method. Any
  43625. // pending HTTP request will be aborted if the provided context is
  43626. // canceled.
  43627. func (c *ForwardingRulesTestIamPermissionsCall) Context(ctx context.Context) *ForwardingRulesTestIamPermissionsCall {
  43628. c.ctx_ = ctx
  43629. return c
  43630. }
  43631. // Header returns an http.Header that can be modified by the caller to
  43632. // add HTTP headers to the request.
  43633. func (c *ForwardingRulesTestIamPermissionsCall) Header() http.Header {
  43634. if c.header_ == nil {
  43635. c.header_ = make(http.Header)
  43636. }
  43637. return c.header_
  43638. }
  43639. func (c *ForwardingRulesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  43640. reqHeaders := make(http.Header)
  43641. for k, v := range c.header_ {
  43642. reqHeaders[k] = v
  43643. }
  43644. reqHeaders.Set("User-Agent", c.s.userAgent())
  43645. var body io.Reader = nil
  43646. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  43647. if err != nil {
  43648. return nil, err
  43649. }
  43650. reqHeaders.Set("Content-Type", "application/json")
  43651. c.urlParams_.Set("alt", alt)
  43652. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules/{resource}/testIamPermissions")
  43653. urls += "?" + c.urlParams_.Encode()
  43654. req, _ := http.NewRequest("POST", urls, body)
  43655. req.Header = reqHeaders
  43656. googleapi.Expand(req.URL, map[string]string{
  43657. "project": c.project,
  43658. "region": c.region,
  43659. "resource": c.resource,
  43660. })
  43661. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43662. }
  43663. // Do executes the "compute.forwardingRules.testIamPermissions" call.
  43664. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  43665. // non-2xx status code is an error. Response headers are in either
  43666. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  43667. // returned at all) in error.(*googleapi.Error).Header. Use
  43668. // googleapi.IsNotModified to check whether the returned error was
  43669. // because http.StatusNotModified was returned.
  43670. func (c *ForwardingRulesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  43671. gensupport.SetOptions(c.urlParams_, opts...)
  43672. res, err := c.doRequest("json")
  43673. if res != nil && res.StatusCode == http.StatusNotModified {
  43674. if res.Body != nil {
  43675. res.Body.Close()
  43676. }
  43677. return nil, &googleapi.Error{
  43678. Code: res.StatusCode,
  43679. Header: res.Header,
  43680. }
  43681. }
  43682. if err != nil {
  43683. return nil, err
  43684. }
  43685. defer googleapi.CloseBody(res)
  43686. if err := googleapi.CheckResponse(res); err != nil {
  43687. return nil, err
  43688. }
  43689. ret := &TestPermissionsResponse{
  43690. ServerResponse: googleapi.ServerResponse{
  43691. Header: res.Header,
  43692. HTTPStatusCode: res.StatusCode,
  43693. },
  43694. }
  43695. target := &ret
  43696. if err := gensupport.DecodeResponse(target, res); err != nil {
  43697. return nil, err
  43698. }
  43699. return ret, nil
  43700. // {
  43701. // "description": "Returns permissions that a caller has on the specified resource.",
  43702. // "httpMethod": "POST",
  43703. // "id": "compute.forwardingRules.testIamPermissions",
  43704. // "parameterOrder": [
  43705. // "project",
  43706. // "region",
  43707. // "resource"
  43708. // ],
  43709. // "parameters": {
  43710. // "project": {
  43711. // "description": "Project ID for this request.",
  43712. // "location": "path",
  43713. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  43714. // "required": true,
  43715. // "type": "string"
  43716. // },
  43717. // "region": {
  43718. // "description": "The name of the region for this request.",
  43719. // "location": "path",
  43720. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  43721. // "required": true,
  43722. // "type": "string"
  43723. // },
  43724. // "resource": {
  43725. // "description": "Name of the resource for this request.",
  43726. // "location": "path",
  43727. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  43728. // "required": true,
  43729. // "type": "string"
  43730. // }
  43731. // },
  43732. // "path": "{project}/regions/{region}/forwardingRules/{resource}/testIamPermissions",
  43733. // "request": {
  43734. // "$ref": "TestPermissionsRequest"
  43735. // },
  43736. // "response": {
  43737. // "$ref": "TestPermissionsResponse"
  43738. // },
  43739. // "scopes": [
  43740. // "https://www.googleapis.com/auth/cloud-platform",
  43741. // "https://www.googleapis.com/auth/compute",
  43742. // "https://www.googleapis.com/auth/compute.readonly"
  43743. // ]
  43744. // }
  43745. }
  43746. // method id "compute.globalAddresses.delete":
  43747. type GlobalAddressesDeleteCall struct {
  43748. s *Service
  43749. project string
  43750. address string
  43751. urlParams_ gensupport.URLParams
  43752. ctx_ context.Context
  43753. header_ http.Header
  43754. }
  43755. // Delete: Deletes the specified address resource.
  43756. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalAddresses/delete
  43757. func (r *GlobalAddressesService) Delete(project string, address string) *GlobalAddressesDeleteCall {
  43758. c := &GlobalAddressesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43759. c.project = project
  43760. c.address = address
  43761. return c
  43762. }
  43763. // RequestId sets the optional parameter "requestId": An optional
  43764. // request ID to identify requests. Specify a unique request ID so that
  43765. // if you must retry your request, the server will know to ignore the
  43766. // request if it has already been completed.
  43767. //
  43768. // For example, consider a situation where you make an initial request
  43769. // and the request times out. If you make the request again with the
  43770. // same request ID, the server can check if original operation with the
  43771. // same request ID was received, and if so, will ignore the second
  43772. // request. This prevents clients from accidentally creating duplicate
  43773. // commitments.
  43774. //
  43775. // The request ID must be a valid UUID with the exception that zero UUID
  43776. // is not supported (00000000-0000-0000-0000-000000000000).
  43777. func (c *GlobalAddressesDeleteCall) RequestId(requestId string) *GlobalAddressesDeleteCall {
  43778. c.urlParams_.Set("requestId", requestId)
  43779. return c
  43780. }
  43781. // Fields allows partial responses to be retrieved. See
  43782. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43783. // for more information.
  43784. func (c *GlobalAddressesDeleteCall) Fields(s ...googleapi.Field) *GlobalAddressesDeleteCall {
  43785. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43786. return c
  43787. }
  43788. // Context sets the context to be used in this call's Do method. Any
  43789. // pending HTTP request will be aborted if the provided context is
  43790. // canceled.
  43791. func (c *GlobalAddressesDeleteCall) Context(ctx context.Context) *GlobalAddressesDeleteCall {
  43792. c.ctx_ = ctx
  43793. return c
  43794. }
  43795. // Header returns an http.Header that can be modified by the caller to
  43796. // add HTTP headers to the request.
  43797. func (c *GlobalAddressesDeleteCall) Header() http.Header {
  43798. if c.header_ == nil {
  43799. c.header_ = make(http.Header)
  43800. }
  43801. return c.header_
  43802. }
  43803. func (c *GlobalAddressesDeleteCall) doRequest(alt string) (*http.Response, error) {
  43804. reqHeaders := make(http.Header)
  43805. for k, v := range c.header_ {
  43806. reqHeaders[k] = v
  43807. }
  43808. reqHeaders.Set("User-Agent", c.s.userAgent())
  43809. var body io.Reader = nil
  43810. c.urlParams_.Set("alt", alt)
  43811. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses/{address}")
  43812. urls += "?" + c.urlParams_.Encode()
  43813. req, _ := http.NewRequest("DELETE", urls, body)
  43814. req.Header = reqHeaders
  43815. googleapi.Expand(req.URL, map[string]string{
  43816. "project": c.project,
  43817. "address": c.address,
  43818. })
  43819. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43820. }
  43821. // Do executes the "compute.globalAddresses.delete" call.
  43822. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  43823. // status code is an error. Response headers are in either
  43824. // *Operation.ServerResponse.Header or (if a response was returned at
  43825. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  43826. // to check whether the returned error was because
  43827. // http.StatusNotModified was returned.
  43828. func (c *GlobalAddressesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  43829. gensupport.SetOptions(c.urlParams_, opts...)
  43830. res, err := c.doRequest("json")
  43831. if res != nil && res.StatusCode == http.StatusNotModified {
  43832. if res.Body != nil {
  43833. res.Body.Close()
  43834. }
  43835. return nil, &googleapi.Error{
  43836. Code: res.StatusCode,
  43837. Header: res.Header,
  43838. }
  43839. }
  43840. if err != nil {
  43841. return nil, err
  43842. }
  43843. defer googleapi.CloseBody(res)
  43844. if err := googleapi.CheckResponse(res); err != nil {
  43845. return nil, err
  43846. }
  43847. ret := &Operation{
  43848. ServerResponse: googleapi.ServerResponse{
  43849. Header: res.Header,
  43850. HTTPStatusCode: res.StatusCode,
  43851. },
  43852. }
  43853. target := &ret
  43854. if err := gensupport.DecodeResponse(target, res); err != nil {
  43855. return nil, err
  43856. }
  43857. return ret, nil
  43858. // {
  43859. // "description": "Deletes the specified address resource.",
  43860. // "httpMethod": "DELETE",
  43861. // "id": "compute.globalAddresses.delete",
  43862. // "parameterOrder": [
  43863. // "project",
  43864. // "address"
  43865. // ],
  43866. // "parameters": {
  43867. // "address": {
  43868. // "description": "Name of the address resource to delete.",
  43869. // "location": "path",
  43870. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  43871. // "required": true,
  43872. // "type": "string"
  43873. // },
  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. // "requestId": {
  43882. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  43883. // "location": "query",
  43884. // "type": "string"
  43885. // }
  43886. // },
  43887. // "path": "{project}/global/addresses/{address}",
  43888. // "response": {
  43889. // "$ref": "Operation"
  43890. // },
  43891. // "scopes": [
  43892. // "https://www.googleapis.com/auth/cloud-platform",
  43893. // "https://www.googleapis.com/auth/compute"
  43894. // ]
  43895. // }
  43896. }
  43897. // method id "compute.globalAddresses.get":
  43898. type GlobalAddressesGetCall struct {
  43899. s *Service
  43900. project string
  43901. address string
  43902. urlParams_ gensupport.URLParams
  43903. ifNoneMatch_ string
  43904. ctx_ context.Context
  43905. header_ http.Header
  43906. }
  43907. // Get: Returns the specified address resource. Gets a list of available
  43908. // addresses by making a list() request.
  43909. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalAddresses/get
  43910. func (r *GlobalAddressesService) Get(project string, address string) *GlobalAddressesGetCall {
  43911. c := &GlobalAddressesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43912. c.project = project
  43913. c.address = address
  43914. return c
  43915. }
  43916. // Fields allows partial responses to be retrieved. See
  43917. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43918. // for more information.
  43919. func (c *GlobalAddressesGetCall) Fields(s ...googleapi.Field) *GlobalAddressesGetCall {
  43920. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43921. return c
  43922. }
  43923. // IfNoneMatch sets the optional parameter which makes the operation
  43924. // fail if the object's ETag matches the given value. This is useful for
  43925. // getting updates only after the object has changed since the last
  43926. // request. Use googleapi.IsNotModified to check whether the response
  43927. // error from Do is the result of In-None-Match.
  43928. func (c *GlobalAddressesGetCall) IfNoneMatch(entityTag string) *GlobalAddressesGetCall {
  43929. c.ifNoneMatch_ = entityTag
  43930. return c
  43931. }
  43932. // Context sets the context to be used in this call's Do method. Any
  43933. // pending HTTP request will be aborted if the provided context is
  43934. // canceled.
  43935. func (c *GlobalAddressesGetCall) Context(ctx context.Context) *GlobalAddressesGetCall {
  43936. c.ctx_ = ctx
  43937. return c
  43938. }
  43939. // Header returns an http.Header that can be modified by the caller to
  43940. // add HTTP headers to the request.
  43941. func (c *GlobalAddressesGetCall) Header() http.Header {
  43942. if c.header_ == nil {
  43943. c.header_ = make(http.Header)
  43944. }
  43945. return c.header_
  43946. }
  43947. func (c *GlobalAddressesGetCall) doRequest(alt string) (*http.Response, error) {
  43948. reqHeaders := make(http.Header)
  43949. for k, v := range c.header_ {
  43950. reqHeaders[k] = v
  43951. }
  43952. reqHeaders.Set("User-Agent", c.s.userAgent())
  43953. if c.ifNoneMatch_ != "" {
  43954. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  43955. }
  43956. var body io.Reader = nil
  43957. c.urlParams_.Set("alt", alt)
  43958. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses/{address}")
  43959. urls += "?" + c.urlParams_.Encode()
  43960. req, _ := http.NewRequest("GET", urls, body)
  43961. req.Header = reqHeaders
  43962. googleapi.Expand(req.URL, map[string]string{
  43963. "project": c.project,
  43964. "address": c.address,
  43965. })
  43966. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43967. }
  43968. // Do executes the "compute.globalAddresses.get" call.
  43969. // Exactly one of *Address or error will be non-nil. Any non-2xx status
  43970. // code is an error. Response headers are in either
  43971. // *Address.ServerResponse.Header or (if a response was returned at all)
  43972. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  43973. // check whether the returned error was because http.StatusNotModified
  43974. // was returned.
  43975. func (c *GlobalAddressesGetCall) Do(opts ...googleapi.CallOption) (*Address, error) {
  43976. gensupport.SetOptions(c.urlParams_, opts...)
  43977. res, err := c.doRequest("json")
  43978. if res != nil && res.StatusCode == http.StatusNotModified {
  43979. if res.Body != nil {
  43980. res.Body.Close()
  43981. }
  43982. return nil, &googleapi.Error{
  43983. Code: res.StatusCode,
  43984. Header: res.Header,
  43985. }
  43986. }
  43987. if err != nil {
  43988. return nil, err
  43989. }
  43990. defer googleapi.CloseBody(res)
  43991. if err := googleapi.CheckResponse(res); err != nil {
  43992. return nil, err
  43993. }
  43994. ret := &Address{
  43995. ServerResponse: googleapi.ServerResponse{
  43996. Header: res.Header,
  43997. HTTPStatusCode: res.StatusCode,
  43998. },
  43999. }
  44000. target := &ret
  44001. if err := gensupport.DecodeResponse(target, res); err != nil {
  44002. return nil, err
  44003. }
  44004. return ret, nil
  44005. // {
  44006. // "description": "Returns the specified address resource. Gets a list of available addresses by making a list() request.",
  44007. // "httpMethod": "GET",
  44008. // "id": "compute.globalAddresses.get",
  44009. // "parameterOrder": [
  44010. // "project",
  44011. // "address"
  44012. // ],
  44013. // "parameters": {
  44014. // "address": {
  44015. // "description": "Name of the address resource to return.",
  44016. // "location": "path",
  44017. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  44018. // "required": true,
  44019. // "type": "string"
  44020. // },
  44021. // "project": {
  44022. // "description": "Project ID for this request.",
  44023. // "location": "path",
  44024. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  44025. // "required": true,
  44026. // "type": "string"
  44027. // }
  44028. // },
  44029. // "path": "{project}/global/addresses/{address}",
  44030. // "response": {
  44031. // "$ref": "Address"
  44032. // },
  44033. // "scopes": [
  44034. // "https://www.googleapis.com/auth/cloud-platform",
  44035. // "https://www.googleapis.com/auth/compute",
  44036. // "https://www.googleapis.com/auth/compute.readonly"
  44037. // ]
  44038. // }
  44039. }
  44040. // method id "compute.globalAddresses.insert":
  44041. type GlobalAddressesInsertCall struct {
  44042. s *Service
  44043. project string
  44044. address *Address
  44045. urlParams_ gensupport.URLParams
  44046. ctx_ context.Context
  44047. header_ http.Header
  44048. }
  44049. // Insert: Creates an address resource in the specified project using
  44050. // the data included in the request.
  44051. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalAddresses/insert
  44052. func (r *GlobalAddressesService) Insert(project string, address *Address) *GlobalAddressesInsertCall {
  44053. c := &GlobalAddressesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44054. c.project = project
  44055. c.address = address
  44056. return c
  44057. }
  44058. // RequestId sets the optional parameter "requestId": An optional
  44059. // request ID to identify requests. Specify a unique request ID so that
  44060. // if you must retry your request, the server will know to ignore the
  44061. // request if it has already been completed.
  44062. //
  44063. // For example, consider a situation where you make an initial request
  44064. // and the request times out. If you make the request again with the
  44065. // same request ID, the server can check if original operation with the
  44066. // same request ID was received, and if so, will ignore the second
  44067. // request. This prevents clients from accidentally creating duplicate
  44068. // commitments.
  44069. //
  44070. // The request ID must be a valid UUID with the exception that zero UUID
  44071. // is not supported (00000000-0000-0000-0000-000000000000).
  44072. func (c *GlobalAddressesInsertCall) RequestId(requestId string) *GlobalAddressesInsertCall {
  44073. c.urlParams_.Set("requestId", requestId)
  44074. return c
  44075. }
  44076. // Fields allows partial responses to be retrieved. See
  44077. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44078. // for more information.
  44079. func (c *GlobalAddressesInsertCall) Fields(s ...googleapi.Field) *GlobalAddressesInsertCall {
  44080. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44081. return c
  44082. }
  44083. // Context sets the context to be used in this call's Do method. Any
  44084. // pending HTTP request will be aborted if the provided context is
  44085. // canceled.
  44086. func (c *GlobalAddressesInsertCall) Context(ctx context.Context) *GlobalAddressesInsertCall {
  44087. c.ctx_ = ctx
  44088. return c
  44089. }
  44090. // Header returns an http.Header that can be modified by the caller to
  44091. // add HTTP headers to the request.
  44092. func (c *GlobalAddressesInsertCall) Header() http.Header {
  44093. if c.header_ == nil {
  44094. c.header_ = make(http.Header)
  44095. }
  44096. return c.header_
  44097. }
  44098. func (c *GlobalAddressesInsertCall) doRequest(alt string) (*http.Response, error) {
  44099. reqHeaders := make(http.Header)
  44100. for k, v := range c.header_ {
  44101. reqHeaders[k] = v
  44102. }
  44103. reqHeaders.Set("User-Agent", c.s.userAgent())
  44104. var body io.Reader = nil
  44105. body, err := googleapi.WithoutDataWrapper.JSONReader(c.address)
  44106. if err != nil {
  44107. return nil, err
  44108. }
  44109. reqHeaders.Set("Content-Type", "application/json")
  44110. c.urlParams_.Set("alt", alt)
  44111. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses")
  44112. urls += "?" + c.urlParams_.Encode()
  44113. req, _ := http.NewRequest("POST", urls, body)
  44114. req.Header = reqHeaders
  44115. googleapi.Expand(req.URL, map[string]string{
  44116. "project": c.project,
  44117. })
  44118. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44119. }
  44120. // Do executes the "compute.globalAddresses.insert" call.
  44121. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  44122. // status code is an error. Response headers are in either
  44123. // *Operation.ServerResponse.Header or (if a response was returned at
  44124. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  44125. // to check whether the returned error was because
  44126. // http.StatusNotModified was returned.
  44127. func (c *GlobalAddressesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  44128. gensupport.SetOptions(c.urlParams_, opts...)
  44129. res, err := c.doRequest("json")
  44130. if res != nil && res.StatusCode == http.StatusNotModified {
  44131. if res.Body != nil {
  44132. res.Body.Close()
  44133. }
  44134. return nil, &googleapi.Error{
  44135. Code: res.StatusCode,
  44136. Header: res.Header,
  44137. }
  44138. }
  44139. if err != nil {
  44140. return nil, err
  44141. }
  44142. defer googleapi.CloseBody(res)
  44143. if err := googleapi.CheckResponse(res); err != nil {
  44144. return nil, err
  44145. }
  44146. ret := &Operation{
  44147. ServerResponse: googleapi.ServerResponse{
  44148. Header: res.Header,
  44149. HTTPStatusCode: res.StatusCode,
  44150. },
  44151. }
  44152. target := &ret
  44153. if err := gensupport.DecodeResponse(target, res); err != nil {
  44154. return nil, err
  44155. }
  44156. return ret, nil
  44157. // {
  44158. // "description": "Creates an address resource in the specified project using the data included in the request.",
  44159. // "httpMethod": "POST",
  44160. // "id": "compute.globalAddresses.insert",
  44161. // "parameterOrder": [
  44162. // "project"
  44163. // ],
  44164. // "parameters": {
  44165. // "project": {
  44166. // "description": "Project ID for this request.",
  44167. // "location": "path",
  44168. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  44169. // "required": true,
  44170. // "type": "string"
  44171. // },
  44172. // "requestId": {
  44173. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  44174. // "location": "query",
  44175. // "type": "string"
  44176. // }
  44177. // },
  44178. // "path": "{project}/global/addresses",
  44179. // "request": {
  44180. // "$ref": "Address"
  44181. // },
  44182. // "response": {
  44183. // "$ref": "Operation"
  44184. // },
  44185. // "scopes": [
  44186. // "https://www.googleapis.com/auth/cloud-platform",
  44187. // "https://www.googleapis.com/auth/compute"
  44188. // ]
  44189. // }
  44190. }
  44191. // method id "compute.globalAddresses.list":
  44192. type GlobalAddressesListCall struct {
  44193. s *Service
  44194. project string
  44195. urlParams_ gensupport.URLParams
  44196. ifNoneMatch_ string
  44197. ctx_ context.Context
  44198. header_ http.Header
  44199. }
  44200. // List: Retrieves a list of global addresses.
  44201. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalAddresses/list
  44202. func (r *GlobalAddressesService) List(project string) *GlobalAddressesListCall {
  44203. c := &GlobalAddressesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44204. c.project = project
  44205. return c
  44206. }
  44207. // Filter sets the optional parameter "filter": A filter expression that
  44208. // filters resources listed in the response. The expression must specify
  44209. // the field name, a comparison operator, and the value that you want to
  44210. // use for filtering. The value must be a string, a number, or a
  44211. // boolean. The comparison operator must be either =, !=, >, or <.
  44212. //
  44213. // For example, if you are filtering Compute Engine instances, you can
  44214. // exclude instances named example-instance by specifying name !=
  44215. // example-instance.
  44216. //
  44217. // You can also filter nested fields. For example, you could specify
  44218. // scheduling.automaticRestart = false to include instances only if they
  44219. // are not scheduled for automatic restarts. You can use filtering on
  44220. // nested fields to filter based on resource labels.
  44221. //
  44222. // To filter on multiple expressions, provide each separate expression
  44223. // within parentheses. For example, (scheduling.automaticRestart = true)
  44224. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  44225. // AND expression. However, you can include AND and OR expressions
  44226. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  44227. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  44228. // true).
  44229. func (c *GlobalAddressesListCall) Filter(filter string) *GlobalAddressesListCall {
  44230. c.urlParams_.Set("filter", filter)
  44231. return c
  44232. }
  44233. // MaxResults sets the optional parameter "maxResults": The maximum
  44234. // number of results per page that should be returned. If the number of
  44235. // available results is larger than maxResults, Compute Engine returns a
  44236. // nextPageToken that can be used to get the next page of results in
  44237. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  44238. // (Default: 500)
  44239. func (c *GlobalAddressesListCall) MaxResults(maxResults int64) *GlobalAddressesListCall {
  44240. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  44241. return c
  44242. }
  44243. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  44244. // a certain order. By default, results are returned in alphanumerical
  44245. // order based on the resource name.
  44246. //
  44247. // You can also sort results in descending order based on the creation
  44248. // timestamp using orderBy="creationTimestamp desc". This sorts results
  44249. // based on the creationTimestamp field in reverse chronological order
  44250. // (newest result first). Use this to sort resources like operations so
  44251. // that the newest operation is returned first.
  44252. //
  44253. // Currently, only sorting by name or creationTimestamp desc is
  44254. // supported.
  44255. func (c *GlobalAddressesListCall) OrderBy(orderBy string) *GlobalAddressesListCall {
  44256. c.urlParams_.Set("orderBy", orderBy)
  44257. return c
  44258. }
  44259. // PageToken sets the optional parameter "pageToken": Specifies a page
  44260. // token to use. Set pageToken to the nextPageToken returned by a
  44261. // previous list request to get the next page of results.
  44262. func (c *GlobalAddressesListCall) PageToken(pageToken string) *GlobalAddressesListCall {
  44263. c.urlParams_.Set("pageToken", pageToken)
  44264. return c
  44265. }
  44266. // Fields allows partial responses to be retrieved. See
  44267. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44268. // for more information.
  44269. func (c *GlobalAddressesListCall) Fields(s ...googleapi.Field) *GlobalAddressesListCall {
  44270. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44271. return c
  44272. }
  44273. // IfNoneMatch sets the optional parameter which makes the operation
  44274. // fail if the object's ETag matches the given value. This is useful for
  44275. // getting updates only after the object has changed since the last
  44276. // request. Use googleapi.IsNotModified to check whether the response
  44277. // error from Do is the result of In-None-Match.
  44278. func (c *GlobalAddressesListCall) IfNoneMatch(entityTag string) *GlobalAddressesListCall {
  44279. c.ifNoneMatch_ = entityTag
  44280. return c
  44281. }
  44282. // Context sets the context to be used in this call's Do method. Any
  44283. // pending HTTP request will be aborted if the provided context is
  44284. // canceled.
  44285. func (c *GlobalAddressesListCall) Context(ctx context.Context) *GlobalAddressesListCall {
  44286. c.ctx_ = ctx
  44287. return c
  44288. }
  44289. // Header returns an http.Header that can be modified by the caller to
  44290. // add HTTP headers to the request.
  44291. func (c *GlobalAddressesListCall) Header() http.Header {
  44292. if c.header_ == nil {
  44293. c.header_ = make(http.Header)
  44294. }
  44295. return c.header_
  44296. }
  44297. func (c *GlobalAddressesListCall) doRequest(alt string) (*http.Response, error) {
  44298. reqHeaders := make(http.Header)
  44299. for k, v := range c.header_ {
  44300. reqHeaders[k] = v
  44301. }
  44302. reqHeaders.Set("User-Agent", c.s.userAgent())
  44303. if c.ifNoneMatch_ != "" {
  44304. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  44305. }
  44306. var body io.Reader = nil
  44307. c.urlParams_.Set("alt", alt)
  44308. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses")
  44309. urls += "?" + c.urlParams_.Encode()
  44310. req, _ := http.NewRequest("GET", urls, body)
  44311. req.Header = reqHeaders
  44312. googleapi.Expand(req.URL, map[string]string{
  44313. "project": c.project,
  44314. })
  44315. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44316. }
  44317. // Do executes the "compute.globalAddresses.list" call.
  44318. // Exactly one of *AddressList or error will be non-nil. Any non-2xx
  44319. // status code is an error. Response headers are in either
  44320. // *AddressList.ServerResponse.Header or (if a response was returned at
  44321. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  44322. // to check whether the returned error was because
  44323. // http.StatusNotModified was returned.
  44324. func (c *GlobalAddressesListCall) Do(opts ...googleapi.CallOption) (*AddressList, error) {
  44325. gensupport.SetOptions(c.urlParams_, opts...)
  44326. res, err := c.doRequest("json")
  44327. if res != nil && res.StatusCode == http.StatusNotModified {
  44328. if res.Body != nil {
  44329. res.Body.Close()
  44330. }
  44331. return nil, &googleapi.Error{
  44332. Code: res.StatusCode,
  44333. Header: res.Header,
  44334. }
  44335. }
  44336. if err != nil {
  44337. return nil, err
  44338. }
  44339. defer googleapi.CloseBody(res)
  44340. if err := googleapi.CheckResponse(res); err != nil {
  44341. return nil, err
  44342. }
  44343. ret := &AddressList{
  44344. ServerResponse: googleapi.ServerResponse{
  44345. Header: res.Header,
  44346. HTTPStatusCode: res.StatusCode,
  44347. },
  44348. }
  44349. target := &ret
  44350. if err := gensupport.DecodeResponse(target, res); err != nil {
  44351. return nil, err
  44352. }
  44353. return ret, nil
  44354. // {
  44355. // "description": "Retrieves a list of global addresses.",
  44356. // "httpMethod": "GET",
  44357. // "id": "compute.globalAddresses.list",
  44358. // "parameterOrder": [
  44359. // "project"
  44360. // ],
  44361. // "parameters": {
  44362. // "filter": {
  44363. // "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).",
  44364. // "location": "query",
  44365. // "type": "string"
  44366. // },
  44367. // "maxResults": {
  44368. // "default": "500",
  44369. // "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)",
  44370. // "format": "uint32",
  44371. // "location": "query",
  44372. // "minimum": "0",
  44373. // "type": "integer"
  44374. // },
  44375. // "orderBy": {
  44376. // "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.",
  44377. // "location": "query",
  44378. // "type": "string"
  44379. // },
  44380. // "pageToken": {
  44381. // "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.",
  44382. // "location": "query",
  44383. // "type": "string"
  44384. // },
  44385. // "project": {
  44386. // "description": "Project ID for this request.",
  44387. // "location": "path",
  44388. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  44389. // "required": true,
  44390. // "type": "string"
  44391. // }
  44392. // },
  44393. // "path": "{project}/global/addresses",
  44394. // "response": {
  44395. // "$ref": "AddressList"
  44396. // },
  44397. // "scopes": [
  44398. // "https://www.googleapis.com/auth/cloud-platform",
  44399. // "https://www.googleapis.com/auth/compute",
  44400. // "https://www.googleapis.com/auth/compute.readonly"
  44401. // ]
  44402. // }
  44403. }
  44404. // Pages invokes f for each page of results.
  44405. // A non-nil error returned from f will halt the iteration.
  44406. // The provided context supersedes any context provided to the Context method.
  44407. func (c *GlobalAddressesListCall) Pages(ctx context.Context, f func(*AddressList) error) error {
  44408. c.ctx_ = ctx
  44409. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  44410. for {
  44411. x, err := c.Do()
  44412. if err != nil {
  44413. return err
  44414. }
  44415. if err := f(x); err != nil {
  44416. return err
  44417. }
  44418. if x.NextPageToken == "" {
  44419. return nil
  44420. }
  44421. c.PageToken(x.NextPageToken)
  44422. }
  44423. }
  44424. // method id "compute.globalAddresses.setLabels":
  44425. type GlobalAddressesSetLabelsCall struct {
  44426. s *Service
  44427. project string
  44428. resource string
  44429. globalsetlabelsrequest *GlobalSetLabelsRequest
  44430. urlParams_ gensupport.URLParams
  44431. ctx_ context.Context
  44432. header_ http.Header
  44433. }
  44434. // SetLabels: Sets the labels on a GlobalAddress. To learn more about
  44435. // labels, read the Labeling Resources documentation.
  44436. func (r *GlobalAddressesService) SetLabels(project string, resource string, globalsetlabelsrequest *GlobalSetLabelsRequest) *GlobalAddressesSetLabelsCall {
  44437. c := &GlobalAddressesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44438. c.project = project
  44439. c.resource = resource
  44440. c.globalsetlabelsrequest = globalsetlabelsrequest
  44441. return c
  44442. }
  44443. // Fields allows partial responses to be retrieved. See
  44444. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44445. // for more information.
  44446. func (c *GlobalAddressesSetLabelsCall) Fields(s ...googleapi.Field) *GlobalAddressesSetLabelsCall {
  44447. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44448. return c
  44449. }
  44450. // Context sets the context to be used in this call's Do method. Any
  44451. // pending HTTP request will be aborted if the provided context is
  44452. // canceled.
  44453. func (c *GlobalAddressesSetLabelsCall) Context(ctx context.Context) *GlobalAddressesSetLabelsCall {
  44454. c.ctx_ = ctx
  44455. return c
  44456. }
  44457. // Header returns an http.Header that can be modified by the caller to
  44458. // add HTTP headers to the request.
  44459. func (c *GlobalAddressesSetLabelsCall) Header() http.Header {
  44460. if c.header_ == nil {
  44461. c.header_ = make(http.Header)
  44462. }
  44463. return c.header_
  44464. }
  44465. func (c *GlobalAddressesSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  44466. reqHeaders := make(http.Header)
  44467. for k, v := range c.header_ {
  44468. reqHeaders[k] = v
  44469. }
  44470. reqHeaders.Set("User-Agent", c.s.userAgent())
  44471. var body io.Reader = nil
  44472. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest)
  44473. if err != nil {
  44474. return nil, err
  44475. }
  44476. reqHeaders.Set("Content-Type", "application/json")
  44477. c.urlParams_.Set("alt", alt)
  44478. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses/{resource}/setLabels")
  44479. urls += "?" + c.urlParams_.Encode()
  44480. req, _ := http.NewRequest("POST", urls, body)
  44481. req.Header = reqHeaders
  44482. googleapi.Expand(req.URL, map[string]string{
  44483. "project": c.project,
  44484. "resource": c.resource,
  44485. })
  44486. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44487. }
  44488. // Do executes the "compute.globalAddresses.setLabels" call.
  44489. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  44490. // status code is an error. Response headers are in either
  44491. // *Operation.ServerResponse.Header or (if a response was returned at
  44492. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  44493. // to check whether the returned error was because
  44494. // http.StatusNotModified was returned.
  44495. func (c *GlobalAddressesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  44496. gensupport.SetOptions(c.urlParams_, opts...)
  44497. res, err := c.doRequest("json")
  44498. if res != nil && res.StatusCode == http.StatusNotModified {
  44499. if res.Body != nil {
  44500. res.Body.Close()
  44501. }
  44502. return nil, &googleapi.Error{
  44503. Code: res.StatusCode,
  44504. Header: res.Header,
  44505. }
  44506. }
  44507. if err != nil {
  44508. return nil, err
  44509. }
  44510. defer googleapi.CloseBody(res)
  44511. if err := googleapi.CheckResponse(res); err != nil {
  44512. return nil, err
  44513. }
  44514. ret := &Operation{
  44515. ServerResponse: googleapi.ServerResponse{
  44516. Header: res.Header,
  44517. HTTPStatusCode: res.StatusCode,
  44518. },
  44519. }
  44520. target := &ret
  44521. if err := gensupport.DecodeResponse(target, res); err != nil {
  44522. return nil, err
  44523. }
  44524. return ret, nil
  44525. // {
  44526. // "description": "Sets the labels on a GlobalAddress. To learn more about labels, read the Labeling Resources documentation.",
  44527. // "httpMethod": "POST",
  44528. // "id": "compute.globalAddresses.setLabels",
  44529. // "parameterOrder": [
  44530. // "project",
  44531. // "resource"
  44532. // ],
  44533. // "parameters": {
  44534. // "project": {
  44535. // "description": "Project ID for this request.",
  44536. // "location": "path",
  44537. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  44538. // "required": true,
  44539. // "type": "string"
  44540. // },
  44541. // "resource": {
  44542. // "description": "Name of the resource for this request.",
  44543. // "location": "path",
  44544. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?",
  44545. // "required": true,
  44546. // "type": "string"
  44547. // }
  44548. // },
  44549. // "path": "{project}/global/addresses/{resource}/setLabels",
  44550. // "request": {
  44551. // "$ref": "GlobalSetLabelsRequest"
  44552. // },
  44553. // "response": {
  44554. // "$ref": "Operation"
  44555. // },
  44556. // "scopes": [
  44557. // "https://www.googleapis.com/auth/cloud-platform",
  44558. // "https://www.googleapis.com/auth/compute"
  44559. // ]
  44560. // }
  44561. }
  44562. // method id "compute.globalAddresses.testIamPermissions":
  44563. type GlobalAddressesTestIamPermissionsCall struct {
  44564. s *Service
  44565. project string
  44566. resource string
  44567. testpermissionsrequest *TestPermissionsRequest
  44568. urlParams_ gensupport.URLParams
  44569. ctx_ context.Context
  44570. header_ http.Header
  44571. }
  44572. // TestIamPermissions: Returns permissions that a caller has on the
  44573. // specified resource.
  44574. func (r *GlobalAddressesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *GlobalAddressesTestIamPermissionsCall {
  44575. c := &GlobalAddressesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44576. c.project = project
  44577. c.resource = resource
  44578. c.testpermissionsrequest = testpermissionsrequest
  44579. return c
  44580. }
  44581. // Fields allows partial responses to be retrieved. See
  44582. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44583. // for more information.
  44584. func (c *GlobalAddressesTestIamPermissionsCall) Fields(s ...googleapi.Field) *GlobalAddressesTestIamPermissionsCall {
  44585. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44586. return c
  44587. }
  44588. // Context sets the context to be used in this call's Do method. Any
  44589. // pending HTTP request will be aborted if the provided context is
  44590. // canceled.
  44591. func (c *GlobalAddressesTestIamPermissionsCall) Context(ctx context.Context) *GlobalAddressesTestIamPermissionsCall {
  44592. c.ctx_ = ctx
  44593. return c
  44594. }
  44595. // Header returns an http.Header that can be modified by the caller to
  44596. // add HTTP headers to the request.
  44597. func (c *GlobalAddressesTestIamPermissionsCall) Header() http.Header {
  44598. if c.header_ == nil {
  44599. c.header_ = make(http.Header)
  44600. }
  44601. return c.header_
  44602. }
  44603. func (c *GlobalAddressesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  44604. reqHeaders := make(http.Header)
  44605. for k, v := range c.header_ {
  44606. reqHeaders[k] = v
  44607. }
  44608. reqHeaders.Set("User-Agent", c.s.userAgent())
  44609. var body io.Reader = nil
  44610. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  44611. if err != nil {
  44612. return nil, err
  44613. }
  44614. reqHeaders.Set("Content-Type", "application/json")
  44615. c.urlParams_.Set("alt", alt)
  44616. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses/{resource}/testIamPermissions")
  44617. urls += "?" + c.urlParams_.Encode()
  44618. req, _ := http.NewRequest("POST", urls, body)
  44619. req.Header = reqHeaders
  44620. googleapi.Expand(req.URL, map[string]string{
  44621. "project": c.project,
  44622. "resource": c.resource,
  44623. })
  44624. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44625. }
  44626. // Do executes the "compute.globalAddresses.testIamPermissions" call.
  44627. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  44628. // non-2xx status code is an error. Response headers are in either
  44629. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  44630. // returned at all) in error.(*googleapi.Error).Header. Use
  44631. // googleapi.IsNotModified to check whether the returned error was
  44632. // because http.StatusNotModified was returned.
  44633. func (c *GlobalAddressesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  44634. gensupport.SetOptions(c.urlParams_, opts...)
  44635. res, err := c.doRequest("json")
  44636. if res != nil && res.StatusCode == http.StatusNotModified {
  44637. if res.Body != nil {
  44638. res.Body.Close()
  44639. }
  44640. return nil, &googleapi.Error{
  44641. Code: res.StatusCode,
  44642. Header: res.Header,
  44643. }
  44644. }
  44645. if err != nil {
  44646. return nil, err
  44647. }
  44648. defer googleapi.CloseBody(res)
  44649. if err := googleapi.CheckResponse(res); err != nil {
  44650. return nil, err
  44651. }
  44652. ret := &TestPermissionsResponse{
  44653. ServerResponse: googleapi.ServerResponse{
  44654. Header: res.Header,
  44655. HTTPStatusCode: res.StatusCode,
  44656. },
  44657. }
  44658. target := &ret
  44659. if err := gensupport.DecodeResponse(target, res); err != nil {
  44660. return nil, err
  44661. }
  44662. return ret, nil
  44663. // {
  44664. // "description": "Returns permissions that a caller has on the specified resource.",
  44665. // "httpMethod": "POST",
  44666. // "id": "compute.globalAddresses.testIamPermissions",
  44667. // "parameterOrder": [
  44668. // "project",
  44669. // "resource"
  44670. // ],
  44671. // "parameters": {
  44672. // "project": {
  44673. // "description": "Project ID for this request.",
  44674. // "location": "path",
  44675. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  44676. // "required": true,
  44677. // "type": "string"
  44678. // },
  44679. // "resource": {
  44680. // "description": "Name of the resource for this request.",
  44681. // "location": "path",
  44682. // "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?",
  44683. // "required": true,
  44684. // "type": "string"
  44685. // }
  44686. // },
  44687. // "path": "{project}/global/addresses/{resource}/testIamPermissions",
  44688. // "request": {
  44689. // "$ref": "TestPermissionsRequest"
  44690. // },
  44691. // "response": {
  44692. // "$ref": "TestPermissionsResponse"
  44693. // },
  44694. // "scopes": [
  44695. // "https://www.googleapis.com/auth/cloud-platform",
  44696. // "https://www.googleapis.com/auth/compute",
  44697. // "https://www.googleapis.com/auth/compute.readonly"
  44698. // ]
  44699. // }
  44700. }
  44701. // method id "compute.globalForwardingRules.delete":
  44702. type GlobalForwardingRulesDeleteCall struct {
  44703. s *Service
  44704. project string
  44705. forwardingRule string
  44706. urlParams_ gensupport.URLParams
  44707. ctx_ context.Context
  44708. header_ http.Header
  44709. }
  44710. // Delete: Deletes the specified GlobalForwardingRule resource.
  44711. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/delete
  44712. func (r *GlobalForwardingRulesService) Delete(project string, forwardingRule string) *GlobalForwardingRulesDeleteCall {
  44713. c := &GlobalForwardingRulesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44714. c.project = project
  44715. c.forwardingRule = forwardingRule
  44716. return c
  44717. }
  44718. // RequestId sets the optional parameter "requestId": An optional
  44719. // request ID to identify requests. Specify a unique request ID so that
  44720. // if you must retry your request, the server will know to ignore the
  44721. // request if it has already been completed.
  44722. //
  44723. // For example, consider a situation where you make an initial request
  44724. // and the request times out. If you make the request again with the
  44725. // same request ID, the server can check if original operation with the
  44726. // same request ID was received, and if so, will ignore the second
  44727. // request. This prevents clients from accidentally creating duplicate
  44728. // commitments.
  44729. //
  44730. // The request ID must be a valid UUID with the exception that zero UUID
  44731. // is not supported (00000000-0000-0000-0000-000000000000).
  44732. func (c *GlobalForwardingRulesDeleteCall) RequestId(requestId string) *GlobalForwardingRulesDeleteCall {
  44733. c.urlParams_.Set("requestId", requestId)
  44734. return c
  44735. }
  44736. // Fields allows partial responses to be retrieved. See
  44737. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44738. // for more information.
  44739. func (c *GlobalForwardingRulesDeleteCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesDeleteCall {
  44740. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44741. return c
  44742. }
  44743. // Context sets the context to be used in this call's Do method. Any
  44744. // pending HTTP request will be aborted if the provided context is
  44745. // canceled.
  44746. func (c *GlobalForwardingRulesDeleteCall) Context(ctx context.Context) *GlobalForwardingRulesDeleteCall {
  44747. c.ctx_ = ctx
  44748. return c
  44749. }
  44750. // Header returns an http.Header that can be modified by the caller to
  44751. // add HTTP headers to the request.
  44752. func (c *GlobalForwardingRulesDeleteCall) Header() http.Header {
  44753. if c.header_ == nil {
  44754. c.header_ = make(http.Header)
  44755. }
  44756. return c.header_
  44757. }
  44758. func (c *GlobalForwardingRulesDeleteCall) doRequest(alt string) (*http.Response, error) {
  44759. reqHeaders := make(http.Header)
  44760. for k, v := range c.header_ {
  44761. reqHeaders[k] = v
  44762. }
  44763. reqHeaders.Set("User-Agent", c.s.userAgent())
  44764. var body io.Reader = nil
  44765. c.urlParams_.Set("alt", alt)
  44766. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules/{forwardingRule}")
  44767. urls += "?" + c.urlParams_.Encode()
  44768. req, _ := http.NewRequest("DELETE", urls, body)
  44769. req.Header = reqHeaders
  44770. googleapi.Expand(req.URL, map[string]string{
  44771. "project": c.project,
  44772. "forwardingRule": c.forwardingRule,
  44773. })
  44774. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44775. }
  44776. // Do executes the "compute.globalForwardingRules.delete" call.
  44777. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  44778. // status code is an error. Response headers are in either
  44779. // *Operation.ServerResponse.Header or (if a response was returned at
  44780. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  44781. // to check whether the returned error was because
  44782. // http.StatusNotModified was returned.
  44783. func (c *GlobalForwardingRulesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  44784. gensupport.SetOptions(c.urlParams_, opts...)
  44785. res, err := c.doRequest("json")
  44786. if res != nil && res.StatusCode == http.StatusNotModified {
  44787. if res.Body != nil {
  44788. res.Body.Close()
  44789. }
  44790. return nil, &googleapi.Error{
  44791. Code: res.StatusCode,
  44792. Header: res.Header,
  44793. }
  44794. }
  44795. if err != nil {
  44796. return nil, err
  44797. }
  44798. defer googleapi.CloseBody(res)
  44799. if err := googleapi.CheckResponse(res); err != nil {
  44800. return nil, err
  44801. }
  44802. ret := &Operation{
  44803. ServerResponse: googleapi.ServerResponse{
  44804. Header: res.Header,
  44805. HTTPStatusCode: res.StatusCode,
  44806. },
  44807. }
  44808. target := &ret
  44809. if err := gensupport.DecodeResponse(target, res); err != nil {
  44810. return nil, err
  44811. }
  44812. return ret, nil
  44813. // {
  44814. // "description": "Deletes the specified GlobalForwardingRule resource.",
  44815. // "httpMethod": "DELETE",
  44816. // "id": "compute.globalForwardingRules.delete",
  44817. // "parameterOrder": [
  44818. // "project",
  44819. // "forwardingRule"
  44820. // ],
  44821. // "parameters": {
  44822. // "forwardingRule": {
  44823. // "description": "Name of the ForwardingRule resource to delete.",
  44824. // "location": "path",
  44825. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  44826. // "required": true,
  44827. // "type": "string"
  44828. // },
  44829. // "project": {
  44830. // "description": "Project ID for this request.",
  44831. // "location": "path",
  44832. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  44833. // "required": true,
  44834. // "type": "string"
  44835. // },
  44836. // "requestId": {
  44837. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  44838. // "location": "query",
  44839. // "type": "string"
  44840. // }
  44841. // },
  44842. // "path": "{project}/global/forwardingRules/{forwardingRule}",
  44843. // "response": {
  44844. // "$ref": "Operation"
  44845. // },
  44846. // "scopes": [
  44847. // "https://www.googleapis.com/auth/cloud-platform",
  44848. // "https://www.googleapis.com/auth/compute"
  44849. // ]
  44850. // }
  44851. }
  44852. // method id "compute.globalForwardingRules.get":
  44853. type GlobalForwardingRulesGetCall struct {
  44854. s *Service
  44855. project string
  44856. forwardingRule string
  44857. urlParams_ gensupport.URLParams
  44858. ifNoneMatch_ string
  44859. ctx_ context.Context
  44860. header_ http.Header
  44861. }
  44862. // Get: Returns the specified GlobalForwardingRule resource. Gets a list
  44863. // of available forwarding rules by making a list() request.
  44864. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/get
  44865. func (r *GlobalForwardingRulesService) Get(project string, forwardingRule string) *GlobalForwardingRulesGetCall {
  44866. c := &GlobalForwardingRulesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44867. c.project = project
  44868. c.forwardingRule = forwardingRule
  44869. return c
  44870. }
  44871. // Fields allows partial responses to be retrieved. See
  44872. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44873. // for more information.
  44874. func (c *GlobalForwardingRulesGetCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesGetCall {
  44875. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44876. return c
  44877. }
  44878. // IfNoneMatch sets the optional parameter which makes the operation
  44879. // fail if the object's ETag matches the given value. This is useful for
  44880. // getting updates only after the object has changed since the last
  44881. // request. Use googleapi.IsNotModified to check whether the response
  44882. // error from Do is the result of In-None-Match.
  44883. func (c *GlobalForwardingRulesGetCall) IfNoneMatch(entityTag string) *GlobalForwardingRulesGetCall {
  44884. c.ifNoneMatch_ = entityTag
  44885. return c
  44886. }
  44887. // Context sets the context to be used in this call's Do method. Any
  44888. // pending HTTP request will be aborted if the provided context is
  44889. // canceled.
  44890. func (c *GlobalForwardingRulesGetCall) Context(ctx context.Context) *GlobalForwardingRulesGetCall {
  44891. c.ctx_ = ctx
  44892. return c
  44893. }
  44894. // Header returns an http.Header that can be modified by the caller to
  44895. // add HTTP headers to the request.
  44896. func (c *GlobalForwardingRulesGetCall) Header() http.Header {
  44897. if c.header_ == nil {
  44898. c.header_ = make(http.Header)
  44899. }
  44900. return c.header_
  44901. }
  44902. func (c *GlobalForwardingRulesGetCall) doRequest(alt string) (*http.Response, error) {
  44903. reqHeaders := make(http.Header)
  44904. for k, v := range c.header_ {
  44905. reqHeaders[k] = v
  44906. }
  44907. reqHeaders.Set("User-Agent", c.s.userAgent())
  44908. if c.ifNoneMatch_ != "" {
  44909. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  44910. }
  44911. var body io.Reader = nil
  44912. c.urlParams_.Set("alt", alt)
  44913. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules/{forwardingRule}")
  44914. urls += "?" + c.urlParams_.Encode()
  44915. req, _ := http.NewRequest("GET", urls, body)
  44916. req.Header = reqHeaders
  44917. googleapi.Expand(req.URL, map[string]string{
  44918. "project": c.project,
  44919. "forwardingRule": c.forwardingRule,
  44920. })
  44921. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44922. }
  44923. // Do executes the "compute.globalForwardingRules.get" call.
  44924. // Exactly one of *ForwardingRule or error will be non-nil. Any non-2xx
  44925. // status code is an error. Response headers are in either
  44926. // *ForwardingRule.ServerResponse.Header or (if a response was returned
  44927. // at all) in error.(*googleapi.Error).Header. Use
  44928. // googleapi.IsNotModified to check whether the returned error was
  44929. // because http.StatusNotModified was returned.
  44930. func (c *GlobalForwardingRulesGetCall) Do(opts ...googleapi.CallOption) (*ForwardingRule, error) {
  44931. gensupport.SetOptions(c.urlParams_, opts...)
  44932. res, err := c.doRequest("json")
  44933. if res != nil && res.StatusCode == http.StatusNotModified {
  44934. if res.Body != nil {
  44935. res.Body.Close()
  44936. }
  44937. return nil, &googleapi.Error{
  44938. Code: res.StatusCode,
  44939. Header: res.Header,
  44940. }
  44941. }
  44942. if err != nil {
  44943. return nil, err
  44944. }
  44945. defer googleapi.CloseBody(res)
  44946. if err := googleapi.CheckResponse(res); err != nil {
  44947. return nil, err
  44948. }
  44949. ret := &ForwardingRule{
  44950. ServerResponse: googleapi.ServerResponse{
  44951. Header: res.Header,
  44952. HTTPStatusCode: res.StatusCode,
  44953. },
  44954. }
  44955. target := &ret
  44956. if err := gensupport.DecodeResponse(target, res); err != nil {
  44957. return nil, err
  44958. }
  44959. return ret, nil
  44960. // {
  44961. // "description": "Returns the specified GlobalForwardingRule resource. Gets a list of available forwarding rules by making a list() request.",
  44962. // "httpMethod": "GET",
  44963. // "id": "compute.globalForwardingRules.get",
  44964. // "parameterOrder": [
  44965. // "project",
  44966. // "forwardingRule"
  44967. // ],
  44968. // "parameters": {
  44969. // "forwardingRule": {
  44970. // "description": "Name of the ForwardingRule resource to return.",
  44971. // "location": "path",
  44972. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  44973. // "required": true,
  44974. // "type": "string"
  44975. // },
  44976. // "project": {
  44977. // "description": "Project ID for this request.",
  44978. // "location": "path",
  44979. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  44980. // "required": true,
  44981. // "type": "string"
  44982. // }
  44983. // },
  44984. // "path": "{project}/global/forwardingRules/{forwardingRule}",
  44985. // "response": {
  44986. // "$ref": "ForwardingRule"
  44987. // },
  44988. // "scopes": [
  44989. // "https://www.googleapis.com/auth/cloud-platform",
  44990. // "https://www.googleapis.com/auth/compute",
  44991. // "https://www.googleapis.com/auth/compute.readonly"
  44992. // ]
  44993. // }
  44994. }
  44995. // method id "compute.globalForwardingRules.insert":
  44996. type GlobalForwardingRulesInsertCall struct {
  44997. s *Service
  44998. project string
  44999. forwardingrule *ForwardingRule
  45000. urlParams_ gensupport.URLParams
  45001. ctx_ context.Context
  45002. header_ http.Header
  45003. }
  45004. // Insert: Creates a GlobalForwardingRule resource in the specified
  45005. // project using the data included in the request.
  45006. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/insert
  45007. func (r *GlobalForwardingRulesService) Insert(project string, forwardingrule *ForwardingRule) *GlobalForwardingRulesInsertCall {
  45008. c := &GlobalForwardingRulesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45009. c.project = project
  45010. c.forwardingrule = forwardingrule
  45011. return c
  45012. }
  45013. // RequestId sets the optional parameter "requestId": An optional
  45014. // request ID to identify requests. Specify a unique request ID so that
  45015. // if you must retry your request, the server will know to ignore the
  45016. // request if it has already been completed.
  45017. //
  45018. // For example, consider a situation where you make an initial request
  45019. // and the request times out. If you make the request again with the
  45020. // same request ID, the server can check if original operation with the
  45021. // same request ID was received, and if so, will ignore the second
  45022. // request. This prevents clients from accidentally creating duplicate
  45023. // commitments.
  45024. //
  45025. // The request ID must be a valid UUID with the exception that zero UUID
  45026. // is not supported (00000000-0000-0000-0000-000000000000).
  45027. func (c *GlobalForwardingRulesInsertCall) RequestId(requestId string) *GlobalForwardingRulesInsertCall {
  45028. c.urlParams_.Set("requestId", requestId)
  45029. return c
  45030. }
  45031. // Fields allows partial responses to be retrieved. See
  45032. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45033. // for more information.
  45034. func (c *GlobalForwardingRulesInsertCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesInsertCall {
  45035. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45036. return c
  45037. }
  45038. // Context sets the context to be used in this call's Do method. Any
  45039. // pending HTTP request will be aborted if the provided context is
  45040. // canceled.
  45041. func (c *GlobalForwardingRulesInsertCall) Context(ctx context.Context) *GlobalForwardingRulesInsertCall {
  45042. c.ctx_ = ctx
  45043. return c
  45044. }
  45045. // Header returns an http.Header that can be modified by the caller to
  45046. // add HTTP headers to the request.
  45047. func (c *GlobalForwardingRulesInsertCall) Header() http.Header {
  45048. if c.header_ == nil {
  45049. c.header_ = make(http.Header)
  45050. }
  45051. return c.header_
  45052. }
  45053. func (c *GlobalForwardingRulesInsertCall) doRequest(alt string) (*http.Response, error) {
  45054. reqHeaders := make(http.Header)
  45055. for k, v := range c.header_ {
  45056. reqHeaders[k] = v
  45057. }
  45058. reqHeaders.Set("User-Agent", c.s.userAgent())
  45059. var body io.Reader = nil
  45060. body, err := googleapi.WithoutDataWrapper.JSONReader(c.forwardingrule)
  45061. if err != nil {
  45062. return nil, err
  45063. }
  45064. reqHeaders.Set("Content-Type", "application/json")
  45065. c.urlParams_.Set("alt", alt)
  45066. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules")
  45067. urls += "?" + c.urlParams_.Encode()
  45068. req, _ := http.NewRequest("POST", urls, body)
  45069. req.Header = reqHeaders
  45070. googleapi.Expand(req.URL, map[string]string{
  45071. "project": c.project,
  45072. })
  45073. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45074. }
  45075. // Do executes the "compute.globalForwardingRules.insert" call.
  45076. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  45077. // status code is an error. Response headers are in either
  45078. // *Operation.ServerResponse.Header or (if a response was returned at
  45079. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  45080. // to check whether the returned error was because
  45081. // http.StatusNotModified was returned.
  45082. func (c *GlobalForwardingRulesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  45083. gensupport.SetOptions(c.urlParams_, opts...)
  45084. res, err := c.doRequest("json")
  45085. if res != nil && res.StatusCode == http.StatusNotModified {
  45086. if res.Body != nil {
  45087. res.Body.Close()
  45088. }
  45089. return nil, &googleapi.Error{
  45090. Code: res.StatusCode,
  45091. Header: res.Header,
  45092. }
  45093. }
  45094. if err != nil {
  45095. return nil, err
  45096. }
  45097. defer googleapi.CloseBody(res)
  45098. if err := googleapi.CheckResponse(res); err != nil {
  45099. return nil, err
  45100. }
  45101. ret := &Operation{
  45102. ServerResponse: googleapi.ServerResponse{
  45103. Header: res.Header,
  45104. HTTPStatusCode: res.StatusCode,
  45105. },
  45106. }
  45107. target := &ret
  45108. if err := gensupport.DecodeResponse(target, res); err != nil {
  45109. return nil, err
  45110. }
  45111. return ret, nil
  45112. // {
  45113. // "description": "Creates a GlobalForwardingRule resource in the specified project using the data included in the request.",
  45114. // "httpMethod": "POST",
  45115. // "id": "compute.globalForwardingRules.insert",
  45116. // "parameterOrder": [
  45117. // "project"
  45118. // ],
  45119. // "parameters": {
  45120. // "project": {
  45121. // "description": "Project ID for this request.",
  45122. // "location": "path",
  45123. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  45124. // "required": true,
  45125. // "type": "string"
  45126. // },
  45127. // "requestId": {
  45128. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  45129. // "location": "query",
  45130. // "type": "string"
  45131. // }
  45132. // },
  45133. // "path": "{project}/global/forwardingRules",
  45134. // "request": {
  45135. // "$ref": "ForwardingRule"
  45136. // },
  45137. // "response": {
  45138. // "$ref": "Operation"
  45139. // },
  45140. // "scopes": [
  45141. // "https://www.googleapis.com/auth/cloud-platform",
  45142. // "https://www.googleapis.com/auth/compute"
  45143. // ]
  45144. // }
  45145. }
  45146. // method id "compute.globalForwardingRules.list":
  45147. type GlobalForwardingRulesListCall struct {
  45148. s *Service
  45149. project string
  45150. urlParams_ gensupport.URLParams
  45151. ifNoneMatch_ string
  45152. ctx_ context.Context
  45153. header_ http.Header
  45154. }
  45155. // List: Retrieves a list of GlobalForwardingRule resources available to
  45156. // the specified project.
  45157. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/list
  45158. func (r *GlobalForwardingRulesService) List(project string) *GlobalForwardingRulesListCall {
  45159. c := &GlobalForwardingRulesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45160. c.project = project
  45161. return c
  45162. }
  45163. // Filter sets the optional parameter "filter": A filter expression that
  45164. // filters resources listed in the response. The expression must specify
  45165. // the field name, a comparison operator, and the value that you want to
  45166. // use for filtering. The value must be a string, a number, or a
  45167. // boolean. The comparison operator must be either =, !=, >, or <.
  45168. //
  45169. // For example, if you are filtering Compute Engine instances, you can
  45170. // exclude instances named example-instance by specifying name !=
  45171. // example-instance.
  45172. //
  45173. // You can also filter nested fields. For example, you could specify
  45174. // scheduling.automaticRestart = false to include instances only if they
  45175. // are not scheduled for automatic restarts. You can use filtering on
  45176. // nested fields to filter based on resource labels.
  45177. //
  45178. // To filter on multiple expressions, provide each separate expression
  45179. // within parentheses. For example, (scheduling.automaticRestart = true)
  45180. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  45181. // AND expression. However, you can include AND and OR expressions
  45182. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  45183. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  45184. // true).
  45185. func (c *GlobalForwardingRulesListCall) Filter(filter string) *GlobalForwardingRulesListCall {
  45186. c.urlParams_.Set("filter", filter)
  45187. return c
  45188. }
  45189. // MaxResults sets the optional parameter "maxResults": The maximum
  45190. // number of results per page that should be returned. If the number of
  45191. // available results is larger than maxResults, Compute Engine returns a
  45192. // nextPageToken that can be used to get the next page of results in
  45193. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  45194. // (Default: 500)
  45195. func (c *GlobalForwardingRulesListCall) MaxResults(maxResults int64) *GlobalForwardingRulesListCall {
  45196. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  45197. return c
  45198. }
  45199. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  45200. // a certain order. By default, results are returned in alphanumerical
  45201. // order based on the resource name.
  45202. //
  45203. // You can also sort results in descending order based on the creation
  45204. // timestamp using orderBy="creationTimestamp desc". This sorts results
  45205. // based on the creationTimestamp field in reverse chronological order
  45206. // (newest result first). Use this to sort resources like operations so
  45207. // that the newest operation is returned first.
  45208. //
  45209. // Currently, only sorting by name or creationTimestamp desc is
  45210. // supported.
  45211. func (c *GlobalForwardingRulesListCall) OrderBy(orderBy string) *GlobalForwardingRulesListCall {
  45212. c.urlParams_.Set("orderBy", orderBy)
  45213. return c
  45214. }
  45215. // PageToken sets the optional parameter "pageToken": Specifies a page
  45216. // token to use. Set pageToken to the nextPageToken returned by a
  45217. // previous list request to get the next page of results.
  45218. func (c *GlobalForwardingRulesListCall) PageToken(pageToken string) *GlobalForwardingRulesListCall {
  45219. c.urlParams_.Set("pageToken", pageToken)
  45220. return c
  45221. }
  45222. // Fields allows partial responses to be retrieved. See
  45223. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45224. // for more information.
  45225. func (c *GlobalForwardingRulesListCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesListCall {
  45226. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45227. return c
  45228. }
  45229. // IfNoneMatch sets the optional parameter which makes the operation
  45230. // fail if the object's ETag matches the given value. This is useful for
  45231. // getting updates only after the object has changed since the last
  45232. // request. Use googleapi.IsNotModified to check whether the response
  45233. // error from Do is the result of In-None-Match.
  45234. func (c *GlobalForwardingRulesListCall) IfNoneMatch(entityTag string) *GlobalForwardingRulesListCall {
  45235. c.ifNoneMatch_ = entityTag
  45236. return c
  45237. }
  45238. // Context sets the context to be used in this call's Do method. Any
  45239. // pending HTTP request will be aborted if the provided context is
  45240. // canceled.
  45241. func (c *GlobalForwardingRulesListCall) Context(ctx context.Context) *GlobalForwardingRulesListCall {
  45242. c.ctx_ = ctx
  45243. return c
  45244. }
  45245. // Header returns an http.Header that can be modified by the caller to
  45246. // add HTTP headers to the request.
  45247. func (c *GlobalForwardingRulesListCall) Header() http.Header {
  45248. if c.header_ == nil {
  45249. c.header_ = make(http.Header)
  45250. }
  45251. return c.header_
  45252. }
  45253. func (c *GlobalForwardingRulesListCall) doRequest(alt string) (*http.Response, error) {
  45254. reqHeaders := make(http.Header)
  45255. for k, v := range c.header_ {
  45256. reqHeaders[k] = v
  45257. }
  45258. reqHeaders.Set("User-Agent", c.s.userAgent())
  45259. if c.ifNoneMatch_ != "" {
  45260. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  45261. }
  45262. var body io.Reader = nil
  45263. c.urlParams_.Set("alt", alt)
  45264. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules")
  45265. urls += "?" + c.urlParams_.Encode()
  45266. req, _ := http.NewRequest("GET", urls, body)
  45267. req.Header = reqHeaders
  45268. googleapi.Expand(req.URL, map[string]string{
  45269. "project": c.project,
  45270. })
  45271. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45272. }
  45273. // Do executes the "compute.globalForwardingRules.list" call.
  45274. // Exactly one of *ForwardingRuleList or error will be non-nil. Any
  45275. // non-2xx status code is an error. Response headers are in either
  45276. // *ForwardingRuleList.ServerResponse.Header or (if a response was
  45277. // returned at all) in error.(*googleapi.Error).Header. Use
  45278. // googleapi.IsNotModified to check whether the returned error was
  45279. // because http.StatusNotModified was returned.
  45280. func (c *GlobalForwardingRulesListCall) Do(opts ...googleapi.CallOption) (*ForwardingRuleList, error) {
  45281. gensupport.SetOptions(c.urlParams_, opts...)
  45282. res, err := c.doRequest("json")
  45283. if res != nil && res.StatusCode == http.StatusNotModified {
  45284. if res.Body != nil {
  45285. res.Body.Close()
  45286. }
  45287. return nil, &googleapi.Error{
  45288. Code: res.StatusCode,
  45289. Header: res.Header,
  45290. }
  45291. }
  45292. if err != nil {
  45293. return nil, err
  45294. }
  45295. defer googleapi.CloseBody(res)
  45296. if err := googleapi.CheckResponse(res); err != nil {
  45297. return nil, err
  45298. }
  45299. ret := &ForwardingRuleList{
  45300. ServerResponse: googleapi.ServerResponse{
  45301. Header: res.Header,
  45302. HTTPStatusCode: res.StatusCode,
  45303. },
  45304. }
  45305. target := &ret
  45306. if err := gensupport.DecodeResponse(target, res); err != nil {
  45307. return nil, err
  45308. }
  45309. return ret, nil
  45310. // {
  45311. // "description": "Retrieves a list of GlobalForwardingRule resources available to the specified project.",
  45312. // "httpMethod": "GET",
  45313. // "id": "compute.globalForwardingRules.list",
  45314. // "parameterOrder": [
  45315. // "project"
  45316. // ],
  45317. // "parameters": {
  45318. // "filter": {
  45319. // "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).",
  45320. // "location": "query",
  45321. // "type": "string"
  45322. // },
  45323. // "maxResults": {
  45324. // "default": "500",
  45325. // "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)",
  45326. // "format": "uint32",
  45327. // "location": "query",
  45328. // "minimum": "0",
  45329. // "type": "integer"
  45330. // },
  45331. // "orderBy": {
  45332. // "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.",
  45333. // "location": "query",
  45334. // "type": "string"
  45335. // },
  45336. // "pageToken": {
  45337. // "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.",
  45338. // "location": "query",
  45339. // "type": "string"
  45340. // },
  45341. // "project": {
  45342. // "description": "Project ID for this request.",
  45343. // "location": "path",
  45344. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  45345. // "required": true,
  45346. // "type": "string"
  45347. // }
  45348. // },
  45349. // "path": "{project}/global/forwardingRules",
  45350. // "response": {
  45351. // "$ref": "ForwardingRuleList"
  45352. // },
  45353. // "scopes": [
  45354. // "https://www.googleapis.com/auth/cloud-platform",
  45355. // "https://www.googleapis.com/auth/compute",
  45356. // "https://www.googleapis.com/auth/compute.readonly"
  45357. // ]
  45358. // }
  45359. }
  45360. // Pages invokes f for each page of results.
  45361. // A non-nil error returned from f will halt the iteration.
  45362. // The provided context supersedes any context provided to the Context method.
  45363. func (c *GlobalForwardingRulesListCall) Pages(ctx context.Context, f func(*ForwardingRuleList) error) error {
  45364. c.ctx_ = ctx
  45365. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  45366. for {
  45367. x, err := c.Do()
  45368. if err != nil {
  45369. return err
  45370. }
  45371. if err := f(x); err != nil {
  45372. return err
  45373. }
  45374. if x.NextPageToken == "" {
  45375. return nil
  45376. }
  45377. c.PageToken(x.NextPageToken)
  45378. }
  45379. }
  45380. // method id "compute.globalForwardingRules.patch":
  45381. type GlobalForwardingRulesPatchCall struct {
  45382. s *Service
  45383. project string
  45384. forwardingRule string
  45385. forwardingrule *ForwardingRule
  45386. urlParams_ gensupport.URLParams
  45387. ctx_ context.Context
  45388. header_ http.Header
  45389. }
  45390. // Patch: Updates the specified forwarding rule with the data included
  45391. // in the request. This method supports PATCH semantics and uses the
  45392. // JSON merge patch format and processing rules. Currently, you can only
  45393. // patch the network_tier field.
  45394. func (r *GlobalForwardingRulesService) Patch(project string, forwardingRule string, forwardingrule *ForwardingRule) *GlobalForwardingRulesPatchCall {
  45395. c := &GlobalForwardingRulesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45396. c.project = project
  45397. c.forwardingRule = forwardingRule
  45398. c.forwardingrule = forwardingrule
  45399. return c
  45400. }
  45401. // RequestId sets the optional parameter "requestId": An optional
  45402. // request ID to identify requests. Specify a unique request ID so that
  45403. // if you must retry your request, the server will know to ignore the
  45404. // request if it has already been completed.
  45405. //
  45406. // For example, consider a situation where you make an initial request
  45407. // and the request times out. If you make the request again with the
  45408. // same request ID, the server can check if original operation with the
  45409. // same request ID was received, and if so, will ignore the second
  45410. // request. This prevents clients from accidentally creating duplicate
  45411. // commitments.
  45412. //
  45413. // The request ID must be a valid UUID with the exception that zero UUID
  45414. // is not supported (00000000-0000-0000-0000-000000000000).
  45415. func (c *GlobalForwardingRulesPatchCall) RequestId(requestId string) *GlobalForwardingRulesPatchCall {
  45416. c.urlParams_.Set("requestId", requestId)
  45417. return c
  45418. }
  45419. // Fields allows partial responses to be retrieved. See
  45420. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45421. // for more information.
  45422. func (c *GlobalForwardingRulesPatchCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesPatchCall {
  45423. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45424. return c
  45425. }
  45426. // Context sets the context to be used in this call's Do method. Any
  45427. // pending HTTP request will be aborted if the provided context is
  45428. // canceled.
  45429. func (c *GlobalForwardingRulesPatchCall) Context(ctx context.Context) *GlobalForwardingRulesPatchCall {
  45430. c.ctx_ = ctx
  45431. return c
  45432. }
  45433. // Header returns an http.Header that can be modified by the caller to
  45434. // add HTTP headers to the request.
  45435. func (c *GlobalForwardingRulesPatchCall) Header() http.Header {
  45436. if c.header_ == nil {
  45437. c.header_ = make(http.Header)
  45438. }
  45439. return c.header_
  45440. }
  45441. func (c *GlobalForwardingRulesPatchCall) doRequest(alt string) (*http.Response, error) {
  45442. reqHeaders := make(http.Header)
  45443. for k, v := range c.header_ {
  45444. reqHeaders[k] = v
  45445. }
  45446. reqHeaders.Set("User-Agent", c.s.userAgent())
  45447. var body io.Reader = nil
  45448. body, err := googleapi.WithoutDataWrapper.JSONReader(c.forwardingrule)
  45449. if err != nil {
  45450. return nil, err
  45451. }
  45452. reqHeaders.Set("Content-Type", "application/json")
  45453. c.urlParams_.Set("alt", alt)
  45454. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules/{forwardingRule}")
  45455. urls += "?" + c.urlParams_.Encode()
  45456. req, _ := http.NewRequest("PATCH", urls, body)
  45457. req.Header = reqHeaders
  45458. googleapi.Expand(req.URL, map[string]string{
  45459. "project": c.project,
  45460. "forwardingRule": c.forwardingRule,
  45461. })
  45462. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45463. }
  45464. // Do executes the "compute.globalForwardingRules.patch" call.
  45465. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  45466. // status code is an error. Response headers are in either
  45467. // *Operation.ServerResponse.Header or (if a response was returned at
  45468. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  45469. // to check whether the returned error was because
  45470. // http.StatusNotModified was returned.
  45471. func (c *GlobalForwardingRulesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  45472. gensupport.SetOptions(c.urlParams_, opts...)
  45473. res, err := c.doRequest("json")
  45474. if res != nil && res.StatusCode == http.StatusNotModified {
  45475. if res.Body != nil {
  45476. res.Body.Close()
  45477. }
  45478. return nil, &googleapi.Error{
  45479. Code: res.StatusCode,
  45480. Header: res.Header,
  45481. }
  45482. }
  45483. if err != nil {
  45484. return nil, err
  45485. }
  45486. defer googleapi.CloseBody(res)
  45487. if err := googleapi.CheckResponse(res); err != nil {
  45488. return nil, err
  45489. }
  45490. ret := &Operation{
  45491. ServerResponse: googleapi.ServerResponse{
  45492. Header: res.Header,
  45493. HTTPStatusCode: res.StatusCode,
  45494. },
  45495. }
  45496. target := &ret
  45497. if err := gensupport.DecodeResponse(target, res); err != nil {
  45498. return nil, err
  45499. }
  45500. return ret, nil
  45501. // {
  45502. // "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.",
  45503. // "httpMethod": "PATCH",
  45504. // "id": "compute.globalForwardingRules.patch",
  45505. // "parameterOrder": [
  45506. // "project",
  45507. // "forwardingRule"
  45508. // ],
  45509. // "parameters": {
  45510. // "forwardingRule": {
  45511. // "description": "Name of the ForwardingRule resource to patch.",
  45512. // "location": "path",
  45513. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  45514. // "required": true,
  45515. // "type": "string"
  45516. // },
  45517. // "project": {
  45518. // "description": "Project ID for this request.",
  45519. // "location": "path",
  45520. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  45521. // "required": true,
  45522. // "type": "string"
  45523. // },
  45524. // "requestId": {
  45525. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  45526. // "location": "query",
  45527. // "type": "string"
  45528. // }
  45529. // },
  45530. // "path": "{project}/global/forwardingRules/{forwardingRule}",
  45531. // "request": {
  45532. // "$ref": "ForwardingRule"
  45533. // },
  45534. // "response": {
  45535. // "$ref": "Operation"
  45536. // },
  45537. // "scopes": [
  45538. // "https://www.googleapis.com/auth/cloud-platform",
  45539. // "https://www.googleapis.com/auth/compute"
  45540. // ]
  45541. // }
  45542. }
  45543. // method id "compute.globalForwardingRules.setLabels":
  45544. type GlobalForwardingRulesSetLabelsCall struct {
  45545. s *Service
  45546. project string
  45547. resource string
  45548. globalsetlabelsrequest *GlobalSetLabelsRequest
  45549. urlParams_ gensupport.URLParams
  45550. ctx_ context.Context
  45551. header_ http.Header
  45552. }
  45553. // SetLabels: Sets the labels on the specified resource. To learn more
  45554. // about labels, read the Labeling Resources documentation.
  45555. func (r *GlobalForwardingRulesService) SetLabels(project string, resource string, globalsetlabelsrequest *GlobalSetLabelsRequest) *GlobalForwardingRulesSetLabelsCall {
  45556. c := &GlobalForwardingRulesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45557. c.project = project
  45558. c.resource = resource
  45559. c.globalsetlabelsrequest = globalsetlabelsrequest
  45560. return c
  45561. }
  45562. // Fields allows partial responses to be retrieved. See
  45563. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45564. // for more information.
  45565. func (c *GlobalForwardingRulesSetLabelsCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesSetLabelsCall {
  45566. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45567. return c
  45568. }
  45569. // Context sets the context to be used in this call's Do method. Any
  45570. // pending HTTP request will be aborted if the provided context is
  45571. // canceled.
  45572. func (c *GlobalForwardingRulesSetLabelsCall) Context(ctx context.Context) *GlobalForwardingRulesSetLabelsCall {
  45573. c.ctx_ = ctx
  45574. return c
  45575. }
  45576. // Header returns an http.Header that can be modified by the caller to
  45577. // add HTTP headers to the request.
  45578. func (c *GlobalForwardingRulesSetLabelsCall) Header() http.Header {
  45579. if c.header_ == nil {
  45580. c.header_ = make(http.Header)
  45581. }
  45582. return c.header_
  45583. }
  45584. func (c *GlobalForwardingRulesSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  45585. reqHeaders := make(http.Header)
  45586. for k, v := range c.header_ {
  45587. reqHeaders[k] = v
  45588. }
  45589. reqHeaders.Set("User-Agent", c.s.userAgent())
  45590. var body io.Reader = nil
  45591. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest)
  45592. if err != nil {
  45593. return nil, err
  45594. }
  45595. reqHeaders.Set("Content-Type", "application/json")
  45596. c.urlParams_.Set("alt", alt)
  45597. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules/{resource}/setLabels")
  45598. urls += "?" + c.urlParams_.Encode()
  45599. req, _ := http.NewRequest("POST", urls, body)
  45600. req.Header = reqHeaders
  45601. googleapi.Expand(req.URL, map[string]string{
  45602. "project": c.project,
  45603. "resource": c.resource,
  45604. })
  45605. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45606. }
  45607. // Do executes the "compute.globalForwardingRules.setLabels" call.
  45608. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  45609. // status code is an error. Response headers are in either
  45610. // *Operation.ServerResponse.Header or (if a response was returned at
  45611. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  45612. // to check whether the returned error was because
  45613. // http.StatusNotModified was returned.
  45614. func (c *GlobalForwardingRulesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  45615. gensupport.SetOptions(c.urlParams_, opts...)
  45616. res, err := c.doRequest("json")
  45617. if res != nil && res.StatusCode == http.StatusNotModified {
  45618. if res.Body != nil {
  45619. res.Body.Close()
  45620. }
  45621. return nil, &googleapi.Error{
  45622. Code: res.StatusCode,
  45623. Header: res.Header,
  45624. }
  45625. }
  45626. if err != nil {
  45627. return nil, err
  45628. }
  45629. defer googleapi.CloseBody(res)
  45630. if err := googleapi.CheckResponse(res); err != nil {
  45631. return nil, err
  45632. }
  45633. ret := &Operation{
  45634. ServerResponse: googleapi.ServerResponse{
  45635. Header: res.Header,
  45636. HTTPStatusCode: res.StatusCode,
  45637. },
  45638. }
  45639. target := &ret
  45640. if err := gensupport.DecodeResponse(target, res); err != nil {
  45641. return nil, err
  45642. }
  45643. return ret, nil
  45644. // {
  45645. // "description": "Sets the labels on the specified resource. To learn more about labels, read the Labeling Resources documentation.",
  45646. // "httpMethod": "POST",
  45647. // "id": "compute.globalForwardingRules.setLabels",
  45648. // "parameterOrder": [
  45649. // "project",
  45650. // "resource"
  45651. // ],
  45652. // "parameters": {
  45653. // "project": {
  45654. // "description": "Project ID for this request.",
  45655. // "location": "path",
  45656. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  45657. // "required": true,
  45658. // "type": "string"
  45659. // },
  45660. // "resource": {
  45661. // "description": "Name of the resource for this request.",
  45662. // "location": "path",
  45663. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?",
  45664. // "required": true,
  45665. // "type": "string"
  45666. // }
  45667. // },
  45668. // "path": "{project}/global/forwardingRules/{resource}/setLabels",
  45669. // "request": {
  45670. // "$ref": "GlobalSetLabelsRequest"
  45671. // },
  45672. // "response": {
  45673. // "$ref": "Operation"
  45674. // },
  45675. // "scopes": [
  45676. // "https://www.googleapis.com/auth/cloud-platform",
  45677. // "https://www.googleapis.com/auth/compute"
  45678. // ]
  45679. // }
  45680. }
  45681. // method id "compute.globalForwardingRules.setTarget":
  45682. type GlobalForwardingRulesSetTargetCall struct {
  45683. s *Service
  45684. project string
  45685. forwardingRule string
  45686. targetreference *TargetReference
  45687. urlParams_ gensupport.URLParams
  45688. ctx_ context.Context
  45689. header_ http.Header
  45690. }
  45691. // SetTarget: Changes target URL for the GlobalForwardingRule resource.
  45692. // The new target should be of the same type as the old target.
  45693. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/setTarget
  45694. func (r *GlobalForwardingRulesService) SetTarget(project string, forwardingRule string, targetreference *TargetReference) *GlobalForwardingRulesSetTargetCall {
  45695. c := &GlobalForwardingRulesSetTargetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45696. c.project = project
  45697. c.forwardingRule = forwardingRule
  45698. c.targetreference = targetreference
  45699. return c
  45700. }
  45701. // RequestId sets the optional parameter "requestId": An optional
  45702. // request ID to identify requests. Specify a unique request ID so that
  45703. // if you must retry your request, the server will know to ignore the
  45704. // request if it has already been completed.
  45705. //
  45706. // For example, consider a situation where you make an initial request
  45707. // and the request times out. If you make the request again with the
  45708. // same request ID, the server can check if original operation with the
  45709. // same request ID was received, and if so, will ignore the second
  45710. // request. This prevents clients from accidentally creating duplicate
  45711. // commitments.
  45712. //
  45713. // The request ID must be a valid UUID with the exception that zero UUID
  45714. // is not supported (00000000-0000-0000-0000-000000000000).
  45715. func (c *GlobalForwardingRulesSetTargetCall) RequestId(requestId string) *GlobalForwardingRulesSetTargetCall {
  45716. c.urlParams_.Set("requestId", requestId)
  45717. return c
  45718. }
  45719. // Fields allows partial responses to be retrieved. See
  45720. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45721. // for more information.
  45722. func (c *GlobalForwardingRulesSetTargetCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesSetTargetCall {
  45723. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45724. return c
  45725. }
  45726. // Context sets the context to be used in this call's Do method. Any
  45727. // pending HTTP request will be aborted if the provided context is
  45728. // canceled.
  45729. func (c *GlobalForwardingRulesSetTargetCall) Context(ctx context.Context) *GlobalForwardingRulesSetTargetCall {
  45730. c.ctx_ = ctx
  45731. return c
  45732. }
  45733. // Header returns an http.Header that can be modified by the caller to
  45734. // add HTTP headers to the request.
  45735. func (c *GlobalForwardingRulesSetTargetCall) Header() http.Header {
  45736. if c.header_ == nil {
  45737. c.header_ = make(http.Header)
  45738. }
  45739. return c.header_
  45740. }
  45741. func (c *GlobalForwardingRulesSetTargetCall) doRequest(alt string) (*http.Response, error) {
  45742. reqHeaders := make(http.Header)
  45743. for k, v := range c.header_ {
  45744. reqHeaders[k] = v
  45745. }
  45746. reqHeaders.Set("User-Agent", c.s.userAgent())
  45747. var body io.Reader = nil
  45748. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetreference)
  45749. if err != nil {
  45750. return nil, err
  45751. }
  45752. reqHeaders.Set("Content-Type", "application/json")
  45753. c.urlParams_.Set("alt", alt)
  45754. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules/{forwardingRule}/setTarget")
  45755. urls += "?" + c.urlParams_.Encode()
  45756. req, _ := http.NewRequest("POST", urls, body)
  45757. req.Header = reqHeaders
  45758. googleapi.Expand(req.URL, map[string]string{
  45759. "project": c.project,
  45760. "forwardingRule": c.forwardingRule,
  45761. })
  45762. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45763. }
  45764. // Do executes the "compute.globalForwardingRules.setTarget" call.
  45765. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  45766. // status code is an error. Response headers are in either
  45767. // *Operation.ServerResponse.Header or (if a response was returned at
  45768. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  45769. // to check whether the returned error was because
  45770. // http.StatusNotModified was returned.
  45771. func (c *GlobalForwardingRulesSetTargetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  45772. gensupport.SetOptions(c.urlParams_, opts...)
  45773. res, err := c.doRequest("json")
  45774. if res != nil && res.StatusCode == http.StatusNotModified {
  45775. if res.Body != nil {
  45776. res.Body.Close()
  45777. }
  45778. return nil, &googleapi.Error{
  45779. Code: res.StatusCode,
  45780. Header: res.Header,
  45781. }
  45782. }
  45783. if err != nil {
  45784. return nil, err
  45785. }
  45786. defer googleapi.CloseBody(res)
  45787. if err := googleapi.CheckResponse(res); err != nil {
  45788. return nil, err
  45789. }
  45790. ret := &Operation{
  45791. ServerResponse: googleapi.ServerResponse{
  45792. Header: res.Header,
  45793. HTTPStatusCode: res.StatusCode,
  45794. },
  45795. }
  45796. target := &ret
  45797. if err := gensupport.DecodeResponse(target, res); err != nil {
  45798. return nil, err
  45799. }
  45800. return ret, nil
  45801. // {
  45802. // "description": "Changes target URL for the GlobalForwardingRule resource. The new target should be of the same type as the old target.",
  45803. // "httpMethod": "POST",
  45804. // "id": "compute.globalForwardingRules.setTarget",
  45805. // "parameterOrder": [
  45806. // "project",
  45807. // "forwardingRule"
  45808. // ],
  45809. // "parameters": {
  45810. // "forwardingRule": {
  45811. // "description": "Name of the ForwardingRule resource in which target is to be set.",
  45812. // "location": "path",
  45813. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  45814. // "required": true,
  45815. // "type": "string"
  45816. // },
  45817. // "project": {
  45818. // "description": "Project ID for this request.",
  45819. // "location": "path",
  45820. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  45821. // "required": true,
  45822. // "type": "string"
  45823. // },
  45824. // "requestId": {
  45825. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  45826. // "location": "query",
  45827. // "type": "string"
  45828. // }
  45829. // },
  45830. // "path": "{project}/global/forwardingRules/{forwardingRule}/setTarget",
  45831. // "request": {
  45832. // "$ref": "TargetReference"
  45833. // },
  45834. // "response": {
  45835. // "$ref": "Operation"
  45836. // },
  45837. // "scopes": [
  45838. // "https://www.googleapis.com/auth/cloud-platform",
  45839. // "https://www.googleapis.com/auth/compute"
  45840. // ]
  45841. // }
  45842. }
  45843. // method id "compute.globalForwardingRules.testIamPermissions":
  45844. type GlobalForwardingRulesTestIamPermissionsCall struct {
  45845. s *Service
  45846. project string
  45847. resource string
  45848. testpermissionsrequest *TestPermissionsRequest
  45849. urlParams_ gensupport.URLParams
  45850. ctx_ context.Context
  45851. header_ http.Header
  45852. }
  45853. // TestIamPermissions: Returns permissions that a caller has on the
  45854. // specified resource.
  45855. func (r *GlobalForwardingRulesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *GlobalForwardingRulesTestIamPermissionsCall {
  45856. c := &GlobalForwardingRulesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45857. c.project = project
  45858. c.resource = resource
  45859. c.testpermissionsrequest = testpermissionsrequest
  45860. return c
  45861. }
  45862. // Fields allows partial responses to be retrieved. See
  45863. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45864. // for more information.
  45865. func (c *GlobalForwardingRulesTestIamPermissionsCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesTestIamPermissionsCall {
  45866. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45867. return c
  45868. }
  45869. // Context sets the context to be used in this call's Do method. Any
  45870. // pending HTTP request will be aborted if the provided context is
  45871. // canceled.
  45872. func (c *GlobalForwardingRulesTestIamPermissionsCall) Context(ctx context.Context) *GlobalForwardingRulesTestIamPermissionsCall {
  45873. c.ctx_ = ctx
  45874. return c
  45875. }
  45876. // Header returns an http.Header that can be modified by the caller to
  45877. // add HTTP headers to the request.
  45878. func (c *GlobalForwardingRulesTestIamPermissionsCall) Header() http.Header {
  45879. if c.header_ == nil {
  45880. c.header_ = make(http.Header)
  45881. }
  45882. return c.header_
  45883. }
  45884. func (c *GlobalForwardingRulesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  45885. reqHeaders := make(http.Header)
  45886. for k, v := range c.header_ {
  45887. reqHeaders[k] = v
  45888. }
  45889. reqHeaders.Set("User-Agent", c.s.userAgent())
  45890. var body io.Reader = nil
  45891. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  45892. if err != nil {
  45893. return nil, err
  45894. }
  45895. reqHeaders.Set("Content-Type", "application/json")
  45896. c.urlParams_.Set("alt", alt)
  45897. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules/{resource}/testIamPermissions")
  45898. urls += "?" + c.urlParams_.Encode()
  45899. req, _ := http.NewRequest("POST", urls, body)
  45900. req.Header = reqHeaders
  45901. googleapi.Expand(req.URL, map[string]string{
  45902. "project": c.project,
  45903. "resource": c.resource,
  45904. })
  45905. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45906. }
  45907. // Do executes the "compute.globalForwardingRules.testIamPermissions" call.
  45908. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  45909. // non-2xx status code is an error. Response headers are in either
  45910. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  45911. // returned at all) in error.(*googleapi.Error).Header. Use
  45912. // googleapi.IsNotModified to check whether the returned error was
  45913. // because http.StatusNotModified was returned.
  45914. func (c *GlobalForwardingRulesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  45915. gensupport.SetOptions(c.urlParams_, opts...)
  45916. res, err := c.doRequest("json")
  45917. if res != nil && res.StatusCode == http.StatusNotModified {
  45918. if res.Body != nil {
  45919. res.Body.Close()
  45920. }
  45921. return nil, &googleapi.Error{
  45922. Code: res.StatusCode,
  45923. Header: res.Header,
  45924. }
  45925. }
  45926. if err != nil {
  45927. return nil, err
  45928. }
  45929. defer googleapi.CloseBody(res)
  45930. if err := googleapi.CheckResponse(res); err != nil {
  45931. return nil, err
  45932. }
  45933. ret := &TestPermissionsResponse{
  45934. ServerResponse: googleapi.ServerResponse{
  45935. Header: res.Header,
  45936. HTTPStatusCode: res.StatusCode,
  45937. },
  45938. }
  45939. target := &ret
  45940. if err := gensupport.DecodeResponse(target, res); err != nil {
  45941. return nil, err
  45942. }
  45943. return ret, nil
  45944. // {
  45945. // "description": "Returns permissions that a caller has on the specified resource.",
  45946. // "httpMethod": "POST",
  45947. // "id": "compute.globalForwardingRules.testIamPermissions",
  45948. // "parameterOrder": [
  45949. // "project",
  45950. // "resource"
  45951. // ],
  45952. // "parameters": {
  45953. // "project": {
  45954. // "description": "Project ID for this request.",
  45955. // "location": "path",
  45956. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  45957. // "required": true,
  45958. // "type": "string"
  45959. // },
  45960. // "resource": {
  45961. // "description": "Name of the resource for this request.",
  45962. // "location": "path",
  45963. // "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?",
  45964. // "required": true,
  45965. // "type": "string"
  45966. // }
  45967. // },
  45968. // "path": "{project}/global/forwardingRules/{resource}/testIamPermissions",
  45969. // "request": {
  45970. // "$ref": "TestPermissionsRequest"
  45971. // },
  45972. // "response": {
  45973. // "$ref": "TestPermissionsResponse"
  45974. // },
  45975. // "scopes": [
  45976. // "https://www.googleapis.com/auth/cloud-platform",
  45977. // "https://www.googleapis.com/auth/compute",
  45978. // "https://www.googleapis.com/auth/compute.readonly"
  45979. // ]
  45980. // }
  45981. }
  45982. // method id "compute.globalOperations.aggregatedList":
  45983. type GlobalOperationsAggregatedListCall struct {
  45984. s *Service
  45985. project string
  45986. urlParams_ gensupport.URLParams
  45987. ifNoneMatch_ string
  45988. ctx_ context.Context
  45989. header_ http.Header
  45990. }
  45991. // AggregatedList: Retrieves an aggregated list of all operations.
  45992. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalOperations/aggregatedList
  45993. func (r *GlobalOperationsService) AggregatedList(project string) *GlobalOperationsAggregatedListCall {
  45994. c := &GlobalOperationsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45995. c.project = project
  45996. return c
  45997. }
  45998. // Filter sets the optional parameter "filter": A filter expression that
  45999. // filters resources listed in the response. The expression must specify
  46000. // the field name, a comparison operator, and the value that you want to
  46001. // use for filtering. The value must be a string, a number, or a
  46002. // boolean. The comparison operator must be either =, !=, >, or <.
  46003. //
  46004. // For example, if you are filtering Compute Engine instances, you can
  46005. // exclude instances named example-instance by specifying name !=
  46006. // example-instance.
  46007. //
  46008. // You can also filter nested fields. For example, you could specify
  46009. // scheduling.automaticRestart = false to include instances only if they
  46010. // are not scheduled for automatic restarts. You can use filtering on
  46011. // nested fields to filter based on resource labels.
  46012. //
  46013. // To filter on multiple expressions, provide each separate expression
  46014. // within parentheses. For example, (scheduling.automaticRestart = true)
  46015. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  46016. // AND expression. However, you can include AND and OR expressions
  46017. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  46018. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  46019. // true).
  46020. func (c *GlobalOperationsAggregatedListCall) Filter(filter string) *GlobalOperationsAggregatedListCall {
  46021. c.urlParams_.Set("filter", filter)
  46022. return c
  46023. }
  46024. // MaxResults sets the optional parameter "maxResults": The maximum
  46025. // number of results per page that should be returned. If the number of
  46026. // available results is larger than maxResults, Compute Engine returns a
  46027. // nextPageToken that can be used to get the next page of results in
  46028. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  46029. // (Default: 500)
  46030. func (c *GlobalOperationsAggregatedListCall) MaxResults(maxResults int64) *GlobalOperationsAggregatedListCall {
  46031. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  46032. return c
  46033. }
  46034. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  46035. // a certain order. By default, results are returned in alphanumerical
  46036. // order based on the resource name.
  46037. //
  46038. // You can also sort results in descending order based on the creation
  46039. // timestamp using orderBy="creationTimestamp desc". This sorts results
  46040. // based on the creationTimestamp field in reverse chronological order
  46041. // (newest result first). Use this to sort resources like operations so
  46042. // that the newest operation is returned first.
  46043. //
  46044. // Currently, only sorting by name or creationTimestamp desc is
  46045. // supported.
  46046. func (c *GlobalOperationsAggregatedListCall) OrderBy(orderBy string) *GlobalOperationsAggregatedListCall {
  46047. c.urlParams_.Set("orderBy", orderBy)
  46048. return c
  46049. }
  46050. // PageToken sets the optional parameter "pageToken": Specifies a page
  46051. // token to use. Set pageToken to the nextPageToken returned by a
  46052. // previous list request to get the next page of results.
  46053. func (c *GlobalOperationsAggregatedListCall) PageToken(pageToken string) *GlobalOperationsAggregatedListCall {
  46054. c.urlParams_.Set("pageToken", pageToken)
  46055. return c
  46056. }
  46057. // Fields allows partial responses to be retrieved. See
  46058. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46059. // for more information.
  46060. func (c *GlobalOperationsAggregatedListCall) Fields(s ...googleapi.Field) *GlobalOperationsAggregatedListCall {
  46061. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46062. return c
  46063. }
  46064. // IfNoneMatch sets the optional parameter which makes the operation
  46065. // fail if the object's ETag matches the given value. This is useful for
  46066. // getting updates only after the object has changed since the last
  46067. // request. Use googleapi.IsNotModified to check whether the response
  46068. // error from Do is the result of In-None-Match.
  46069. func (c *GlobalOperationsAggregatedListCall) IfNoneMatch(entityTag string) *GlobalOperationsAggregatedListCall {
  46070. c.ifNoneMatch_ = entityTag
  46071. return c
  46072. }
  46073. // Context sets the context to be used in this call's Do method. Any
  46074. // pending HTTP request will be aborted if the provided context is
  46075. // canceled.
  46076. func (c *GlobalOperationsAggregatedListCall) Context(ctx context.Context) *GlobalOperationsAggregatedListCall {
  46077. c.ctx_ = ctx
  46078. return c
  46079. }
  46080. // Header returns an http.Header that can be modified by the caller to
  46081. // add HTTP headers to the request.
  46082. func (c *GlobalOperationsAggregatedListCall) Header() http.Header {
  46083. if c.header_ == nil {
  46084. c.header_ = make(http.Header)
  46085. }
  46086. return c.header_
  46087. }
  46088. func (c *GlobalOperationsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  46089. reqHeaders := make(http.Header)
  46090. for k, v := range c.header_ {
  46091. reqHeaders[k] = v
  46092. }
  46093. reqHeaders.Set("User-Agent", c.s.userAgent())
  46094. if c.ifNoneMatch_ != "" {
  46095. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  46096. }
  46097. var body io.Reader = nil
  46098. c.urlParams_.Set("alt", alt)
  46099. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/operations")
  46100. urls += "?" + c.urlParams_.Encode()
  46101. req, _ := http.NewRequest("GET", urls, body)
  46102. req.Header = reqHeaders
  46103. googleapi.Expand(req.URL, map[string]string{
  46104. "project": c.project,
  46105. })
  46106. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46107. }
  46108. // Do executes the "compute.globalOperations.aggregatedList" call.
  46109. // Exactly one of *OperationAggregatedList or error will be non-nil. Any
  46110. // non-2xx status code is an error. Response headers are in either
  46111. // *OperationAggregatedList.ServerResponse.Header or (if a response was
  46112. // returned at all) in error.(*googleapi.Error).Header. Use
  46113. // googleapi.IsNotModified to check whether the returned error was
  46114. // because http.StatusNotModified was returned.
  46115. func (c *GlobalOperationsAggregatedListCall) Do(opts ...googleapi.CallOption) (*OperationAggregatedList, error) {
  46116. gensupport.SetOptions(c.urlParams_, opts...)
  46117. res, err := c.doRequest("json")
  46118. if res != nil && res.StatusCode == http.StatusNotModified {
  46119. if res.Body != nil {
  46120. res.Body.Close()
  46121. }
  46122. return nil, &googleapi.Error{
  46123. Code: res.StatusCode,
  46124. Header: res.Header,
  46125. }
  46126. }
  46127. if err != nil {
  46128. return nil, err
  46129. }
  46130. defer googleapi.CloseBody(res)
  46131. if err := googleapi.CheckResponse(res); err != nil {
  46132. return nil, err
  46133. }
  46134. ret := &OperationAggregatedList{
  46135. ServerResponse: googleapi.ServerResponse{
  46136. Header: res.Header,
  46137. HTTPStatusCode: res.StatusCode,
  46138. },
  46139. }
  46140. target := &ret
  46141. if err := gensupport.DecodeResponse(target, res); err != nil {
  46142. return nil, err
  46143. }
  46144. return ret, nil
  46145. // {
  46146. // "description": "Retrieves an aggregated list of all operations.",
  46147. // "httpMethod": "GET",
  46148. // "id": "compute.globalOperations.aggregatedList",
  46149. // "parameterOrder": [
  46150. // "project"
  46151. // ],
  46152. // "parameters": {
  46153. // "filter": {
  46154. // "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).",
  46155. // "location": "query",
  46156. // "type": "string"
  46157. // },
  46158. // "maxResults": {
  46159. // "default": "500",
  46160. // "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)",
  46161. // "format": "uint32",
  46162. // "location": "query",
  46163. // "minimum": "0",
  46164. // "type": "integer"
  46165. // },
  46166. // "orderBy": {
  46167. // "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.",
  46168. // "location": "query",
  46169. // "type": "string"
  46170. // },
  46171. // "pageToken": {
  46172. // "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.",
  46173. // "location": "query",
  46174. // "type": "string"
  46175. // },
  46176. // "project": {
  46177. // "description": "Project ID for this request.",
  46178. // "location": "path",
  46179. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  46180. // "required": true,
  46181. // "type": "string"
  46182. // }
  46183. // },
  46184. // "path": "{project}/aggregated/operations",
  46185. // "response": {
  46186. // "$ref": "OperationAggregatedList"
  46187. // },
  46188. // "scopes": [
  46189. // "https://www.googleapis.com/auth/cloud-platform",
  46190. // "https://www.googleapis.com/auth/compute",
  46191. // "https://www.googleapis.com/auth/compute.readonly"
  46192. // ]
  46193. // }
  46194. }
  46195. // Pages invokes f for each page of results.
  46196. // A non-nil error returned from f will halt the iteration.
  46197. // The provided context supersedes any context provided to the Context method.
  46198. func (c *GlobalOperationsAggregatedListCall) Pages(ctx context.Context, f func(*OperationAggregatedList) error) error {
  46199. c.ctx_ = ctx
  46200. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  46201. for {
  46202. x, err := c.Do()
  46203. if err != nil {
  46204. return err
  46205. }
  46206. if err := f(x); err != nil {
  46207. return err
  46208. }
  46209. if x.NextPageToken == "" {
  46210. return nil
  46211. }
  46212. c.PageToken(x.NextPageToken)
  46213. }
  46214. }
  46215. // method id "compute.globalOperations.delete":
  46216. type GlobalOperationsDeleteCall struct {
  46217. s *Service
  46218. project string
  46219. operation string
  46220. urlParams_ gensupport.URLParams
  46221. ctx_ context.Context
  46222. header_ http.Header
  46223. }
  46224. // Delete: Deletes the specified Operations resource.
  46225. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalOperations/delete
  46226. func (r *GlobalOperationsService) Delete(project string, operation string) *GlobalOperationsDeleteCall {
  46227. c := &GlobalOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46228. c.project = project
  46229. c.operation = operation
  46230. return c
  46231. }
  46232. // Fields allows partial responses to be retrieved. See
  46233. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46234. // for more information.
  46235. func (c *GlobalOperationsDeleteCall) Fields(s ...googleapi.Field) *GlobalOperationsDeleteCall {
  46236. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46237. return c
  46238. }
  46239. // Context sets the context to be used in this call's Do method. Any
  46240. // pending HTTP request will be aborted if the provided context is
  46241. // canceled.
  46242. func (c *GlobalOperationsDeleteCall) Context(ctx context.Context) *GlobalOperationsDeleteCall {
  46243. c.ctx_ = ctx
  46244. return c
  46245. }
  46246. // Header returns an http.Header that can be modified by the caller to
  46247. // add HTTP headers to the request.
  46248. func (c *GlobalOperationsDeleteCall) Header() http.Header {
  46249. if c.header_ == nil {
  46250. c.header_ = make(http.Header)
  46251. }
  46252. return c.header_
  46253. }
  46254. func (c *GlobalOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  46255. reqHeaders := make(http.Header)
  46256. for k, v := range c.header_ {
  46257. reqHeaders[k] = v
  46258. }
  46259. reqHeaders.Set("User-Agent", c.s.userAgent())
  46260. var body io.Reader = nil
  46261. c.urlParams_.Set("alt", alt)
  46262. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations/{operation}")
  46263. urls += "?" + c.urlParams_.Encode()
  46264. req, _ := http.NewRequest("DELETE", urls, body)
  46265. req.Header = reqHeaders
  46266. googleapi.Expand(req.URL, map[string]string{
  46267. "project": c.project,
  46268. "operation": c.operation,
  46269. })
  46270. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46271. }
  46272. // Do executes the "compute.globalOperations.delete" call.
  46273. func (c *GlobalOperationsDeleteCall) Do(opts ...googleapi.CallOption) error {
  46274. gensupport.SetOptions(c.urlParams_, opts...)
  46275. res, err := c.doRequest("json")
  46276. if err != nil {
  46277. return err
  46278. }
  46279. defer googleapi.CloseBody(res)
  46280. if err := googleapi.CheckResponse(res); err != nil {
  46281. return err
  46282. }
  46283. return nil
  46284. // {
  46285. // "description": "Deletes the specified Operations resource.",
  46286. // "httpMethod": "DELETE",
  46287. // "id": "compute.globalOperations.delete",
  46288. // "parameterOrder": [
  46289. // "project",
  46290. // "operation"
  46291. // ],
  46292. // "parameters": {
  46293. // "operation": {
  46294. // "description": "Name of the Operations resource to delete.",
  46295. // "location": "path",
  46296. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  46297. // "required": true,
  46298. // "type": "string"
  46299. // },
  46300. // "project": {
  46301. // "description": "Project ID for this request.",
  46302. // "location": "path",
  46303. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  46304. // "required": true,
  46305. // "type": "string"
  46306. // }
  46307. // },
  46308. // "path": "{project}/global/operations/{operation}",
  46309. // "scopes": [
  46310. // "https://www.googleapis.com/auth/cloud-platform",
  46311. // "https://www.googleapis.com/auth/compute"
  46312. // ]
  46313. // }
  46314. }
  46315. // method id "compute.globalOperations.get":
  46316. type GlobalOperationsGetCall struct {
  46317. s *Service
  46318. project string
  46319. operation string
  46320. urlParams_ gensupport.URLParams
  46321. ifNoneMatch_ string
  46322. ctx_ context.Context
  46323. header_ http.Header
  46324. }
  46325. // Get: Retrieves the specified Operations resource. Gets a list of
  46326. // operations by making a list() request.
  46327. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalOperations/get
  46328. func (r *GlobalOperationsService) Get(project string, operation string) *GlobalOperationsGetCall {
  46329. c := &GlobalOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46330. c.project = project
  46331. c.operation = operation
  46332. return c
  46333. }
  46334. // Fields allows partial responses to be retrieved. See
  46335. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46336. // for more information.
  46337. func (c *GlobalOperationsGetCall) Fields(s ...googleapi.Field) *GlobalOperationsGetCall {
  46338. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46339. return c
  46340. }
  46341. // IfNoneMatch sets the optional parameter which makes the operation
  46342. // fail if the object's ETag matches the given value. This is useful for
  46343. // getting updates only after the object has changed since the last
  46344. // request. Use googleapi.IsNotModified to check whether the response
  46345. // error from Do is the result of In-None-Match.
  46346. func (c *GlobalOperationsGetCall) IfNoneMatch(entityTag string) *GlobalOperationsGetCall {
  46347. c.ifNoneMatch_ = entityTag
  46348. return c
  46349. }
  46350. // Context sets the context to be used in this call's Do method. Any
  46351. // pending HTTP request will be aborted if the provided context is
  46352. // canceled.
  46353. func (c *GlobalOperationsGetCall) Context(ctx context.Context) *GlobalOperationsGetCall {
  46354. c.ctx_ = ctx
  46355. return c
  46356. }
  46357. // Header returns an http.Header that can be modified by the caller to
  46358. // add HTTP headers to the request.
  46359. func (c *GlobalOperationsGetCall) Header() http.Header {
  46360. if c.header_ == nil {
  46361. c.header_ = make(http.Header)
  46362. }
  46363. return c.header_
  46364. }
  46365. func (c *GlobalOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  46366. reqHeaders := make(http.Header)
  46367. for k, v := range c.header_ {
  46368. reqHeaders[k] = v
  46369. }
  46370. reqHeaders.Set("User-Agent", c.s.userAgent())
  46371. if c.ifNoneMatch_ != "" {
  46372. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  46373. }
  46374. var body io.Reader = nil
  46375. c.urlParams_.Set("alt", alt)
  46376. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations/{operation}")
  46377. urls += "?" + c.urlParams_.Encode()
  46378. req, _ := http.NewRequest("GET", urls, body)
  46379. req.Header = reqHeaders
  46380. googleapi.Expand(req.URL, map[string]string{
  46381. "project": c.project,
  46382. "operation": c.operation,
  46383. })
  46384. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46385. }
  46386. // Do executes the "compute.globalOperations.get" call.
  46387. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  46388. // status code is an error. Response headers are in either
  46389. // *Operation.ServerResponse.Header or (if a response was returned at
  46390. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  46391. // to check whether the returned error was because
  46392. // http.StatusNotModified was returned.
  46393. func (c *GlobalOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  46394. gensupport.SetOptions(c.urlParams_, opts...)
  46395. res, err := c.doRequest("json")
  46396. if res != nil && res.StatusCode == http.StatusNotModified {
  46397. if res.Body != nil {
  46398. res.Body.Close()
  46399. }
  46400. return nil, &googleapi.Error{
  46401. Code: res.StatusCode,
  46402. Header: res.Header,
  46403. }
  46404. }
  46405. if err != nil {
  46406. return nil, err
  46407. }
  46408. defer googleapi.CloseBody(res)
  46409. if err := googleapi.CheckResponse(res); err != nil {
  46410. return nil, err
  46411. }
  46412. ret := &Operation{
  46413. ServerResponse: googleapi.ServerResponse{
  46414. Header: res.Header,
  46415. HTTPStatusCode: res.StatusCode,
  46416. },
  46417. }
  46418. target := &ret
  46419. if err := gensupport.DecodeResponse(target, res); err != nil {
  46420. return nil, err
  46421. }
  46422. return ret, nil
  46423. // {
  46424. // "description": "Retrieves the specified Operations resource. Gets a list of operations by making a list() request.",
  46425. // "httpMethod": "GET",
  46426. // "id": "compute.globalOperations.get",
  46427. // "parameterOrder": [
  46428. // "project",
  46429. // "operation"
  46430. // ],
  46431. // "parameters": {
  46432. // "operation": {
  46433. // "description": "Name of the Operations resource to return.",
  46434. // "location": "path",
  46435. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  46436. // "required": true,
  46437. // "type": "string"
  46438. // },
  46439. // "project": {
  46440. // "description": "Project ID for this request.",
  46441. // "location": "path",
  46442. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  46443. // "required": true,
  46444. // "type": "string"
  46445. // }
  46446. // },
  46447. // "path": "{project}/global/operations/{operation}",
  46448. // "response": {
  46449. // "$ref": "Operation"
  46450. // },
  46451. // "scopes": [
  46452. // "https://www.googleapis.com/auth/cloud-platform",
  46453. // "https://www.googleapis.com/auth/compute",
  46454. // "https://www.googleapis.com/auth/compute.readonly"
  46455. // ]
  46456. // }
  46457. }
  46458. // method id "compute.globalOperations.list":
  46459. type GlobalOperationsListCall struct {
  46460. s *Service
  46461. project string
  46462. urlParams_ gensupport.URLParams
  46463. ifNoneMatch_ string
  46464. ctx_ context.Context
  46465. header_ http.Header
  46466. }
  46467. // List: Retrieves a list of Operation resources contained within the
  46468. // specified project.
  46469. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalOperations/list
  46470. func (r *GlobalOperationsService) List(project string) *GlobalOperationsListCall {
  46471. c := &GlobalOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46472. c.project = project
  46473. return c
  46474. }
  46475. // Filter sets the optional parameter "filter": A filter expression that
  46476. // filters resources listed in the response. The expression must specify
  46477. // the field name, a comparison operator, and the value that you want to
  46478. // use for filtering. The value must be a string, a number, or a
  46479. // boolean. The comparison operator must be either =, !=, >, or <.
  46480. //
  46481. // For example, if you are filtering Compute Engine instances, you can
  46482. // exclude instances named example-instance by specifying name !=
  46483. // example-instance.
  46484. //
  46485. // You can also filter nested fields. For example, you could specify
  46486. // scheduling.automaticRestart = false to include instances only if they
  46487. // are not scheduled for automatic restarts. You can use filtering on
  46488. // nested fields to filter based on resource labels.
  46489. //
  46490. // To filter on multiple expressions, provide each separate expression
  46491. // within parentheses. For example, (scheduling.automaticRestart = true)
  46492. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  46493. // AND expression. However, you can include AND and OR expressions
  46494. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  46495. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  46496. // true).
  46497. func (c *GlobalOperationsListCall) Filter(filter string) *GlobalOperationsListCall {
  46498. c.urlParams_.Set("filter", filter)
  46499. return c
  46500. }
  46501. // MaxResults sets the optional parameter "maxResults": The maximum
  46502. // number of results per page that should be returned. If the number of
  46503. // available results is larger than maxResults, Compute Engine returns a
  46504. // nextPageToken that can be used to get the next page of results in
  46505. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  46506. // (Default: 500)
  46507. func (c *GlobalOperationsListCall) MaxResults(maxResults int64) *GlobalOperationsListCall {
  46508. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  46509. return c
  46510. }
  46511. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  46512. // a certain order. By default, results are returned in alphanumerical
  46513. // order based on the resource name.
  46514. //
  46515. // You can also sort results in descending order based on the creation
  46516. // timestamp using orderBy="creationTimestamp desc". This sorts results
  46517. // based on the creationTimestamp field in reverse chronological order
  46518. // (newest result first). Use this to sort resources like operations so
  46519. // that the newest operation is returned first.
  46520. //
  46521. // Currently, only sorting by name or creationTimestamp desc is
  46522. // supported.
  46523. func (c *GlobalOperationsListCall) OrderBy(orderBy string) *GlobalOperationsListCall {
  46524. c.urlParams_.Set("orderBy", orderBy)
  46525. return c
  46526. }
  46527. // PageToken sets the optional parameter "pageToken": Specifies a page
  46528. // token to use. Set pageToken to the nextPageToken returned by a
  46529. // previous list request to get the next page of results.
  46530. func (c *GlobalOperationsListCall) PageToken(pageToken string) *GlobalOperationsListCall {
  46531. c.urlParams_.Set("pageToken", pageToken)
  46532. return c
  46533. }
  46534. // Fields allows partial responses to be retrieved. See
  46535. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46536. // for more information.
  46537. func (c *GlobalOperationsListCall) Fields(s ...googleapi.Field) *GlobalOperationsListCall {
  46538. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46539. return c
  46540. }
  46541. // IfNoneMatch sets the optional parameter which makes the operation
  46542. // fail if the object's ETag matches the given value. This is useful for
  46543. // getting updates only after the object has changed since the last
  46544. // request. Use googleapi.IsNotModified to check whether the response
  46545. // error from Do is the result of In-None-Match.
  46546. func (c *GlobalOperationsListCall) IfNoneMatch(entityTag string) *GlobalOperationsListCall {
  46547. c.ifNoneMatch_ = entityTag
  46548. return c
  46549. }
  46550. // Context sets the context to be used in this call's Do method. Any
  46551. // pending HTTP request will be aborted if the provided context is
  46552. // canceled.
  46553. func (c *GlobalOperationsListCall) Context(ctx context.Context) *GlobalOperationsListCall {
  46554. c.ctx_ = ctx
  46555. return c
  46556. }
  46557. // Header returns an http.Header that can be modified by the caller to
  46558. // add HTTP headers to the request.
  46559. func (c *GlobalOperationsListCall) Header() http.Header {
  46560. if c.header_ == nil {
  46561. c.header_ = make(http.Header)
  46562. }
  46563. return c.header_
  46564. }
  46565. func (c *GlobalOperationsListCall) doRequest(alt string) (*http.Response, error) {
  46566. reqHeaders := make(http.Header)
  46567. for k, v := range c.header_ {
  46568. reqHeaders[k] = v
  46569. }
  46570. reqHeaders.Set("User-Agent", c.s.userAgent())
  46571. if c.ifNoneMatch_ != "" {
  46572. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  46573. }
  46574. var body io.Reader = nil
  46575. c.urlParams_.Set("alt", alt)
  46576. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations")
  46577. urls += "?" + c.urlParams_.Encode()
  46578. req, _ := http.NewRequest("GET", urls, body)
  46579. req.Header = reqHeaders
  46580. googleapi.Expand(req.URL, map[string]string{
  46581. "project": c.project,
  46582. })
  46583. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46584. }
  46585. // Do executes the "compute.globalOperations.list" call.
  46586. // Exactly one of *OperationList or error will be non-nil. Any non-2xx
  46587. // status code is an error. Response headers are in either
  46588. // *OperationList.ServerResponse.Header or (if a response was returned
  46589. // at all) in error.(*googleapi.Error).Header. Use
  46590. // googleapi.IsNotModified to check whether the returned error was
  46591. // because http.StatusNotModified was returned.
  46592. func (c *GlobalOperationsListCall) Do(opts ...googleapi.CallOption) (*OperationList, error) {
  46593. gensupport.SetOptions(c.urlParams_, opts...)
  46594. res, err := c.doRequest("json")
  46595. if res != nil && res.StatusCode == http.StatusNotModified {
  46596. if res.Body != nil {
  46597. res.Body.Close()
  46598. }
  46599. return nil, &googleapi.Error{
  46600. Code: res.StatusCode,
  46601. Header: res.Header,
  46602. }
  46603. }
  46604. if err != nil {
  46605. return nil, err
  46606. }
  46607. defer googleapi.CloseBody(res)
  46608. if err := googleapi.CheckResponse(res); err != nil {
  46609. return nil, err
  46610. }
  46611. ret := &OperationList{
  46612. ServerResponse: googleapi.ServerResponse{
  46613. Header: res.Header,
  46614. HTTPStatusCode: res.StatusCode,
  46615. },
  46616. }
  46617. target := &ret
  46618. if err := gensupport.DecodeResponse(target, res); err != nil {
  46619. return nil, err
  46620. }
  46621. return ret, nil
  46622. // {
  46623. // "description": "Retrieves a list of Operation resources contained within the specified project.",
  46624. // "httpMethod": "GET",
  46625. // "id": "compute.globalOperations.list",
  46626. // "parameterOrder": [
  46627. // "project"
  46628. // ],
  46629. // "parameters": {
  46630. // "filter": {
  46631. // "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).",
  46632. // "location": "query",
  46633. // "type": "string"
  46634. // },
  46635. // "maxResults": {
  46636. // "default": "500",
  46637. // "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)",
  46638. // "format": "uint32",
  46639. // "location": "query",
  46640. // "minimum": "0",
  46641. // "type": "integer"
  46642. // },
  46643. // "orderBy": {
  46644. // "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.",
  46645. // "location": "query",
  46646. // "type": "string"
  46647. // },
  46648. // "pageToken": {
  46649. // "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.",
  46650. // "location": "query",
  46651. // "type": "string"
  46652. // },
  46653. // "project": {
  46654. // "description": "Project ID for this request.",
  46655. // "location": "path",
  46656. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  46657. // "required": true,
  46658. // "type": "string"
  46659. // }
  46660. // },
  46661. // "path": "{project}/global/operations",
  46662. // "response": {
  46663. // "$ref": "OperationList"
  46664. // },
  46665. // "scopes": [
  46666. // "https://www.googleapis.com/auth/cloud-platform",
  46667. // "https://www.googleapis.com/auth/compute",
  46668. // "https://www.googleapis.com/auth/compute.readonly"
  46669. // ]
  46670. // }
  46671. }
  46672. // Pages invokes f for each page of results.
  46673. // A non-nil error returned from f will halt the iteration.
  46674. // The provided context supersedes any context provided to the Context method.
  46675. func (c *GlobalOperationsListCall) Pages(ctx context.Context, f func(*OperationList) error) error {
  46676. c.ctx_ = ctx
  46677. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  46678. for {
  46679. x, err := c.Do()
  46680. if err != nil {
  46681. return err
  46682. }
  46683. if err := f(x); err != nil {
  46684. return err
  46685. }
  46686. if x.NextPageToken == "" {
  46687. return nil
  46688. }
  46689. c.PageToken(x.NextPageToken)
  46690. }
  46691. }
  46692. // method id "compute.globalOperations.wait":
  46693. type GlobalOperationsWaitCall struct {
  46694. s *Service
  46695. project string
  46696. operation string
  46697. urlParams_ gensupport.URLParams
  46698. ctx_ context.Context
  46699. header_ http.Header
  46700. }
  46701. // Wait: Waits for the specified Operations resource until it is done or
  46702. // timeout, and retrieves the specified Operations resource. 1.
  46703. // Immediately returns when the operation is already done. 2. Waits for
  46704. // no more than the default deadline (2 minutes, subject to change) and
  46705. // then returns the current state of the operation, which may be DONE or
  46706. // still in progress. 3. Is best-effort: a. The server can wait less
  46707. // than the default deadline or zero seconds, in overload situations. b.
  46708. // There is no guarantee that the operation is actually done when
  46709. // returns. 4. User should be prepared to retry if the operation is not
  46710. // DONE.
  46711. func (r *GlobalOperationsService) Wait(project string, operation string) *GlobalOperationsWaitCall {
  46712. c := &GlobalOperationsWaitCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46713. c.project = project
  46714. c.operation = operation
  46715. return c
  46716. }
  46717. // Fields allows partial responses to be retrieved. See
  46718. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46719. // for more information.
  46720. func (c *GlobalOperationsWaitCall) Fields(s ...googleapi.Field) *GlobalOperationsWaitCall {
  46721. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46722. return c
  46723. }
  46724. // Context sets the context to be used in this call's Do method. Any
  46725. // pending HTTP request will be aborted if the provided context is
  46726. // canceled.
  46727. func (c *GlobalOperationsWaitCall) Context(ctx context.Context) *GlobalOperationsWaitCall {
  46728. c.ctx_ = ctx
  46729. return c
  46730. }
  46731. // Header returns an http.Header that can be modified by the caller to
  46732. // add HTTP headers to the request.
  46733. func (c *GlobalOperationsWaitCall) Header() http.Header {
  46734. if c.header_ == nil {
  46735. c.header_ = make(http.Header)
  46736. }
  46737. return c.header_
  46738. }
  46739. func (c *GlobalOperationsWaitCall) doRequest(alt string) (*http.Response, error) {
  46740. reqHeaders := make(http.Header)
  46741. for k, v := range c.header_ {
  46742. reqHeaders[k] = v
  46743. }
  46744. reqHeaders.Set("User-Agent", c.s.userAgent())
  46745. var body io.Reader = nil
  46746. c.urlParams_.Set("alt", alt)
  46747. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations/{operation}/wait")
  46748. urls += "?" + c.urlParams_.Encode()
  46749. req, _ := http.NewRequest("POST", urls, body)
  46750. req.Header = reqHeaders
  46751. googleapi.Expand(req.URL, map[string]string{
  46752. "project": c.project,
  46753. "operation": c.operation,
  46754. })
  46755. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46756. }
  46757. // Do executes the "compute.globalOperations.wait" call.
  46758. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  46759. // status code is an error. Response headers are in either
  46760. // *Operation.ServerResponse.Header or (if a response was returned at
  46761. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  46762. // to check whether the returned error was because
  46763. // http.StatusNotModified was returned.
  46764. func (c *GlobalOperationsWaitCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  46765. gensupport.SetOptions(c.urlParams_, opts...)
  46766. res, err := c.doRequest("json")
  46767. if res != nil && res.StatusCode == http.StatusNotModified {
  46768. if res.Body != nil {
  46769. res.Body.Close()
  46770. }
  46771. return nil, &googleapi.Error{
  46772. Code: res.StatusCode,
  46773. Header: res.Header,
  46774. }
  46775. }
  46776. if err != nil {
  46777. return nil, err
  46778. }
  46779. defer googleapi.CloseBody(res)
  46780. if err := googleapi.CheckResponse(res); err != nil {
  46781. return nil, err
  46782. }
  46783. ret := &Operation{
  46784. ServerResponse: googleapi.ServerResponse{
  46785. Header: res.Header,
  46786. HTTPStatusCode: res.StatusCode,
  46787. },
  46788. }
  46789. target := &ret
  46790. if err := gensupport.DecodeResponse(target, res); err != nil {
  46791. return nil, err
  46792. }
  46793. return ret, nil
  46794. // {
  46795. // "description": "Waits for the specified Operations resource until it is done or timeout, and retrieves the specified Operations resource. 1. Immediately returns when the operation is already done. 2. Waits for no more than the default deadline (2 minutes, subject to change) and then returns the current state of the operation, which may be DONE or still in progress. 3. Is best-effort: a. The server can wait less than the default deadline or zero seconds, in overload situations. b. There is no guarantee that the operation is actually done when returns. 4. User should be prepared to retry if the operation is not DONE.",
  46796. // "httpMethod": "POST",
  46797. // "id": "compute.globalOperations.wait",
  46798. // "parameterOrder": [
  46799. // "project",
  46800. // "operation"
  46801. // ],
  46802. // "parameters": {
  46803. // "operation": {
  46804. // "description": "Name of the Operations resource to return.",
  46805. // "location": "path",
  46806. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  46807. // "required": true,
  46808. // "type": "string"
  46809. // },
  46810. // "project": {
  46811. // "description": "Project ID for this request.",
  46812. // "location": "path",
  46813. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  46814. // "required": true,
  46815. // "type": "string"
  46816. // }
  46817. // },
  46818. // "path": "{project}/global/operations/{operation}/wait",
  46819. // "response": {
  46820. // "$ref": "Operation"
  46821. // },
  46822. // "scopes": [
  46823. // "https://www.googleapis.com/auth/cloud-platform",
  46824. // "https://www.googleapis.com/auth/compute",
  46825. // "https://www.googleapis.com/auth/compute.readonly"
  46826. // ]
  46827. // }
  46828. }
  46829. // method id "compute.healthChecks.aggregatedList":
  46830. type HealthChecksAggregatedListCall struct {
  46831. s *Service
  46832. project string
  46833. urlParams_ gensupport.URLParams
  46834. ifNoneMatch_ string
  46835. ctx_ context.Context
  46836. header_ http.Header
  46837. }
  46838. // AggregatedList: Retrieves the list of all HealthCheck resources,
  46839. // regional and global, available to the specified project.
  46840. func (r *HealthChecksService) AggregatedList(project string) *HealthChecksAggregatedListCall {
  46841. c := &HealthChecksAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46842. c.project = project
  46843. return c
  46844. }
  46845. // Filter sets the optional parameter "filter": A filter expression that
  46846. // filters resources listed in the response. The expression must specify
  46847. // the field name, a comparison operator, and the value that you want to
  46848. // use for filtering. The value must be a string, a number, or a
  46849. // boolean. The comparison operator must be either =, !=, >, or <.
  46850. //
  46851. // For example, if you are filtering Compute Engine instances, you can
  46852. // exclude instances named example-instance by specifying name !=
  46853. // example-instance.
  46854. //
  46855. // You can also filter nested fields. For example, you could specify
  46856. // scheduling.automaticRestart = false to include instances only if they
  46857. // are not scheduled for automatic restarts. You can use filtering on
  46858. // nested fields to filter based on resource labels.
  46859. //
  46860. // To filter on multiple expressions, provide each separate expression
  46861. // within parentheses. For example, (scheduling.automaticRestart = true)
  46862. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  46863. // AND expression. However, you can include AND and OR expressions
  46864. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  46865. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  46866. // true).
  46867. func (c *HealthChecksAggregatedListCall) Filter(filter string) *HealthChecksAggregatedListCall {
  46868. c.urlParams_.Set("filter", filter)
  46869. return c
  46870. }
  46871. // MaxResults sets the optional parameter "maxResults": The maximum
  46872. // number of results per page that should be returned. If the number of
  46873. // available results is larger than maxResults, Compute Engine returns a
  46874. // nextPageToken that can be used to get the next page of results in
  46875. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  46876. // (Default: 500)
  46877. func (c *HealthChecksAggregatedListCall) MaxResults(maxResults int64) *HealthChecksAggregatedListCall {
  46878. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  46879. return c
  46880. }
  46881. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  46882. // a certain order. By default, results are returned in alphanumerical
  46883. // order based on the resource name.
  46884. //
  46885. // You can also sort results in descending order based on the creation
  46886. // timestamp using orderBy="creationTimestamp desc". This sorts results
  46887. // based on the creationTimestamp field in reverse chronological order
  46888. // (newest result first). Use this to sort resources like operations so
  46889. // that the newest operation is returned first.
  46890. //
  46891. // Currently, only sorting by name or creationTimestamp desc is
  46892. // supported.
  46893. func (c *HealthChecksAggregatedListCall) OrderBy(orderBy string) *HealthChecksAggregatedListCall {
  46894. c.urlParams_.Set("orderBy", orderBy)
  46895. return c
  46896. }
  46897. // PageToken sets the optional parameter "pageToken": Specifies a page
  46898. // token to use. Set pageToken to the nextPageToken returned by a
  46899. // previous list request to get the next page of results.
  46900. func (c *HealthChecksAggregatedListCall) PageToken(pageToken string) *HealthChecksAggregatedListCall {
  46901. c.urlParams_.Set("pageToken", pageToken)
  46902. return c
  46903. }
  46904. // Fields allows partial responses to be retrieved. See
  46905. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46906. // for more information.
  46907. func (c *HealthChecksAggregatedListCall) Fields(s ...googleapi.Field) *HealthChecksAggregatedListCall {
  46908. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46909. return c
  46910. }
  46911. // IfNoneMatch sets the optional parameter which makes the operation
  46912. // fail if the object's ETag matches the given value. This is useful for
  46913. // getting updates only after the object has changed since the last
  46914. // request. Use googleapi.IsNotModified to check whether the response
  46915. // error from Do is the result of In-None-Match.
  46916. func (c *HealthChecksAggregatedListCall) IfNoneMatch(entityTag string) *HealthChecksAggregatedListCall {
  46917. c.ifNoneMatch_ = entityTag
  46918. return c
  46919. }
  46920. // Context sets the context to be used in this call's Do method. Any
  46921. // pending HTTP request will be aborted if the provided context is
  46922. // canceled.
  46923. func (c *HealthChecksAggregatedListCall) Context(ctx context.Context) *HealthChecksAggregatedListCall {
  46924. c.ctx_ = ctx
  46925. return c
  46926. }
  46927. // Header returns an http.Header that can be modified by the caller to
  46928. // add HTTP headers to the request.
  46929. func (c *HealthChecksAggregatedListCall) Header() http.Header {
  46930. if c.header_ == nil {
  46931. c.header_ = make(http.Header)
  46932. }
  46933. return c.header_
  46934. }
  46935. func (c *HealthChecksAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  46936. reqHeaders := make(http.Header)
  46937. for k, v := range c.header_ {
  46938. reqHeaders[k] = v
  46939. }
  46940. reqHeaders.Set("User-Agent", c.s.userAgent())
  46941. if c.ifNoneMatch_ != "" {
  46942. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  46943. }
  46944. var body io.Reader = nil
  46945. c.urlParams_.Set("alt", alt)
  46946. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/healthChecks")
  46947. urls += "?" + c.urlParams_.Encode()
  46948. req, _ := http.NewRequest("GET", urls, body)
  46949. req.Header = reqHeaders
  46950. googleapi.Expand(req.URL, map[string]string{
  46951. "project": c.project,
  46952. })
  46953. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46954. }
  46955. // Do executes the "compute.healthChecks.aggregatedList" call.
  46956. // Exactly one of *HealthChecksAggregatedList or error will be non-nil.
  46957. // Any non-2xx status code is an error. Response headers are in either
  46958. // *HealthChecksAggregatedList.ServerResponse.Header or (if a response
  46959. // was returned at all) in error.(*googleapi.Error).Header. Use
  46960. // googleapi.IsNotModified to check whether the returned error was
  46961. // because http.StatusNotModified was returned.
  46962. func (c *HealthChecksAggregatedListCall) Do(opts ...googleapi.CallOption) (*HealthChecksAggregatedList, error) {
  46963. gensupport.SetOptions(c.urlParams_, opts...)
  46964. res, err := c.doRequest("json")
  46965. if res != nil && res.StatusCode == http.StatusNotModified {
  46966. if res.Body != nil {
  46967. res.Body.Close()
  46968. }
  46969. return nil, &googleapi.Error{
  46970. Code: res.StatusCode,
  46971. Header: res.Header,
  46972. }
  46973. }
  46974. if err != nil {
  46975. return nil, err
  46976. }
  46977. defer googleapi.CloseBody(res)
  46978. if err := googleapi.CheckResponse(res); err != nil {
  46979. return nil, err
  46980. }
  46981. ret := &HealthChecksAggregatedList{
  46982. ServerResponse: googleapi.ServerResponse{
  46983. Header: res.Header,
  46984. HTTPStatusCode: res.StatusCode,
  46985. },
  46986. }
  46987. target := &ret
  46988. if err := gensupport.DecodeResponse(target, res); err != nil {
  46989. return nil, err
  46990. }
  46991. return ret, nil
  46992. // {
  46993. // "description": "Retrieves the list of all HealthCheck resources, regional and global, available to the specified project.",
  46994. // "httpMethod": "GET",
  46995. // "id": "compute.healthChecks.aggregatedList",
  46996. // "parameterOrder": [
  46997. // "project"
  46998. // ],
  46999. // "parameters": {
  47000. // "filter": {
  47001. // "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).",
  47002. // "location": "query",
  47003. // "type": "string"
  47004. // },
  47005. // "maxResults": {
  47006. // "default": "500",
  47007. // "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)",
  47008. // "format": "uint32",
  47009. // "location": "query",
  47010. // "minimum": "0",
  47011. // "type": "integer"
  47012. // },
  47013. // "orderBy": {
  47014. // "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.",
  47015. // "location": "query",
  47016. // "type": "string"
  47017. // },
  47018. // "pageToken": {
  47019. // "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.",
  47020. // "location": "query",
  47021. // "type": "string"
  47022. // },
  47023. // "project": {
  47024. // "description": "Name of the project scoping this request.",
  47025. // "location": "path",
  47026. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  47027. // "required": true,
  47028. // "type": "string"
  47029. // }
  47030. // },
  47031. // "path": "{project}/aggregated/healthChecks",
  47032. // "response": {
  47033. // "$ref": "HealthChecksAggregatedList"
  47034. // },
  47035. // "scopes": [
  47036. // "https://www.googleapis.com/auth/cloud-platform",
  47037. // "https://www.googleapis.com/auth/compute",
  47038. // "https://www.googleapis.com/auth/compute.readonly"
  47039. // ]
  47040. // }
  47041. }
  47042. // Pages invokes f for each page of results.
  47043. // A non-nil error returned from f will halt the iteration.
  47044. // The provided context supersedes any context provided to the Context method.
  47045. func (c *HealthChecksAggregatedListCall) Pages(ctx context.Context, f func(*HealthChecksAggregatedList) error) error {
  47046. c.ctx_ = ctx
  47047. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  47048. for {
  47049. x, err := c.Do()
  47050. if err != nil {
  47051. return err
  47052. }
  47053. if err := f(x); err != nil {
  47054. return err
  47055. }
  47056. if x.NextPageToken == "" {
  47057. return nil
  47058. }
  47059. c.PageToken(x.NextPageToken)
  47060. }
  47061. }
  47062. // method id "compute.healthChecks.delete":
  47063. type HealthChecksDeleteCall struct {
  47064. s *Service
  47065. project string
  47066. healthCheck string
  47067. urlParams_ gensupport.URLParams
  47068. ctx_ context.Context
  47069. header_ http.Header
  47070. }
  47071. // Delete: Deletes the specified HealthCheck resource.
  47072. func (r *HealthChecksService) Delete(project string, healthCheck string) *HealthChecksDeleteCall {
  47073. c := &HealthChecksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  47074. c.project = project
  47075. c.healthCheck = healthCheck
  47076. return c
  47077. }
  47078. // RequestId sets the optional parameter "requestId": An optional
  47079. // request ID to identify requests. Specify a unique request ID so that
  47080. // if you must retry your request, the server will know to ignore the
  47081. // request if it has already been completed.
  47082. //
  47083. // For example, consider a situation where you make an initial request
  47084. // and the request times out. If you make the request again with the
  47085. // same request ID, the server can check if original operation with the
  47086. // same request ID was received, and if so, will ignore the second
  47087. // request. This prevents clients from accidentally creating duplicate
  47088. // commitments.
  47089. //
  47090. // The request ID must be a valid UUID with the exception that zero UUID
  47091. // is not supported (00000000-0000-0000-0000-000000000000).
  47092. func (c *HealthChecksDeleteCall) RequestId(requestId string) *HealthChecksDeleteCall {
  47093. c.urlParams_.Set("requestId", requestId)
  47094. return c
  47095. }
  47096. // Fields allows partial responses to be retrieved. See
  47097. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  47098. // for more information.
  47099. func (c *HealthChecksDeleteCall) Fields(s ...googleapi.Field) *HealthChecksDeleteCall {
  47100. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  47101. return c
  47102. }
  47103. // Context sets the context to be used in this call's Do method. Any
  47104. // pending HTTP request will be aborted if the provided context is
  47105. // canceled.
  47106. func (c *HealthChecksDeleteCall) Context(ctx context.Context) *HealthChecksDeleteCall {
  47107. c.ctx_ = ctx
  47108. return c
  47109. }
  47110. // Header returns an http.Header that can be modified by the caller to
  47111. // add HTTP headers to the request.
  47112. func (c *HealthChecksDeleteCall) Header() http.Header {
  47113. if c.header_ == nil {
  47114. c.header_ = make(http.Header)
  47115. }
  47116. return c.header_
  47117. }
  47118. func (c *HealthChecksDeleteCall) doRequest(alt string) (*http.Response, error) {
  47119. reqHeaders := make(http.Header)
  47120. for k, v := range c.header_ {
  47121. reqHeaders[k] = v
  47122. }
  47123. reqHeaders.Set("User-Agent", c.s.userAgent())
  47124. var body io.Reader = nil
  47125. c.urlParams_.Set("alt", alt)
  47126. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks/{healthCheck}")
  47127. urls += "?" + c.urlParams_.Encode()
  47128. req, _ := http.NewRequest("DELETE", urls, body)
  47129. req.Header = reqHeaders
  47130. googleapi.Expand(req.URL, map[string]string{
  47131. "project": c.project,
  47132. "healthCheck": c.healthCheck,
  47133. })
  47134. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  47135. }
  47136. // Do executes the "compute.healthChecks.delete" call.
  47137. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  47138. // status code is an error. Response headers are in either
  47139. // *Operation.ServerResponse.Header or (if a response was returned at
  47140. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  47141. // to check whether the returned error was because
  47142. // http.StatusNotModified was returned.
  47143. func (c *HealthChecksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  47144. gensupport.SetOptions(c.urlParams_, opts...)
  47145. res, err := c.doRequest("json")
  47146. if res != nil && res.StatusCode == http.StatusNotModified {
  47147. if res.Body != nil {
  47148. res.Body.Close()
  47149. }
  47150. return nil, &googleapi.Error{
  47151. Code: res.StatusCode,
  47152. Header: res.Header,
  47153. }
  47154. }
  47155. if err != nil {
  47156. return nil, err
  47157. }
  47158. defer googleapi.CloseBody(res)
  47159. if err := googleapi.CheckResponse(res); err != nil {
  47160. return nil, err
  47161. }
  47162. ret := &Operation{
  47163. ServerResponse: googleapi.ServerResponse{
  47164. Header: res.Header,
  47165. HTTPStatusCode: res.StatusCode,
  47166. },
  47167. }
  47168. target := &ret
  47169. if err := gensupport.DecodeResponse(target, res); err != nil {
  47170. return nil, err
  47171. }
  47172. return ret, nil
  47173. // {
  47174. // "description": "Deletes the specified HealthCheck resource.",
  47175. // "httpMethod": "DELETE",
  47176. // "id": "compute.healthChecks.delete",
  47177. // "parameterOrder": [
  47178. // "project",
  47179. // "healthCheck"
  47180. // ],
  47181. // "parameters": {
  47182. // "healthCheck": {
  47183. // "description": "Name of the HealthCheck resource to delete.",
  47184. // "location": "path",
  47185. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  47186. // "required": true,
  47187. // "type": "string"
  47188. // },
  47189. // "project": {
  47190. // "description": "Project ID for this request.",
  47191. // "location": "path",
  47192. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  47193. // "required": true,
  47194. // "type": "string"
  47195. // },
  47196. // "requestId": {
  47197. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  47198. // "location": "query",
  47199. // "type": "string"
  47200. // }
  47201. // },
  47202. // "path": "{project}/global/healthChecks/{healthCheck}",
  47203. // "response": {
  47204. // "$ref": "Operation"
  47205. // },
  47206. // "scopes": [
  47207. // "https://www.googleapis.com/auth/cloud-platform",
  47208. // "https://www.googleapis.com/auth/compute"
  47209. // ]
  47210. // }
  47211. }
  47212. // method id "compute.healthChecks.get":
  47213. type HealthChecksGetCall struct {
  47214. s *Service
  47215. project string
  47216. healthCheck string
  47217. urlParams_ gensupport.URLParams
  47218. ifNoneMatch_ string
  47219. ctx_ context.Context
  47220. header_ http.Header
  47221. }
  47222. // Get: Returns the specified HealthCheck resource. Gets a list of
  47223. // available health checks by making a list() request.
  47224. func (r *HealthChecksService) Get(project string, healthCheck string) *HealthChecksGetCall {
  47225. c := &HealthChecksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  47226. c.project = project
  47227. c.healthCheck = healthCheck
  47228. return c
  47229. }
  47230. // Fields allows partial responses to be retrieved. See
  47231. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  47232. // for more information.
  47233. func (c *HealthChecksGetCall) Fields(s ...googleapi.Field) *HealthChecksGetCall {
  47234. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  47235. return c
  47236. }
  47237. // IfNoneMatch sets the optional parameter which makes the operation
  47238. // fail if the object's ETag matches the given value. This is useful for
  47239. // getting updates only after the object has changed since the last
  47240. // request. Use googleapi.IsNotModified to check whether the response
  47241. // error from Do is the result of In-None-Match.
  47242. func (c *HealthChecksGetCall) IfNoneMatch(entityTag string) *HealthChecksGetCall {
  47243. c.ifNoneMatch_ = entityTag
  47244. return c
  47245. }
  47246. // Context sets the context to be used in this call's Do method. Any
  47247. // pending HTTP request will be aborted if the provided context is
  47248. // canceled.
  47249. func (c *HealthChecksGetCall) Context(ctx context.Context) *HealthChecksGetCall {
  47250. c.ctx_ = ctx
  47251. return c
  47252. }
  47253. // Header returns an http.Header that can be modified by the caller to
  47254. // add HTTP headers to the request.
  47255. func (c *HealthChecksGetCall) Header() http.Header {
  47256. if c.header_ == nil {
  47257. c.header_ = make(http.Header)
  47258. }
  47259. return c.header_
  47260. }
  47261. func (c *HealthChecksGetCall) doRequest(alt string) (*http.Response, error) {
  47262. reqHeaders := make(http.Header)
  47263. for k, v := range c.header_ {
  47264. reqHeaders[k] = v
  47265. }
  47266. reqHeaders.Set("User-Agent", c.s.userAgent())
  47267. if c.ifNoneMatch_ != "" {
  47268. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  47269. }
  47270. var body io.Reader = nil
  47271. c.urlParams_.Set("alt", alt)
  47272. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks/{healthCheck}")
  47273. urls += "?" + c.urlParams_.Encode()
  47274. req, _ := http.NewRequest("GET", urls, body)
  47275. req.Header = reqHeaders
  47276. googleapi.Expand(req.URL, map[string]string{
  47277. "project": c.project,
  47278. "healthCheck": c.healthCheck,
  47279. })
  47280. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  47281. }
  47282. // Do executes the "compute.healthChecks.get" call.
  47283. // Exactly one of *HealthCheck or error will be non-nil. Any non-2xx
  47284. // status code is an error. Response headers are in either
  47285. // *HealthCheck.ServerResponse.Header or (if a response was returned at
  47286. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  47287. // to check whether the returned error was because
  47288. // http.StatusNotModified was returned.
  47289. func (c *HealthChecksGetCall) Do(opts ...googleapi.CallOption) (*HealthCheck, error) {
  47290. gensupport.SetOptions(c.urlParams_, opts...)
  47291. res, err := c.doRequest("json")
  47292. if res != nil && res.StatusCode == http.StatusNotModified {
  47293. if res.Body != nil {
  47294. res.Body.Close()
  47295. }
  47296. return nil, &googleapi.Error{
  47297. Code: res.StatusCode,
  47298. Header: res.Header,
  47299. }
  47300. }
  47301. if err != nil {
  47302. return nil, err
  47303. }
  47304. defer googleapi.CloseBody(res)
  47305. if err := googleapi.CheckResponse(res); err != nil {
  47306. return nil, err
  47307. }
  47308. ret := &HealthCheck{
  47309. ServerResponse: googleapi.ServerResponse{
  47310. Header: res.Header,
  47311. HTTPStatusCode: res.StatusCode,
  47312. },
  47313. }
  47314. target := &ret
  47315. if err := gensupport.DecodeResponse(target, res); err != nil {
  47316. return nil, err
  47317. }
  47318. return ret, nil
  47319. // {
  47320. // "description": "Returns the specified HealthCheck resource. Gets a list of available health checks by making a list() request.",
  47321. // "httpMethod": "GET",
  47322. // "id": "compute.healthChecks.get",
  47323. // "parameterOrder": [
  47324. // "project",
  47325. // "healthCheck"
  47326. // ],
  47327. // "parameters": {
  47328. // "healthCheck": {
  47329. // "description": "Name of the HealthCheck resource to return.",
  47330. // "location": "path",
  47331. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  47332. // "required": true,
  47333. // "type": "string"
  47334. // },
  47335. // "project": {
  47336. // "description": "Project ID for this request.",
  47337. // "location": "path",
  47338. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  47339. // "required": true,
  47340. // "type": "string"
  47341. // }
  47342. // },
  47343. // "path": "{project}/global/healthChecks/{healthCheck}",
  47344. // "response": {
  47345. // "$ref": "HealthCheck"
  47346. // },
  47347. // "scopes": [
  47348. // "https://www.googleapis.com/auth/cloud-platform",
  47349. // "https://www.googleapis.com/auth/compute",
  47350. // "https://www.googleapis.com/auth/compute.readonly"
  47351. // ]
  47352. // }
  47353. }
  47354. // method id "compute.healthChecks.insert":
  47355. type HealthChecksInsertCall struct {
  47356. s *Service
  47357. project string
  47358. healthcheck *HealthCheck
  47359. urlParams_ gensupport.URLParams
  47360. ctx_ context.Context
  47361. header_ http.Header
  47362. }
  47363. // Insert: Creates a HealthCheck resource in the specified project using
  47364. // the data included in the request.
  47365. func (r *HealthChecksService) Insert(project string, healthcheck *HealthCheck) *HealthChecksInsertCall {
  47366. c := &HealthChecksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  47367. c.project = project
  47368. c.healthcheck = healthcheck
  47369. return c
  47370. }
  47371. // RequestId sets the optional parameter "requestId": An optional
  47372. // request ID to identify requests. Specify a unique request ID so that
  47373. // if you must retry your request, the server will know to ignore the
  47374. // request if it has already been completed.
  47375. //
  47376. // For example, consider a situation where you make an initial request
  47377. // and the request times out. If you make the request again with the
  47378. // same request ID, the server can check if original operation with the
  47379. // same request ID was received, and if so, will ignore the second
  47380. // request. This prevents clients from accidentally creating duplicate
  47381. // commitments.
  47382. //
  47383. // The request ID must be a valid UUID with the exception that zero UUID
  47384. // is not supported (00000000-0000-0000-0000-000000000000).
  47385. func (c *HealthChecksInsertCall) RequestId(requestId string) *HealthChecksInsertCall {
  47386. c.urlParams_.Set("requestId", requestId)
  47387. return c
  47388. }
  47389. // Fields allows partial responses to be retrieved. See
  47390. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  47391. // for more information.
  47392. func (c *HealthChecksInsertCall) Fields(s ...googleapi.Field) *HealthChecksInsertCall {
  47393. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  47394. return c
  47395. }
  47396. // Context sets the context to be used in this call's Do method. Any
  47397. // pending HTTP request will be aborted if the provided context is
  47398. // canceled.
  47399. func (c *HealthChecksInsertCall) Context(ctx context.Context) *HealthChecksInsertCall {
  47400. c.ctx_ = ctx
  47401. return c
  47402. }
  47403. // Header returns an http.Header that can be modified by the caller to
  47404. // add HTTP headers to the request.
  47405. func (c *HealthChecksInsertCall) Header() http.Header {
  47406. if c.header_ == nil {
  47407. c.header_ = make(http.Header)
  47408. }
  47409. return c.header_
  47410. }
  47411. func (c *HealthChecksInsertCall) doRequest(alt string) (*http.Response, error) {
  47412. reqHeaders := make(http.Header)
  47413. for k, v := range c.header_ {
  47414. reqHeaders[k] = v
  47415. }
  47416. reqHeaders.Set("User-Agent", c.s.userAgent())
  47417. var body io.Reader = nil
  47418. body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck)
  47419. if err != nil {
  47420. return nil, err
  47421. }
  47422. reqHeaders.Set("Content-Type", "application/json")
  47423. c.urlParams_.Set("alt", alt)
  47424. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks")
  47425. urls += "?" + c.urlParams_.Encode()
  47426. req, _ := http.NewRequest("POST", urls, body)
  47427. req.Header = reqHeaders
  47428. googleapi.Expand(req.URL, map[string]string{
  47429. "project": c.project,
  47430. })
  47431. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  47432. }
  47433. // Do executes the "compute.healthChecks.insert" call.
  47434. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  47435. // status code is an error. Response headers are in either
  47436. // *Operation.ServerResponse.Header or (if a response was returned at
  47437. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  47438. // to check whether the returned error was because
  47439. // http.StatusNotModified was returned.
  47440. func (c *HealthChecksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  47441. gensupport.SetOptions(c.urlParams_, opts...)
  47442. res, err := c.doRequest("json")
  47443. if res != nil && res.StatusCode == http.StatusNotModified {
  47444. if res.Body != nil {
  47445. res.Body.Close()
  47446. }
  47447. return nil, &googleapi.Error{
  47448. Code: res.StatusCode,
  47449. Header: res.Header,
  47450. }
  47451. }
  47452. if err != nil {
  47453. return nil, err
  47454. }
  47455. defer googleapi.CloseBody(res)
  47456. if err := googleapi.CheckResponse(res); err != nil {
  47457. return nil, err
  47458. }
  47459. ret := &Operation{
  47460. ServerResponse: googleapi.ServerResponse{
  47461. Header: res.Header,
  47462. HTTPStatusCode: res.StatusCode,
  47463. },
  47464. }
  47465. target := &ret
  47466. if err := gensupport.DecodeResponse(target, res); err != nil {
  47467. return nil, err
  47468. }
  47469. return ret, nil
  47470. // {
  47471. // "description": "Creates a HealthCheck resource in the specified project using the data included in the request.",
  47472. // "httpMethod": "POST",
  47473. // "id": "compute.healthChecks.insert",
  47474. // "parameterOrder": [
  47475. // "project"
  47476. // ],
  47477. // "parameters": {
  47478. // "project": {
  47479. // "description": "Project ID for this request.",
  47480. // "location": "path",
  47481. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  47482. // "required": true,
  47483. // "type": "string"
  47484. // },
  47485. // "requestId": {
  47486. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  47487. // "location": "query",
  47488. // "type": "string"
  47489. // }
  47490. // },
  47491. // "path": "{project}/global/healthChecks",
  47492. // "request": {
  47493. // "$ref": "HealthCheck"
  47494. // },
  47495. // "response": {
  47496. // "$ref": "Operation"
  47497. // },
  47498. // "scopes": [
  47499. // "https://www.googleapis.com/auth/cloud-platform",
  47500. // "https://www.googleapis.com/auth/compute"
  47501. // ]
  47502. // }
  47503. }
  47504. // method id "compute.healthChecks.list":
  47505. type HealthChecksListCall struct {
  47506. s *Service
  47507. project string
  47508. urlParams_ gensupport.URLParams
  47509. ifNoneMatch_ string
  47510. ctx_ context.Context
  47511. header_ http.Header
  47512. }
  47513. // List: Retrieves the list of HealthCheck resources available to the
  47514. // specified project.
  47515. func (r *HealthChecksService) List(project string) *HealthChecksListCall {
  47516. c := &HealthChecksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  47517. c.project = project
  47518. return c
  47519. }
  47520. // Filter sets the optional parameter "filter": A filter expression that
  47521. // filters resources listed in the response. The expression must specify
  47522. // the field name, a comparison operator, and the value that you want to
  47523. // use for filtering. The value must be a string, a number, or a
  47524. // boolean. The comparison operator must be either =, !=, >, or <.
  47525. //
  47526. // For example, if you are filtering Compute Engine instances, you can
  47527. // exclude instances named example-instance by specifying name !=
  47528. // example-instance.
  47529. //
  47530. // You can also filter nested fields. For example, you could specify
  47531. // scheduling.automaticRestart = false to include instances only if they
  47532. // are not scheduled for automatic restarts. You can use filtering on
  47533. // nested fields to filter based on resource labels.
  47534. //
  47535. // To filter on multiple expressions, provide each separate expression
  47536. // within parentheses. For example, (scheduling.automaticRestart = true)
  47537. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  47538. // AND expression. However, you can include AND and OR expressions
  47539. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  47540. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  47541. // true).
  47542. func (c *HealthChecksListCall) Filter(filter string) *HealthChecksListCall {
  47543. c.urlParams_.Set("filter", filter)
  47544. return c
  47545. }
  47546. // MaxResults sets the optional parameter "maxResults": The maximum
  47547. // number of results per page that should be returned. If the number of
  47548. // available results is larger than maxResults, Compute Engine returns a
  47549. // nextPageToken that can be used to get the next page of results in
  47550. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  47551. // (Default: 500)
  47552. func (c *HealthChecksListCall) MaxResults(maxResults int64) *HealthChecksListCall {
  47553. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  47554. return c
  47555. }
  47556. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  47557. // a certain order. By default, results are returned in alphanumerical
  47558. // order based on the resource name.
  47559. //
  47560. // You can also sort results in descending order based on the creation
  47561. // timestamp using orderBy="creationTimestamp desc". This sorts results
  47562. // based on the creationTimestamp field in reverse chronological order
  47563. // (newest result first). Use this to sort resources like operations so
  47564. // that the newest operation is returned first.
  47565. //
  47566. // Currently, only sorting by name or creationTimestamp desc is
  47567. // supported.
  47568. func (c *HealthChecksListCall) OrderBy(orderBy string) *HealthChecksListCall {
  47569. c.urlParams_.Set("orderBy", orderBy)
  47570. return c
  47571. }
  47572. // PageToken sets the optional parameter "pageToken": Specifies a page
  47573. // token to use. Set pageToken to the nextPageToken returned by a
  47574. // previous list request to get the next page of results.
  47575. func (c *HealthChecksListCall) PageToken(pageToken string) *HealthChecksListCall {
  47576. c.urlParams_.Set("pageToken", pageToken)
  47577. return c
  47578. }
  47579. // Fields allows partial responses to be retrieved. See
  47580. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  47581. // for more information.
  47582. func (c *HealthChecksListCall) Fields(s ...googleapi.Field) *HealthChecksListCall {
  47583. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  47584. return c
  47585. }
  47586. // IfNoneMatch sets the optional parameter which makes the operation
  47587. // fail if the object's ETag matches the given value. This is useful for
  47588. // getting updates only after the object has changed since the last
  47589. // request. Use googleapi.IsNotModified to check whether the response
  47590. // error from Do is the result of In-None-Match.
  47591. func (c *HealthChecksListCall) IfNoneMatch(entityTag string) *HealthChecksListCall {
  47592. c.ifNoneMatch_ = entityTag
  47593. return c
  47594. }
  47595. // Context sets the context to be used in this call's Do method. Any
  47596. // pending HTTP request will be aborted if the provided context is
  47597. // canceled.
  47598. func (c *HealthChecksListCall) Context(ctx context.Context) *HealthChecksListCall {
  47599. c.ctx_ = ctx
  47600. return c
  47601. }
  47602. // Header returns an http.Header that can be modified by the caller to
  47603. // add HTTP headers to the request.
  47604. func (c *HealthChecksListCall) Header() http.Header {
  47605. if c.header_ == nil {
  47606. c.header_ = make(http.Header)
  47607. }
  47608. return c.header_
  47609. }
  47610. func (c *HealthChecksListCall) doRequest(alt string) (*http.Response, error) {
  47611. reqHeaders := make(http.Header)
  47612. for k, v := range c.header_ {
  47613. reqHeaders[k] = v
  47614. }
  47615. reqHeaders.Set("User-Agent", c.s.userAgent())
  47616. if c.ifNoneMatch_ != "" {
  47617. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  47618. }
  47619. var body io.Reader = nil
  47620. c.urlParams_.Set("alt", alt)
  47621. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks")
  47622. urls += "?" + c.urlParams_.Encode()
  47623. req, _ := http.NewRequest("GET", urls, body)
  47624. req.Header = reqHeaders
  47625. googleapi.Expand(req.URL, map[string]string{
  47626. "project": c.project,
  47627. })
  47628. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  47629. }
  47630. // Do executes the "compute.healthChecks.list" call.
  47631. // Exactly one of *HealthCheckList or error will be non-nil. Any non-2xx
  47632. // status code is an error. Response headers are in either
  47633. // *HealthCheckList.ServerResponse.Header or (if a response was returned
  47634. // at all) in error.(*googleapi.Error).Header. Use
  47635. // googleapi.IsNotModified to check whether the returned error was
  47636. // because http.StatusNotModified was returned.
  47637. func (c *HealthChecksListCall) Do(opts ...googleapi.CallOption) (*HealthCheckList, error) {
  47638. gensupport.SetOptions(c.urlParams_, opts...)
  47639. res, err := c.doRequest("json")
  47640. if res != nil && res.StatusCode == http.StatusNotModified {
  47641. if res.Body != nil {
  47642. res.Body.Close()
  47643. }
  47644. return nil, &googleapi.Error{
  47645. Code: res.StatusCode,
  47646. Header: res.Header,
  47647. }
  47648. }
  47649. if err != nil {
  47650. return nil, err
  47651. }
  47652. defer googleapi.CloseBody(res)
  47653. if err := googleapi.CheckResponse(res); err != nil {
  47654. return nil, err
  47655. }
  47656. ret := &HealthCheckList{
  47657. ServerResponse: googleapi.ServerResponse{
  47658. Header: res.Header,
  47659. HTTPStatusCode: res.StatusCode,
  47660. },
  47661. }
  47662. target := &ret
  47663. if err := gensupport.DecodeResponse(target, res); err != nil {
  47664. return nil, err
  47665. }
  47666. return ret, nil
  47667. // {
  47668. // "description": "Retrieves the list of HealthCheck resources available to the specified project.",
  47669. // "httpMethod": "GET",
  47670. // "id": "compute.healthChecks.list",
  47671. // "parameterOrder": [
  47672. // "project"
  47673. // ],
  47674. // "parameters": {
  47675. // "filter": {
  47676. // "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).",
  47677. // "location": "query",
  47678. // "type": "string"
  47679. // },
  47680. // "maxResults": {
  47681. // "default": "500",
  47682. // "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)",
  47683. // "format": "uint32",
  47684. // "location": "query",
  47685. // "minimum": "0",
  47686. // "type": "integer"
  47687. // },
  47688. // "orderBy": {
  47689. // "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.",
  47690. // "location": "query",
  47691. // "type": "string"
  47692. // },
  47693. // "pageToken": {
  47694. // "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.",
  47695. // "location": "query",
  47696. // "type": "string"
  47697. // },
  47698. // "project": {
  47699. // "description": "Project ID for this request.",
  47700. // "location": "path",
  47701. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  47702. // "required": true,
  47703. // "type": "string"
  47704. // }
  47705. // },
  47706. // "path": "{project}/global/healthChecks",
  47707. // "response": {
  47708. // "$ref": "HealthCheckList"
  47709. // },
  47710. // "scopes": [
  47711. // "https://www.googleapis.com/auth/cloud-platform",
  47712. // "https://www.googleapis.com/auth/compute",
  47713. // "https://www.googleapis.com/auth/compute.readonly"
  47714. // ]
  47715. // }
  47716. }
  47717. // Pages invokes f for each page of results.
  47718. // A non-nil error returned from f will halt the iteration.
  47719. // The provided context supersedes any context provided to the Context method.
  47720. func (c *HealthChecksListCall) Pages(ctx context.Context, f func(*HealthCheckList) error) error {
  47721. c.ctx_ = ctx
  47722. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  47723. for {
  47724. x, err := c.Do()
  47725. if err != nil {
  47726. return err
  47727. }
  47728. if err := f(x); err != nil {
  47729. return err
  47730. }
  47731. if x.NextPageToken == "" {
  47732. return nil
  47733. }
  47734. c.PageToken(x.NextPageToken)
  47735. }
  47736. }
  47737. // method id "compute.healthChecks.patch":
  47738. type HealthChecksPatchCall struct {
  47739. s *Service
  47740. project string
  47741. healthCheck string
  47742. healthcheck *HealthCheck
  47743. urlParams_ gensupport.URLParams
  47744. ctx_ context.Context
  47745. header_ http.Header
  47746. }
  47747. // Patch: Updates a HealthCheck resource in the specified project using
  47748. // the data included in the request. This method supports PATCH
  47749. // semantics and uses the JSON merge patch format and processing rules.
  47750. func (r *HealthChecksService) Patch(project string, healthCheck string, healthcheck *HealthCheck) *HealthChecksPatchCall {
  47751. c := &HealthChecksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  47752. c.project = project
  47753. c.healthCheck = healthCheck
  47754. c.healthcheck = healthcheck
  47755. return c
  47756. }
  47757. // RequestId sets the optional parameter "requestId": An optional
  47758. // request ID to identify requests. Specify a unique request ID so that
  47759. // if you must retry your request, the server will know to ignore the
  47760. // request if it has already been completed.
  47761. //
  47762. // For example, consider a situation where you make an initial request
  47763. // and the request times out. If you make the request again with the
  47764. // same request ID, the server can check if original operation with the
  47765. // same request ID was received, and if so, will ignore the second
  47766. // request. This prevents clients from accidentally creating duplicate
  47767. // commitments.
  47768. //
  47769. // The request ID must be a valid UUID with the exception that zero UUID
  47770. // is not supported (00000000-0000-0000-0000-000000000000).
  47771. func (c *HealthChecksPatchCall) RequestId(requestId string) *HealthChecksPatchCall {
  47772. c.urlParams_.Set("requestId", requestId)
  47773. return c
  47774. }
  47775. // Fields allows partial responses to be retrieved. See
  47776. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  47777. // for more information.
  47778. func (c *HealthChecksPatchCall) Fields(s ...googleapi.Field) *HealthChecksPatchCall {
  47779. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  47780. return c
  47781. }
  47782. // Context sets the context to be used in this call's Do method. Any
  47783. // pending HTTP request will be aborted if the provided context is
  47784. // canceled.
  47785. func (c *HealthChecksPatchCall) Context(ctx context.Context) *HealthChecksPatchCall {
  47786. c.ctx_ = ctx
  47787. return c
  47788. }
  47789. // Header returns an http.Header that can be modified by the caller to
  47790. // add HTTP headers to the request.
  47791. func (c *HealthChecksPatchCall) Header() http.Header {
  47792. if c.header_ == nil {
  47793. c.header_ = make(http.Header)
  47794. }
  47795. return c.header_
  47796. }
  47797. func (c *HealthChecksPatchCall) doRequest(alt string) (*http.Response, error) {
  47798. reqHeaders := make(http.Header)
  47799. for k, v := range c.header_ {
  47800. reqHeaders[k] = v
  47801. }
  47802. reqHeaders.Set("User-Agent", c.s.userAgent())
  47803. var body io.Reader = nil
  47804. body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck)
  47805. if err != nil {
  47806. return nil, err
  47807. }
  47808. reqHeaders.Set("Content-Type", "application/json")
  47809. c.urlParams_.Set("alt", alt)
  47810. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks/{healthCheck}")
  47811. urls += "?" + c.urlParams_.Encode()
  47812. req, _ := http.NewRequest("PATCH", urls, body)
  47813. req.Header = reqHeaders
  47814. googleapi.Expand(req.URL, map[string]string{
  47815. "project": c.project,
  47816. "healthCheck": c.healthCheck,
  47817. })
  47818. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  47819. }
  47820. // Do executes the "compute.healthChecks.patch" call.
  47821. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  47822. // status code is an error. Response headers are in either
  47823. // *Operation.ServerResponse.Header or (if a response was returned at
  47824. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  47825. // to check whether the returned error was because
  47826. // http.StatusNotModified was returned.
  47827. func (c *HealthChecksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  47828. gensupport.SetOptions(c.urlParams_, opts...)
  47829. res, err := c.doRequest("json")
  47830. if res != nil && res.StatusCode == http.StatusNotModified {
  47831. if res.Body != nil {
  47832. res.Body.Close()
  47833. }
  47834. return nil, &googleapi.Error{
  47835. Code: res.StatusCode,
  47836. Header: res.Header,
  47837. }
  47838. }
  47839. if err != nil {
  47840. return nil, err
  47841. }
  47842. defer googleapi.CloseBody(res)
  47843. if err := googleapi.CheckResponse(res); err != nil {
  47844. return nil, err
  47845. }
  47846. ret := &Operation{
  47847. ServerResponse: googleapi.ServerResponse{
  47848. Header: res.Header,
  47849. HTTPStatusCode: res.StatusCode,
  47850. },
  47851. }
  47852. target := &ret
  47853. if err := gensupport.DecodeResponse(target, res); err != nil {
  47854. return nil, err
  47855. }
  47856. return ret, nil
  47857. // {
  47858. // "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.",
  47859. // "httpMethod": "PATCH",
  47860. // "id": "compute.healthChecks.patch",
  47861. // "parameterOrder": [
  47862. // "project",
  47863. // "healthCheck"
  47864. // ],
  47865. // "parameters": {
  47866. // "healthCheck": {
  47867. // "description": "Name of the HealthCheck resource to patch.",
  47868. // "location": "path",
  47869. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  47870. // "required": true,
  47871. // "type": "string"
  47872. // },
  47873. // "project": {
  47874. // "description": "Project ID for this request.",
  47875. // "location": "path",
  47876. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  47877. // "required": true,
  47878. // "type": "string"
  47879. // },
  47880. // "requestId": {
  47881. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  47882. // "location": "query",
  47883. // "type": "string"
  47884. // }
  47885. // },
  47886. // "path": "{project}/global/healthChecks/{healthCheck}",
  47887. // "request": {
  47888. // "$ref": "HealthCheck"
  47889. // },
  47890. // "response": {
  47891. // "$ref": "Operation"
  47892. // },
  47893. // "scopes": [
  47894. // "https://www.googleapis.com/auth/cloud-platform",
  47895. // "https://www.googleapis.com/auth/compute"
  47896. // ]
  47897. // }
  47898. }
  47899. // method id "compute.healthChecks.testIamPermissions":
  47900. type HealthChecksTestIamPermissionsCall struct {
  47901. s *Service
  47902. project string
  47903. resource string
  47904. testpermissionsrequest *TestPermissionsRequest
  47905. urlParams_ gensupport.URLParams
  47906. ctx_ context.Context
  47907. header_ http.Header
  47908. }
  47909. // TestIamPermissions: Returns permissions that a caller has on the
  47910. // specified resource.
  47911. func (r *HealthChecksService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *HealthChecksTestIamPermissionsCall {
  47912. c := &HealthChecksTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  47913. c.project = project
  47914. c.resource = resource
  47915. c.testpermissionsrequest = testpermissionsrequest
  47916. return c
  47917. }
  47918. // Fields allows partial responses to be retrieved. See
  47919. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  47920. // for more information.
  47921. func (c *HealthChecksTestIamPermissionsCall) Fields(s ...googleapi.Field) *HealthChecksTestIamPermissionsCall {
  47922. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  47923. return c
  47924. }
  47925. // Context sets the context to be used in this call's Do method. Any
  47926. // pending HTTP request will be aborted if the provided context is
  47927. // canceled.
  47928. func (c *HealthChecksTestIamPermissionsCall) Context(ctx context.Context) *HealthChecksTestIamPermissionsCall {
  47929. c.ctx_ = ctx
  47930. return c
  47931. }
  47932. // Header returns an http.Header that can be modified by the caller to
  47933. // add HTTP headers to the request.
  47934. func (c *HealthChecksTestIamPermissionsCall) Header() http.Header {
  47935. if c.header_ == nil {
  47936. c.header_ = make(http.Header)
  47937. }
  47938. return c.header_
  47939. }
  47940. func (c *HealthChecksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  47941. reqHeaders := make(http.Header)
  47942. for k, v := range c.header_ {
  47943. reqHeaders[k] = v
  47944. }
  47945. reqHeaders.Set("User-Agent", c.s.userAgent())
  47946. var body io.Reader = nil
  47947. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  47948. if err != nil {
  47949. return nil, err
  47950. }
  47951. reqHeaders.Set("Content-Type", "application/json")
  47952. c.urlParams_.Set("alt", alt)
  47953. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks/{resource}/testIamPermissions")
  47954. urls += "?" + c.urlParams_.Encode()
  47955. req, _ := http.NewRequest("POST", urls, body)
  47956. req.Header = reqHeaders
  47957. googleapi.Expand(req.URL, map[string]string{
  47958. "project": c.project,
  47959. "resource": c.resource,
  47960. })
  47961. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  47962. }
  47963. // Do executes the "compute.healthChecks.testIamPermissions" call.
  47964. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  47965. // non-2xx status code is an error. Response headers are in either
  47966. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  47967. // returned at all) in error.(*googleapi.Error).Header. Use
  47968. // googleapi.IsNotModified to check whether the returned error was
  47969. // because http.StatusNotModified was returned.
  47970. func (c *HealthChecksTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  47971. gensupport.SetOptions(c.urlParams_, opts...)
  47972. res, err := c.doRequest("json")
  47973. if res != nil && res.StatusCode == http.StatusNotModified {
  47974. if res.Body != nil {
  47975. res.Body.Close()
  47976. }
  47977. return nil, &googleapi.Error{
  47978. Code: res.StatusCode,
  47979. Header: res.Header,
  47980. }
  47981. }
  47982. if err != nil {
  47983. return nil, err
  47984. }
  47985. defer googleapi.CloseBody(res)
  47986. if err := googleapi.CheckResponse(res); err != nil {
  47987. return nil, err
  47988. }
  47989. ret := &TestPermissionsResponse{
  47990. ServerResponse: googleapi.ServerResponse{
  47991. Header: res.Header,
  47992. HTTPStatusCode: res.StatusCode,
  47993. },
  47994. }
  47995. target := &ret
  47996. if err := gensupport.DecodeResponse(target, res); err != nil {
  47997. return nil, err
  47998. }
  47999. return ret, nil
  48000. // {
  48001. // "description": "Returns permissions that a caller has on the specified resource.",
  48002. // "httpMethod": "POST",
  48003. // "id": "compute.healthChecks.testIamPermissions",
  48004. // "parameterOrder": [
  48005. // "project",
  48006. // "resource"
  48007. // ],
  48008. // "parameters": {
  48009. // "project": {
  48010. // "description": "Project ID for this request.",
  48011. // "location": "path",
  48012. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  48013. // "required": true,
  48014. // "type": "string"
  48015. // },
  48016. // "resource": {
  48017. // "description": "Name of the resource for this request.",
  48018. // "location": "path",
  48019. // "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?",
  48020. // "required": true,
  48021. // "type": "string"
  48022. // }
  48023. // },
  48024. // "path": "{project}/global/healthChecks/{resource}/testIamPermissions",
  48025. // "request": {
  48026. // "$ref": "TestPermissionsRequest"
  48027. // },
  48028. // "response": {
  48029. // "$ref": "TestPermissionsResponse"
  48030. // },
  48031. // "scopes": [
  48032. // "https://www.googleapis.com/auth/cloud-platform",
  48033. // "https://www.googleapis.com/auth/compute",
  48034. // "https://www.googleapis.com/auth/compute.readonly"
  48035. // ]
  48036. // }
  48037. }
  48038. // method id "compute.healthChecks.update":
  48039. type HealthChecksUpdateCall struct {
  48040. s *Service
  48041. project string
  48042. healthCheck string
  48043. healthcheck *HealthCheck
  48044. urlParams_ gensupport.URLParams
  48045. ctx_ context.Context
  48046. header_ http.Header
  48047. }
  48048. // Update: Updates a HealthCheck resource in the specified project using
  48049. // the data included in the request.
  48050. func (r *HealthChecksService) Update(project string, healthCheck string, healthcheck *HealthCheck) *HealthChecksUpdateCall {
  48051. c := &HealthChecksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  48052. c.project = project
  48053. c.healthCheck = healthCheck
  48054. c.healthcheck = healthcheck
  48055. return c
  48056. }
  48057. // RequestId sets the optional parameter "requestId": An optional
  48058. // request ID to identify requests. Specify a unique request ID so that
  48059. // if you must retry your request, the server will know to ignore the
  48060. // request if it has already been completed.
  48061. //
  48062. // For example, consider a situation where you make an initial request
  48063. // and the request times out. If you make the request again with the
  48064. // same request ID, the server can check if original operation with the
  48065. // same request ID was received, and if so, will ignore the second
  48066. // request. This prevents clients from accidentally creating duplicate
  48067. // commitments.
  48068. //
  48069. // The request ID must be a valid UUID with the exception that zero UUID
  48070. // is not supported (00000000-0000-0000-0000-000000000000).
  48071. func (c *HealthChecksUpdateCall) RequestId(requestId string) *HealthChecksUpdateCall {
  48072. c.urlParams_.Set("requestId", requestId)
  48073. return c
  48074. }
  48075. // Fields allows partial responses to be retrieved. See
  48076. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  48077. // for more information.
  48078. func (c *HealthChecksUpdateCall) Fields(s ...googleapi.Field) *HealthChecksUpdateCall {
  48079. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  48080. return c
  48081. }
  48082. // Context sets the context to be used in this call's Do method. Any
  48083. // pending HTTP request will be aborted if the provided context is
  48084. // canceled.
  48085. func (c *HealthChecksUpdateCall) Context(ctx context.Context) *HealthChecksUpdateCall {
  48086. c.ctx_ = ctx
  48087. return c
  48088. }
  48089. // Header returns an http.Header that can be modified by the caller to
  48090. // add HTTP headers to the request.
  48091. func (c *HealthChecksUpdateCall) Header() http.Header {
  48092. if c.header_ == nil {
  48093. c.header_ = make(http.Header)
  48094. }
  48095. return c.header_
  48096. }
  48097. func (c *HealthChecksUpdateCall) doRequest(alt string) (*http.Response, error) {
  48098. reqHeaders := make(http.Header)
  48099. for k, v := range c.header_ {
  48100. reqHeaders[k] = v
  48101. }
  48102. reqHeaders.Set("User-Agent", c.s.userAgent())
  48103. var body io.Reader = nil
  48104. body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck)
  48105. if err != nil {
  48106. return nil, err
  48107. }
  48108. reqHeaders.Set("Content-Type", "application/json")
  48109. c.urlParams_.Set("alt", alt)
  48110. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks/{healthCheck}")
  48111. urls += "?" + c.urlParams_.Encode()
  48112. req, _ := http.NewRequest("PUT", urls, body)
  48113. req.Header = reqHeaders
  48114. googleapi.Expand(req.URL, map[string]string{
  48115. "project": c.project,
  48116. "healthCheck": c.healthCheck,
  48117. })
  48118. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  48119. }
  48120. // Do executes the "compute.healthChecks.update" call.
  48121. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  48122. // status code is an error. Response headers are in either
  48123. // *Operation.ServerResponse.Header or (if a response was returned at
  48124. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  48125. // to check whether the returned error was because
  48126. // http.StatusNotModified was returned.
  48127. func (c *HealthChecksUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  48128. gensupport.SetOptions(c.urlParams_, opts...)
  48129. res, err := c.doRequest("json")
  48130. if res != nil && res.StatusCode == http.StatusNotModified {
  48131. if res.Body != nil {
  48132. res.Body.Close()
  48133. }
  48134. return nil, &googleapi.Error{
  48135. Code: res.StatusCode,
  48136. Header: res.Header,
  48137. }
  48138. }
  48139. if err != nil {
  48140. return nil, err
  48141. }
  48142. defer googleapi.CloseBody(res)
  48143. if err := googleapi.CheckResponse(res); err != nil {
  48144. return nil, err
  48145. }
  48146. ret := &Operation{
  48147. ServerResponse: googleapi.ServerResponse{
  48148. Header: res.Header,
  48149. HTTPStatusCode: res.StatusCode,
  48150. },
  48151. }
  48152. target := &ret
  48153. if err := gensupport.DecodeResponse(target, res); err != nil {
  48154. return nil, err
  48155. }
  48156. return ret, nil
  48157. // {
  48158. // "description": "Updates a HealthCheck resource in the specified project using the data included in the request.",
  48159. // "httpMethod": "PUT",
  48160. // "id": "compute.healthChecks.update",
  48161. // "parameterOrder": [
  48162. // "project",
  48163. // "healthCheck"
  48164. // ],
  48165. // "parameters": {
  48166. // "healthCheck": {
  48167. // "description": "Name of the HealthCheck resource to update.",
  48168. // "location": "path",
  48169. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  48170. // "required": true,
  48171. // "type": "string"
  48172. // },
  48173. // "project": {
  48174. // "description": "Project ID for this request.",
  48175. // "location": "path",
  48176. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  48177. // "required": true,
  48178. // "type": "string"
  48179. // },
  48180. // "requestId": {
  48181. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  48182. // "location": "query",
  48183. // "type": "string"
  48184. // }
  48185. // },
  48186. // "path": "{project}/global/healthChecks/{healthCheck}",
  48187. // "request": {
  48188. // "$ref": "HealthCheck"
  48189. // },
  48190. // "response": {
  48191. // "$ref": "Operation"
  48192. // },
  48193. // "scopes": [
  48194. // "https://www.googleapis.com/auth/cloud-platform",
  48195. // "https://www.googleapis.com/auth/compute"
  48196. // ]
  48197. // }
  48198. }
  48199. // method id "compute.hostTypes.aggregatedList":
  48200. type HostTypesAggregatedListCall struct {
  48201. s *Service
  48202. project string
  48203. urlParams_ gensupport.URLParams
  48204. ifNoneMatch_ string
  48205. ctx_ context.Context
  48206. header_ http.Header
  48207. }
  48208. // AggregatedList: Retrieves an aggregated list of host types.
  48209. func (r *HostTypesService) AggregatedList(project string) *HostTypesAggregatedListCall {
  48210. c := &HostTypesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  48211. c.project = project
  48212. return c
  48213. }
  48214. // Filter sets the optional parameter "filter": A filter expression that
  48215. // filters resources listed in the response. The expression must specify
  48216. // the field name, a comparison operator, and the value that you want to
  48217. // use for filtering. The value must be a string, a number, or a
  48218. // boolean. The comparison operator must be either =, !=, >, or <.
  48219. //
  48220. // For example, if you are filtering Compute Engine instances, you can
  48221. // exclude instances named example-instance by specifying name !=
  48222. // example-instance.
  48223. //
  48224. // You can also filter nested fields. For example, you could specify
  48225. // scheduling.automaticRestart = false to include instances only if they
  48226. // are not scheduled for automatic restarts. You can use filtering on
  48227. // nested fields to filter based on resource labels.
  48228. //
  48229. // To filter on multiple expressions, provide each separate expression
  48230. // within parentheses. For example, (scheduling.automaticRestart = true)
  48231. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  48232. // AND expression. However, you can include AND and OR expressions
  48233. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  48234. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  48235. // true).
  48236. func (c *HostTypesAggregatedListCall) Filter(filter string) *HostTypesAggregatedListCall {
  48237. c.urlParams_.Set("filter", filter)
  48238. return c
  48239. }
  48240. // MaxResults sets the optional parameter "maxResults": The maximum
  48241. // number of results per page that should be returned. If the number of
  48242. // available results is larger than maxResults, Compute Engine returns a
  48243. // nextPageToken that can be used to get the next page of results in
  48244. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  48245. // (Default: 500)
  48246. func (c *HostTypesAggregatedListCall) MaxResults(maxResults int64) *HostTypesAggregatedListCall {
  48247. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  48248. return c
  48249. }
  48250. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  48251. // a certain order. By default, results are returned in alphanumerical
  48252. // order based on the resource name.
  48253. //
  48254. // You can also sort results in descending order based on the creation
  48255. // timestamp using orderBy="creationTimestamp desc". This sorts results
  48256. // based on the creationTimestamp field in reverse chronological order
  48257. // (newest result first). Use this to sort resources like operations so
  48258. // that the newest operation is returned first.
  48259. //
  48260. // Currently, only sorting by name or creationTimestamp desc is
  48261. // supported.
  48262. func (c *HostTypesAggregatedListCall) OrderBy(orderBy string) *HostTypesAggregatedListCall {
  48263. c.urlParams_.Set("orderBy", orderBy)
  48264. return c
  48265. }
  48266. // PageToken sets the optional parameter "pageToken": Specifies a page
  48267. // token to use. Set pageToken to the nextPageToken returned by a
  48268. // previous list request to get the next page of results.
  48269. func (c *HostTypesAggregatedListCall) PageToken(pageToken string) *HostTypesAggregatedListCall {
  48270. c.urlParams_.Set("pageToken", pageToken)
  48271. return c
  48272. }
  48273. // Fields allows partial responses to be retrieved. See
  48274. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  48275. // for more information.
  48276. func (c *HostTypesAggregatedListCall) Fields(s ...googleapi.Field) *HostTypesAggregatedListCall {
  48277. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  48278. return c
  48279. }
  48280. // IfNoneMatch sets the optional parameter which makes the operation
  48281. // fail if the object's ETag matches the given value. This is useful for
  48282. // getting updates only after the object has changed since the last
  48283. // request. Use googleapi.IsNotModified to check whether the response
  48284. // error from Do is the result of In-None-Match.
  48285. func (c *HostTypesAggregatedListCall) IfNoneMatch(entityTag string) *HostTypesAggregatedListCall {
  48286. c.ifNoneMatch_ = entityTag
  48287. return c
  48288. }
  48289. // Context sets the context to be used in this call's Do method. Any
  48290. // pending HTTP request will be aborted if the provided context is
  48291. // canceled.
  48292. func (c *HostTypesAggregatedListCall) Context(ctx context.Context) *HostTypesAggregatedListCall {
  48293. c.ctx_ = ctx
  48294. return c
  48295. }
  48296. // Header returns an http.Header that can be modified by the caller to
  48297. // add HTTP headers to the request.
  48298. func (c *HostTypesAggregatedListCall) Header() http.Header {
  48299. if c.header_ == nil {
  48300. c.header_ = make(http.Header)
  48301. }
  48302. return c.header_
  48303. }
  48304. func (c *HostTypesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  48305. reqHeaders := make(http.Header)
  48306. for k, v := range c.header_ {
  48307. reqHeaders[k] = v
  48308. }
  48309. reqHeaders.Set("User-Agent", c.s.userAgent())
  48310. if c.ifNoneMatch_ != "" {
  48311. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  48312. }
  48313. var body io.Reader = nil
  48314. c.urlParams_.Set("alt", alt)
  48315. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/hostTypes")
  48316. urls += "?" + c.urlParams_.Encode()
  48317. req, _ := http.NewRequest("GET", urls, body)
  48318. req.Header = reqHeaders
  48319. googleapi.Expand(req.URL, map[string]string{
  48320. "project": c.project,
  48321. })
  48322. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  48323. }
  48324. // Do executes the "compute.hostTypes.aggregatedList" call.
  48325. // Exactly one of *HostTypeAggregatedList or error will be non-nil. Any
  48326. // non-2xx status code is an error. Response headers are in either
  48327. // *HostTypeAggregatedList.ServerResponse.Header or (if a response was
  48328. // returned at all) in error.(*googleapi.Error).Header. Use
  48329. // googleapi.IsNotModified to check whether the returned error was
  48330. // because http.StatusNotModified was returned.
  48331. func (c *HostTypesAggregatedListCall) Do(opts ...googleapi.CallOption) (*HostTypeAggregatedList, error) {
  48332. gensupport.SetOptions(c.urlParams_, opts...)
  48333. res, err := c.doRequest("json")
  48334. if res != nil && res.StatusCode == http.StatusNotModified {
  48335. if res.Body != nil {
  48336. res.Body.Close()
  48337. }
  48338. return nil, &googleapi.Error{
  48339. Code: res.StatusCode,
  48340. Header: res.Header,
  48341. }
  48342. }
  48343. if err != nil {
  48344. return nil, err
  48345. }
  48346. defer googleapi.CloseBody(res)
  48347. if err := googleapi.CheckResponse(res); err != nil {
  48348. return nil, err
  48349. }
  48350. ret := &HostTypeAggregatedList{
  48351. ServerResponse: googleapi.ServerResponse{
  48352. Header: res.Header,
  48353. HTTPStatusCode: res.StatusCode,
  48354. },
  48355. }
  48356. target := &ret
  48357. if err := gensupport.DecodeResponse(target, res); err != nil {
  48358. return nil, err
  48359. }
  48360. return ret, nil
  48361. // {
  48362. // "description": "Retrieves an aggregated list of host types.",
  48363. // "httpMethod": "GET",
  48364. // "id": "compute.hostTypes.aggregatedList",
  48365. // "parameterOrder": [
  48366. // "project"
  48367. // ],
  48368. // "parameters": {
  48369. // "filter": {
  48370. // "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).",
  48371. // "location": "query",
  48372. // "type": "string"
  48373. // },
  48374. // "maxResults": {
  48375. // "default": "500",
  48376. // "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)",
  48377. // "format": "uint32",
  48378. // "location": "query",
  48379. // "minimum": "0",
  48380. // "type": "integer"
  48381. // },
  48382. // "orderBy": {
  48383. // "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.",
  48384. // "location": "query",
  48385. // "type": "string"
  48386. // },
  48387. // "pageToken": {
  48388. // "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.",
  48389. // "location": "query",
  48390. // "type": "string"
  48391. // },
  48392. // "project": {
  48393. // "description": "Project ID for this request.",
  48394. // "location": "path",
  48395. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  48396. // "required": true,
  48397. // "type": "string"
  48398. // }
  48399. // },
  48400. // "path": "{project}/aggregated/hostTypes",
  48401. // "response": {
  48402. // "$ref": "HostTypeAggregatedList"
  48403. // },
  48404. // "scopes": [
  48405. // "https://www.googleapis.com/auth/cloud-platform",
  48406. // "https://www.googleapis.com/auth/compute",
  48407. // "https://www.googleapis.com/auth/compute.readonly"
  48408. // ]
  48409. // }
  48410. }
  48411. // Pages invokes f for each page of results.
  48412. // A non-nil error returned from f will halt the iteration.
  48413. // The provided context supersedes any context provided to the Context method.
  48414. func (c *HostTypesAggregatedListCall) Pages(ctx context.Context, f func(*HostTypeAggregatedList) error) error {
  48415. c.ctx_ = ctx
  48416. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  48417. for {
  48418. x, err := c.Do()
  48419. if err != nil {
  48420. return err
  48421. }
  48422. if err := f(x); err != nil {
  48423. return err
  48424. }
  48425. if x.NextPageToken == "" {
  48426. return nil
  48427. }
  48428. c.PageToken(x.NextPageToken)
  48429. }
  48430. }
  48431. // method id "compute.hostTypes.get":
  48432. type HostTypesGetCall struct {
  48433. s *Service
  48434. project string
  48435. zone string
  48436. hostType string
  48437. urlParams_ gensupport.URLParams
  48438. ifNoneMatch_ string
  48439. ctx_ context.Context
  48440. header_ http.Header
  48441. }
  48442. // Get: Returns the specified host type. Gets a list of available host
  48443. // types by making a list() request.
  48444. func (r *HostTypesService) Get(project string, zone string, hostType string) *HostTypesGetCall {
  48445. c := &HostTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  48446. c.project = project
  48447. c.zone = zone
  48448. c.hostType = hostType
  48449. return c
  48450. }
  48451. // Fields allows partial responses to be retrieved. See
  48452. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  48453. // for more information.
  48454. func (c *HostTypesGetCall) Fields(s ...googleapi.Field) *HostTypesGetCall {
  48455. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  48456. return c
  48457. }
  48458. // IfNoneMatch sets the optional parameter which makes the operation
  48459. // fail if the object's ETag matches the given value. This is useful for
  48460. // getting updates only after the object has changed since the last
  48461. // request. Use googleapi.IsNotModified to check whether the response
  48462. // error from Do is the result of In-None-Match.
  48463. func (c *HostTypesGetCall) IfNoneMatch(entityTag string) *HostTypesGetCall {
  48464. c.ifNoneMatch_ = entityTag
  48465. return c
  48466. }
  48467. // Context sets the context to be used in this call's Do method. Any
  48468. // pending HTTP request will be aborted if the provided context is
  48469. // canceled.
  48470. func (c *HostTypesGetCall) Context(ctx context.Context) *HostTypesGetCall {
  48471. c.ctx_ = ctx
  48472. return c
  48473. }
  48474. // Header returns an http.Header that can be modified by the caller to
  48475. // add HTTP headers to the request.
  48476. func (c *HostTypesGetCall) Header() http.Header {
  48477. if c.header_ == nil {
  48478. c.header_ = make(http.Header)
  48479. }
  48480. return c.header_
  48481. }
  48482. func (c *HostTypesGetCall) doRequest(alt string) (*http.Response, error) {
  48483. reqHeaders := make(http.Header)
  48484. for k, v := range c.header_ {
  48485. reqHeaders[k] = v
  48486. }
  48487. reqHeaders.Set("User-Agent", c.s.userAgent())
  48488. if c.ifNoneMatch_ != "" {
  48489. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  48490. }
  48491. var body io.Reader = nil
  48492. c.urlParams_.Set("alt", alt)
  48493. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/hostTypes/{hostType}")
  48494. urls += "?" + c.urlParams_.Encode()
  48495. req, _ := http.NewRequest("GET", urls, body)
  48496. req.Header = reqHeaders
  48497. googleapi.Expand(req.URL, map[string]string{
  48498. "project": c.project,
  48499. "zone": c.zone,
  48500. "hostType": c.hostType,
  48501. })
  48502. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  48503. }
  48504. // Do executes the "compute.hostTypes.get" call.
  48505. // Exactly one of *HostType or error will be non-nil. Any non-2xx status
  48506. // code is an error. Response headers are in either
  48507. // *HostType.ServerResponse.Header or (if a response was returned at
  48508. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  48509. // to check whether the returned error was because
  48510. // http.StatusNotModified was returned.
  48511. func (c *HostTypesGetCall) Do(opts ...googleapi.CallOption) (*HostType, error) {
  48512. gensupport.SetOptions(c.urlParams_, opts...)
  48513. res, err := c.doRequest("json")
  48514. if res != nil && res.StatusCode == http.StatusNotModified {
  48515. if res.Body != nil {
  48516. res.Body.Close()
  48517. }
  48518. return nil, &googleapi.Error{
  48519. Code: res.StatusCode,
  48520. Header: res.Header,
  48521. }
  48522. }
  48523. if err != nil {
  48524. return nil, err
  48525. }
  48526. defer googleapi.CloseBody(res)
  48527. if err := googleapi.CheckResponse(res); err != nil {
  48528. return nil, err
  48529. }
  48530. ret := &HostType{
  48531. ServerResponse: googleapi.ServerResponse{
  48532. Header: res.Header,
  48533. HTTPStatusCode: res.StatusCode,
  48534. },
  48535. }
  48536. target := &ret
  48537. if err := gensupport.DecodeResponse(target, res); err != nil {
  48538. return nil, err
  48539. }
  48540. return ret, nil
  48541. // {
  48542. // "description": "Returns the specified host type. Gets a list of available host types by making a list() request.",
  48543. // "httpMethod": "GET",
  48544. // "id": "compute.hostTypes.get",
  48545. // "parameterOrder": [
  48546. // "project",
  48547. // "zone",
  48548. // "hostType"
  48549. // ],
  48550. // "parameters": {
  48551. // "hostType": {
  48552. // "description": "Name of the host type to return.",
  48553. // "location": "path",
  48554. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  48555. // "required": true,
  48556. // "type": "string"
  48557. // },
  48558. // "project": {
  48559. // "description": "Project ID for this request.",
  48560. // "location": "path",
  48561. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  48562. // "required": true,
  48563. // "type": "string"
  48564. // },
  48565. // "zone": {
  48566. // "description": "The name of the zone for this request.",
  48567. // "location": "path",
  48568. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  48569. // "required": true,
  48570. // "type": "string"
  48571. // }
  48572. // },
  48573. // "path": "{project}/zones/{zone}/hostTypes/{hostType}",
  48574. // "response": {
  48575. // "$ref": "HostType"
  48576. // },
  48577. // "scopes": [
  48578. // "https://www.googleapis.com/auth/cloud-platform",
  48579. // "https://www.googleapis.com/auth/compute",
  48580. // "https://www.googleapis.com/auth/compute.readonly"
  48581. // ]
  48582. // }
  48583. }
  48584. // method id "compute.hostTypes.list":
  48585. type HostTypesListCall struct {
  48586. s *Service
  48587. project string
  48588. zone string
  48589. urlParams_ gensupport.URLParams
  48590. ifNoneMatch_ string
  48591. ctx_ context.Context
  48592. header_ http.Header
  48593. }
  48594. // List: Retrieves a list of host types available to the specified
  48595. // project.
  48596. func (r *HostTypesService) List(project string, zone string) *HostTypesListCall {
  48597. c := &HostTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  48598. c.project = project
  48599. c.zone = zone
  48600. return c
  48601. }
  48602. // Filter sets the optional parameter "filter": A filter expression that
  48603. // filters resources listed in the response. The expression must specify
  48604. // the field name, a comparison operator, and the value that you want to
  48605. // use for filtering. The value must be a string, a number, or a
  48606. // boolean. The comparison operator must be either =, !=, >, or <.
  48607. //
  48608. // For example, if you are filtering Compute Engine instances, you can
  48609. // exclude instances named example-instance by specifying name !=
  48610. // example-instance.
  48611. //
  48612. // You can also filter nested fields. For example, you could specify
  48613. // scheduling.automaticRestart = false to include instances only if they
  48614. // are not scheduled for automatic restarts. You can use filtering on
  48615. // nested fields to filter based on resource labels.
  48616. //
  48617. // To filter on multiple expressions, provide each separate expression
  48618. // within parentheses. For example, (scheduling.automaticRestart = true)
  48619. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  48620. // AND expression. However, you can include AND and OR expressions
  48621. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  48622. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  48623. // true).
  48624. func (c *HostTypesListCall) Filter(filter string) *HostTypesListCall {
  48625. c.urlParams_.Set("filter", filter)
  48626. return c
  48627. }
  48628. // MaxResults sets the optional parameter "maxResults": The maximum
  48629. // number of results per page that should be returned. If the number of
  48630. // available results is larger than maxResults, Compute Engine returns a
  48631. // nextPageToken that can be used to get the next page of results in
  48632. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  48633. // (Default: 500)
  48634. func (c *HostTypesListCall) MaxResults(maxResults int64) *HostTypesListCall {
  48635. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  48636. return c
  48637. }
  48638. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  48639. // a certain order. By default, results are returned in alphanumerical
  48640. // order based on the resource name.
  48641. //
  48642. // You can also sort results in descending order based on the creation
  48643. // timestamp using orderBy="creationTimestamp desc". This sorts results
  48644. // based on the creationTimestamp field in reverse chronological order
  48645. // (newest result first). Use this to sort resources like operations so
  48646. // that the newest operation is returned first.
  48647. //
  48648. // Currently, only sorting by name or creationTimestamp desc is
  48649. // supported.
  48650. func (c *HostTypesListCall) OrderBy(orderBy string) *HostTypesListCall {
  48651. c.urlParams_.Set("orderBy", orderBy)
  48652. return c
  48653. }
  48654. // PageToken sets the optional parameter "pageToken": Specifies a page
  48655. // token to use. Set pageToken to the nextPageToken returned by a
  48656. // previous list request to get the next page of results.
  48657. func (c *HostTypesListCall) PageToken(pageToken string) *HostTypesListCall {
  48658. c.urlParams_.Set("pageToken", pageToken)
  48659. return c
  48660. }
  48661. // Fields allows partial responses to be retrieved. See
  48662. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  48663. // for more information.
  48664. func (c *HostTypesListCall) Fields(s ...googleapi.Field) *HostTypesListCall {
  48665. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  48666. return c
  48667. }
  48668. // IfNoneMatch sets the optional parameter which makes the operation
  48669. // fail if the object's ETag matches the given value. This is useful for
  48670. // getting updates only after the object has changed since the last
  48671. // request. Use googleapi.IsNotModified to check whether the response
  48672. // error from Do is the result of In-None-Match.
  48673. func (c *HostTypesListCall) IfNoneMatch(entityTag string) *HostTypesListCall {
  48674. c.ifNoneMatch_ = entityTag
  48675. return c
  48676. }
  48677. // Context sets the context to be used in this call's Do method. Any
  48678. // pending HTTP request will be aborted if the provided context is
  48679. // canceled.
  48680. func (c *HostTypesListCall) Context(ctx context.Context) *HostTypesListCall {
  48681. c.ctx_ = ctx
  48682. return c
  48683. }
  48684. // Header returns an http.Header that can be modified by the caller to
  48685. // add HTTP headers to the request.
  48686. func (c *HostTypesListCall) Header() http.Header {
  48687. if c.header_ == nil {
  48688. c.header_ = make(http.Header)
  48689. }
  48690. return c.header_
  48691. }
  48692. func (c *HostTypesListCall) doRequest(alt string) (*http.Response, error) {
  48693. reqHeaders := make(http.Header)
  48694. for k, v := range c.header_ {
  48695. reqHeaders[k] = v
  48696. }
  48697. reqHeaders.Set("User-Agent", c.s.userAgent())
  48698. if c.ifNoneMatch_ != "" {
  48699. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  48700. }
  48701. var body io.Reader = nil
  48702. c.urlParams_.Set("alt", alt)
  48703. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/hostTypes")
  48704. urls += "?" + c.urlParams_.Encode()
  48705. req, _ := http.NewRequest("GET", urls, body)
  48706. req.Header = reqHeaders
  48707. googleapi.Expand(req.URL, map[string]string{
  48708. "project": c.project,
  48709. "zone": c.zone,
  48710. })
  48711. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  48712. }
  48713. // Do executes the "compute.hostTypes.list" call.
  48714. // Exactly one of *HostTypeList or error will be non-nil. Any non-2xx
  48715. // status code is an error. Response headers are in either
  48716. // *HostTypeList.ServerResponse.Header or (if a response was returned at
  48717. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  48718. // to check whether the returned error was because
  48719. // http.StatusNotModified was returned.
  48720. func (c *HostTypesListCall) Do(opts ...googleapi.CallOption) (*HostTypeList, error) {
  48721. gensupport.SetOptions(c.urlParams_, opts...)
  48722. res, err := c.doRequest("json")
  48723. if res != nil && res.StatusCode == http.StatusNotModified {
  48724. if res.Body != nil {
  48725. res.Body.Close()
  48726. }
  48727. return nil, &googleapi.Error{
  48728. Code: res.StatusCode,
  48729. Header: res.Header,
  48730. }
  48731. }
  48732. if err != nil {
  48733. return nil, err
  48734. }
  48735. defer googleapi.CloseBody(res)
  48736. if err := googleapi.CheckResponse(res); err != nil {
  48737. return nil, err
  48738. }
  48739. ret := &HostTypeList{
  48740. ServerResponse: googleapi.ServerResponse{
  48741. Header: res.Header,
  48742. HTTPStatusCode: res.StatusCode,
  48743. },
  48744. }
  48745. target := &ret
  48746. if err := gensupport.DecodeResponse(target, res); err != nil {
  48747. return nil, err
  48748. }
  48749. return ret, nil
  48750. // {
  48751. // "description": "Retrieves a list of host types available to the specified project.",
  48752. // "httpMethod": "GET",
  48753. // "id": "compute.hostTypes.list",
  48754. // "parameterOrder": [
  48755. // "project",
  48756. // "zone"
  48757. // ],
  48758. // "parameters": {
  48759. // "filter": {
  48760. // "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).",
  48761. // "location": "query",
  48762. // "type": "string"
  48763. // },
  48764. // "maxResults": {
  48765. // "default": "500",
  48766. // "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)",
  48767. // "format": "uint32",
  48768. // "location": "query",
  48769. // "minimum": "0",
  48770. // "type": "integer"
  48771. // },
  48772. // "orderBy": {
  48773. // "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.",
  48774. // "location": "query",
  48775. // "type": "string"
  48776. // },
  48777. // "pageToken": {
  48778. // "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.",
  48779. // "location": "query",
  48780. // "type": "string"
  48781. // },
  48782. // "project": {
  48783. // "description": "Project ID for this request.",
  48784. // "location": "path",
  48785. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  48786. // "required": true,
  48787. // "type": "string"
  48788. // },
  48789. // "zone": {
  48790. // "description": "The name of the zone for this request.",
  48791. // "location": "path",
  48792. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  48793. // "required": true,
  48794. // "type": "string"
  48795. // }
  48796. // },
  48797. // "path": "{project}/zones/{zone}/hostTypes",
  48798. // "response": {
  48799. // "$ref": "HostTypeList"
  48800. // },
  48801. // "scopes": [
  48802. // "https://www.googleapis.com/auth/cloud-platform",
  48803. // "https://www.googleapis.com/auth/compute",
  48804. // "https://www.googleapis.com/auth/compute.readonly"
  48805. // ]
  48806. // }
  48807. }
  48808. // Pages invokes f for each page of results.
  48809. // A non-nil error returned from f will halt the iteration.
  48810. // The provided context supersedes any context provided to the Context method.
  48811. func (c *HostTypesListCall) Pages(ctx context.Context, f func(*HostTypeList) error) error {
  48812. c.ctx_ = ctx
  48813. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  48814. for {
  48815. x, err := c.Do()
  48816. if err != nil {
  48817. return err
  48818. }
  48819. if err := f(x); err != nil {
  48820. return err
  48821. }
  48822. if x.NextPageToken == "" {
  48823. return nil
  48824. }
  48825. c.PageToken(x.NextPageToken)
  48826. }
  48827. }
  48828. // method id "compute.hosts.aggregatedList":
  48829. type HostsAggregatedListCall struct {
  48830. s *Service
  48831. project string
  48832. urlParams_ gensupport.URLParams
  48833. ifNoneMatch_ string
  48834. ctx_ context.Context
  48835. header_ http.Header
  48836. }
  48837. // AggregatedList: Retrieves an aggregated list of hosts.
  48838. func (r *HostsService) AggregatedList(project string) *HostsAggregatedListCall {
  48839. c := &HostsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  48840. c.project = project
  48841. return c
  48842. }
  48843. // Filter sets the optional parameter "filter": A filter expression that
  48844. // filters resources listed in the response. The expression must specify
  48845. // the field name, a comparison operator, and the value that you want to
  48846. // use for filtering. The value must be a string, a number, or a
  48847. // boolean. The comparison operator must be either =, !=, >, or <.
  48848. //
  48849. // For example, if you are filtering Compute Engine instances, you can
  48850. // exclude instances named example-instance by specifying name !=
  48851. // example-instance.
  48852. //
  48853. // You can also filter nested fields. For example, you could specify
  48854. // scheduling.automaticRestart = false to include instances only if they
  48855. // are not scheduled for automatic restarts. You can use filtering on
  48856. // nested fields to filter based on resource labels.
  48857. //
  48858. // To filter on multiple expressions, provide each separate expression
  48859. // within parentheses. For example, (scheduling.automaticRestart = true)
  48860. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  48861. // AND expression. However, you can include AND and OR expressions
  48862. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  48863. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  48864. // true).
  48865. func (c *HostsAggregatedListCall) Filter(filter string) *HostsAggregatedListCall {
  48866. c.urlParams_.Set("filter", filter)
  48867. return c
  48868. }
  48869. // MaxResults sets the optional parameter "maxResults": The maximum
  48870. // number of results per page that should be returned. If the number of
  48871. // available results is larger than maxResults, Compute Engine returns a
  48872. // nextPageToken that can be used to get the next page of results in
  48873. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  48874. // (Default: 500)
  48875. func (c *HostsAggregatedListCall) MaxResults(maxResults int64) *HostsAggregatedListCall {
  48876. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  48877. return c
  48878. }
  48879. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  48880. // a certain order. By default, results are returned in alphanumerical
  48881. // order based on the resource name.
  48882. //
  48883. // You can also sort results in descending order based on the creation
  48884. // timestamp using orderBy="creationTimestamp desc". This sorts results
  48885. // based on the creationTimestamp field in reverse chronological order
  48886. // (newest result first). Use this to sort resources like operations so
  48887. // that the newest operation is returned first.
  48888. //
  48889. // Currently, only sorting by name or creationTimestamp desc is
  48890. // supported.
  48891. func (c *HostsAggregatedListCall) OrderBy(orderBy string) *HostsAggregatedListCall {
  48892. c.urlParams_.Set("orderBy", orderBy)
  48893. return c
  48894. }
  48895. // PageToken sets the optional parameter "pageToken": Specifies a page
  48896. // token to use. Set pageToken to the nextPageToken returned by a
  48897. // previous list request to get the next page of results.
  48898. func (c *HostsAggregatedListCall) PageToken(pageToken string) *HostsAggregatedListCall {
  48899. c.urlParams_.Set("pageToken", pageToken)
  48900. return c
  48901. }
  48902. // Fields allows partial responses to be retrieved. See
  48903. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  48904. // for more information.
  48905. func (c *HostsAggregatedListCall) Fields(s ...googleapi.Field) *HostsAggregatedListCall {
  48906. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  48907. return c
  48908. }
  48909. // IfNoneMatch sets the optional parameter which makes the operation
  48910. // fail if the object's ETag matches the given value. This is useful for
  48911. // getting updates only after the object has changed since the last
  48912. // request. Use googleapi.IsNotModified to check whether the response
  48913. // error from Do is the result of In-None-Match.
  48914. func (c *HostsAggregatedListCall) IfNoneMatch(entityTag string) *HostsAggregatedListCall {
  48915. c.ifNoneMatch_ = entityTag
  48916. return c
  48917. }
  48918. // Context sets the context to be used in this call's Do method. Any
  48919. // pending HTTP request will be aborted if the provided context is
  48920. // canceled.
  48921. func (c *HostsAggregatedListCall) Context(ctx context.Context) *HostsAggregatedListCall {
  48922. c.ctx_ = ctx
  48923. return c
  48924. }
  48925. // Header returns an http.Header that can be modified by the caller to
  48926. // add HTTP headers to the request.
  48927. func (c *HostsAggregatedListCall) Header() http.Header {
  48928. if c.header_ == nil {
  48929. c.header_ = make(http.Header)
  48930. }
  48931. return c.header_
  48932. }
  48933. func (c *HostsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  48934. reqHeaders := make(http.Header)
  48935. for k, v := range c.header_ {
  48936. reqHeaders[k] = v
  48937. }
  48938. reqHeaders.Set("User-Agent", c.s.userAgent())
  48939. if c.ifNoneMatch_ != "" {
  48940. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  48941. }
  48942. var body io.Reader = nil
  48943. c.urlParams_.Set("alt", alt)
  48944. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/hosts")
  48945. urls += "?" + c.urlParams_.Encode()
  48946. req, _ := http.NewRequest("GET", urls, body)
  48947. req.Header = reqHeaders
  48948. googleapi.Expand(req.URL, map[string]string{
  48949. "project": c.project,
  48950. })
  48951. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  48952. }
  48953. // Do executes the "compute.hosts.aggregatedList" call.
  48954. // Exactly one of *HostAggregatedList or error will be non-nil. Any
  48955. // non-2xx status code is an error. Response headers are in either
  48956. // *HostAggregatedList.ServerResponse.Header or (if a response was
  48957. // returned at all) in error.(*googleapi.Error).Header. Use
  48958. // googleapi.IsNotModified to check whether the returned error was
  48959. // because http.StatusNotModified was returned.
  48960. func (c *HostsAggregatedListCall) Do(opts ...googleapi.CallOption) (*HostAggregatedList, error) {
  48961. gensupport.SetOptions(c.urlParams_, opts...)
  48962. res, err := c.doRequest("json")
  48963. if res != nil && res.StatusCode == http.StatusNotModified {
  48964. if res.Body != nil {
  48965. res.Body.Close()
  48966. }
  48967. return nil, &googleapi.Error{
  48968. Code: res.StatusCode,
  48969. Header: res.Header,
  48970. }
  48971. }
  48972. if err != nil {
  48973. return nil, err
  48974. }
  48975. defer googleapi.CloseBody(res)
  48976. if err := googleapi.CheckResponse(res); err != nil {
  48977. return nil, err
  48978. }
  48979. ret := &HostAggregatedList{
  48980. ServerResponse: googleapi.ServerResponse{
  48981. Header: res.Header,
  48982. HTTPStatusCode: res.StatusCode,
  48983. },
  48984. }
  48985. target := &ret
  48986. if err := gensupport.DecodeResponse(target, res); err != nil {
  48987. return nil, err
  48988. }
  48989. return ret, nil
  48990. // {
  48991. // "description": "Retrieves an aggregated list of hosts.",
  48992. // "httpMethod": "GET",
  48993. // "id": "compute.hosts.aggregatedList",
  48994. // "parameterOrder": [
  48995. // "project"
  48996. // ],
  48997. // "parameters": {
  48998. // "filter": {
  48999. // "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).",
  49000. // "location": "query",
  49001. // "type": "string"
  49002. // },
  49003. // "maxResults": {
  49004. // "default": "500",
  49005. // "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)",
  49006. // "format": "uint32",
  49007. // "location": "query",
  49008. // "minimum": "0",
  49009. // "type": "integer"
  49010. // },
  49011. // "orderBy": {
  49012. // "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.",
  49013. // "location": "query",
  49014. // "type": "string"
  49015. // },
  49016. // "pageToken": {
  49017. // "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.",
  49018. // "location": "query",
  49019. // "type": "string"
  49020. // },
  49021. // "project": {
  49022. // "description": "Project ID for this request.",
  49023. // "location": "path",
  49024. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  49025. // "required": true,
  49026. // "type": "string"
  49027. // }
  49028. // },
  49029. // "path": "{project}/aggregated/hosts",
  49030. // "response": {
  49031. // "$ref": "HostAggregatedList"
  49032. // },
  49033. // "scopes": [
  49034. // "https://www.googleapis.com/auth/cloud-platform",
  49035. // "https://www.googleapis.com/auth/compute",
  49036. // "https://www.googleapis.com/auth/compute.readonly"
  49037. // ]
  49038. // }
  49039. }
  49040. // Pages invokes f for each page of results.
  49041. // A non-nil error returned from f will halt the iteration.
  49042. // The provided context supersedes any context provided to the Context method.
  49043. func (c *HostsAggregatedListCall) Pages(ctx context.Context, f func(*HostAggregatedList) error) error {
  49044. c.ctx_ = ctx
  49045. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  49046. for {
  49047. x, err := c.Do()
  49048. if err != nil {
  49049. return err
  49050. }
  49051. if err := f(x); err != nil {
  49052. return err
  49053. }
  49054. if x.NextPageToken == "" {
  49055. return nil
  49056. }
  49057. c.PageToken(x.NextPageToken)
  49058. }
  49059. }
  49060. // method id "compute.hosts.delete":
  49061. type HostsDeleteCall struct {
  49062. s *Service
  49063. project string
  49064. zone string
  49065. host string
  49066. urlParams_ gensupport.URLParams
  49067. ctx_ context.Context
  49068. header_ http.Header
  49069. }
  49070. // Delete: Deletes the specified Host resource.
  49071. func (r *HostsService) Delete(project string, zone string, host string) *HostsDeleteCall {
  49072. c := &HostsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  49073. c.project = project
  49074. c.zone = zone
  49075. c.host = host
  49076. return c
  49077. }
  49078. // RequestId sets the optional parameter "requestId": An optional
  49079. // request ID to identify requests. Specify a unique request ID so that
  49080. // if you must retry your request, the server will know to ignore the
  49081. // request if it has already been completed.
  49082. //
  49083. // For example, consider a situation where you make an initial request
  49084. // and the request times out. If you make the request again with the
  49085. // same request ID, the server can check if original operation with the
  49086. // same request ID was received, and if so, will ignore the second
  49087. // request. This prevents clients from accidentally creating duplicate
  49088. // commitments.
  49089. //
  49090. // The request ID must be a valid UUID with the exception that zero UUID
  49091. // is not supported (00000000-0000-0000-0000-000000000000).
  49092. func (c *HostsDeleteCall) RequestId(requestId string) *HostsDeleteCall {
  49093. c.urlParams_.Set("requestId", requestId)
  49094. return c
  49095. }
  49096. // Fields allows partial responses to be retrieved. See
  49097. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  49098. // for more information.
  49099. func (c *HostsDeleteCall) Fields(s ...googleapi.Field) *HostsDeleteCall {
  49100. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  49101. return c
  49102. }
  49103. // Context sets the context to be used in this call's Do method. Any
  49104. // pending HTTP request will be aborted if the provided context is
  49105. // canceled.
  49106. func (c *HostsDeleteCall) Context(ctx context.Context) *HostsDeleteCall {
  49107. c.ctx_ = ctx
  49108. return c
  49109. }
  49110. // Header returns an http.Header that can be modified by the caller to
  49111. // add HTTP headers to the request.
  49112. func (c *HostsDeleteCall) Header() http.Header {
  49113. if c.header_ == nil {
  49114. c.header_ = make(http.Header)
  49115. }
  49116. return c.header_
  49117. }
  49118. func (c *HostsDeleteCall) doRequest(alt string) (*http.Response, error) {
  49119. reqHeaders := make(http.Header)
  49120. for k, v := range c.header_ {
  49121. reqHeaders[k] = v
  49122. }
  49123. reqHeaders.Set("User-Agent", c.s.userAgent())
  49124. var body io.Reader = nil
  49125. c.urlParams_.Set("alt", alt)
  49126. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/hosts/{host}")
  49127. urls += "?" + c.urlParams_.Encode()
  49128. req, _ := http.NewRequest("DELETE", urls, body)
  49129. req.Header = reqHeaders
  49130. googleapi.Expand(req.URL, map[string]string{
  49131. "project": c.project,
  49132. "zone": c.zone,
  49133. "host": c.host,
  49134. })
  49135. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  49136. }
  49137. // Do executes the "compute.hosts.delete" call.
  49138. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  49139. // status code is an error. Response headers are in either
  49140. // *Operation.ServerResponse.Header or (if a response was returned at
  49141. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  49142. // to check whether the returned error was because
  49143. // http.StatusNotModified was returned.
  49144. func (c *HostsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  49145. gensupport.SetOptions(c.urlParams_, opts...)
  49146. res, err := c.doRequest("json")
  49147. if res != nil && res.StatusCode == http.StatusNotModified {
  49148. if res.Body != nil {
  49149. res.Body.Close()
  49150. }
  49151. return nil, &googleapi.Error{
  49152. Code: res.StatusCode,
  49153. Header: res.Header,
  49154. }
  49155. }
  49156. if err != nil {
  49157. return nil, err
  49158. }
  49159. defer googleapi.CloseBody(res)
  49160. if err := googleapi.CheckResponse(res); err != nil {
  49161. return nil, err
  49162. }
  49163. ret := &Operation{
  49164. ServerResponse: googleapi.ServerResponse{
  49165. Header: res.Header,
  49166. HTTPStatusCode: res.StatusCode,
  49167. },
  49168. }
  49169. target := &ret
  49170. if err := gensupport.DecodeResponse(target, res); err != nil {
  49171. return nil, err
  49172. }
  49173. return ret, nil
  49174. // {
  49175. // "description": "Deletes the specified Host resource.",
  49176. // "httpMethod": "DELETE",
  49177. // "id": "compute.hosts.delete",
  49178. // "parameterOrder": [
  49179. // "project",
  49180. // "zone",
  49181. // "host"
  49182. // ],
  49183. // "parameters": {
  49184. // "host": {
  49185. // "description": "Name of the Host resource to delete.",
  49186. // "location": "path",
  49187. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  49188. // "required": true,
  49189. // "type": "string"
  49190. // },
  49191. // "project": {
  49192. // "description": "Project ID for this request.",
  49193. // "location": "path",
  49194. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  49195. // "required": true,
  49196. // "type": "string"
  49197. // },
  49198. // "requestId": {
  49199. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  49200. // "location": "query",
  49201. // "type": "string"
  49202. // },
  49203. // "zone": {
  49204. // "description": "The name of the zone for this request.",
  49205. // "location": "path",
  49206. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  49207. // "required": true,
  49208. // "type": "string"
  49209. // }
  49210. // },
  49211. // "path": "{project}/zones/{zone}/hosts/{host}",
  49212. // "response": {
  49213. // "$ref": "Operation"
  49214. // },
  49215. // "scopes": [
  49216. // "https://www.googleapis.com/auth/cloud-platform",
  49217. // "https://www.googleapis.com/auth/compute"
  49218. // ]
  49219. // }
  49220. }
  49221. // method id "compute.hosts.get":
  49222. type HostsGetCall struct {
  49223. s *Service
  49224. project string
  49225. zone string
  49226. host string
  49227. urlParams_ gensupport.URLParams
  49228. ifNoneMatch_ string
  49229. ctx_ context.Context
  49230. header_ http.Header
  49231. }
  49232. // Get: Returns the specified host. Gets a list of available hosts by
  49233. // making a list() request.
  49234. func (r *HostsService) Get(project string, zone string, host string) *HostsGetCall {
  49235. c := &HostsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  49236. c.project = project
  49237. c.zone = zone
  49238. c.host = host
  49239. return c
  49240. }
  49241. // Fields allows partial responses to be retrieved. See
  49242. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  49243. // for more information.
  49244. func (c *HostsGetCall) Fields(s ...googleapi.Field) *HostsGetCall {
  49245. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  49246. return c
  49247. }
  49248. // IfNoneMatch sets the optional parameter which makes the operation
  49249. // fail if the object's ETag matches the given value. This is useful for
  49250. // getting updates only after the object has changed since the last
  49251. // request. Use googleapi.IsNotModified to check whether the response
  49252. // error from Do is the result of In-None-Match.
  49253. func (c *HostsGetCall) IfNoneMatch(entityTag string) *HostsGetCall {
  49254. c.ifNoneMatch_ = entityTag
  49255. return c
  49256. }
  49257. // Context sets the context to be used in this call's Do method. Any
  49258. // pending HTTP request will be aborted if the provided context is
  49259. // canceled.
  49260. func (c *HostsGetCall) Context(ctx context.Context) *HostsGetCall {
  49261. c.ctx_ = ctx
  49262. return c
  49263. }
  49264. // Header returns an http.Header that can be modified by the caller to
  49265. // add HTTP headers to the request.
  49266. func (c *HostsGetCall) Header() http.Header {
  49267. if c.header_ == nil {
  49268. c.header_ = make(http.Header)
  49269. }
  49270. return c.header_
  49271. }
  49272. func (c *HostsGetCall) doRequest(alt string) (*http.Response, error) {
  49273. reqHeaders := make(http.Header)
  49274. for k, v := range c.header_ {
  49275. reqHeaders[k] = v
  49276. }
  49277. reqHeaders.Set("User-Agent", c.s.userAgent())
  49278. if c.ifNoneMatch_ != "" {
  49279. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  49280. }
  49281. var body io.Reader = nil
  49282. c.urlParams_.Set("alt", alt)
  49283. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/hosts/{host}")
  49284. urls += "?" + c.urlParams_.Encode()
  49285. req, _ := http.NewRequest("GET", urls, body)
  49286. req.Header = reqHeaders
  49287. googleapi.Expand(req.URL, map[string]string{
  49288. "project": c.project,
  49289. "zone": c.zone,
  49290. "host": c.host,
  49291. })
  49292. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  49293. }
  49294. // Do executes the "compute.hosts.get" call.
  49295. // Exactly one of *Host or error will be non-nil. Any non-2xx status
  49296. // code is an error. Response headers are in either
  49297. // *Host.ServerResponse.Header or (if a response was returned at all) in
  49298. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  49299. // whether the returned error was because http.StatusNotModified was
  49300. // returned.
  49301. func (c *HostsGetCall) Do(opts ...googleapi.CallOption) (*Host, error) {
  49302. gensupport.SetOptions(c.urlParams_, opts...)
  49303. res, err := c.doRequest("json")
  49304. if res != nil && res.StatusCode == http.StatusNotModified {
  49305. if res.Body != nil {
  49306. res.Body.Close()
  49307. }
  49308. return nil, &googleapi.Error{
  49309. Code: res.StatusCode,
  49310. Header: res.Header,
  49311. }
  49312. }
  49313. if err != nil {
  49314. return nil, err
  49315. }
  49316. defer googleapi.CloseBody(res)
  49317. if err := googleapi.CheckResponse(res); err != nil {
  49318. return nil, err
  49319. }
  49320. ret := &Host{
  49321. ServerResponse: googleapi.ServerResponse{
  49322. Header: res.Header,
  49323. HTTPStatusCode: res.StatusCode,
  49324. },
  49325. }
  49326. target := &ret
  49327. if err := gensupport.DecodeResponse(target, res); err != nil {
  49328. return nil, err
  49329. }
  49330. return ret, nil
  49331. // {
  49332. // "description": "Returns the specified host. Gets a list of available hosts by making a list() request.",
  49333. // "httpMethod": "GET",
  49334. // "id": "compute.hosts.get",
  49335. // "parameterOrder": [
  49336. // "project",
  49337. // "zone",
  49338. // "host"
  49339. // ],
  49340. // "parameters": {
  49341. // "host": {
  49342. // "description": "Name of the host to return.",
  49343. // "location": "path",
  49344. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  49345. // "required": true,
  49346. // "type": "string"
  49347. // },
  49348. // "project": {
  49349. // "description": "Project ID for this request.",
  49350. // "location": "path",
  49351. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  49352. // "required": true,
  49353. // "type": "string"
  49354. // },
  49355. // "zone": {
  49356. // "description": "The name of the zone for this request.",
  49357. // "location": "path",
  49358. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  49359. // "required": true,
  49360. // "type": "string"
  49361. // }
  49362. // },
  49363. // "path": "{project}/zones/{zone}/hosts/{host}",
  49364. // "response": {
  49365. // "$ref": "Host"
  49366. // },
  49367. // "scopes": [
  49368. // "https://www.googleapis.com/auth/cloud-platform",
  49369. // "https://www.googleapis.com/auth/compute",
  49370. // "https://www.googleapis.com/auth/compute.readonly"
  49371. // ]
  49372. // }
  49373. }
  49374. // method id "compute.hosts.getIamPolicy":
  49375. type HostsGetIamPolicyCall struct {
  49376. s *Service
  49377. project string
  49378. zone string
  49379. resource string
  49380. urlParams_ gensupport.URLParams
  49381. ifNoneMatch_ string
  49382. ctx_ context.Context
  49383. header_ http.Header
  49384. }
  49385. // GetIamPolicy: Gets the access control policy for a resource. May be
  49386. // empty if no such policy or resource exists.
  49387. func (r *HostsService) GetIamPolicy(project string, zone string, resource string) *HostsGetIamPolicyCall {
  49388. c := &HostsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  49389. c.project = project
  49390. c.zone = zone
  49391. c.resource = resource
  49392. return c
  49393. }
  49394. // Fields allows partial responses to be retrieved. See
  49395. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  49396. // for more information.
  49397. func (c *HostsGetIamPolicyCall) Fields(s ...googleapi.Field) *HostsGetIamPolicyCall {
  49398. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  49399. return c
  49400. }
  49401. // IfNoneMatch sets the optional parameter which makes the operation
  49402. // fail if the object's ETag matches the given value. This is useful for
  49403. // getting updates only after the object has changed since the last
  49404. // request. Use googleapi.IsNotModified to check whether the response
  49405. // error from Do is the result of In-None-Match.
  49406. func (c *HostsGetIamPolicyCall) IfNoneMatch(entityTag string) *HostsGetIamPolicyCall {
  49407. c.ifNoneMatch_ = entityTag
  49408. return c
  49409. }
  49410. // Context sets the context to be used in this call's Do method. Any
  49411. // pending HTTP request will be aborted if the provided context is
  49412. // canceled.
  49413. func (c *HostsGetIamPolicyCall) Context(ctx context.Context) *HostsGetIamPolicyCall {
  49414. c.ctx_ = ctx
  49415. return c
  49416. }
  49417. // Header returns an http.Header that can be modified by the caller to
  49418. // add HTTP headers to the request.
  49419. func (c *HostsGetIamPolicyCall) Header() http.Header {
  49420. if c.header_ == nil {
  49421. c.header_ = make(http.Header)
  49422. }
  49423. return c.header_
  49424. }
  49425. func (c *HostsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  49426. reqHeaders := make(http.Header)
  49427. for k, v := range c.header_ {
  49428. reqHeaders[k] = v
  49429. }
  49430. reqHeaders.Set("User-Agent", c.s.userAgent())
  49431. if c.ifNoneMatch_ != "" {
  49432. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  49433. }
  49434. var body io.Reader = nil
  49435. c.urlParams_.Set("alt", alt)
  49436. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/hosts/{resource}/getIamPolicy")
  49437. urls += "?" + c.urlParams_.Encode()
  49438. req, _ := http.NewRequest("GET", urls, body)
  49439. req.Header = reqHeaders
  49440. googleapi.Expand(req.URL, map[string]string{
  49441. "project": c.project,
  49442. "zone": c.zone,
  49443. "resource": c.resource,
  49444. })
  49445. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  49446. }
  49447. // Do executes the "compute.hosts.getIamPolicy" call.
  49448. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  49449. // code is an error. Response headers are in either
  49450. // *Policy.ServerResponse.Header or (if a response was returned at all)
  49451. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  49452. // check whether the returned error was because http.StatusNotModified
  49453. // was returned.
  49454. func (c *HostsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  49455. gensupport.SetOptions(c.urlParams_, opts...)
  49456. res, err := c.doRequest("json")
  49457. if res != nil && res.StatusCode == http.StatusNotModified {
  49458. if res.Body != nil {
  49459. res.Body.Close()
  49460. }
  49461. return nil, &googleapi.Error{
  49462. Code: res.StatusCode,
  49463. Header: res.Header,
  49464. }
  49465. }
  49466. if err != nil {
  49467. return nil, err
  49468. }
  49469. defer googleapi.CloseBody(res)
  49470. if err := googleapi.CheckResponse(res); err != nil {
  49471. return nil, err
  49472. }
  49473. ret := &Policy{
  49474. ServerResponse: googleapi.ServerResponse{
  49475. Header: res.Header,
  49476. HTTPStatusCode: res.StatusCode,
  49477. },
  49478. }
  49479. target := &ret
  49480. if err := gensupport.DecodeResponse(target, res); err != nil {
  49481. return nil, err
  49482. }
  49483. return ret, nil
  49484. // {
  49485. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  49486. // "httpMethod": "GET",
  49487. // "id": "compute.hosts.getIamPolicy",
  49488. // "parameterOrder": [
  49489. // "project",
  49490. // "zone",
  49491. // "resource"
  49492. // ],
  49493. // "parameters": {
  49494. // "project": {
  49495. // "description": "Project ID for this request.",
  49496. // "location": "path",
  49497. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  49498. // "required": true,
  49499. // "type": "string"
  49500. // },
  49501. // "resource": {
  49502. // "description": "Name of the resource for this request.",
  49503. // "location": "path",
  49504. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  49505. // "required": true,
  49506. // "type": "string"
  49507. // },
  49508. // "zone": {
  49509. // "description": "The name of the zone for this request.",
  49510. // "location": "path",
  49511. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  49512. // "required": true,
  49513. // "type": "string"
  49514. // }
  49515. // },
  49516. // "path": "{project}/zones/{zone}/hosts/{resource}/getIamPolicy",
  49517. // "response": {
  49518. // "$ref": "Policy"
  49519. // },
  49520. // "scopes": [
  49521. // "https://www.googleapis.com/auth/cloud-platform",
  49522. // "https://www.googleapis.com/auth/compute",
  49523. // "https://www.googleapis.com/auth/compute.readonly"
  49524. // ]
  49525. // }
  49526. }
  49527. // method id "compute.hosts.insert":
  49528. type HostsInsertCall struct {
  49529. s *Service
  49530. project string
  49531. zone string
  49532. host *Host
  49533. urlParams_ gensupport.URLParams
  49534. ctx_ context.Context
  49535. header_ http.Header
  49536. }
  49537. // Insert: Creates a host resource in the specified project using the
  49538. // data included in the request.
  49539. func (r *HostsService) Insert(project string, zone string, host *Host) *HostsInsertCall {
  49540. c := &HostsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  49541. c.project = project
  49542. c.zone = zone
  49543. c.host = host
  49544. return c
  49545. }
  49546. // RequestId sets the optional parameter "requestId": An optional
  49547. // request ID to identify requests. Specify a unique request ID so that
  49548. // if you must retry your request, the server will know to ignore the
  49549. // request if it has already been completed.
  49550. //
  49551. // For example, consider a situation where you make an initial request
  49552. // and the request times out. If you make the request again with the
  49553. // same request ID, the server can check if original operation with the
  49554. // same request ID was received, and if so, will ignore the second
  49555. // request. This prevents clients from accidentally creating duplicate
  49556. // commitments.
  49557. //
  49558. // The request ID must be a valid UUID with the exception that zero UUID
  49559. // is not supported (00000000-0000-0000-0000-000000000000).
  49560. func (c *HostsInsertCall) RequestId(requestId string) *HostsInsertCall {
  49561. c.urlParams_.Set("requestId", requestId)
  49562. return c
  49563. }
  49564. // Fields allows partial responses to be retrieved. See
  49565. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  49566. // for more information.
  49567. func (c *HostsInsertCall) Fields(s ...googleapi.Field) *HostsInsertCall {
  49568. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  49569. return c
  49570. }
  49571. // Context sets the context to be used in this call's Do method. Any
  49572. // pending HTTP request will be aborted if the provided context is
  49573. // canceled.
  49574. func (c *HostsInsertCall) Context(ctx context.Context) *HostsInsertCall {
  49575. c.ctx_ = ctx
  49576. return c
  49577. }
  49578. // Header returns an http.Header that can be modified by the caller to
  49579. // add HTTP headers to the request.
  49580. func (c *HostsInsertCall) Header() http.Header {
  49581. if c.header_ == nil {
  49582. c.header_ = make(http.Header)
  49583. }
  49584. return c.header_
  49585. }
  49586. func (c *HostsInsertCall) doRequest(alt string) (*http.Response, error) {
  49587. reqHeaders := make(http.Header)
  49588. for k, v := range c.header_ {
  49589. reqHeaders[k] = v
  49590. }
  49591. reqHeaders.Set("User-Agent", c.s.userAgent())
  49592. var body io.Reader = nil
  49593. body, err := googleapi.WithoutDataWrapper.JSONReader(c.host)
  49594. if err != nil {
  49595. return nil, err
  49596. }
  49597. reqHeaders.Set("Content-Type", "application/json")
  49598. c.urlParams_.Set("alt", alt)
  49599. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/hosts")
  49600. urls += "?" + c.urlParams_.Encode()
  49601. req, _ := http.NewRequest("POST", urls, body)
  49602. req.Header = reqHeaders
  49603. googleapi.Expand(req.URL, map[string]string{
  49604. "project": c.project,
  49605. "zone": c.zone,
  49606. })
  49607. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  49608. }
  49609. // Do executes the "compute.hosts.insert" call.
  49610. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  49611. // status code is an error. Response headers are in either
  49612. // *Operation.ServerResponse.Header or (if a response was returned at
  49613. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  49614. // to check whether the returned error was because
  49615. // http.StatusNotModified was returned.
  49616. func (c *HostsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  49617. gensupport.SetOptions(c.urlParams_, opts...)
  49618. res, err := c.doRequest("json")
  49619. if res != nil && res.StatusCode == http.StatusNotModified {
  49620. if res.Body != nil {
  49621. res.Body.Close()
  49622. }
  49623. return nil, &googleapi.Error{
  49624. Code: res.StatusCode,
  49625. Header: res.Header,
  49626. }
  49627. }
  49628. if err != nil {
  49629. return nil, err
  49630. }
  49631. defer googleapi.CloseBody(res)
  49632. if err := googleapi.CheckResponse(res); err != nil {
  49633. return nil, err
  49634. }
  49635. ret := &Operation{
  49636. ServerResponse: googleapi.ServerResponse{
  49637. Header: res.Header,
  49638. HTTPStatusCode: res.StatusCode,
  49639. },
  49640. }
  49641. target := &ret
  49642. if err := gensupport.DecodeResponse(target, res); err != nil {
  49643. return nil, err
  49644. }
  49645. return ret, nil
  49646. // {
  49647. // "description": "Creates a host resource in the specified project using the data included in the request.",
  49648. // "httpMethod": "POST",
  49649. // "id": "compute.hosts.insert",
  49650. // "parameterOrder": [
  49651. // "project",
  49652. // "zone"
  49653. // ],
  49654. // "parameters": {
  49655. // "project": {
  49656. // "description": "Project ID for this request.",
  49657. // "location": "path",
  49658. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  49659. // "required": true,
  49660. // "type": "string"
  49661. // },
  49662. // "requestId": {
  49663. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  49664. // "location": "query",
  49665. // "type": "string"
  49666. // },
  49667. // "zone": {
  49668. // "description": "The name of the zone for this request.",
  49669. // "location": "path",
  49670. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  49671. // "required": true,
  49672. // "type": "string"
  49673. // }
  49674. // },
  49675. // "path": "{project}/zones/{zone}/hosts",
  49676. // "request": {
  49677. // "$ref": "Host"
  49678. // },
  49679. // "response": {
  49680. // "$ref": "Operation"
  49681. // },
  49682. // "scopes": [
  49683. // "https://www.googleapis.com/auth/cloud-platform",
  49684. // "https://www.googleapis.com/auth/compute"
  49685. // ]
  49686. // }
  49687. }
  49688. // method id "compute.hosts.list":
  49689. type HostsListCall struct {
  49690. s *Service
  49691. project string
  49692. zone string
  49693. urlParams_ gensupport.URLParams
  49694. ifNoneMatch_ string
  49695. ctx_ context.Context
  49696. header_ http.Header
  49697. }
  49698. // List: Retrieves a list of hosts available to the specified project.
  49699. func (r *HostsService) List(project string, zone string) *HostsListCall {
  49700. c := &HostsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  49701. c.project = project
  49702. c.zone = zone
  49703. return c
  49704. }
  49705. // Filter sets the optional parameter "filter": A filter expression that
  49706. // filters resources listed in the response. The expression must specify
  49707. // the field name, a comparison operator, and the value that you want to
  49708. // use for filtering. The value must be a string, a number, or a
  49709. // boolean. The comparison operator must be either =, !=, >, or <.
  49710. //
  49711. // For example, if you are filtering Compute Engine instances, you can
  49712. // exclude instances named example-instance by specifying name !=
  49713. // example-instance.
  49714. //
  49715. // You can also filter nested fields. For example, you could specify
  49716. // scheduling.automaticRestart = false to include instances only if they
  49717. // are not scheduled for automatic restarts. You can use filtering on
  49718. // nested fields to filter based on resource labels.
  49719. //
  49720. // To filter on multiple expressions, provide each separate expression
  49721. // within parentheses. For example, (scheduling.automaticRestart = true)
  49722. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  49723. // AND expression. However, you can include AND and OR expressions
  49724. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  49725. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  49726. // true).
  49727. func (c *HostsListCall) Filter(filter string) *HostsListCall {
  49728. c.urlParams_.Set("filter", filter)
  49729. return c
  49730. }
  49731. // MaxResults sets the optional parameter "maxResults": The maximum
  49732. // number of results per page that should be returned. If the number of
  49733. // available results is larger than maxResults, Compute Engine returns a
  49734. // nextPageToken that can be used to get the next page of results in
  49735. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  49736. // (Default: 500)
  49737. func (c *HostsListCall) MaxResults(maxResults int64) *HostsListCall {
  49738. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  49739. return c
  49740. }
  49741. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  49742. // a certain order. By default, results are returned in alphanumerical
  49743. // order based on the resource name.
  49744. //
  49745. // You can also sort results in descending order based on the creation
  49746. // timestamp using orderBy="creationTimestamp desc". This sorts results
  49747. // based on the creationTimestamp field in reverse chronological order
  49748. // (newest result first). Use this to sort resources like operations so
  49749. // that the newest operation is returned first.
  49750. //
  49751. // Currently, only sorting by name or creationTimestamp desc is
  49752. // supported.
  49753. func (c *HostsListCall) OrderBy(orderBy string) *HostsListCall {
  49754. c.urlParams_.Set("orderBy", orderBy)
  49755. return c
  49756. }
  49757. // PageToken sets the optional parameter "pageToken": Specifies a page
  49758. // token to use. Set pageToken to the nextPageToken returned by a
  49759. // previous list request to get the next page of results.
  49760. func (c *HostsListCall) PageToken(pageToken string) *HostsListCall {
  49761. c.urlParams_.Set("pageToken", pageToken)
  49762. return c
  49763. }
  49764. // Fields allows partial responses to be retrieved. See
  49765. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  49766. // for more information.
  49767. func (c *HostsListCall) Fields(s ...googleapi.Field) *HostsListCall {
  49768. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  49769. return c
  49770. }
  49771. // IfNoneMatch sets the optional parameter which makes the operation
  49772. // fail if the object's ETag matches the given value. This is useful for
  49773. // getting updates only after the object has changed since the last
  49774. // request. Use googleapi.IsNotModified to check whether the response
  49775. // error from Do is the result of In-None-Match.
  49776. func (c *HostsListCall) IfNoneMatch(entityTag string) *HostsListCall {
  49777. c.ifNoneMatch_ = entityTag
  49778. return c
  49779. }
  49780. // Context sets the context to be used in this call's Do method. Any
  49781. // pending HTTP request will be aborted if the provided context is
  49782. // canceled.
  49783. func (c *HostsListCall) Context(ctx context.Context) *HostsListCall {
  49784. c.ctx_ = ctx
  49785. return c
  49786. }
  49787. // Header returns an http.Header that can be modified by the caller to
  49788. // add HTTP headers to the request.
  49789. func (c *HostsListCall) Header() http.Header {
  49790. if c.header_ == nil {
  49791. c.header_ = make(http.Header)
  49792. }
  49793. return c.header_
  49794. }
  49795. func (c *HostsListCall) doRequest(alt string) (*http.Response, error) {
  49796. reqHeaders := make(http.Header)
  49797. for k, v := range c.header_ {
  49798. reqHeaders[k] = v
  49799. }
  49800. reqHeaders.Set("User-Agent", c.s.userAgent())
  49801. if c.ifNoneMatch_ != "" {
  49802. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  49803. }
  49804. var body io.Reader = nil
  49805. c.urlParams_.Set("alt", alt)
  49806. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/hosts")
  49807. urls += "?" + c.urlParams_.Encode()
  49808. req, _ := http.NewRequest("GET", urls, body)
  49809. req.Header = reqHeaders
  49810. googleapi.Expand(req.URL, map[string]string{
  49811. "project": c.project,
  49812. "zone": c.zone,
  49813. })
  49814. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  49815. }
  49816. // Do executes the "compute.hosts.list" call.
  49817. // Exactly one of *HostList or error will be non-nil. Any non-2xx status
  49818. // code is an error. Response headers are in either
  49819. // *HostList.ServerResponse.Header or (if a response was returned at
  49820. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  49821. // to check whether the returned error was because
  49822. // http.StatusNotModified was returned.
  49823. func (c *HostsListCall) Do(opts ...googleapi.CallOption) (*HostList, error) {
  49824. gensupport.SetOptions(c.urlParams_, opts...)
  49825. res, err := c.doRequest("json")
  49826. if res != nil && res.StatusCode == http.StatusNotModified {
  49827. if res.Body != nil {
  49828. res.Body.Close()
  49829. }
  49830. return nil, &googleapi.Error{
  49831. Code: res.StatusCode,
  49832. Header: res.Header,
  49833. }
  49834. }
  49835. if err != nil {
  49836. return nil, err
  49837. }
  49838. defer googleapi.CloseBody(res)
  49839. if err := googleapi.CheckResponse(res); err != nil {
  49840. return nil, err
  49841. }
  49842. ret := &HostList{
  49843. ServerResponse: googleapi.ServerResponse{
  49844. Header: res.Header,
  49845. HTTPStatusCode: res.StatusCode,
  49846. },
  49847. }
  49848. target := &ret
  49849. if err := gensupport.DecodeResponse(target, res); err != nil {
  49850. return nil, err
  49851. }
  49852. return ret, nil
  49853. // {
  49854. // "description": "Retrieves a list of hosts available to the specified project.",
  49855. // "httpMethod": "GET",
  49856. // "id": "compute.hosts.list",
  49857. // "parameterOrder": [
  49858. // "project",
  49859. // "zone"
  49860. // ],
  49861. // "parameters": {
  49862. // "filter": {
  49863. // "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).",
  49864. // "location": "query",
  49865. // "type": "string"
  49866. // },
  49867. // "maxResults": {
  49868. // "default": "500",
  49869. // "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)",
  49870. // "format": "uint32",
  49871. // "location": "query",
  49872. // "minimum": "0",
  49873. // "type": "integer"
  49874. // },
  49875. // "orderBy": {
  49876. // "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.",
  49877. // "location": "query",
  49878. // "type": "string"
  49879. // },
  49880. // "pageToken": {
  49881. // "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.",
  49882. // "location": "query",
  49883. // "type": "string"
  49884. // },
  49885. // "project": {
  49886. // "description": "Project ID for this request.",
  49887. // "location": "path",
  49888. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  49889. // "required": true,
  49890. // "type": "string"
  49891. // },
  49892. // "zone": {
  49893. // "description": "The name of the zone for this request.",
  49894. // "location": "path",
  49895. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  49896. // "required": true,
  49897. // "type": "string"
  49898. // }
  49899. // },
  49900. // "path": "{project}/zones/{zone}/hosts",
  49901. // "response": {
  49902. // "$ref": "HostList"
  49903. // },
  49904. // "scopes": [
  49905. // "https://www.googleapis.com/auth/cloud-platform",
  49906. // "https://www.googleapis.com/auth/compute",
  49907. // "https://www.googleapis.com/auth/compute.readonly"
  49908. // ]
  49909. // }
  49910. }
  49911. // Pages invokes f for each page of results.
  49912. // A non-nil error returned from f will halt the iteration.
  49913. // The provided context supersedes any context provided to the Context method.
  49914. func (c *HostsListCall) Pages(ctx context.Context, f func(*HostList) error) error {
  49915. c.ctx_ = ctx
  49916. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  49917. for {
  49918. x, err := c.Do()
  49919. if err != nil {
  49920. return err
  49921. }
  49922. if err := f(x); err != nil {
  49923. return err
  49924. }
  49925. if x.NextPageToken == "" {
  49926. return nil
  49927. }
  49928. c.PageToken(x.NextPageToken)
  49929. }
  49930. }
  49931. // method id "compute.hosts.setIamPolicy":
  49932. type HostsSetIamPolicyCall struct {
  49933. s *Service
  49934. project string
  49935. zone string
  49936. resource string
  49937. zonesetpolicyrequest *ZoneSetPolicyRequest
  49938. urlParams_ gensupport.URLParams
  49939. ctx_ context.Context
  49940. header_ http.Header
  49941. }
  49942. // SetIamPolicy: Sets the access control policy on the specified
  49943. // resource. Replaces any existing policy.
  49944. func (r *HostsService) SetIamPolicy(project string, zone string, resource string, zonesetpolicyrequest *ZoneSetPolicyRequest) *HostsSetIamPolicyCall {
  49945. c := &HostsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  49946. c.project = project
  49947. c.zone = zone
  49948. c.resource = resource
  49949. c.zonesetpolicyrequest = zonesetpolicyrequest
  49950. return c
  49951. }
  49952. // Fields allows partial responses to be retrieved. See
  49953. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  49954. // for more information.
  49955. func (c *HostsSetIamPolicyCall) Fields(s ...googleapi.Field) *HostsSetIamPolicyCall {
  49956. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  49957. return c
  49958. }
  49959. // Context sets the context to be used in this call's Do method. Any
  49960. // pending HTTP request will be aborted if the provided context is
  49961. // canceled.
  49962. func (c *HostsSetIamPolicyCall) Context(ctx context.Context) *HostsSetIamPolicyCall {
  49963. c.ctx_ = ctx
  49964. return c
  49965. }
  49966. // Header returns an http.Header that can be modified by the caller to
  49967. // add HTTP headers to the request.
  49968. func (c *HostsSetIamPolicyCall) Header() http.Header {
  49969. if c.header_ == nil {
  49970. c.header_ = make(http.Header)
  49971. }
  49972. return c.header_
  49973. }
  49974. func (c *HostsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  49975. reqHeaders := make(http.Header)
  49976. for k, v := range c.header_ {
  49977. reqHeaders[k] = v
  49978. }
  49979. reqHeaders.Set("User-Agent", c.s.userAgent())
  49980. var body io.Reader = nil
  49981. body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetpolicyrequest)
  49982. if err != nil {
  49983. return nil, err
  49984. }
  49985. reqHeaders.Set("Content-Type", "application/json")
  49986. c.urlParams_.Set("alt", alt)
  49987. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/hosts/{resource}/setIamPolicy")
  49988. urls += "?" + c.urlParams_.Encode()
  49989. req, _ := http.NewRequest("POST", urls, body)
  49990. req.Header = reqHeaders
  49991. googleapi.Expand(req.URL, map[string]string{
  49992. "project": c.project,
  49993. "zone": c.zone,
  49994. "resource": c.resource,
  49995. })
  49996. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  49997. }
  49998. // Do executes the "compute.hosts.setIamPolicy" call.
  49999. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  50000. // code is an error. Response headers are in either
  50001. // *Policy.ServerResponse.Header or (if a response was returned at all)
  50002. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  50003. // check whether the returned error was because http.StatusNotModified
  50004. // was returned.
  50005. func (c *HostsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  50006. gensupport.SetOptions(c.urlParams_, opts...)
  50007. res, err := c.doRequest("json")
  50008. if res != nil && res.StatusCode == http.StatusNotModified {
  50009. if res.Body != nil {
  50010. res.Body.Close()
  50011. }
  50012. return nil, &googleapi.Error{
  50013. Code: res.StatusCode,
  50014. Header: res.Header,
  50015. }
  50016. }
  50017. if err != nil {
  50018. return nil, err
  50019. }
  50020. defer googleapi.CloseBody(res)
  50021. if err := googleapi.CheckResponse(res); err != nil {
  50022. return nil, err
  50023. }
  50024. ret := &Policy{
  50025. ServerResponse: googleapi.ServerResponse{
  50026. Header: res.Header,
  50027. HTTPStatusCode: res.StatusCode,
  50028. },
  50029. }
  50030. target := &ret
  50031. if err := gensupport.DecodeResponse(target, res); err != nil {
  50032. return nil, err
  50033. }
  50034. return ret, nil
  50035. // {
  50036. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  50037. // "httpMethod": "POST",
  50038. // "id": "compute.hosts.setIamPolicy",
  50039. // "parameterOrder": [
  50040. // "project",
  50041. // "zone",
  50042. // "resource"
  50043. // ],
  50044. // "parameters": {
  50045. // "project": {
  50046. // "description": "Project ID for this request.",
  50047. // "location": "path",
  50048. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  50049. // "required": true,
  50050. // "type": "string"
  50051. // },
  50052. // "resource": {
  50053. // "description": "Name of the resource for this request.",
  50054. // "location": "path",
  50055. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  50056. // "required": true,
  50057. // "type": "string"
  50058. // },
  50059. // "zone": {
  50060. // "description": "The name of the zone for this request.",
  50061. // "location": "path",
  50062. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  50063. // "required": true,
  50064. // "type": "string"
  50065. // }
  50066. // },
  50067. // "path": "{project}/zones/{zone}/hosts/{resource}/setIamPolicy",
  50068. // "request": {
  50069. // "$ref": "ZoneSetPolicyRequest"
  50070. // },
  50071. // "response": {
  50072. // "$ref": "Policy"
  50073. // },
  50074. // "scopes": [
  50075. // "https://www.googleapis.com/auth/cloud-platform",
  50076. // "https://www.googleapis.com/auth/compute"
  50077. // ]
  50078. // }
  50079. }
  50080. // method id "compute.hosts.testIamPermissions":
  50081. type HostsTestIamPermissionsCall struct {
  50082. s *Service
  50083. project string
  50084. zone string
  50085. resource string
  50086. testpermissionsrequest *TestPermissionsRequest
  50087. urlParams_ gensupport.URLParams
  50088. ctx_ context.Context
  50089. header_ http.Header
  50090. }
  50091. // TestIamPermissions: Returns permissions that a caller has on the
  50092. // specified resource.
  50093. func (r *HostsService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *HostsTestIamPermissionsCall {
  50094. c := &HostsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  50095. c.project = project
  50096. c.zone = zone
  50097. c.resource = resource
  50098. c.testpermissionsrequest = testpermissionsrequest
  50099. return c
  50100. }
  50101. // Fields allows partial responses to be retrieved. See
  50102. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  50103. // for more information.
  50104. func (c *HostsTestIamPermissionsCall) Fields(s ...googleapi.Field) *HostsTestIamPermissionsCall {
  50105. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  50106. return c
  50107. }
  50108. // Context sets the context to be used in this call's Do method. Any
  50109. // pending HTTP request will be aborted if the provided context is
  50110. // canceled.
  50111. func (c *HostsTestIamPermissionsCall) Context(ctx context.Context) *HostsTestIamPermissionsCall {
  50112. c.ctx_ = ctx
  50113. return c
  50114. }
  50115. // Header returns an http.Header that can be modified by the caller to
  50116. // add HTTP headers to the request.
  50117. func (c *HostsTestIamPermissionsCall) Header() http.Header {
  50118. if c.header_ == nil {
  50119. c.header_ = make(http.Header)
  50120. }
  50121. return c.header_
  50122. }
  50123. func (c *HostsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  50124. reqHeaders := make(http.Header)
  50125. for k, v := range c.header_ {
  50126. reqHeaders[k] = v
  50127. }
  50128. reqHeaders.Set("User-Agent", c.s.userAgent())
  50129. var body io.Reader = nil
  50130. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  50131. if err != nil {
  50132. return nil, err
  50133. }
  50134. reqHeaders.Set("Content-Type", "application/json")
  50135. c.urlParams_.Set("alt", alt)
  50136. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/hosts/{resource}/testIamPermissions")
  50137. urls += "?" + c.urlParams_.Encode()
  50138. req, _ := http.NewRequest("POST", urls, body)
  50139. req.Header = reqHeaders
  50140. googleapi.Expand(req.URL, map[string]string{
  50141. "project": c.project,
  50142. "zone": c.zone,
  50143. "resource": c.resource,
  50144. })
  50145. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  50146. }
  50147. // Do executes the "compute.hosts.testIamPermissions" call.
  50148. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  50149. // non-2xx status code is an error. Response headers are in either
  50150. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  50151. // returned at all) in error.(*googleapi.Error).Header. Use
  50152. // googleapi.IsNotModified to check whether the returned error was
  50153. // because http.StatusNotModified was returned.
  50154. func (c *HostsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  50155. gensupport.SetOptions(c.urlParams_, opts...)
  50156. res, err := c.doRequest("json")
  50157. if res != nil && res.StatusCode == http.StatusNotModified {
  50158. if res.Body != nil {
  50159. res.Body.Close()
  50160. }
  50161. return nil, &googleapi.Error{
  50162. Code: res.StatusCode,
  50163. Header: res.Header,
  50164. }
  50165. }
  50166. if err != nil {
  50167. return nil, err
  50168. }
  50169. defer googleapi.CloseBody(res)
  50170. if err := googleapi.CheckResponse(res); err != nil {
  50171. return nil, err
  50172. }
  50173. ret := &TestPermissionsResponse{
  50174. ServerResponse: googleapi.ServerResponse{
  50175. Header: res.Header,
  50176. HTTPStatusCode: res.StatusCode,
  50177. },
  50178. }
  50179. target := &ret
  50180. if err := gensupport.DecodeResponse(target, res); err != nil {
  50181. return nil, err
  50182. }
  50183. return ret, nil
  50184. // {
  50185. // "description": "Returns permissions that a caller has on the specified resource.",
  50186. // "httpMethod": "POST",
  50187. // "id": "compute.hosts.testIamPermissions",
  50188. // "parameterOrder": [
  50189. // "project",
  50190. // "zone",
  50191. // "resource"
  50192. // ],
  50193. // "parameters": {
  50194. // "project": {
  50195. // "description": "Project ID for this request.",
  50196. // "location": "path",
  50197. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  50198. // "required": true,
  50199. // "type": "string"
  50200. // },
  50201. // "resource": {
  50202. // "description": "Name of the resource for this request.",
  50203. // "location": "path",
  50204. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  50205. // "required": true,
  50206. // "type": "string"
  50207. // },
  50208. // "zone": {
  50209. // "description": "The name of the zone for this request.",
  50210. // "location": "path",
  50211. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  50212. // "required": true,
  50213. // "type": "string"
  50214. // }
  50215. // },
  50216. // "path": "{project}/zones/{zone}/hosts/{resource}/testIamPermissions",
  50217. // "request": {
  50218. // "$ref": "TestPermissionsRequest"
  50219. // },
  50220. // "response": {
  50221. // "$ref": "TestPermissionsResponse"
  50222. // },
  50223. // "scopes": [
  50224. // "https://www.googleapis.com/auth/cloud-platform",
  50225. // "https://www.googleapis.com/auth/compute",
  50226. // "https://www.googleapis.com/auth/compute.readonly"
  50227. // ]
  50228. // }
  50229. }
  50230. // method id "compute.httpHealthChecks.delete":
  50231. type HttpHealthChecksDeleteCall struct {
  50232. s *Service
  50233. project string
  50234. httpHealthCheck string
  50235. urlParams_ gensupport.URLParams
  50236. ctx_ context.Context
  50237. header_ http.Header
  50238. }
  50239. // Delete: Deletes the specified HttpHealthCheck resource.
  50240. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/delete
  50241. func (r *HttpHealthChecksService) Delete(project string, httpHealthCheck string) *HttpHealthChecksDeleteCall {
  50242. c := &HttpHealthChecksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  50243. c.project = project
  50244. c.httpHealthCheck = httpHealthCheck
  50245. return c
  50246. }
  50247. // RequestId sets the optional parameter "requestId": An optional
  50248. // request ID to identify requests. Specify a unique request ID so that
  50249. // if you must retry your request, the server will know to ignore the
  50250. // request if it has already been completed.
  50251. //
  50252. // For example, consider a situation where you make an initial request
  50253. // and the request times out. If you make the request again with the
  50254. // same request ID, the server can check if original operation with the
  50255. // same request ID was received, and if so, will ignore the second
  50256. // request. This prevents clients from accidentally creating duplicate
  50257. // commitments.
  50258. //
  50259. // The request ID must be a valid UUID with the exception that zero UUID
  50260. // is not supported (00000000-0000-0000-0000-000000000000).
  50261. func (c *HttpHealthChecksDeleteCall) RequestId(requestId string) *HttpHealthChecksDeleteCall {
  50262. c.urlParams_.Set("requestId", requestId)
  50263. return c
  50264. }
  50265. // Fields allows partial responses to be retrieved. See
  50266. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  50267. // for more information.
  50268. func (c *HttpHealthChecksDeleteCall) Fields(s ...googleapi.Field) *HttpHealthChecksDeleteCall {
  50269. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  50270. return c
  50271. }
  50272. // Context sets the context to be used in this call's Do method. Any
  50273. // pending HTTP request will be aborted if the provided context is
  50274. // canceled.
  50275. func (c *HttpHealthChecksDeleteCall) Context(ctx context.Context) *HttpHealthChecksDeleteCall {
  50276. c.ctx_ = ctx
  50277. return c
  50278. }
  50279. // Header returns an http.Header that can be modified by the caller to
  50280. // add HTTP headers to the request.
  50281. func (c *HttpHealthChecksDeleteCall) Header() http.Header {
  50282. if c.header_ == nil {
  50283. c.header_ = make(http.Header)
  50284. }
  50285. return c.header_
  50286. }
  50287. func (c *HttpHealthChecksDeleteCall) doRequest(alt string) (*http.Response, error) {
  50288. reqHeaders := make(http.Header)
  50289. for k, v := range c.header_ {
  50290. reqHeaders[k] = v
  50291. }
  50292. reqHeaders.Set("User-Agent", c.s.userAgent())
  50293. var body io.Reader = nil
  50294. c.urlParams_.Set("alt", alt)
  50295. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{httpHealthCheck}")
  50296. urls += "?" + c.urlParams_.Encode()
  50297. req, _ := http.NewRequest("DELETE", urls, body)
  50298. req.Header = reqHeaders
  50299. googleapi.Expand(req.URL, map[string]string{
  50300. "project": c.project,
  50301. "httpHealthCheck": c.httpHealthCheck,
  50302. })
  50303. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  50304. }
  50305. // Do executes the "compute.httpHealthChecks.delete" call.
  50306. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  50307. // status code is an error. Response headers are in either
  50308. // *Operation.ServerResponse.Header or (if a response was returned at
  50309. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  50310. // to check whether the returned error was because
  50311. // http.StatusNotModified was returned.
  50312. func (c *HttpHealthChecksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  50313. gensupport.SetOptions(c.urlParams_, opts...)
  50314. res, err := c.doRequest("json")
  50315. if res != nil && res.StatusCode == http.StatusNotModified {
  50316. if res.Body != nil {
  50317. res.Body.Close()
  50318. }
  50319. return nil, &googleapi.Error{
  50320. Code: res.StatusCode,
  50321. Header: res.Header,
  50322. }
  50323. }
  50324. if err != nil {
  50325. return nil, err
  50326. }
  50327. defer googleapi.CloseBody(res)
  50328. if err := googleapi.CheckResponse(res); err != nil {
  50329. return nil, err
  50330. }
  50331. ret := &Operation{
  50332. ServerResponse: googleapi.ServerResponse{
  50333. Header: res.Header,
  50334. HTTPStatusCode: res.StatusCode,
  50335. },
  50336. }
  50337. target := &ret
  50338. if err := gensupport.DecodeResponse(target, res); err != nil {
  50339. return nil, err
  50340. }
  50341. return ret, nil
  50342. // {
  50343. // "description": "Deletes the specified HttpHealthCheck resource.",
  50344. // "httpMethod": "DELETE",
  50345. // "id": "compute.httpHealthChecks.delete",
  50346. // "parameterOrder": [
  50347. // "project",
  50348. // "httpHealthCheck"
  50349. // ],
  50350. // "parameters": {
  50351. // "httpHealthCheck": {
  50352. // "description": "Name of the HttpHealthCheck resource to delete.",
  50353. // "location": "path",
  50354. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  50355. // "required": true,
  50356. // "type": "string"
  50357. // },
  50358. // "project": {
  50359. // "description": "Project ID for this request.",
  50360. // "location": "path",
  50361. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  50362. // "required": true,
  50363. // "type": "string"
  50364. // },
  50365. // "requestId": {
  50366. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  50367. // "location": "query",
  50368. // "type": "string"
  50369. // }
  50370. // },
  50371. // "path": "{project}/global/httpHealthChecks/{httpHealthCheck}",
  50372. // "response": {
  50373. // "$ref": "Operation"
  50374. // },
  50375. // "scopes": [
  50376. // "https://www.googleapis.com/auth/cloud-platform",
  50377. // "https://www.googleapis.com/auth/compute"
  50378. // ]
  50379. // }
  50380. }
  50381. // method id "compute.httpHealthChecks.get":
  50382. type HttpHealthChecksGetCall struct {
  50383. s *Service
  50384. project string
  50385. httpHealthCheck string
  50386. urlParams_ gensupport.URLParams
  50387. ifNoneMatch_ string
  50388. ctx_ context.Context
  50389. header_ http.Header
  50390. }
  50391. // Get: Returns the specified HttpHealthCheck resource. Gets a list of
  50392. // available HTTP health checks by making a list() request.
  50393. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/get
  50394. func (r *HttpHealthChecksService) Get(project string, httpHealthCheck string) *HttpHealthChecksGetCall {
  50395. c := &HttpHealthChecksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  50396. c.project = project
  50397. c.httpHealthCheck = httpHealthCheck
  50398. return c
  50399. }
  50400. // Fields allows partial responses to be retrieved. See
  50401. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  50402. // for more information.
  50403. func (c *HttpHealthChecksGetCall) Fields(s ...googleapi.Field) *HttpHealthChecksGetCall {
  50404. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  50405. return c
  50406. }
  50407. // IfNoneMatch sets the optional parameter which makes the operation
  50408. // fail if the object's ETag matches the given value. This is useful for
  50409. // getting updates only after the object has changed since the last
  50410. // request. Use googleapi.IsNotModified to check whether the response
  50411. // error from Do is the result of In-None-Match.
  50412. func (c *HttpHealthChecksGetCall) IfNoneMatch(entityTag string) *HttpHealthChecksGetCall {
  50413. c.ifNoneMatch_ = entityTag
  50414. return c
  50415. }
  50416. // Context sets the context to be used in this call's Do method. Any
  50417. // pending HTTP request will be aborted if the provided context is
  50418. // canceled.
  50419. func (c *HttpHealthChecksGetCall) Context(ctx context.Context) *HttpHealthChecksGetCall {
  50420. c.ctx_ = ctx
  50421. return c
  50422. }
  50423. // Header returns an http.Header that can be modified by the caller to
  50424. // add HTTP headers to the request.
  50425. func (c *HttpHealthChecksGetCall) Header() http.Header {
  50426. if c.header_ == nil {
  50427. c.header_ = make(http.Header)
  50428. }
  50429. return c.header_
  50430. }
  50431. func (c *HttpHealthChecksGetCall) doRequest(alt string) (*http.Response, error) {
  50432. reqHeaders := make(http.Header)
  50433. for k, v := range c.header_ {
  50434. reqHeaders[k] = v
  50435. }
  50436. reqHeaders.Set("User-Agent", c.s.userAgent())
  50437. if c.ifNoneMatch_ != "" {
  50438. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  50439. }
  50440. var body io.Reader = nil
  50441. c.urlParams_.Set("alt", alt)
  50442. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{httpHealthCheck}")
  50443. urls += "?" + c.urlParams_.Encode()
  50444. req, _ := http.NewRequest("GET", urls, body)
  50445. req.Header = reqHeaders
  50446. googleapi.Expand(req.URL, map[string]string{
  50447. "project": c.project,
  50448. "httpHealthCheck": c.httpHealthCheck,
  50449. })
  50450. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  50451. }
  50452. // Do executes the "compute.httpHealthChecks.get" call.
  50453. // Exactly one of *HttpHealthCheck or error will be non-nil. Any non-2xx
  50454. // status code is an error. Response headers are in either
  50455. // *HttpHealthCheck.ServerResponse.Header or (if a response was returned
  50456. // at all) in error.(*googleapi.Error).Header. Use
  50457. // googleapi.IsNotModified to check whether the returned error was
  50458. // because http.StatusNotModified was returned.
  50459. func (c *HttpHealthChecksGetCall) Do(opts ...googleapi.CallOption) (*HttpHealthCheck, error) {
  50460. gensupport.SetOptions(c.urlParams_, opts...)
  50461. res, err := c.doRequest("json")
  50462. if res != nil && res.StatusCode == http.StatusNotModified {
  50463. if res.Body != nil {
  50464. res.Body.Close()
  50465. }
  50466. return nil, &googleapi.Error{
  50467. Code: res.StatusCode,
  50468. Header: res.Header,
  50469. }
  50470. }
  50471. if err != nil {
  50472. return nil, err
  50473. }
  50474. defer googleapi.CloseBody(res)
  50475. if err := googleapi.CheckResponse(res); err != nil {
  50476. return nil, err
  50477. }
  50478. ret := &HttpHealthCheck{
  50479. ServerResponse: googleapi.ServerResponse{
  50480. Header: res.Header,
  50481. HTTPStatusCode: res.StatusCode,
  50482. },
  50483. }
  50484. target := &ret
  50485. if err := gensupport.DecodeResponse(target, res); err != nil {
  50486. return nil, err
  50487. }
  50488. return ret, nil
  50489. // {
  50490. // "description": "Returns the specified HttpHealthCheck resource. Gets a list of available HTTP health checks by making a list() request.",
  50491. // "httpMethod": "GET",
  50492. // "id": "compute.httpHealthChecks.get",
  50493. // "parameterOrder": [
  50494. // "project",
  50495. // "httpHealthCheck"
  50496. // ],
  50497. // "parameters": {
  50498. // "httpHealthCheck": {
  50499. // "description": "Name of the HttpHealthCheck resource to return.",
  50500. // "location": "path",
  50501. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  50502. // "required": true,
  50503. // "type": "string"
  50504. // },
  50505. // "project": {
  50506. // "description": "Project ID for this request.",
  50507. // "location": "path",
  50508. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  50509. // "required": true,
  50510. // "type": "string"
  50511. // }
  50512. // },
  50513. // "path": "{project}/global/httpHealthChecks/{httpHealthCheck}",
  50514. // "response": {
  50515. // "$ref": "HttpHealthCheck"
  50516. // },
  50517. // "scopes": [
  50518. // "https://www.googleapis.com/auth/cloud-platform",
  50519. // "https://www.googleapis.com/auth/compute",
  50520. // "https://www.googleapis.com/auth/compute.readonly"
  50521. // ]
  50522. // }
  50523. }
  50524. // method id "compute.httpHealthChecks.insert":
  50525. type HttpHealthChecksInsertCall struct {
  50526. s *Service
  50527. project string
  50528. httphealthcheck *HttpHealthCheck
  50529. urlParams_ gensupport.URLParams
  50530. ctx_ context.Context
  50531. header_ http.Header
  50532. }
  50533. // Insert: Creates a HttpHealthCheck resource in the specified project
  50534. // using the data included in the request.
  50535. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/insert
  50536. func (r *HttpHealthChecksService) Insert(project string, httphealthcheck *HttpHealthCheck) *HttpHealthChecksInsertCall {
  50537. c := &HttpHealthChecksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  50538. c.project = project
  50539. c.httphealthcheck = httphealthcheck
  50540. return c
  50541. }
  50542. // RequestId sets the optional parameter "requestId": An optional
  50543. // request ID to identify requests. Specify a unique request ID so that
  50544. // if you must retry your request, the server will know to ignore the
  50545. // request if it has already been completed.
  50546. //
  50547. // For example, consider a situation where you make an initial request
  50548. // and the request times out. If you make the request again with the
  50549. // same request ID, the server can check if original operation with the
  50550. // same request ID was received, and if so, will ignore the second
  50551. // request. This prevents clients from accidentally creating duplicate
  50552. // commitments.
  50553. //
  50554. // The request ID must be a valid UUID with the exception that zero UUID
  50555. // is not supported (00000000-0000-0000-0000-000000000000).
  50556. func (c *HttpHealthChecksInsertCall) RequestId(requestId string) *HttpHealthChecksInsertCall {
  50557. c.urlParams_.Set("requestId", requestId)
  50558. return c
  50559. }
  50560. // Fields allows partial responses to be retrieved. See
  50561. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  50562. // for more information.
  50563. func (c *HttpHealthChecksInsertCall) Fields(s ...googleapi.Field) *HttpHealthChecksInsertCall {
  50564. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  50565. return c
  50566. }
  50567. // Context sets the context to be used in this call's Do method. Any
  50568. // pending HTTP request will be aborted if the provided context is
  50569. // canceled.
  50570. func (c *HttpHealthChecksInsertCall) Context(ctx context.Context) *HttpHealthChecksInsertCall {
  50571. c.ctx_ = ctx
  50572. return c
  50573. }
  50574. // Header returns an http.Header that can be modified by the caller to
  50575. // add HTTP headers to the request.
  50576. func (c *HttpHealthChecksInsertCall) Header() http.Header {
  50577. if c.header_ == nil {
  50578. c.header_ = make(http.Header)
  50579. }
  50580. return c.header_
  50581. }
  50582. func (c *HttpHealthChecksInsertCall) doRequest(alt string) (*http.Response, error) {
  50583. reqHeaders := make(http.Header)
  50584. for k, v := range c.header_ {
  50585. reqHeaders[k] = v
  50586. }
  50587. reqHeaders.Set("User-Agent", c.s.userAgent())
  50588. var body io.Reader = nil
  50589. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httphealthcheck)
  50590. if err != nil {
  50591. return nil, err
  50592. }
  50593. reqHeaders.Set("Content-Type", "application/json")
  50594. c.urlParams_.Set("alt", alt)
  50595. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks")
  50596. urls += "?" + c.urlParams_.Encode()
  50597. req, _ := http.NewRequest("POST", urls, body)
  50598. req.Header = reqHeaders
  50599. googleapi.Expand(req.URL, map[string]string{
  50600. "project": c.project,
  50601. })
  50602. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  50603. }
  50604. // Do executes the "compute.httpHealthChecks.insert" call.
  50605. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  50606. // status code is an error. Response headers are in either
  50607. // *Operation.ServerResponse.Header or (if a response was returned at
  50608. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  50609. // to check whether the returned error was because
  50610. // http.StatusNotModified was returned.
  50611. func (c *HttpHealthChecksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  50612. gensupport.SetOptions(c.urlParams_, opts...)
  50613. res, err := c.doRequest("json")
  50614. if res != nil && res.StatusCode == http.StatusNotModified {
  50615. if res.Body != nil {
  50616. res.Body.Close()
  50617. }
  50618. return nil, &googleapi.Error{
  50619. Code: res.StatusCode,
  50620. Header: res.Header,
  50621. }
  50622. }
  50623. if err != nil {
  50624. return nil, err
  50625. }
  50626. defer googleapi.CloseBody(res)
  50627. if err := googleapi.CheckResponse(res); err != nil {
  50628. return nil, err
  50629. }
  50630. ret := &Operation{
  50631. ServerResponse: googleapi.ServerResponse{
  50632. Header: res.Header,
  50633. HTTPStatusCode: res.StatusCode,
  50634. },
  50635. }
  50636. target := &ret
  50637. if err := gensupport.DecodeResponse(target, res); err != nil {
  50638. return nil, err
  50639. }
  50640. return ret, nil
  50641. // {
  50642. // "description": "Creates a HttpHealthCheck resource in the specified project using the data included in the request.",
  50643. // "httpMethod": "POST",
  50644. // "id": "compute.httpHealthChecks.insert",
  50645. // "parameterOrder": [
  50646. // "project"
  50647. // ],
  50648. // "parameters": {
  50649. // "project": {
  50650. // "description": "Project ID for this request.",
  50651. // "location": "path",
  50652. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  50653. // "required": true,
  50654. // "type": "string"
  50655. // },
  50656. // "requestId": {
  50657. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  50658. // "location": "query",
  50659. // "type": "string"
  50660. // }
  50661. // },
  50662. // "path": "{project}/global/httpHealthChecks",
  50663. // "request": {
  50664. // "$ref": "HttpHealthCheck"
  50665. // },
  50666. // "response": {
  50667. // "$ref": "Operation"
  50668. // },
  50669. // "scopes": [
  50670. // "https://www.googleapis.com/auth/cloud-platform",
  50671. // "https://www.googleapis.com/auth/compute"
  50672. // ]
  50673. // }
  50674. }
  50675. // method id "compute.httpHealthChecks.list":
  50676. type HttpHealthChecksListCall struct {
  50677. s *Service
  50678. project string
  50679. urlParams_ gensupport.URLParams
  50680. ifNoneMatch_ string
  50681. ctx_ context.Context
  50682. header_ http.Header
  50683. }
  50684. // List: Retrieves the list of HttpHealthCheck resources available to
  50685. // the specified project.
  50686. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/list
  50687. func (r *HttpHealthChecksService) List(project string) *HttpHealthChecksListCall {
  50688. c := &HttpHealthChecksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  50689. c.project = project
  50690. return c
  50691. }
  50692. // Filter sets the optional parameter "filter": A filter expression that
  50693. // filters resources listed in the response. The expression must specify
  50694. // the field name, a comparison operator, and the value that you want to
  50695. // use for filtering. The value must be a string, a number, or a
  50696. // boolean. The comparison operator must be either =, !=, >, or <.
  50697. //
  50698. // For example, if you are filtering Compute Engine instances, you can
  50699. // exclude instances named example-instance by specifying name !=
  50700. // example-instance.
  50701. //
  50702. // You can also filter nested fields. For example, you could specify
  50703. // scheduling.automaticRestart = false to include instances only if they
  50704. // are not scheduled for automatic restarts. You can use filtering on
  50705. // nested fields to filter based on resource labels.
  50706. //
  50707. // To filter on multiple expressions, provide each separate expression
  50708. // within parentheses. For example, (scheduling.automaticRestart = true)
  50709. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  50710. // AND expression. However, you can include AND and OR expressions
  50711. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  50712. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  50713. // true).
  50714. func (c *HttpHealthChecksListCall) Filter(filter string) *HttpHealthChecksListCall {
  50715. c.urlParams_.Set("filter", filter)
  50716. return c
  50717. }
  50718. // MaxResults sets the optional parameter "maxResults": The maximum
  50719. // number of results per page that should be returned. If the number of
  50720. // available results is larger than maxResults, Compute Engine returns a
  50721. // nextPageToken that can be used to get the next page of results in
  50722. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  50723. // (Default: 500)
  50724. func (c *HttpHealthChecksListCall) MaxResults(maxResults int64) *HttpHealthChecksListCall {
  50725. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  50726. return c
  50727. }
  50728. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  50729. // a certain order. By default, results are returned in alphanumerical
  50730. // order based on the resource name.
  50731. //
  50732. // You can also sort results in descending order based on the creation
  50733. // timestamp using orderBy="creationTimestamp desc". This sorts results
  50734. // based on the creationTimestamp field in reverse chronological order
  50735. // (newest result first). Use this to sort resources like operations so
  50736. // that the newest operation is returned first.
  50737. //
  50738. // Currently, only sorting by name or creationTimestamp desc is
  50739. // supported.
  50740. func (c *HttpHealthChecksListCall) OrderBy(orderBy string) *HttpHealthChecksListCall {
  50741. c.urlParams_.Set("orderBy", orderBy)
  50742. return c
  50743. }
  50744. // PageToken sets the optional parameter "pageToken": Specifies a page
  50745. // token to use. Set pageToken to the nextPageToken returned by a
  50746. // previous list request to get the next page of results.
  50747. func (c *HttpHealthChecksListCall) PageToken(pageToken string) *HttpHealthChecksListCall {
  50748. c.urlParams_.Set("pageToken", pageToken)
  50749. return c
  50750. }
  50751. // Fields allows partial responses to be retrieved. See
  50752. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  50753. // for more information.
  50754. func (c *HttpHealthChecksListCall) Fields(s ...googleapi.Field) *HttpHealthChecksListCall {
  50755. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  50756. return c
  50757. }
  50758. // IfNoneMatch sets the optional parameter which makes the operation
  50759. // fail if the object's ETag matches the given value. This is useful for
  50760. // getting updates only after the object has changed since the last
  50761. // request. Use googleapi.IsNotModified to check whether the response
  50762. // error from Do is the result of In-None-Match.
  50763. func (c *HttpHealthChecksListCall) IfNoneMatch(entityTag string) *HttpHealthChecksListCall {
  50764. c.ifNoneMatch_ = entityTag
  50765. return c
  50766. }
  50767. // Context sets the context to be used in this call's Do method. Any
  50768. // pending HTTP request will be aborted if the provided context is
  50769. // canceled.
  50770. func (c *HttpHealthChecksListCall) Context(ctx context.Context) *HttpHealthChecksListCall {
  50771. c.ctx_ = ctx
  50772. return c
  50773. }
  50774. // Header returns an http.Header that can be modified by the caller to
  50775. // add HTTP headers to the request.
  50776. func (c *HttpHealthChecksListCall) Header() http.Header {
  50777. if c.header_ == nil {
  50778. c.header_ = make(http.Header)
  50779. }
  50780. return c.header_
  50781. }
  50782. func (c *HttpHealthChecksListCall) doRequest(alt string) (*http.Response, error) {
  50783. reqHeaders := make(http.Header)
  50784. for k, v := range c.header_ {
  50785. reqHeaders[k] = v
  50786. }
  50787. reqHeaders.Set("User-Agent", c.s.userAgent())
  50788. if c.ifNoneMatch_ != "" {
  50789. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  50790. }
  50791. var body io.Reader = nil
  50792. c.urlParams_.Set("alt", alt)
  50793. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks")
  50794. urls += "?" + c.urlParams_.Encode()
  50795. req, _ := http.NewRequest("GET", urls, body)
  50796. req.Header = reqHeaders
  50797. googleapi.Expand(req.URL, map[string]string{
  50798. "project": c.project,
  50799. })
  50800. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  50801. }
  50802. // Do executes the "compute.httpHealthChecks.list" call.
  50803. // Exactly one of *HttpHealthCheckList or error will be non-nil. Any
  50804. // non-2xx status code is an error. Response headers are in either
  50805. // *HttpHealthCheckList.ServerResponse.Header or (if a response was
  50806. // returned at all) in error.(*googleapi.Error).Header. Use
  50807. // googleapi.IsNotModified to check whether the returned error was
  50808. // because http.StatusNotModified was returned.
  50809. func (c *HttpHealthChecksListCall) Do(opts ...googleapi.CallOption) (*HttpHealthCheckList, error) {
  50810. gensupport.SetOptions(c.urlParams_, opts...)
  50811. res, err := c.doRequest("json")
  50812. if res != nil && res.StatusCode == http.StatusNotModified {
  50813. if res.Body != nil {
  50814. res.Body.Close()
  50815. }
  50816. return nil, &googleapi.Error{
  50817. Code: res.StatusCode,
  50818. Header: res.Header,
  50819. }
  50820. }
  50821. if err != nil {
  50822. return nil, err
  50823. }
  50824. defer googleapi.CloseBody(res)
  50825. if err := googleapi.CheckResponse(res); err != nil {
  50826. return nil, err
  50827. }
  50828. ret := &HttpHealthCheckList{
  50829. ServerResponse: googleapi.ServerResponse{
  50830. Header: res.Header,
  50831. HTTPStatusCode: res.StatusCode,
  50832. },
  50833. }
  50834. target := &ret
  50835. if err := gensupport.DecodeResponse(target, res); err != nil {
  50836. return nil, err
  50837. }
  50838. return ret, nil
  50839. // {
  50840. // "description": "Retrieves the list of HttpHealthCheck resources available to the specified project.",
  50841. // "httpMethod": "GET",
  50842. // "id": "compute.httpHealthChecks.list",
  50843. // "parameterOrder": [
  50844. // "project"
  50845. // ],
  50846. // "parameters": {
  50847. // "filter": {
  50848. // "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).",
  50849. // "location": "query",
  50850. // "type": "string"
  50851. // },
  50852. // "maxResults": {
  50853. // "default": "500",
  50854. // "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)",
  50855. // "format": "uint32",
  50856. // "location": "query",
  50857. // "minimum": "0",
  50858. // "type": "integer"
  50859. // },
  50860. // "orderBy": {
  50861. // "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.",
  50862. // "location": "query",
  50863. // "type": "string"
  50864. // },
  50865. // "pageToken": {
  50866. // "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.",
  50867. // "location": "query",
  50868. // "type": "string"
  50869. // },
  50870. // "project": {
  50871. // "description": "Project ID for this request.",
  50872. // "location": "path",
  50873. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  50874. // "required": true,
  50875. // "type": "string"
  50876. // }
  50877. // },
  50878. // "path": "{project}/global/httpHealthChecks",
  50879. // "response": {
  50880. // "$ref": "HttpHealthCheckList"
  50881. // },
  50882. // "scopes": [
  50883. // "https://www.googleapis.com/auth/cloud-platform",
  50884. // "https://www.googleapis.com/auth/compute",
  50885. // "https://www.googleapis.com/auth/compute.readonly"
  50886. // ]
  50887. // }
  50888. }
  50889. // Pages invokes f for each page of results.
  50890. // A non-nil error returned from f will halt the iteration.
  50891. // The provided context supersedes any context provided to the Context method.
  50892. func (c *HttpHealthChecksListCall) Pages(ctx context.Context, f func(*HttpHealthCheckList) error) error {
  50893. c.ctx_ = ctx
  50894. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  50895. for {
  50896. x, err := c.Do()
  50897. if err != nil {
  50898. return err
  50899. }
  50900. if err := f(x); err != nil {
  50901. return err
  50902. }
  50903. if x.NextPageToken == "" {
  50904. return nil
  50905. }
  50906. c.PageToken(x.NextPageToken)
  50907. }
  50908. }
  50909. // method id "compute.httpHealthChecks.patch":
  50910. type HttpHealthChecksPatchCall struct {
  50911. s *Service
  50912. project string
  50913. httpHealthCheck string
  50914. httphealthcheck *HttpHealthCheck
  50915. urlParams_ gensupport.URLParams
  50916. ctx_ context.Context
  50917. header_ http.Header
  50918. }
  50919. // Patch: Updates a HttpHealthCheck resource in the specified project
  50920. // using the data included in the request. This method supports PATCH
  50921. // semantics and uses the JSON merge patch format and processing rules.
  50922. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/patch
  50923. func (r *HttpHealthChecksService) Patch(project string, httpHealthCheck string, httphealthcheck *HttpHealthCheck) *HttpHealthChecksPatchCall {
  50924. c := &HttpHealthChecksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  50925. c.project = project
  50926. c.httpHealthCheck = httpHealthCheck
  50927. c.httphealthcheck = httphealthcheck
  50928. return c
  50929. }
  50930. // RequestId sets the optional parameter "requestId": An optional
  50931. // request ID to identify requests. Specify a unique request ID so that
  50932. // if you must retry your request, the server will know to ignore the
  50933. // request if it has already been completed.
  50934. //
  50935. // For example, consider a situation where you make an initial request
  50936. // and the request times out. If you make the request again with the
  50937. // same request ID, the server can check if original operation with the
  50938. // same request ID was received, and if so, will ignore the second
  50939. // request. This prevents clients from accidentally creating duplicate
  50940. // commitments.
  50941. //
  50942. // The request ID must be a valid UUID with the exception that zero UUID
  50943. // is not supported (00000000-0000-0000-0000-000000000000).
  50944. func (c *HttpHealthChecksPatchCall) RequestId(requestId string) *HttpHealthChecksPatchCall {
  50945. c.urlParams_.Set("requestId", requestId)
  50946. return c
  50947. }
  50948. // Fields allows partial responses to be retrieved. See
  50949. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  50950. // for more information.
  50951. func (c *HttpHealthChecksPatchCall) Fields(s ...googleapi.Field) *HttpHealthChecksPatchCall {
  50952. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  50953. return c
  50954. }
  50955. // Context sets the context to be used in this call's Do method. Any
  50956. // pending HTTP request will be aborted if the provided context is
  50957. // canceled.
  50958. func (c *HttpHealthChecksPatchCall) Context(ctx context.Context) *HttpHealthChecksPatchCall {
  50959. c.ctx_ = ctx
  50960. return c
  50961. }
  50962. // Header returns an http.Header that can be modified by the caller to
  50963. // add HTTP headers to the request.
  50964. func (c *HttpHealthChecksPatchCall) Header() http.Header {
  50965. if c.header_ == nil {
  50966. c.header_ = make(http.Header)
  50967. }
  50968. return c.header_
  50969. }
  50970. func (c *HttpHealthChecksPatchCall) doRequest(alt string) (*http.Response, error) {
  50971. reqHeaders := make(http.Header)
  50972. for k, v := range c.header_ {
  50973. reqHeaders[k] = v
  50974. }
  50975. reqHeaders.Set("User-Agent", c.s.userAgent())
  50976. var body io.Reader = nil
  50977. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httphealthcheck)
  50978. if err != nil {
  50979. return nil, err
  50980. }
  50981. reqHeaders.Set("Content-Type", "application/json")
  50982. c.urlParams_.Set("alt", alt)
  50983. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{httpHealthCheck}")
  50984. urls += "?" + c.urlParams_.Encode()
  50985. req, _ := http.NewRequest("PATCH", urls, body)
  50986. req.Header = reqHeaders
  50987. googleapi.Expand(req.URL, map[string]string{
  50988. "project": c.project,
  50989. "httpHealthCheck": c.httpHealthCheck,
  50990. })
  50991. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  50992. }
  50993. // Do executes the "compute.httpHealthChecks.patch" call.
  50994. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  50995. // status code is an error. Response headers are in either
  50996. // *Operation.ServerResponse.Header or (if a response was returned at
  50997. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  50998. // to check whether the returned error was because
  50999. // http.StatusNotModified was returned.
  51000. func (c *HttpHealthChecksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  51001. gensupport.SetOptions(c.urlParams_, opts...)
  51002. res, err := c.doRequest("json")
  51003. if res != nil && res.StatusCode == http.StatusNotModified {
  51004. if res.Body != nil {
  51005. res.Body.Close()
  51006. }
  51007. return nil, &googleapi.Error{
  51008. Code: res.StatusCode,
  51009. Header: res.Header,
  51010. }
  51011. }
  51012. if err != nil {
  51013. return nil, err
  51014. }
  51015. defer googleapi.CloseBody(res)
  51016. if err := googleapi.CheckResponse(res); err != nil {
  51017. return nil, err
  51018. }
  51019. ret := &Operation{
  51020. ServerResponse: googleapi.ServerResponse{
  51021. Header: res.Header,
  51022. HTTPStatusCode: res.StatusCode,
  51023. },
  51024. }
  51025. target := &ret
  51026. if err := gensupport.DecodeResponse(target, res); err != nil {
  51027. return nil, err
  51028. }
  51029. return ret, nil
  51030. // {
  51031. // "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.",
  51032. // "httpMethod": "PATCH",
  51033. // "id": "compute.httpHealthChecks.patch",
  51034. // "parameterOrder": [
  51035. // "project",
  51036. // "httpHealthCheck"
  51037. // ],
  51038. // "parameters": {
  51039. // "httpHealthCheck": {
  51040. // "description": "Name of the HttpHealthCheck resource to patch.",
  51041. // "location": "path",
  51042. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  51043. // "required": true,
  51044. // "type": "string"
  51045. // },
  51046. // "project": {
  51047. // "description": "Project ID for this request.",
  51048. // "location": "path",
  51049. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  51050. // "required": true,
  51051. // "type": "string"
  51052. // },
  51053. // "requestId": {
  51054. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  51055. // "location": "query",
  51056. // "type": "string"
  51057. // }
  51058. // },
  51059. // "path": "{project}/global/httpHealthChecks/{httpHealthCheck}",
  51060. // "request": {
  51061. // "$ref": "HttpHealthCheck"
  51062. // },
  51063. // "response": {
  51064. // "$ref": "Operation"
  51065. // },
  51066. // "scopes": [
  51067. // "https://www.googleapis.com/auth/cloud-platform",
  51068. // "https://www.googleapis.com/auth/compute"
  51069. // ]
  51070. // }
  51071. }
  51072. // method id "compute.httpHealthChecks.testIamPermissions":
  51073. type HttpHealthChecksTestIamPermissionsCall struct {
  51074. s *Service
  51075. project string
  51076. resource string
  51077. testpermissionsrequest *TestPermissionsRequest
  51078. urlParams_ gensupport.URLParams
  51079. ctx_ context.Context
  51080. header_ http.Header
  51081. }
  51082. // TestIamPermissions: Returns permissions that a caller has on the
  51083. // specified resource.
  51084. func (r *HttpHealthChecksService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *HttpHealthChecksTestIamPermissionsCall {
  51085. c := &HttpHealthChecksTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  51086. c.project = project
  51087. c.resource = resource
  51088. c.testpermissionsrequest = testpermissionsrequest
  51089. return c
  51090. }
  51091. // Fields allows partial responses to be retrieved. See
  51092. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  51093. // for more information.
  51094. func (c *HttpHealthChecksTestIamPermissionsCall) Fields(s ...googleapi.Field) *HttpHealthChecksTestIamPermissionsCall {
  51095. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  51096. return c
  51097. }
  51098. // Context sets the context to be used in this call's Do method. Any
  51099. // pending HTTP request will be aborted if the provided context is
  51100. // canceled.
  51101. func (c *HttpHealthChecksTestIamPermissionsCall) Context(ctx context.Context) *HttpHealthChecksTestIamPermissionsCall {
  51102. c.ctx_ = ctx
  51103. return c
  51104. }
  51105. // Header returns an http.Header that can be modified by the caller to
  51106. // add HTTP headers to the request.
  51107. func (c *HttpHealthChecksTestIamPermissionsCall) Header() http.Header {
  51108. if c.header_ == nil {
  51109. c.header_ = make(http.Header)
  51110. }
  51111. return c.header_
  51112. }
  51113. func (c *HttpHealthChecksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  51114. reqHeaders := make(http.Header)
  51115. for k, v := range c.header_ {
  51116. reqHeaders[k] = v
  51117. }
  51118. reqHeaders.Set("User-Agent", c.s.userAgent())
  51119. var body io.Reader = nil
  51120. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  51121. if err != nil {
  51122. return nil, err
  51123. }
  51124. reqHeaders.Set("Content-Type", "application/json")
  51125. c.urlParams_.Set("alt", alt)
  51126. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{resource}/testIamPermissions")
  51127. urls += "?" + c.urlParams_.Encode()
  51128. req, _ := http.NewRequest("POST", urls, body)
  51129. req.Header = reqHeaders
  51130. googleapi.Expand(req.URL, map[string]string{
  51131. "project": c.project,
  51132. "resource": c.resource,
  51133. })
  51134. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  51135. }
  51136. // Do executes the "compute.httpHealthChecks.testIamPermissions" call.
  51137. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  51138. // non-2xx status code is an error. Response headers are in either
  51139. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  51140. // returned at all) in error.(*googleapi.Error).Header. Use
  51141. // googleapi.IsNotModified to check whether the returned error was
  51142. // because http.StatusNotModified was returned.
  51143. func (c *HttpHealthChecksTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  51144. gensupport.SetOptions(c.urlParams_, opts...)
  51145. res, err := c.doRequest("json")
  51146. if res != nil && res.StatusCode == http.StatusNotModified {
  51147. if res.Body != nil {
  51148. res.Body.Close()
  51149. }
  51150. return nil, &googleapi.Error{
  51151. Code: res.StatusCode,
  51152. Header: res.Header,
  51153. }
  51154. }
  51155. if err != nil {
  51156. return nil, err
  51157. }
  51158. defer googleapi.CloseBody(res)
  51159. if err := googleapi.CheckResponse(res); err != nil {
  51160. return nil, err
  51161. }
  51162. ret := &TestPermissionsResponse{
  51163. ServerResponse: googleapi.ServerResponse{
  51164. Header: res.Header,
  51165. HTTPStatusCode: res.StatusCode,
  51166. },
  51167. }
  51168. target := &ret
  51169. if err := gensupport.DecodeResponse(target, res); err != nil {
  51170. return nil, err
  51171. }
  51172. return ret, nil
  51173. // {
  51174. // "description": "Returns permissions that a caller has on the specified resource.",
  51175. // "httpMethod": "POST",
  51176. // "id": "compute.httpHealthChecks.testIamPermissions",
  51177. // "parameterOrder": [
  51178. // "project",
  51179. // "resource"
  51180. // ],
  51181. // "parameters": {
  51182. // "project": {
  51183. // "description": "Project ID for this request.",
  51184. // "location": "path",
  51185. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  51186. // "required": true,
  51187. // "type": "string"
  51188. // },
  51189. // "resource": {
  51190. // "description": "Name of the resource for this request.",
  51191. // "location": "path",
  51192. // "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?",
  51193. // "required": true,
  51194. // "type": "string"
  51195. // }
  51196. // },
  51197. // "path": "{project}/global/httpHealthChecks/{resource}/testIamPermissions",
  51198. // "request": {
  51199. // "$ref": "TestPermissionsRequest"
  51200. // },
  51201. // "response": {
  51202. // "$ref": "TestPermissionsResponse"
  51203. // },
  51204. // "scopes": [
  51205. // "https://www.googleapis.com/auth/cloud-platform",
  51206. // "https://www.googleapis.com/auth/compute",
  51207. // "https://www.googleapis.com/auth/compute.readonly"
  51208. // ]
  51209. // }
  51210. }
  51211. // method id "compute.httpHealthChecks.update":
  51212. type HttpHealthChecksUpdateCall struct {
  51213. s *Service
  51214. project string
  51215. httpHealthCheck string
  51216. httphealthcheck *HttpHealthCheck
  51217. urlParams_ gensupport.URLParams
  51218. ctx_ context.Context
  51219. header_ http.Header
  51220. }
  51221. // Update: Updates a HttpHealthCheck resource in the specified project
  51222. // using the data included in the request.
  51223. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/update
  51224. func (r *HttpHealthChecksService) Update(project string, httpHealthCheck string, httphealthcheck *HttpHealthCheck) *HttpHealthChecksUpdateCall {
  51225. c := &HttpHealthChecksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  51226. c.project = project
  51227. c.httpHealthCheck = httpHealthCheck
  51228. c.httphealthcheck = httphealthcheck
  51229. return c
  51230. }
  51231. // RequestId sets the optional parameter "requestId": An optional
  51232. // request ID to identify requests. Specify a unique request ID so that
  51233. // if you must retry your request, the server will know to ignore the
  51234. // request if it has already been completed.
  51235. //
  51236. // For example, consider a situation where you make an initial request
  51237. // and the request times out. If you make the request again with the
  51238. // same request ID, the server can check if original operation with the
  51239. // same request ID was received, and if so, will ignore the second
  51240. // request. This prevents clients from accidentally creating duplicate
  51241. // commitments.
  51242. //
  51243. // The request ID must be a valid UUID with the exception that zero UUID
  51244. // is not supported (00000000-0000-0000-0000-000000000000).
  51245. func (c *HttpHealthChecksUpdateCall) RequestId(requestId string) *HttpHealthChecksUpdateCall {
  51246. c.urlParams_.Set("requestId", requestId)
  51247. return c
  51248. }
  51249. // Fields allows partial responses to be retrieved. See
  51250. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  51251. // for more information.
  51252. func (c *HttpHealthChecksUpdateCall) Fields(s ...googleapi.Field) *HttpHealthChecksUpdateCall {
  51253. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  51254. return c
  51255. }
  51256. // Context sets the context to be used in this call's Do method. Any
  51257. // pending HTTP request will be aborted if the provided context is
  51258. // canceled.
  51259. func (c *HttpHealthChecksUpdateCall) Context(ctx context.Context) *HttpHealthChecksUpdateCall {
  51260. c.ctx_ = ctx
  51261. return c
  51262. }
  51263. // Header returns an http.Header that can be modified by the caller to
  51264. // add HTTP headers to the request.
  51265. func (c *HttpHealthChecksUpdateCall) Header() http.Header {
  51266. if c.header_ == nil {
  51267. c.header_ = make(http.Header)
  51268. }
  51269. return c.header_
  51270. }
  51271. func (c *HttpHealthChecksUpdateCall) doRequest(alt string) (*http.Response, error) {
  51272. reqHeaders := make(http.Header)
  51273. for k, v := range c.header_ {
  51274. reqHeaders[k] = v
  51275. }
  51276. reqHeaders.Set("User-Agent", c.s.userAgent())
  51277. var body io.Reader = nil
  51278. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httphealthcheck)
  51279. if err != nil {
  51280. return nil, err
  51281. }
  51282. reqHeaders.Set("Content-Type", "application/json")
  51283. c.urlParams_.Set("alt", alt)
  51284. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{httpHealthCheck}")
  51285. urls += "?" + c.urlParams_.Encode()
  51286. req, _ := http.NewRequest("PUT", urls, body)
  51287. req.Header = reqHeaders
  51288. googleapi.Expand(req.URL, map[string]string{
  51289. "project": c.project,
  51290. "httpHealthCheck": c.httpHealthCheck,
  51291. })
  51292. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  51293. }
  51294. // Do executes the "compute.httpHealthChecks.update" call.
  51295. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  51296. // status code is an error. Response headers are in either
  51297. // *Operation.ServerResponse.Header or (if a response was returned at
  51298. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  51299. // to check whether the returned error was because
  51300. // http.StatusNotModified was returned.
  51301. func (c *HttpHealthChecksUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  51302. gensupport.SetOptions(c.urlParams_, opts...)
  51303. res, err := c.doRequest("json")
  51304. if res != nil && res.StatusCode == http.StatusNotModified {
  51305. if res.Body != nil {
  51306. res.Body.Close()
  51307. }
  51308. return nil, &googleapi.Error{
  51309. Code: res.StatusCode,
  51310. Header: res.Header,
  51311. }
  51312. }
  51313. if err != nil {
  51314. return nil, err
  51315. }
  51316. defer googleapi.CloseBody(res)
  51317. if err := googleapi.CheckResponse(res); err != nil {
  51318. return nil, err
  51319. }
  51320. ret := &Operation{
  51321. ServerResponse: googleapi.ServerResponse{
  51322. Header: res.Header,
  51323. HTTPStatusCode: res.StatusCode,
  51324. },
  51325. }
  51326. target := &ret
  51327. if err := gensupport.DecodeResponse(target, res); err != nil {
  51328. return nil, err
  51329. }
  51330. return ret, nil
  51331. // {
  51332. // "description": "Updates a HttpHealthCheck resource in the specified project using the data included in the request.",
  51333. // "httpMethod": "PUT",
  51334. // "id": "compute.httpHealthChecks.update",
  51335. // "parameterOrder": [
  51336. // "project",
  51337. // "httpHealthCheck"
  51338. // ],
  51339. // "parameters": {
  51340. // "httpHealthCheck": {
  51341. // "description": "Name of the HttpHealthCheck resource to update.",
  51342. // "location": "path",
  51343. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  51344. // "required": true,
  51345. // "type": "string"
  51346. // },
  51347. // "project": {
  51348. // "description": "Project ID for this request.",
  51349. // "location": "path",
  51350. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  51351. // "required": true,
  51352. // "type": "string"
  51353. // },
  51354. // "requestId": {
  51355. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  51356. // "location": "query",
  51357. // "type": "string"
  51358. // }
  51359. // },
  51360. // "path": "{project}/global/httpHealthChecks/{httpHealthCheck}",
  51361. // "request": {
  51362. // "$ref": "HttpHealthCheck"
  51363. // },
  51364. // "response": {
  51365. // "$ref": "Operation"
  51366. // },
  51367. // "scopes": [
  51368. // "https://www.googleapis.com/auth/cloud-platform",
  51369. // "https://www.googleapis.com/auth/compute"
  51370. // ]
  51371. // }
  51372. }
  51373. // method id "compute.httpsHealthChecks.delete":
  51374. type HttpsHealthChecksDeleteCall struct {
  51375. s *Service
  51376. project string
  51377. httpsHealthCheck string
  51378. urlParams_ gensupport.URLParams
  51379. ctx_ context.Context
  51380. header_ http.Header
  51381. }
  51382. // Delete: Deletes the specified HttpsHealthCheck resource.
  51383. func (r *HttpsHealthChecksService) Delete(project string, httpsHealthCheck string) *HttpsHealthChecksDeleteCall {
  51384. c := &HttpsHealthChecksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  51385. c.project = project
  51386. c.httpsHealthCheck = httpsHealthCheck
  51387. return c
  51388. }
  51389. // RequestId sets the optional parameter "requestId": An optional
  51390. // request ID to identify requests. Specify a unique request ID so that
  51391. // if you must retry your request, the server will know to ignore the
  51392. // request if it has already been completed.
  51393. //
  51394. // For example, consider a situation where you make an initial request
  51395. // and the request times out. If you make the request again with the
  51396. // same request ID, the server can check if original operation with the
  51397. // same request ID was received, and if so, will ignore the second
  51398. // request. This prevents clients from accidentally creating duplicate
  51399. // commitments.
  51400. //
  51401. // The request ID must be a valid UUID with the exception that zero UUID
  51402. // is not supported (00000000-0000-0000-0000-000000000000).
  51403. func (c *HttpsHealthChecksDeleteCall) RequestId(requestId string) *HttpsHealthChecksDeleteCall {
  51404. c.urlParams_.Set("requestId", requestId)
  51405. return c
  51406. }
  51407. // Fields allows partial responses to be retrieved. See
  51408. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  51409. // for more information.
  51410. func (c *HttpsHealthChecksDeleteCall) Fields(s ...googleapi.Field) *HttpsHealthChecksDeleteCall {
  51411. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  51412. return c
  51413. }
  51414. // Context sets the context to be used in this call's Do method. Any
  51415. // pending HTTP request will be aborted if the provided context is
  51416. // canceled.
  51417. func (c *HttpsHealthChecksDeleteCall) Context(ctx context.Context) *HttpsHealthChecksDeleteCall {
  51418. c.ctx_ = ctx
  51419. return c
  51420. }
  51421. // Header returns an http.Header that can be modified by the caller to
  51422. // add HTTP headers to the request.
  51423. func (c *HttpsHealthChecksDeleteCall) Header() http.Header {
  51424. if c.header_ == nil {
  51425. c.header_ = make(http.Header)
  51426. }
  51427. return c.header_
  51428. }
  51429. func (c *HttpsHealthChecksDeleteCall) doRequest(alt string) (*http.Response, error) {
  51430. reqHeaders := make(http.Header)
  51431. for k, v := range c.header_ {
  51432. reqHeaders[k] = v
  51433. }
  51434. reqHeaders.Set("User-Agent", c.s.userAgent())
  51435. var body io.Reader = nil
  51436. c.urlParams_.Set("alt", alt)
  51437. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{httpsHealthCheck}")
  51438. urls += "?" + c.urlParams_.Encode()
  51439. req, _ := http.NewRequest("DELETE", urls, body)
  51440. req.Header = reqHeaders
  51441. googleapi.Expand(req.URL, map[string]string{
  51442. "project": c.project,
  51443. "httpsHealthCheck": c.httpsHealthCheck,
  51444. })
  51445. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  51446. }
  51447. // Do executes the "compute.httpsHealthChecks.delete" call.
  51448. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  51449. // status code is an error. Response headers are in either
  51450. // *Operation.ServerResponse.Header or (if a response was returned at
  51451. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  51452. // to check whether the returned error was because
  51453. // http.StatusNotModified was returned.
  51454. func (c *HttpsHealthChecksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  51455. gensupport.SetOptions(c.urlParams_, opts...)
  51456. res, err := c.doRequest("json")
  51457. if res != nil && res.StatusCode == http.StatusNotModified {
  51458. if res.Body != nil {
  51459. res.Body.Close()
  51460. }
  51461. return nil, &googleapi.Error{
  51462. Code: res.StatusCode,
  51463. Header: res.Header,
  51464. }
  51465. }
  51466. if err != nil {
  51467. return nil, err
  51468. }
  51469. defer googleapi.CloseBody(res)
  51470. if err := googleapi.CheckResponse(res); err != nil {
  51471. return nil, err
  51472. }
  51473. ret := &Operation{
  51474. ServerResponse: googleapi.ServerResponse{
  51475. Header: res.Header,
  51476. HTTPStatusCode: res.StatusCode,
  51477. },
  51478. }
  51479. target := &ret
  51480. if err := gensupport.DecodeResponse(target, res); err != nil {
  51481. return nil, err
  51482. }
  51483. return ret, nil
  51484. // {
  51485. // "description": "Deletes the specified HttpsHealthCheck resource.",
  51486. // "httpMethod": "DELETE",
  51487. // "id": "compute.httpsHealthChecks.delete",
  51488. // "parameterOrder": [
  51489. // "project",
  51490. // "httpsHealthCheck"
  51491. // ],
  51492. // "parameters": {
  51493. // "httpsHealthCheck": {
  51494. // "description": "Name of the HttpsHealthCheck resource to delete.",
  51495. // "location": "path",
  51496. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  51497. // "required": true,
  51498. // "type": "string"
  51499. // },
  51500. // "project": {
  51501. // "description": "Project ID for this request.",
  51502. // "location": "path",
  51503. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  51504. // "required": true,
  51505. // "type": "string"
  51506. // },
  51507. // "requestId": {
  51508. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  51509. // "location": "query",
  51510. // "type": "string"
  51511. // }
  51512. // },
  51513. // "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}",
  51514. // "response": {
  51515. // "$ref": "Operation"
  51516. // },
  51517. // "scopes": [
  51518. // "https://www.googleapis.com/auth/cloud-platform",
  51519. // "https://www.googleapis.com/auth/compute"
  51520. // ]
  51521. // }
  51522. }
  51523. // method id "compute.httpsHealthChecks.get":
  51524. type HttpsHealthChecksGetCall struct {
  51525. s *Service
  51526. project string
  51527. httpsHealthCheck string
  51528. urlParams_ gensupport.URLParams
  51529. ifNoneMatch_ string
  51530. ctx_ context.Context
  51531. header_ http.Header
  51532. }
  51533. // Get: Returns the specified HttpsHealthCheck resource. Gets a list of
  51534. // available HTTPS health checks by making a list() request.
  51535. func (r *HttpsHealthChecksService) Get(project string, httpsHealthCheck string) *HttpsHealthChecksGetCall {
  51536. c := &HttpsHealthChecksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  51537. c.project = project
  51538. c.httpsHealthCheck = httpsHealthCheck
  51539. return c
  51540. }
  51541. // Fields allows partial responses to be retrieved. See
  51542. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  51543. // for more information.
  51544. func (c *HttpsHealthChecksGetCall) Fields(s ...googleapi.Field) *HttpsHealthChecksGetCall {
  51545. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  51546. return c
  51547. }
  51548. // IfNoneMatch sets the optional parameter which makes the operation
  51549. // fail if the object's ETag matches the given value. This is useful for
  51550. // getting updates only after the object has changed since the last
  51551. // request. Use googleapi.IsNotModified to check whether the response
  51552. // error from Do is the result of In-None-Match.
  51553. func (c *HttpsHealthChecksGetCall) IfNoneMatch(entityTag string) *HttpsHealthChecksGetCall {
  51554. c.ifNoneMatch_ = entityTag
  51555. return c
  51556. }
  51557. // Context sets the context to be used in this call's Do method. Any
  51558. // pending HTTP request will be aborted if the provided context is
  51559. // canceled.
  51560. func (c *HttpsHealthChecksGetCall) Context(ctx context.Context) *HttpsHealthChecksGetCall {
  51561. c.ctx_ = ctx
  51562. return c
  51563. }
  51564. // Header returns an http.Header that can be modified by the caller to
  51565. // add HTTP headers to the request.
  51566. func (c *HttpsHealthChecksGetCall) Header() http.Header {
  51567. if c.header_ == nil {
  51568. c.header_ = make(http.Header)
  51569. }
  51570. return c.header_
  51571. }
  51572. func (c *HttpsHealthChecksGetCall) doRequest(alt string) (*http.Response, error) {
  51573. reqHeaders := make(http.Header)
  51574. for k, v := range c.header_ {
  51575. reqHeaders[k] = v
  51576. }
  51577. reqHeaders.Set("User-Agent", c.s.userAgent())
  51578. if c.ifNoneMatch_ != "" {
  51579. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  51580. }
  51581. var body io.Reader = nil
  51582. c.urlParams_.Set("alt", alt)
  51583. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{httpsHealthCheck}")
  51584. urls += "?" + c.urlParams_.Encode()
  51585. req, _ := http.NewRequest("GET", urls, body)
  51586. req.Header = reqHeaders
  51587. googleapi.Expand(req.URL, map[string]string{
  51588. "project": c.project,
  51589. "httpsHealthCheck": c.httpsHealthCheck,
  51590. })
  51591. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  51592. }
  51593. // Do executes the "compute.httpsHealthChecks.get" call.
  51594. // Exactly one of *HttpsHealthCheck or error will be non-nil. Any
  51595. // non-2xx status code is an error. Response headers are in either
  51596. // *HttpsHealthCheck.ServerResponse.Header or (if a response was
  51597. // returned at all) in error.(*googleapi.Error).Header. Use
  51598. // googleapi.IsNotModified to check whether the returned error was
  51599. // because http.StatusNotModified was returned.
  51600. func (c *HttpsHealthChecksGetCall) Do(opts ...googleapi.CallOption) (*HttpsHealthCheck, error) {
  51601. gensupport.SetOptions(c.urlParams_, opts...)
  51602. res, err := c.doRequest("json")
  51603. if res != nil && res.StatusCode == http.StatusNotModified {
  51604. if res.Body != nil {
  51605. res.Body.Close()
  51606. }
  51607. return nil, &googleapi.Error{
  51608. Code: res.StatusCode,
  51609. Header: res.Header,
  51610. }
  51611. }
  51612. if err != nil {
  51613. return nil, err
  51614. }
  51615. defer googleapi.CloseBody(res)
  51616. if err := googleapi.CheckResponse(res); err != nil {
  51617. return nil, err
  51618. }
  51619. ret := &HttpsHealthCheck{
  51620. ServerResponse: googleapi.ServerResponse{
  51621. Header: res.Header,
  51622. HTTPStatusCode: res.StatusCode,
  51623. },
  51624. }
  51625. target := &ret
  51626. if err := gensupport.DecodeResponse(target, res); err != nil {
  51627. return nil, err
  51628. }
  51629. return ret, nil
  51630. // {
  51631. // "description": "Returns the specified HttpsHealthCheck resource. Gets a list of available HTTPS health checks by making a list() request.",
  51632. // "httpMethod": "GET",
  51633. // "id": "compute.httpsHealthChecks.get",
  51634. // "parameterOrder": [
  51635. // "project",
  51636. // "httpsHealthCheck"
  51637. // ],
  51638. // "parameters": {
  51639. // "httpsHealthCheck": {
  51640. // "description": "Name of the HttpsHealthCheck resource to return.",
  51641. // "location": "path",
  51642. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  51643. // "required": true,
  51644. // "type": "string"
  51645. // },
  51646. // "project": {
  51647. // "description": "Project ID for this request.",
  51648. // "location": "path",
  51649. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  51650. // "required": true,
  51651. // "type": "string"
  51652. // }
  51653. // },
  51654. // "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}",
  51655. // "response": {
  51656. // "$ref": "HttpsHealthCheck"
  51657. // },
  51658. // "scopes": [
  51659. // "https://www.googleapis.com/auth/cloud-platform",
  51660. // "https://www.googleapis.com/auth/compute",
  51661. // "https://www.googleapis.com/auth/compute.readonly"
  51662. // ]
  51663. // }
  51664. }
  51665. // method id "compute.httpsHealthChecks.insert":
  51666. type HttpsHealthChecksInsertCall struct {
  51667. s *Service
  51668. project string
  51669. httpshealthcheck *HttpsHealthCheck
  51670. urlParams_ gensupport.URLParams
  51671. ctx_ context.Context
  51672. header_ http.Header
  51673. }
  51674. // Insert: Creates a HttpsHealthCheck resource in the specified project
  51675. // using the data included in the request.
  51676. func (r *HttpsHealthChecksService) Insert(project string, httpshealthcheck *HttpsHealthCheck) *HttpsHealthChecksInsertCall {
  51677. c := &HttpsHealthChecksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  51678. c.project = project
  51679. c.httpshealthcheck = httpshealthcheck
  51680. return c
  51681. }
  51682. // RequestId sets the optional parameter "requestId": An optional
  51683. // request ID to identify requests. Specify a unique request ID so that
  51684. // if you must retry your request, the server will know to ignore the
  51685. // request if it has already been completed.
  51686. //
  51687. // For example, consider a situation where you make an initial request
  51688. // and the request times out. If you make the request again with the
  51689. // same request ID, the server can check if original operation with the
  51690. // same request ID was received, and if so, will ignore the second
  51691. // request. This prevents clients from accidentally creating duplicate
  51692. // commitments.
  51693. //
  51694. // The request ID must be a valid UUID with the exception that zero UUID
  51695. // is not supported (00000000-0000-0000-0000-000000000000).
  51696. func (c *HttpsHealthChecksInsertCall) RequestId(requestId string) *HttpsHealthChecksInsertCall {
  51697. c.urlParams_.Set("requestId", requestId)
  51698. return c
  51699. }
  51700. // Fields allows partial responses to be retrieved. See
  51701. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  51702. // for more information.
  51703. func (c *HttpsHealthChecksInsertCall) Fields(s ...googleapi.Field) *HttpsHealthChecksInsertCall {
  51704. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  51705. return c
  51706. }
  51707. // Context sets the context to be used in this call's Do method. Any
  51708. // pending HTTP request will be aborted if the provided context is
  51709. // canceled.
  51710. func (c *HttpsHealthChecksInsertCall) Context(ctx context.Context) *HttpsHealthChecksInsertCall {
  51711. c.ctx_ = ctx
  51712. return c
  51713. }
  51714. // Header returns an http.Header that can be modified by the caller to
  51715. // add HTTP headers to the request.
  51716. func (c *HttpsHealthChecksInsertCall) Header() http.Header {
  51717. if c.header_ == nil {
  51718. c.header_ = make(http.Header)
  51719. }
  51720. return c.header_
  51721. }
  51722. func (c *HttpsHealthChecksInsertCall) doRequest(alt string) (*http.Response, error) {
  51723. reqHeaders := make(http.Header)
  51724. for k, v := range c.header_ {
  51725. reqHeaders[k] = v
  51726. }
  51727. reqHeaders.Set("User-Agent", c.s.userAgent())
  51728. var body io.Reader = nil
  51729. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpshealthcheck)
  51730. if err != nil {
  51731. return nil, err
  51732. }
  51733. reqHeaders.Set("Content-Type", "application/json")
  51734. c.urlParams_.Set("alt", alt)
  51735. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks")
  51736. urls += "?" + c.urlParams_.Encode()
  51737. req, _ := http.NewRequest("POST", urls, body)
  51738. req.Header = reqHeaders
  51739. googleapi.Expand(req.URL, map[string]string{
  51740. "project": c.project,
  51741. })
  51742. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  51743. }
  51744. // Do executes the "compute.httpsHealthChecks.insert" call.
  51745. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  51746. // status code is an error. Response headers are in either
  51747. // *Operation.ServerResponse.Header or (if a response was returned at
  51748. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  51749. // to check whether the returned error was because
  51750. // http.StatusNotModified was returned.
  51751. func (c *HttpsHealthChecksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  51752. gensupport.SetOptions(c.urlParams_, opts...)
  51753. res, err := c.doRequest("json")
  51754. if res != nil && res.StatusCode == http.StatusNotModified {
  51755. if res.Body != nil {
  51756. res.Body.Close()
  51757. }
  51758. return nil, &googleapi.Error{
  51759. Code: res.StatusCode,
  51760. Header: res.Header,
  51761. }
  51762. }
  51763. if err != nil {
  51764. return nil, err
  51765. }
  51766. defer googleapi.CloseBody(res)
  51767. if err := googleapi.CheckResponse(res); err != nil {
  51768. return nil, err
  51769. }
  51770. ret := &Operation{
  51771. ServerResponse: googleapi.ServerResponse{
  51772. Header: res.Header,
  51773. HTTPStatusCode: res.StatusCode,
  51774. },
  51775. }
  51776. target := &ret
  51777. if err := gensupport.DecodeResponse(target, res); err != nil {
  51778. return nil, err
  51779. }
  51780. return ret, nil
  51781. // {
  51782. // "description": "Creates a HttpsHealthCheck resource in the specified project using the data included in the request.",
  51783. // "httpMethod": "POST",
  51784. // "id": "compute.httpsHealthChecks.insert",
  51785. // "parameterOrder": [
  51786. // "project"
  51787. // ],
  51788. // "parameters": {
  51789. // "project": {
  51790. // "description": "Project ID for this request.",
  51791. // "location": "path",
  51792. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  51793. // "required": true,
  51794. // "type": "string"
  51795. // },
  51796. // "requestId": {
  51797. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  51798. // "location": "query",
  51799. // "type": "string"
  51800. // }
  51801. // },
  51802. // "path": "{project}/global/httpsHealthChecks",
  51803. // "request": {
  51804. // "$ref": "HttpsHealthCheck"
  51805. // },
  51806. // "response": {
  51807. // "$ref": "Operation"
  51808. // },
  51809. // "scopes": [
  51810. // "https://www.googleapis.com/auth/cloud-platform",
  51811. // "https://www.googleapis.com/auth/compute"
  51812. // ]
  51813. // }
  51814. }
  51815. // method id "compute.httpsHealthChecks.list":
  51816. type HttpsHealthChecksListCall struct {
  51817. s *Service
  51818. project string
  51819. urlParams_ gensupport.URLParams
  51820. ifNoneMatch_ string
  51821. ctx_ context.Context
  51822. header_ http.Header
  51823. }
  51824. // List: Retrieves the list of HttpsHealthCheck resources available to
  51825. // the specified project.
  51826. func (r *HttpsHealthChecksService) List(project string) *HttpsHealthChecksListCall {
  51827. c := &HttpsHealthChecksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  51828. c.project = project
  51829. return c
  51830. }
  51831. // Filter sets the optional parameter "filter": A filter expression that
  51832. // filters resources listed in the response. The expression must specify
  51833. // the field name, a comparison operator, and the value that you want to
  51834. // use for filtering. The value must be a string, a number, or a
  51835. // boolean. The comparison operator must be either =, !=, >, or <.
  51836. //
  51837. // For example, if you are filtering Compute Engine instances, you can
  51838. // exclude instances named example-instance by specifying name !=
  51839. // example-instance.
  51840. //
  51841. // You can also filter nested fields. For example, you could specify
  51842. // scheduling.automaticRestart = false to include instances only if they
  51843. // are not scheduled for automatic restarts. You can use filtering on
  51844. // nested fields to filter based on resource labels.
  51845. //
  51846. // To filter on multiple expressions, provide each separate expression
  51847. // within parentheses. For example, (scheduling.automaticRestart = true)
  51848. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  51849. // AND expression. However, you can include AND and OR expressions
  51850. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  51851. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  51852. // true).
  51853. func (c *HttpsHealthChecksListCall) Filter(filter string) *HttpsHealthChecksListCall {
  51854. c.urlParams_.Set("filter", filter)
  51855. return c
  51856. }
  51857. // MaxResults sets the optional parameter "maxResults": The maximum
  51858. // number of results per page that should be returned. If the number of
  51859. // available results is larger than maxResults, Compute Engine returns a
  51860. // nextPageToken that can be used to get the next page of results in
  51861. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  51862. // (Default: 500)
  51863. func (c *HttpsHealthChecksListCall) MaxResults(maxResults int64) *HttpsHealthChecksListCall {
  51864. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  51865. return c
  51866. }
  51867. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  51868. // a certain order. By default, results are returned in alphanumerical
  51869. // order based on the resource name.
  51870. //
  51871. // You can also sort results in descending order based on the creation
  51872. // timestamp using orderBy="creationTimestamp desc". This sorts results
  51873. // based on the creationTimestamp field in reverse chronological order
  51874. // (newest result first). Use this to sort resources like operations so
  51875. // that the newest operation is returned first.
  51876. //
  51877. // Currently, only sorting by name or creationTimestamp desc is
  51878. // supported.
  51879. func (c *HttpsHealthChecksListCall) OrderBy(orderBy string) *HttpsHealthChecksListCall {
  51880. c.urlParams_.Set("orderBy", orderBy)
  51881. return c
  51882. }
  51883. // PageToken sets the optional parameter "pageToken": Specifies a page
  51884. // token to use. Set pageToken to the nextPageToken returned by a
  51885. // previous list request to get the next page of results.
  51886. func (c *HttpsHealthChecksListCall) PageToken(pageToken string) *HttpsHealthChecksListCall {
  51887. c.urlParams_.Set("pageToken", pageToken)
  51888. return c
  51889. }
  51890. // Fields allows partial responses to be retrieved. See
  51891. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  51892. // for more information.
  51893. func (c *HttpsHealthChecksListCall) Fields(s ...googleapi.Field) *HttpsHealthChecksListCall {
  51894. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  51895. return c
  51896. }
  51897. // IfNoneMatch sets the optional parameter which makes the operation
  51898. // fail if the object's ETag matches the given value. This is useful for
  51899. // getting updates only after the object has changed since the last
  51900. // request. Use googleapi.IsNotModified to check whether the response
  51901. // error from Do is the result of In-None-Match.
  51902. func (c *HttpsHealthChecksListCall) IfNoneMatch(entityTag string) *HttpsHealthChecksListCall {
  51903. c.ifNoneMatch_ = entityTag
  51904. return c
  51905. }
  51906. // Context sets the context to be used in this call's Do method. Any
  51907. // pending HTTP request will be aborted if the provided context is
  51908. // canceled.
  51909. func (c *HttpsHealthChecksListCall) Context(ctx context.Context) *HttpsHealthChecksListCall {
  51910. c.ctx_ = ctx
  51911. return c
  51912. }
  51913. // Header returns an http.Header that can be modified by the caller to
  51914. // add HTTP headers to the request.
  51915. func (c *HttpsHealthChecksListCall) Header() http.Header {
  51916. if c.header_ == nil {
  51917. c.header_ = make(http.Header)
  51918. }
  51919. return c.header_
  51920. }
  51921. func (c *HttpsHealthChecksListCall) doRequest(alt string) (*http.Response, error) {
  51922. reqHeaders := make(http.Header)
  51923. for k, v := range c.header_ {
  51924. reqHeaders[k] = v
  51925. }
  51926. reqHeaders.Set("User-Agent", c.s.userAgent())
  51927. if c.ifNoneMatch_ != "" {
  51928. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  51929. }
  51930. var body io.Reader = nil
  51931. c.urlParams_.Set("alt", alt)
  51932. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks")
  51933. urls += "?" + c.urlParams_.Encode()
  51934. req, _ := http.NewRequest("GET", urls, body)
  51935. req.Header = reqHeaders
  51936. googleapi.Expand(req.URL, map[string]string{
  51937. "project": c.project,
  51938. })
  51939. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  51940. }
  51941. // Do executes the "compute.httpsHealthChecks.list" call.
  51942. // Exactly one of *HttpsHealthCheckList or error will be non-nil. Any
  51943. // non-2xx status code is an error. Response headers are in either
  51944. // *HttpsHealthCheckList.ServerResponse.Header or (if a response was
  51945. // returned at all) in error.(*googleapi.Error).Header. Use
  51946. // googleapi.IsNotModified to check whether the returned error was
  51947. // because http.StatusNotModified was returned.
  51948. func (c *HttpsHealthChecksListCall) Do(opts ...googleapi.CallOption) (*HttpsHealthCheckList, error) {
  51949. gensupport.SetOptions(c.urlParams_, opts...)
  51950. res, err := c.doRequest("json")
  51951. if res != nil && res.StatusCode == http.StatusNotModified {
  51952. if res.Body != nil {
  51953. res.Body.Close()
  51954. }
  51955. return nil, &googleapi.Error{
  51956. Code: res.StatusCode,
  51957. Header: res.Header,
  51958. }
  51959. }
  51960. if err != nil {
  51961. return nil, err
  51962. }
  51963. defer googleapi.CloseBody(res)
  51964. if err := googleapi.CheckResponse(res); err != nil {
  51965. return nil, err
  51966. }
  51967. ret := &HttpsHealthCheckList{
  51968. ServerResponse: googleapi.ServerResponse{
  51969. Header: res.Header,
  51970. HTTPStatusCode: res.StatusCode,
  51971. },
  51972. }
  51973. target := &ret
  51974. if err := gensupport.DecodeResponse(target, res); err != nil {
  51975. return nil, err
  51976. }
  51977. return ret, nil
  51978. // {
  51979. // "description": "Retrieves the list of HttpsHealthCheck resources available to the specified project.",
  51980. // "httpMethod": "GET",
  51981. // "id": "compute.httpsHealthChecks.list",
  51982. // "parameterOrder": [
  51983. // "project"
  51984. // ],
  51985. // "parameters": {
  51986. // "filter": {
  51987. // "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).",
  51988. // "location": "query",
  51989. // "type": "string"
  51990. // },
  51991. // "maxResults": {
  51992. // "default": "500",
  51993. // "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)",
  51994. // "format": "uint32",
  51995. // "location": "query",
  51996. // "minimum": "0",
  51997. // "type": "integer"
  51998. // },
  51999. // "orderBy": {
  52000. // "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.",
  52001. // "location": "query",
  52002. // "type": "string"
  52003. // },
  52004. // "pageToken": {
  52005. // "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.",
  52006. // "location": "query",
  52007. // "type": "string"
  52008. // },
  52009. // "project": {
  52010. // "description": "Project ID for this request.",
  52011. // "location": "path",
  52012. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  52013. // "required": true,
  52014. // "type": "string"
  52015. // }
  52016. // },
  52017. // "path": "{project}/global/httpsHealthChecks",
  52018. // "response": {
  52019. // "$ref": "HttpsHealthCheckList"
  52020. // },
  52021. // "scopes": [
  52022. // "https://www.googleapis.com/auth/cloud-platform",
  52023. // "https://www.googleapis.com/auth/compute",
  52024. // "https://www.googleapis.com/auth/compute.readonly"
  52025. // ]
  52026. // }
  52027. }
  52028. // Pages invokes f for each page of results.
  52029. // A non-nil error returned from f will halt the iteration.
  52030. // The provided context supersedes any context provided to the Context method.
  52031. func (c *HttpsHealthChecksListCall) Pages(ctx context.Context, f func(*HttpsHealthCheckList) error) error {
  52032. c.ctx_ = ctx
  52033. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  52034. for {
  52035. x, err := c.Do()
  52036. if err != nil {
  52037. return err
  52038. }
  52039. if err := f(x); err != nil {
  52040. return err
  52041. }
  52042. if x.NextPageToken == "" {
  52043. return nil
  52044. }
  52045. c.PageToken(x.NextPageToken)
  52046. }
  52047. }
  52048. // method id "compute.httpsHealthChecks.patch":
  52049. type HttpsHealthChecksPatchCall struct {
  52050. s *Service
  52051. project string
  52052. httpsHealthCheck string
  52053. httpshealthcheck *HttpsHealthCheck
  52054. urlParams_ gensupport.URLParams
  52055. ctx_ context.Context
  52056. header_ http.Header
  52057. }
  52058. // Patch: Updates a HttpsHealthCheck resource in the specified project
  52059. // using the data included in the request. This method supports PATCH
  52060. // semantics and uses the JSON merge patch format and processing rules.
  52061. func (r *HttpsHealthChecksService) Patch(project string, httpsHealthCheck string, httpshealthcheck *HttpsHealthCheck) *HttpsHealthChecksPatchCall {
  52062. c := &HttpsHealthChecksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  52063. c.project = project
  52064. c.httpsHealthCheck = httpsHealthCheck
  52065. c.httpshealthcheck = httpshealthcheck
  52066. return c
  52067. }
  52068. // RequestId sets the optional parameter "requestId": An optional
  52069. // request ID to identify requests. Specify a unique request ID so that
  52070. // if you must retry your request, the server will know to ignore the
  52071. // request if it has already been completed.
  52072. //
  52073. // For example, consider a situation where you make an initial request
  52074. // and the request times out. If you make the request again with the
  52075. // same request ID, the server can check if original operation with the
  52076. // same request ID was received, and if so, will ignore the second
  52077. // request. This prevents clients from accidentally creating duplicate
  52078. // commitments.
  52079. //
  52080. // The request ID must be a valid UUID with the exception that zero UUID
  52081. // is not supported (00000000-0000-0000-0000-000000000000).
  52082. func (c *HttpsHealthChecksPatchCall) RequestId(requestId string) *HttpsHealthChecksPatchCall {
  52083. c.urlParams_.Set("requestId", requestId)
  52084. return c
  52085. }
  52086. // Fields allows partial responses to be retrieved. See
  52087. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  52088. // for more information.
  52089. func (c *HttpsHealthChecksPatchCall) Fields(s ...googleapi.Field) *HttpsHealthChecksPatchCall {
  52090. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  52091. return c
  52092. }
  52093. // Context sets the context to be used in this call's Do method. Any
  52094. // pending HTTP request will be aborted if the provided context is
  52095. // canceled.
  52096. func (c *HttpsHealthChecksPatchCall) Context(ctx context.Context) *HttpsHealthChecksPatchCall {
  52097. c.ctx_ = ctx
  52098. return c
  52099. }
  52100. // Header returns an http.Header that can be modified by the caller to
  52101. // add HTTP headers to the request.
  52102. func (c *HttpsHealthChecksPatchCall) Header() http.Header {
  52103. if c.header_ == nil {
  52104. c.header_ = make(http.Header)
  52105. }
  52106. return c.header_
  52107. }
  52108. func (c *HttpsHealthChecksPatchCall) doRequest(alt string) (*http.Response, error) {
  52109. reqHeaders := make(http.Header)
  52110. for k, v := range c.header_ {
  52111. reqHeaders[k] = v
  52112. }
  52113. reqHeaders.Set("User-Agent", c.s.userAgent())
  52114. var body io.Reader = nil
  52115. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpshealthcheck)
  52116. if err != nil {
  52117. return nil, err
  52118. }
  52119. reqHeaders.Set("Content-Type", "application/json")
  52120. c.urlParams_.Set("alt", alt)
  52121. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{httpsHealthCheck}")
  52122. urls += "?" + c.urlParams_.Encode()
  52123. req, _ := http.NewRequest("PATCH", urls, body)
  52124. req.Header = reqHeaders
  52125. googleapi.Expand(req.URL, map[string]string{
  52126. "project": c.project,
  52127. "httpsHealthCheck": c.httpsHealthCheck,
  52128. })
  52129. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  52130. }
  52131. // Do executes the "compute.httpsHealthChecks.patch" call.
  52132. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  52133. // status code is an error. Response headers are in either
  52134. // *Operation.ServerResponse.Header or (if a response was returned at
  52135. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  52136. // to check whether the returned error was because
  52137. // http.StatusNotModified was returned.
  52138. func (c *HttpsHealthChecksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  52139. gensupport.SetOptions(c.urlParams_, opts...)
  52140. res, err := c.doRequest("json")
  52141. if res != nil && res.StatusCode == http.StatusNotModified {
  52142. if res.Body != nil {
  52143. res.Body.Close()
  52144. }
  52145. return nil, &googleapi.Error{
  52146. Code: res.StatusCode,
  52147. Header: res.Header,
  52148. }
  52149. }
  52150. if err != nil {
  52151. return nil, err
  52152. }
  52153. defer googleapi.CloseBody(res)
  52154. if err := googleapi.CheckResponse(res); err != nil {
  52155. return nil, err
  52156. }
  52157. ret := &Operation{
  52158. ServerResponse: googleapi.ServerResponse{
  52159. Header: res.Header,
  52160. HTTPStatusCode: res.StatusCode,
  52161. },
  52162. }
  52163. target := &ret
  52164. if err := gensupport.DecodeResponse(target, res); err != nil {
  52165. return nil, err
  52166. }
  52167. return ret, nil
  52168. // {
  52169. // "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.",
  52170. // "httpMethod": "PATCH",
  52171. // "id": "compute.httpsHealthChecks.patch",
  52172. // "parameterOrder": [
  52173. // "project",
  52174. // "httpsHealthCheck"
  52175. // ],
  52176. // "parameters": {
  52177. // "httpsHealthCheck": {
  52178. // "description": "Name of the HttpsHealthCheck resource to patch.",
  52179. // "location": "path",
  52180. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  52181. // "required": true,
  52182. // "type": "string"
  52183. // },
  52184. // "project": {
  52185. // "description": "Project ID for this request.",
  52186. // "location": "path",
  52187. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  52188. // "required": true,
  52189. // "type": "string"
  52190. // },
  52191. // "requestId": {
  52192. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  52193. // "location": "query",
  52194. // "type": "string"
  52195. // }
  52196. // },
  52197. // "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}",
  52198. // "request": {
  52199. // "$ref": "HttpsHealthCheck"
  52200. // },
  52201. // "response": {
  52202. // "$ref": "Operation"
  52203. // },
  52204. // "scopes": [
  52205. // "https://www.googleapis.com/auth/cloud-platform",
  52206. // "https://www.googleapis.com/auth/compute"
  52207. // ]
  52208. // }
  52209. }
  52210. // method id "compute.httpsHealthChecks.testIamPermissions":
  52211. type HttpsHealthChecksTestIamPermissionsCall struct {
  52212. s *Service
  52213. project string
  52214. resource string
  52215. testpermissionsrequest *TestPermissionsRequest
  52216. urlParams_ gensupport.URLParams
  52217. ctx_ context.Context
  52218. header_ http.Header
  52219. }
  52220. // TestIamPermissions: Returns permissions that a caller has on the
  52221. // specified resource.
  52222. func (r *HttpsHealthChecksService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *HttpsHealthChecksTestIamPermissionsCall {
  52223. c := &HttpsHealthChecksTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  52224. c.project = project
  52225. c.resource = resource
  52226. c.testpermissionsrequest = testpermissionsrequest
  52227. return c
  52228. }
  52229. // Fields allows partial responses to be retrieved. See
  52230. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  52231. // for more information.
  52232. func (c *HttpsHealthChecksTestIamPermissionsCall) Fields(s ...googleapi.Field) *HttpsHealthChecksTestIamPermissionsCall {
  52233. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  52234. return c
  52235. }
  52236. // Context sets the context to be used in this call's Do method. Any
  52237. // pending HTTP request will be aborted if the provided context is
  52238. // canceled.
  52239. func (c *HttpsHealthChecksTestIamPermissionsCall) Context(ctx context.Context) *HttpsHealthChecksTestIamPermissionsCall {
  52240. c.ctx_ = ctx
  52241. return c
  52242. }
  52243. // Header returns an http.Header that can be modified by the caller to
  52244. // add HTTP headers to the request.
  52245. func (c *HttpsHealthChecksTestIamPermissionsCall) Header() http.Header {
  52246. if c.header_ == nil {
  52247. c.header_ = make(http.Header)
  52248. }
  52249. return c.header_
  52250. }
  52251. func (c *HttpsHealthChecksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  52252. reqHeaders := make(http.Header)
  52253. for k, v := range c.header_ {
  52254. reqHeaders[k] = v
  52255. }
  52256. reqHeaders.Set("User-Agent", c.s.userAgent())
  52257. var body io.Reader = nil
  52258. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  52259. if err != nil {
  52260. return nil, err
  52261. }
  52262. reqHeaders.Set("Content-Type", "application/json")
  52263. c.urlParams_.Set("alt", alt)
  52264. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{resource}/testIamPermissions")
  52265. urls += "?" + c.urlParams_.Encode()
  52266. req, _ := http.NewRequest("POST", urls, body)
  52267. req.Header = reqHeaders
  52268. googleapi.Expand(req.URL, map[string]string{
  52269. "project": c.project,
  52270. "resource": c.resource,
  52271. })
  52272. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  52273. }
  52274. // Do executes the "compute.httpsHealthChecks.testIamPermissions" call.
  52275. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  52276. // non-2xx status code is an error. Response headers are in either
  52277. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  52278. // returned at all) in error.(*googleapi.Error).Header. Use
  52279. // googleapi.IsNotModified to check whether the returned error was
  52280. // because http.StatusNotModified was returned.
  52281. func (c *HttpsHealthChecksTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  52282. gensupport.SetOptions(c.urlParams_, opts...)
  52283. res, err := c.doRequest("json")
  52284. if res != nil && res.StatusCode == http.StatusNotModified {
  52285. if res.Body != nil {
  52286. res.Body.Close()
  52287. }
  52288. return nil, &googleapi.Error{
  52289. Code: res.StatusCode,
  52290. Header: res.Header,
  52291. }
  52292. }
  52293. if err != nil {
  52294. return nil, err
  52295. }
  52296. defer googleapi.CloseBody(res)
  52297. if err := googleapi.CheckResponse(res); err != nil {
  52298. return nil, err
  52299. }
  52300. ret := &TestPermissionsResponse{
  52301. ServerResponse: googleapi.ServerResponse{
  52302. Header: res.Header,
  52303. HTTPStatusCode: res.StatusCode,
  52304. },
  52305. }
  52306. target := &ret
  52307. if err := gensupport.DecodeResponse(target, res); err != nil {
  52308. return nil, err
  52309. }
  52310. return ret, nil
  52311. // {
  52312. // "description": "Returns permissions that a caller has on the specified resource.",
  52313. // "httpMethod": "POST",
  52314. // "id": "compute.httpsHealthChecks.testIamPermissions",
  52315. // "parameterOrder": [
  52316. // "project",
  52317. // "resource"
  52318. // ],
  52319. // "parameters": {
  52320. // "project": {
  52321. // "description": "Project ID for this request.",
  52322. // "location": "path",
  52323. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  52324. // "required": true,
  52325. // "type": "string"
  52326. // },
  52327. // "resource": {
  52328. // "description": "Name of the resource for this request.",
  52329. // "location": "path",
  52330. // "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?",
  52331. // "required": true,
  52332. // "type": "string"
  52333. // }
  52334. // },
  52335. // "path": "{project}/global/httpsHealthChecks/{resource}/testIamPermissions",
  52336. // "request": {
  52337. // "$ref": "TestPermissionsRequest"
  52338. // },
  52339. // "response": {
  52340. // "$ref": "TestPermissionsResponse"
  52341. // },
  52342. // "scopes": [
  52343. // "https://www.googleapis.com/auth/cloud-platform",
  52344. // "https://www.googleapis.com/auth/compute",
  52345. // "https://www.googleapis.com/auth/compute.readonly"
  52346. // ]
  52347. // }
  52348. }
  52349. // method id "compute.httpsHealthChecks.update":
  52350. type HttpsHealthChecksUpdateCall struct {
  52351. s *Service
  52352. project string
  52353. httpsHealthCheck string
  52354. httpshealthcheck *HttpsHealthCheck
  52355. urlParams_ gensupport.URLParams
  52356. ctx_ context.Context
  52357. header_ http.Header
  52358. }
  52359. // Update: Updates a HttpsHealthCheck resource in the specified project
  52360. // using the data included in the request.
  52361. func (r *HttpsHealthChecksService) Update(project string, httpsHealthCheck string, httpshealthcheck *HttpsHealthCheck) *HttpsHealthChecksUpdateCall {
  52362. c := &HttpsHealthChecksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  52363. c.project = project
  52364. c.httpsHealthCheck = httpsHealthCheck
  52365. c.httpshealthcheck = httpshealthcheck
  52366. return c
  52367. }
  52368. // RequestId sets the optional parameter "requestId": An optional
  52369. // request ID to identify requests. Specify a unique request ID so that
  52370. // if you must retry your request, the server will know to ignore the
  52371. // request if it has already been completed.
  52372. //
  52373. // For example, consider a situation where you make an initial request
  52374. // and the request times out. If you make the request again with the
  52375. // same request ID, the server can check if original operation with the
  52376. // same request ID was received, and if so, will ignore the second
  52377. // request. This prevents clients from accidentally creating duplicate
  52378. // commitments.
  52379. //
  52380. // The request ID must be a valid UUID with the exception that zero UUID
  52381. // is not supported (00000000-0000-0000-0000-000000000000).
  52382. func (c *HttpsHealthChecksUpdateCall) RequestId(requestId string) *HttpsHealthChecksUpdateCall {
  52383. c.urlParams_.Set("requestId", requestId)
  52384. return c
  52385. }
  52386. // Fields allows partial responses to be retrieved. See
  52387. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  52388. // for more information.
  52389. func (c *HttpsHealthChecksUpdateCall) Fields(s ...googleapi.Field) *HttpsHealthChecksUpdateCall {
  52390. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  52391. return c
  52392. }
  52393. // Context sets the context to be used in this call's Do method. Any
  52394. // pending HTTP request will be aborted if the provided context is
  52395. // canceled.
  52396. func (c *HttpsHealthChecksUpdateCall) Context(ctx context.Context) *HttpsHealthChecksUpdateCall {
  52397. c.ctx_ = ctx
  52398. return c
  52399. }
  52400. // Header returns an http.Header that can be modified by the caller to
  52401. // add HTTP headers to the request.
  52402. func (c *HttpsHealthChecksUpdateCall) Header() http.Header {
  52403. if c.header_ == nil {
  52404. c.header_ = make(http.Header)
  52405. }
  52406. return c.header_
  52407. }
  52408. func (c *HttpsHealthChecksUpdateCall) doRequest(alt string) (*http.Response, error) {
  52409. reqHeaders := make(http.Header)
  52410. for k, v := range c.header_ {
  52411. reqHeaders[k] = v
  52412. }
  52413. reqHeaders.Set("User-Agent", c.s.userAgent())
  52414. var body io.Reader = nil
  52415. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpshealthcheck)
  52416. if err != nil {
  52417. return nil, err
  52418. }
  52419. reqHeaders.Set("Content-Type", "application/json")
  52420. c.urlParams_.Set("alt", alt)
  52421. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{httpsHealthCheck}")
  52422. urls += "?" + c.urlParams_.Encode()
  52423. req, _ := http.NewRequest("PUT", urls, body)
  52424. req.Header = reqHeaders
  52425. googleapi.Expand(req.URL, map[string]string{
  52426. "project": c.project,
  52427. "httpsHealthCheck": c.httpsHealthCheck,
  52428. })
  52429. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  52430. }
  52431. // Do executes the "compute.httpsHealthChecks.update" call.
  52432. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  52433. // status code is an error. Response headers are in either
  52434. // *Operation.ServerResponse.Header or (if a response was returned at
  52435. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  52436. // to check whether the returned error was because
  52437. // http.StatusNotModified was returned.
  52438. func (c *HttpsHealthChecksUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  52439. gensupport.SetOptions(c.urlParams_, opts...)
  52440. res, err := c.doRequest("json")
  52441. if res != nil && res.StatusCode == http.StatusNotModified {
  52442. if res.Body != nil {
  52443. res.Body.Close()
  52444. }
  52445. return nil, &googleapi.Error{
  52446. Code: res.StatusCode,
  52447. Header: res.Header,
  52448. }
  52449. }
  52450. if err != nil {
  52451. return nil, err
  52452. }
  52453. defer googleapi.CloseBody(res)
  52454. if err := googleapi.CheckResponse(res); err != nil {
  52455. return nil, err
  52456. }
  52457. ret := &Operation{
  52458. ServerResponse: googleapi.ServerResponse{
  52459. Header: res.Header,
  52460. HTTPStatusCode: res.StatusCode,
  52461. },
  52462. }
  52463. target := &ret
  52464. if err := gensupport.DecodeResponse(target, res); err != nil {
  52465. return nil, err
  52466. }
  52467. return ret, nil
  52468. // {
  52469. // "description": "Updates a HttpsHealthCheck resource in the specified project using the data included in the request.",
  52470. // "httpMethod": "PUT",
  52471. // "id": "compute.httpsHealthChecks.update",
  52472. // "parameterOrder": [
  52473. // "project",
  52474. // "httpsHealthCheck"
  52475. // ],
  52476. // "parameters": {
  52477. // "httpsHealthCheck": {
  52478. // "description": "Name of the HttpsHealthCheck resource to update.",
  52479. // "location": "path",
  52480. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  52481. // "required": true,
  52482. // "type": "string"
  52483. // },
  52484. // "project": {
  52485. // "description": "Project ID for this request.",
  52486. // "location": "path",
  52487. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  52488. // "required": true,
  52489. // "type": "string"
  52490. // },
  52491. // "requestId": {
  52492. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  52493. // "location": "query",
  52494. // "type": "string"
  52495. // }
  52496. // },
  52497. // "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}",
  52498. // "request": {
  52499. // "$ref": "HttpsHealthCheck"
  52500. // },
  52501. // "response": {
  52502. // "$ref": "Operation"
  52503. // },
  52504. // "scopes": [
  52505. // "https://www.googleapis.com/auth/cloud-platform",
  52506. // "https://www.googleapis.com/auth/compute"
  52507. // ]
  52508. // }
  52509. }
  52510. // method id "compute.images.delete":
  52511. type ImagesDeleteCall struct {
  52512. s *Service
  52513. project string
  52514. image string
  52515. urlParams_ gensupport.URLParams
  52516. ctx_ context.Context
  52517. header_ http.Header
  52518. }
  52519. // Delete: Deletes the specified image.
  52520. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/delete
  52521. func (r *ImagesService) Delete(project string, image string) *ImagesDeleteCall {
  52522. c := &ImagesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  52523. c.project = project
  52524. c.image = image
  52525. return c
  52526. }
  52527. // RequestId sets the optional parameter "requestId": An optional
  52528. // request ID to identify requests. Specify a unique request ID so that
  52529. // if you must retry your request, the server will know to ignore the
  52530. // request if it has already been completed.
  52531. //
  52532. // For example, consider a situation where you make an initial request
  52533. // and the request times out. If you make the request again with the
  52534. // same request ID, the server can check if original operation with the
  52535. // same request ID was received, and if so, will ignore the second
  52536. // request. This prevents clients from accidentally creating duplicate
  52537. // commitments.
  52538. //
  52539. // The request ID must be a valid UUID with the exception that zero UUID
  52540. // is not supported (00000000-0000-0000-0000-000000000000).
  52541. func (c *ImagesDeleteCall) RequestId(requestId string) *ImagesDeleteCall {
  52542. c.urlParams_.Set("requestId", requestId)
  52543. return c
  52544. }
  52545. // Fields allows partial responses to be retrieved. See
  52546. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  52547. // for more information.
  52548. func (c *ImagesDeleteCall) Fields(s ...googleapi.Field) *ImagesDeleteCall {
  52549. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  52550. return c
  52551. }
  52552. // Context sets the context to be used in this call's Do method. Any
  52553. // pending HTTP request will be aborted if the provided context is
  52554. // canceled.
  52555. func (c *ImagesDeleteCall) Context(ctx context.Context) *ImagesDeleteCall {
  52556. c.ctx_ = ctx
  52557. return c
  52558. }
  52559. // Header returns an http.Header that can be modified by the caller to
  52560. // add HTTP headers to the request.
  52561. func (c *ImagesDeleteCall) Header() http.Header {
  52562. if c.header_ == nil {
  52563. c.header_ = make(http.Header)
  52564. }
  52565. return c.header_
  52566. }
  52567. func (c *ImagesDeleteCall) doRequest(alt string) (*http.Response, error) {
  52568. reqHeaders := make(http.Header)
  52569. for k, v := range c.header_ {
  52570. reqHeaders[k] = v
  52571. }
  52572. reqHeaders.Set("User-Agent", c.s.userAgent())
  52573. var body io.Reader = nil
  52574. c.urlParams_.Set("alt", alt)
  52575. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{image}")
  52576. urls += "?" + c.urlParams_.Encode()
  52577. req, _ := http.NewRequest("DELETE", urls, body)
  52578. req.Header = reqHeaders
  52579. googleapi.Expand(req.URL, map[string]string{
  52580. "project": c.project,
  52581. "image": c.image,
  52582. })
  52583. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  52584. }
  52585. // Do executes the "compute.images.delete" call.
  52586. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  52587. // status code is an error. Response headers are in either
  52588. // *Operation.ServerResponse.Header or (if a response was returned at
  52589. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  52590. // to check whether the returned error was because
  52591. // http.StatusNotModified was returned.
  52592. func (c *ImagesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  52593. gensupport.SetOptions(c.urlParams_, opts...)
  52594. res, err := c.doRequest("json")
  52595. if res != nil && res.StatusCode == http.StatusNotModified {
  52596. if res.Body != nil {
  52597. res.Body.Close()
  52598. }
  52599. return nil, &googleapi.Error{
  52600. Code: res.StatusCode,
  52601. Header: res.Header,
  52602. }
  52603. }
  52604. if err != nil {
  52605. return nil, err
  52606. }
  52607. defer googleapi.CloseBody(res)
  52608. if err := googleapi.CheckResponse(res); err != nil {
  52609. return nil, err
  52610. }
  52611. ret := &Operation{
  52612. ServerResponse: googleapi.ServerResponse{
  52613. Header: res.Header,
  52614. HTTPStatusCode: res.StatusCode,
  52615. },
  52616. }
  52617. target := &ret
  52618. if err := gensupport.DecodeResponse(target, res); err != nil {
  52619. return nil, err
  52620. }
  52621. return ret, nil
  52622. // {
  52623. // "description": "Deletes the specified image.",
  52624. // "httpMethod": "DELETE",
  52625. // "id": "compute.images.delete",
  52626. // "parameterOrder": [
  52627. // "project",
  52628. // "image"
  52629. // ],
  52630. // "parameters": {
  52631. // "image": {
  52632. // "description": "Name of the image resource to delete.",
  52633. // "location": "path",
  52634. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  52635. // "required": true,
  52636. // "type": "string"
  52637. // },
  52638. // "project": {
  52639. // "description": "Project ID for this request.",
  52640. // "location": "path",
  52641. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  52642. // "required": true,
  52643. // "type": "string"
  52644. // },
  52645. // "requestId": {
  52646. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  52647. // "location": "query",
  52648. // "type": "string"
  52649. // }
  52650. // },
  52651. // "path": "{project}/global/images/{image}",
  52652. // "response": {
  52653. // "$ref": "Operation"
  52654. // },
  52655. // "scopes": [
  52656. // "https://www.googleapis.com/auth/cloud-platform",
  52657. // "https://www.googleapis.com/auth/compute"
  52658. // ]
  52659. // }
  52660. }
  52661. // method id "compute.images.deprecate":
  52662. type ImagesDeprecateCall struct {
  52663. s *Service
  52664. project string
  52665. image string
  52666. deprecationstatus *DeprecationStatus
  52667. urlParams_ gensupport.URLParams
  52668. ctx_ context.Context
  52669. header_ http.Header
  52670. }
  52671. // Deprecate: Sets the deprecation status of an image.
  52672. //
  52673. // If an empty request body is given, clears the deprecation status
  52674. // instead.
  52675. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/deprecate
  52676. func (r *ImagesService) Deprecate(project string, image string, deprecationstatus *DeprecationStatus) *ImagesDeprecateCall {
  52677. c := &ImagesDeprecateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  52678. c.project = project
  52679. c.image = image
  52680. c.deprecationstatus = deprecationstatus
  52681. return c
  52682. }
  52683. // RequestId sets the optional parameter "requestId": An optional
  52684. // request ID to identify requests. Specify a unique request ID so that
  52685. // if you must retry your request, the server will know to ignore the
  52686. // request if it has already been completed.
  52687. //
  52688. // For example, consider a situation where you make an initial request
  52689. // and the request times out. If you make the request again with the
  52690. // same request ID, the server can check if original operation with the
  52691. // same request ID was received, and if so, will ignore the second
  52692. // request. This prevents clients from accidentally creating duplicate
  52693. // commitments.
  52694. //
  52695. // The request ID must be a valid UUID with the exception that zero UUID
  52696. // is not supported (00000000-0000-0000-0000-000000000000).
  52697. func (c *ImagesDeprecateCall) RequestId(requestId string) *ImagesDeprecateCall {
  52698. c.urlParams_.Set("requestId", requestId)
  52699. return c
  52700. }
  52701. // Fields allows partial responses to be retrieved. See
  52702. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  52703. // for more information.
  52704. func (c *ImagesDeprecateCall) Fields(s ...googleapi.Field) *ImagesDeprecateCall {
  52705. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  52706. return c
  52707. }
  52708. // Context sets the context to be used in this call's Do method. Any
  52709. // pending HTTP request will be aborted if the provided context is
  52710. // canceled.
  52711. func (c *ImagesDeprecateCall) Context(ctx context.Context) *ImagesDeprecateCall {
  52712. c.ctx_ = ctx
  52713. return c
  52714. }
  52715. // Header returns an http.Header that can be modified by the caller to
  52716. // add HTTP headers to the request.
  52717. func (c *ImagesDeprecateCall) Header() http.Header {
  52718. if c.header_ == nil {
  52719. c.header_ = make(http.Header)
  52720. }
  52721. return c.header_
  52722. }
  52723. func (c *ImagesDeprecateCall) doRequest(alt string) (*http.Response, error) {
  52724. reqHeaders := make(http.Header)
  52725. for k, v := range c.header_ {
  52726. reqHeaders[k] = v
  52727. }
  52728. reqHeaders.Set("User-Agent", c.s.userAgent())
  52729. var body io.Reader = nil
  52730. body, err := googleapi.WithoutDataWrapper.JSONReader(c.deprecationstatus)
  52731. if err != nil {
  52732. return nil, err
  52733. }
  52734. reqHeaders.Set("Content-Type", "application/json")
  52735. c.urlParams_.Set("alt", alt)
  52736. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{image}/deprecate")
  52737. urls += "?" + c.urlParams_.Encode()
  52738. req, _ := http.NewRequest("POST", urls, body)
  52739. req.Header = reqHeaders
  52740. googleapi.Expand(req.URL, map[string]string{
  52741. "project": c.project,
  52742. "image": c.image,
  52743. })
  52744. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  52745. }
  52746. // Do executes the "compute.images.deprecate" call.
  52747. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  52748. // status code is an error. Response headers are in either
  52749. // *Operation.ServerResponse.Header or (if a response was returned at
  52750. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  52751. // to check whether the returned error was because
  52752. // http.StatusNotModified was returned.
  52753. func (c *ImagesDeprecateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  52754. gensupport.SetOptions(c.urlParams_, opts...)
  52755. res, err := c.doRequest("json")
  52756. if res != nil && res.StatusCode == http.StatusNotModified {
  52757. if res.Body != nil {
  52758. res.Body.Close()
  52759. }
  52760. return nil, &googleapi.Error{
  52761. Code: res.StatusCode,
  52762. Header: res.Header,
  52763. }
  52764. }
  52765. if err != nil {
  52766. return nil, err
  52767. }
  52768. defer googleapi.CloseBody(res)
  52769. if err := googleapi.CheckResponse(res); err != nil {
  52770. return nil, err
  52771. }
  52772. ret := &Operation{
  52773. ServerResponse: googleapi.ServerResponse{
  52774. Header: res.Header,
  52775. HTTPStatusCode: res.StatusCode,
  52776. },
  52777. }
  52778. target := &ret
  52779. if err := gensupport.DecodeResponse(target, res); err != nil {
  52780. return nil, err
  52781. }
  52782. return ret, nil
  52783. // {
  52784. // "description": "Sets the deprecation status of an image.\n\nIf an empty request body is given, clears the deprecation status instead.",
  52785. // "httpMethod": "POST",
  52786. // "id": "compute.images.deprecate",
  52787. // "parameterOrder": [
  52788. // "project",
  52789. // "image"
  52790. // ],
  52791. // "parameters": {
  52792. // "image": {
  52793. // "description": "Image name.",
  52794. // "location": "path",
  52795. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  52796. // "required": true,
  52797. // "type": "string"
  52798. // },
  52799. // "project": {
  52800. // "description": "Project ID for this request.",
  52801. // "location": "path",
  52802. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  52803. // "required": true,
  52804. // "type": "string"
  52805. // },
  52806. // "requestId": {
  52807. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  52808. // "location": "query",
  52809. // "type": "string"
  52810. // }
  52811. // },
  52812. // "path": "{project}/global/images/{image}/deprecate",
  52813. // "request": {
  52814. // "$ref": "DeprecationStatus"
  52815. // },
  52816. // "response": {
  52817. // "$ref": "Operation"
  52818. // },
  52819. // "scopes": [
  52820. // "https://www.googleapis.com/auth/cloud-platform",
  52821. // "https://www.googleapis.com/auth/compute"
  52822. // ]
  52823. // }
  52824. }
  52825. // method id "compute.images.get":
  52826. type ImagesGetCall struct {
  52827. s *Service
  52828. project string
  52829. image string
  52830. urlParams_ gensupport.URLParams
  52831. ifNoneMatch_ string
  52832. ctx_ context.Context
  52833. header_ http.Header
  52834. }
  52835. // Get: Returns the specified image. Gets a list of available images by
  52836. // making a list() request.
  52837. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/get
  52838. func (r *ImagesService) Get(project string, image string) *ImagesGetCall {
  52839. c := &ImagesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  52840. c.project = project
  52841. c.image = image
  52842. return c
  52843. }
  52844. // Fields allows partial responses to be retrieved. See
  52845. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  52846. // for more information.
  52847. func (c *ImagesGetCall) Fields(s ...googleapi.Field) *ImagesGetCall {
  52848. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  52849. return c
  52850. }
  52851. // IfNoneMatch sets the optional parameter which makes the operation
  52852. // fail if the object's ETag matches the given value. This is useful for
  52853. // getting updates only after the object has changed since the last
  52854. // request. Use googleapi.IsNotModified to check whether the response
  52855. // error from Do is the result of In-None-Match.
  52856. func (c *ImagesGetCall) IfNoneMatch(entityTag string) *ImagesGetCall {
  52857. c.ifNoneMatch_ = entityTag
  52858. return c
  52859. }
  52860. // Context sets the context to be used in this call's Do method. Any
  52861. // pending HTTP request will be aborted if the provided context is
  52862. // canceled.
  52863. func (c *ImagesGetCall) Context(ctx context.Context) *ImagesGetCall {
  52864. c.ctx_ = ctx
  52865. return c
  52866. }
  52867. // Header returns an http.Header that can be modified by the caller to
  52868. // add HTTP headers to the request.
  52869. func (c *ImagesGetCall) Header() http.Header {
  52870. if c.header_ == nil {
  52871. c.header_ = make(http.Header)
  52872. }
  52873. return c.header_
  52874. }
  52875. func (c *ImagesGetCall) doRequest(alt string) (*http.Response, error) {
  52876. reqHeaders := make(http.Header)
  52877. for k, v := range c.header_ {
  52878. reqHeaders[k] = v
  52879. }
  52880. reqHeaders.Set("User-Agent", c.s.userAgent())
  52881. if c.ifNoneMatch_ != "" {
  52882. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  52883. }
  52884. var body io.Reader = nil
  52885. c.urlParams_.Set("alt", alt)
  52886. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{image}")
  52887. urls += "?" + c.urlParams_.Encode()
  52888. req, _ := http.NewRequest("GET", urls, body)
  52889. req.Header = reqHeaders
  52890. googleapi.Expand(req.URL, map[string]string{
  52891. "project": c.project,
  52892. "image": c.image,
  52893. })
  52894. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  52895. }
  52896. // Do executes the "compute.images.get" call.
  52897. // Exactly one of *Image or error will be non-nil. Any non-2xx status
  52898. // code is an error. Response headers are in either
  52899. // *Image.ServerResponse.Header or (if a response was returned at all)
  52900. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  52901. // check whether the returned error was because http.StatusNotModified
  52902. // was returned.
  52903. func (c *ImagesGetCall) Do(opts ...googleapi.CallOption) (*Image, error) {
  52904. gensupport.SetOptions(c.urlParams_, opts...)
  52905. res, err := c.doRequest("json")
  52906. if res != nil && res.StatusCode == http.StatusNotModified {
  52907. if res.Body != nil {
  52908. res.Body.Close()
  52909. }
  52910. return nil, &googleapi.Error{
  52911. Code: res.StatusCode,
  52912. Header: res.Header,
  52913. }
  52914. }
  52915. if err != nil {
  52916. return nil, err
  52917. }
  52918. defer googleapi.CloseBody(res)
  52919. if err := googleapi.CheckResponse(res); err != nil {
  52920. return nil, err
  52921. }
  52922. ret := &Image{
  52923. ServerResponse: googleapi.ServerResponse{
  52924. Header: res.Header,
  52925. HTTPStatusCode: res.StatusCode,
  52926. },
  52927. }
  52928. target := &ret
  52929. if err := gensupport.DecodeResponse(target, res); err != nil {
  52930. return nil, err
  52931. }
  52932. return ret, nil
  52933. // {
  52934. // "description": "Returns the specified image. Gets a list of available images by making a list() request.",
  52935. // "httpMethod": "GET",
  52936. // "id": "compute.images.get",
  52937. // "parameterOrder": [
  52938. // "project",
  52939. // "image"
  52940. // ],
  52941. // "parameters": {
  52942. // "image": {
  52943. // "description": "Name of the image resource to return.",
  52944. // "location": "path",
  52945. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  52946. // "required": true,
  52947. // "type": "string"
  52948. // },
  52949. // "project": {
  52950. // "description": "Project ID for this request.",
  52951. // "location": "path",
  52952. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  52953. // "required": true,
  52954. // "type": "string"
  52955. // }
  52956. // },
  52957. // "path": "{project}/global/images/{image}",
  52958. // "response": {
  52959. // "$ref": "Image"
  52960. // },
  52961. // "scopes": [
  52962. // "https://www.googleapis.com/auth/cloud-platform",
  52963. // "https://www.googleapis.com/auth/compute",
  52964. // "https://www.googleapis.com/auth/compute.readonly"
  52965. // ]
  52966. // }
  52967. }
  52968. // method id "compute.images.getFromFamily":
  52969. type ImagesGetFromFamilyCall struct {
  52970. s *Service
  52971. project string
  52972. family string
  52973. urlParams_ gensupport.URLParams
  52974. ifNoneMatch_ string
  52975. ctx_ context.Context
  52976. header_ http.Header
  52977. }
  52978. // GetFromFamily: Returns the latest image that is part of an image
  52979. // family and is not deprecated.
  52980. func (r *ImagesService) GetFromFamily(project string, family string) *ImagesGetFromFamilyCall {
  52981. c := &ImagesGetFromFamilyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  52982. c.project = project
  52983. c.family = family
  52984. return c
  52985. }
  52986. // Fields allows partial responses to be retrieved. See
  52987. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  52988. // for more information.
  52989. func (c *ImagesGetFromFamilyCall) Fields(s ...googleapi.Field) *ImagesGetFromFamilyCall {
  52990. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  52991. return c
  52992. }
  52993. // IfNoneMatch sets the optional parameter which makes the operation
  52994. // fail if the object's ETag matches the given value. This is useful for
  52995. // getting updates only after the object has changed since the last
  52996. // request. Use googleapi.IsNotModified to check whether the response
  52997. // error from Do is the result of In-None-Match.
  52998. func (c *ImagesGetFromFamilyCall) IfNoneMatch(entityTag string) *ImagesGetFromFamilyCall {
  52999. c.ifNoneMatch_ = entityTag
  53000. return c
  53001. }
  53002. // Context sets the context to be used in this call's Do method. Any
  53003. // pending HTTP request will be aborted if the provided context is
  53004. // canceled.
  53005. func (c *ImagesGetFromFamilyCall) Context(ctx context.Context) *ImagesGetFromFamilyCall {
  53006. c.ctx_ = ctx
  53007. return c
  53008. }
  53009. // Header returns an http.Header that can be modified by the caller to
  53010. // add HTTP headers to the request.
  53011. func (c *ImagesGetFromFamilyCall) Header() http.Header {
  53012. if c.header_ == nil {
  53013. c.header_ = make(http.Header)
  53014. }
  53015. return c.header_
  53016. }
  53017. func (c *ImagesGetFromFamilyCall) doRequest(alt string) (*http.Response, error) {
  53018. reqHeaders := make(http.Header)
  53019. for k, v := range c.header_ {
  53020. reqHeaders[k] = v
  53021. }
  53022. reqHeaders.Set("User-Agent", c.s.userAgent())
  53023. if c.ifNoneMatch_ != "" {
  53024. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  53025. }
  53026. var body io.Reader = nil
  53027. c.urlParams_.Set("alt", alt)
  53028. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/family/{family}")
  53029. urls += "?" + c.urlParams_.Encode()
  53030. req, _ := http.NewRequest("GET", urls, body)
  53031. req.Header = reqHeaders
  53032. googleapi.Expand(req.URL, map[string]string{
  53033. "project": c.project,
  53034. "family": c.family,
  53035. })
  53036. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  53037. }
  53038. // Do executes the "compute.images.getFromFamily" call.
  53039. // Exactly one of *Image or error will be non-nil. Any non-2xx status
  53040. // code is an error. Response headers are in either
  53041. // *Image.ServerResponse.Header or (if a response was returned at all)
  53042. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  53043. // check whether the returned error was because http.StatusNotModified
  53044. // was returned.
  53045. func (c *ImagesGetFromFamilyCall) Do(opts ...googleapi.CallOption) (*Image, error) {
  53046. gensupport.SetOptions(c.urlParams_, opts...)
  53047. res, err := c.doRequest("json")
  53048. if res != nil && res.StatusCode == http.StatusNotModified {
  53049. if res.Body != nil {
  53050. res.Body.Close()
  53051. }
  53052. return nil, &googleapi.Error{
  53053. Code: res.StatusCode,
  53054. Header: res.Header,
  53055. }
  53056. }
  53057. if err != nil {
  53058. return nil, err
  53059. }
  53060. defer googleapi.CloseBody(res)
  53061. if err := googleapi.CheckResponse(res); err != nil {
  53062. return nil, err
  53063. }
  53064. ret := &Image{
  53065. ServerResponse: googleapi.ServerResponse{
  53066. Header: res.Header,
  53067. HTTPStatusCode: res.StatusCode,
  53068. },
  53069. }
  53070. target := &ret
  53071. if err := gensupport.DecodeResponse(target, res); err != nil {
  53072. return nil, err
  53073. }
  53074. return ret, nil
  53075. // {
  53076. // "description": "Returns the latest image that is part of an image family and is not deprecated.",
  53077. // "httpMethod": "GET",
  53078. // "id": "compute.images.getFromFamily",
  53079. // "parameterOrder": [
  53080. // "project",
  53081. // "family"
  53082. // ],
  53083. // "parameters": {
  53084. // "family": {
  53085. // "description": "Name of the image family to search for.",
  53086. // "location": "path",
  53087. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  53088. // "required": true,
  53089. // "type": "string"
  53090. // },
  53091. // "project": {
  53092. // "description": "Project ID for this request.",
  53093. // "location": "path",
  53094. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  53095. // "required": true,
  53096. // "type": "string"
  53097. // }
  53098. // },
  53099. // "path": "{project}/global/images/family/{family}",
  53100. // "response": {
  53101. // "$ref": "Image"
  53102. // },
  53103. // "scopes": [
  53104. // "https://www.googleapis.com/auth/cloud-platform",
  53105. // "https://www.googleapis.com/auth/compute",
  53106. // "https://www.googleapis.com/auth/compute.readonly"
  53107. // ]
  53108. // }
  53109. }
  53110. // method id "compute.images.getIamPolicy":
  53111. type ImagesGetIamPolicyCall struct {
  53112. s *Service
  53113. project string
  53114. resource string
  53115. urlParams_ gensupport.URLParams
  53116. ifNoneMatch_ string
  53117. ctx_ context.Context
  53118. header_ http.Header
  53119. }
  53120. // GetIamPolicy: Gets the access control policy for a resource. May be
  53121. // empty if no such policy or resource exists.
  53122. func (r *ImagesService) GetIamPolicy(project string, resource string) *ImagesGetIamPolicyCall {
  53123. c := &ImagesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  53124. c.project = project
  53125. c.resource = resource
  53126. return c
  53127. }
  53128. // Fields allows partial responses to be retrieved. See
  53129. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53130. // for more information.
  53131. func (c *ImagesGetIamPolicyCall) Fields(s ...googleapi.Field) *ImagesGetIamPolicyCall {
  53132. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  53133. return c
  53134. }
  53135. // IfNoneMatch sets the optional parameter which makes the operation
  53136. // fail if the object's ETag matches the given value. This is useful for
  53137. // getting updates only after the object has changed since the last
  53138. // request. Use googleapi.IsNotModified to check whether the response
  53139. // error from Do is the result of In-None-Match.
  53140. func (c *ImagesGetIamPolicyCall) IfNoneMatch(entityTag string) *ImagesGetIamPolicyCall {
  53141. c.ifNoneMatch_ = entityTag
  53142. return c
  53143. }
  53144. // Context sets the context to be used in this call's Do method. Any
  53145. // pending HTTP request will be aborted if the provided context is
  53146. // canceled.
  53147. func (c *ImagesGetIamPolicyCall) Context(ctx context.Context) *ImagesGetIamPolicyCall {
  53148. c.ctx_ = ctx
  53149. return c
  53150. }
  53151. // Header returns an http.Header that can be modified by the caller to
  53152. // add HTTP headers to the request.
  53153. func (c *ImagesGetIamPolicyCall) Header() http.Header {
  53154. if c.header_ == nil {
  53155. c.header_ = make(http.Header)
  53156. }
  53157. return c.header_
  53158. }
  53159. func (c *ImagesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  53160. reqHeaders := make(http.Header)
  53161. for k, v := range c.header_ {
  53162. reqHeaders[k] = v
  53163. }
  53164. reqHeaders.Set("User-Agent", c.s.userAgent())
  53165. if c.ifNoneMatch_ != "" {
  53166. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  53167. }
  53168. var body io.Reader = nil
  53169. c.urlParams_.Set("alt", alt)
  53170. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{resource}/getIamPolicy")
  53171. urls += "?" + c.urlParams_.Encode()
  53172. req, _ := http.NewRequest("GET", urls, body)
  53173. req.Header = reqHeaders
  53174. googleapi.Expand(req.URL, map[string]string{
  53175. "project": c.project,
  53176. "resource": c.resource,
  53177. })
  53178. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  53179. }
  53180. // Do executes the "compute.images.getIamPolicy" call.
  53181. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  53182. // code is an error. Response headers are in either
  53183. // *Policy.ServerResponse.Header or (if a response was returned at all)
  53184. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  53185. // check whether the returned error was because http.StatusNotModified
  53186. // was returned.
  53187. func (c *ImagesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  53188. gensupport.SetOptions(c.urlParams_, opts...)
  53189. res, err := c.doRequest("json")
  53190. if res != nil && res.StatusCode == http.StatusNotModified {
  53191. if res.Body != nil {
  53192. res.Body.Close()
  53193. }
  53194. return nil, &googleapi.Error{
  53195. Code: res.StatusCode,
  53196. Header: res.Header,
  53197. }
  53198. }
  53199. if err != nil {
  53200. return nil, err
  53201. }
  53202. defer googleapi.CloseBody(res)
  53203. if err := googleapi.CheckResponse(res); err != nil {
  53204. return nil, err
  53205. }
  53206. ret := &Policy{
  53207. ServerResponse: googleapi.ServerResponse{
  53208. Header: res.Header,
  53209. HTTPStatusCode: res.StatusCode,
  53210. },
  53211. }
  53212. target := &ret
  53213. if err := gensupport.DecodeResponse(target, res); err != nil {
  53214. return nil, err
  53215. }
  53216. return ret, nil
  53217. // {
  53218. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  53219. // "httpMethod": "GET",
  53220. // "id": "compute.images.getIamPolicy",
  53221. // "parameterOrder": [
  53222. // "project",
  53223. // "resource"
  53224. // ],
  53225. // "parameters": {
  53226. // "project": {
  53227. // "description": "Project ID for this request.",
  53228. // "location": "path",
  53229. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  53230. // "required": true,
  53231. // "type": "string"
  53232. // },
  53233. // "resource": {
  53234. // "description": "Name of the resource for this request.",
  53235. // "location": "path",
  53236. // "pattern": "[a-z0-9](?:[-a-z0-9_]{0,61}[a-z0-9])?",
  53237. // "required": true,
  53238. // "type": "string"
  53239. // }
  53240. // },
  53241. // "path": "{project}/global/images/{resource}/getIamPolicy",
  53242. // "response": {
  53243. // "$ref": "Policy"
  53244. // },
  53245. // "scopes": [
  53246. // "https://www.googleapis.com/auth/cloud-platform",
  53247. // "https://www.googleapis.com/auth/compute",
  53248. // "https://www.googleapis.com/auth/compute.readonly"
  53249. // ]
  53250. // }
  53251. }
  53252. // method id "compute.images.insert":
  53253. type ImagesInsertCall struct {
  53254. s *Service
  53255. project string
  53256. image *Image
  53257. urlParams_ gensupport.URLParams
  53258. ctx_ context.Context
  53259. header_ http.Header
  53260. }
  53261. // Insert: Creates an image in the specified project using the data
  53262. // included in the request.
  53263. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/insert
  53264. func (r *ImagesService) Insert(project string, image *Image) *ImagesInsertCall {
  53265. c := &ImagesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  53266. c.project = project
  53267. c.image = image
  53268. return c
  53269. }
  53270. // ForceCreate sets the optional parameter "forceCreate": Force image
  53271. // creation if true.
  53272. func (c *ImagesInsertCall) ForceCreate(forceCreate bool) *ImagesInsertCall {
  53273. c.urlParams_.Set("forceCreate", fmt.Sprint(forceCreate))
  53274. return c
  53275. }
  53276. // RequestId sets the optional parameter "requestId": An optional
  53277. // request ID to identify requests. Specify a unique request ID so that
  53278. // if you must retry your request, the server will know to ignore the
  53279. // request if it has already been completed.
  53280. //
  53281. // For example, consider a situation where you make an initial request
  53282. // and the request times out. If you make the request again with the
  53283. // same request ID, the server can check if original operation with the
  53284. // same request ID was received, and if so, will ignore the second
  53285. // request. This prevents clients from accidentally creating duplicate
  53286. // commitments.
  53287. //
  53288. // The request ID must be a valid UUID with the exception that zero UUID
  53289. // is not supported (00000000-0000-0000-0000-000000000000).
  53290. func (c *ImagesInsertCall) RequestId(requestId string) *ImagesInsertCall {
  53291. c.urlParams_.Set("requestId", requestId)
  53292. return c
  53293. }
  53294. // Fields allows partial responses to be retrieved. See
  53295. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53296. // for more information.
  53297. func (c *ImagesInsertCall) Fields(s ...googleapi.Field) *ImagesInsertCall {
  53298. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  53299. return c
  53300. }
  53301. // Context sets the context to be used in this call's Do method. Any
  53302. // pending HTTP request will be aborted if the provided context is
  53303. // canceled.
  53304. func (c *ImagesInsertCall) Context(ctx context.Context) *ImagesInsertCall {
  53305. c.ctx_ = ctx
  53306. return c
  53307. }
  53308. // Header returns an http.Header that can be modified by the caller to
  53309. // add HTTP headers to the request.
  53310. func (c *ImagesInsertCall) Header() http.Header {
  53311. if c.header_ == nil {
  53312. c.header_ = make(http.Header)
  53313. }
  53314. return c.header_
  53315. }
  53316. func (c *ImagesInsertCall) doRequest(alt string) (*http.Response, error) {
  53317. reqHeaders := make(http.Header)
  53318. for k, v := range c.header_ {
  53319. reqHeaders[k] = v
  53320. }
  53321. reqHeaders.Set("User-Agent", c.s.userAgent())
  53322. var body io.Reader = nil
  53323. body, err := googleapi.WithoutDataWrapper.JSONReader(c.image)
  53324. if err != nil {
  53325. return nil, err
  53326. }
  53327. reqHeaders.Set("Content-Type", "application/json")
  53328. c.urlParams_.Set("alt", alt)
  53329. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images")
  53330. urls += "?" + c.urlParams_.Encode()
  53331. req, _ := http.NewRequest("POST", urls, body)
  53332. req.Header = reqHeaders
  53333. googleapi.Expand(req.URL, map[string]string{
  53334. "project": c.project,
  53335. })
  53336. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  53337. }
  53338. // Do executes the "compute.images.insert" call.
  53339. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  53340. // status code is an error. Response headers are in either
  53341. // *Operation.ServerResponse.Header or (if a response was returned at
  53342. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  53343. // to check whether the returned error was because
  53344. // http.StatusNotModified was returned.
  53345. func (c *ImagesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  53346. gensupport.SetOptions(c.urlParams_, opts...)
  53347. res, err := c.doRequest("json")
  53348. if res != nil && res.StatusCode == http.StatusNotModified {
  53349. if res.Body != nil {
  53350. res.Body.Close()
  53351. }
  53352. return nil, &googleapi.Error{
  53353. Code: res.StatusCode,
  53354. Header: res.Header,
  53355. }
  53356. }
  53357. if err != nil {
  53358. return nil, err
  53359. }
  53360. defer googleapi.CloseBody(res)
  53361. if err := googleapi.CheckResponse(res); err != nil {
  53362. return nil, err
  53363. }
  53364. ret := &Operation{
  53365. ServerResponse: googleapi.ServerResponse{
  53366. Header: res.Header,
  53367. HTTPStatusCode: res.StatusCode,
  53368. },
  53369. }
  53370. target := &ret
  53371. if err := gensupport.DecodeResponse(target, res); err != nil {
  53372. return nil, err
  53373. }
  53374. return ret, nil
  53375. // {
  53376. // "description": "Creates an image in the specified project using the data included in the request.",
  53377. // "httpMethod": "POST",
  53378. // "id": "compute.images.insert",
  53379. // "parameterOrder": [
  53380. // "project"
  53381. // ],
  53382. // "parameters": {
  53383. // "forceCreate": {
  53384. // "description": "Force image creation if true.",
  53385. // "location": "query",
  53386. // "type": "boolean"
  53387. // },
  53388. // "project": {
  53389. // "description": "Project ID for this request.",
  53390. // "location": "path",
  53391. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  53392. // "required": true,
  53393. // "type": "string"
  53394. // },
  53395. // "requestId": {
  53396. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  53397. // "location": "query",
  53398. // "type": "string"
  53399. // }
  53400. // },
  53401. // "path": "{project}/global/images",
  53402. // "request": {
  53403. // "$ref": "Image"
  53404. // },
  53405. // "response": {
  53406. // "$ref": "Operation"
  53407. // },
  53408. // "scopes": [
  53409. // "https://www.googleapis.com/auth/cloud-platform",
  53410. // "https://www.googleapis.com/auth/compute",
  53411. // "https://www.googleapis.com/auth/devstorage.full_control",
  53412. // "https://www.googleapis.com/auth/devstorage.read_only",
  53413. // "https://www.googleapis.com/auth/devstorage.read_write"
  53414. // ]
  53415. // }
  53416. }
  53417. // method id "compute.images.list":
  53418. type ImagesListCall struct {
  53419. s *Service
  53420. project string
  53421. urlParams_ gensupport.URLParams
  53422. ifNoneMatch_ string
  53423. ctx_ context.Context
  53424. header_ http.Header
  53425. }
  53426. // List: Retrieves the list of custom images available to the specified
  53427. // project. Custom images are images you create that belong to your
  53428. // project. This method does not get any images that belong to other
  53429. // projects, including publicly-available images, like Debian 8. If you
  53430. // want to get a list of publicly-available images, use this method to
  53431. // make a request to the respective image project, such as debian-cloud
  53432. // or windows-cloud.
  53433. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/list
  53434. func (r *ImagesService) List(project string) *ImagesListCall {
  53435. c := &ImagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  53436. c.project = project
  53437. return c
  53438. }
  53439. // Filter sets the optional parameter "filter": A filter expression that
  53440. // filters resources listed in the response. The expression must specify
  53441. // the field name, a comparison operator, and the value that you want to
  53442. // use for filtering. The value must be a string, a number, or a
  53443. // boolean. The comparison operator must be either =, !=, >, or <.
  53444. //
  53445. // For example, if you are filtering Compute Engine instances, you can
  53446. // exclude instances named example-instance by specifying name !=
  53447. // example-instance.
  53448. //
  53449. // You can also filter nested fields. For example, you could specify
  53450. // scheduling.automaticRestart = false to include instances only if they
  53451. // are not scheduled for automatic restarts. You can use filtering on
  53452. // nested fields to filter based on resource labels.
  53453. //
  53454. // To filter on multiple expressions, provide each separate expression
  53455. // within parentheses. For example, (scheduling.automaticRestart = true)
  53456. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  53457. // AND expression. However, you can include AND and OR expressions
  53458. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  53459. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  53460. // true).
  53461. func (c *ImagesListCall) Filter(filter string) *ImagesListCall {
  53462. c.urlParams_.Set("filter", filter)
  53463. return c
  53464. }
  53465. // MaxResults sets the optional parameter "maxResults": The maximum
  53466. // number of results per page that should be returned. If the number of
  53467. // available results is larger than maxResults, Compute Engine returns a
  53468. // nextPageToken that can be used to get the next page of results in
  53469. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  53470. // (Default: 500)
  53471. func (c *ImagesListCall) MaxResults(maxResults int64) *ImagesListCall {
  53472. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  53473. return c
  53474. }
  53475. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  53476. // a certain order. By default, results are returned in alphanumerical
  53477. // order based on the resource name.
  53478. //
  53479. // You can also sort results in descending order based on the creation
  53480. // timestamp using orderBy="creationTimestamp desc". This sorts results
  53481. // based on the creationTimestamp field in reverse chronological order
  53482. // (newest result first). Use this to sort resources like operations so
  53483. // that the newest operation is returned first.
  53484. //
  53485. // Currently, only sorting by name or creationTimestamp desc is
  53486. // supported.
  53487. func (c *ImagesListCall) OrderBy(orderBy string) *ImagesListCall {
  53488. c.urlParams_.Set("orderBy", orderBy)
  53489. return c
  53490. }
  53491. // PageToken sets the optional parameter "pageToken": Specifies a page
  53492. // token to use. Set pageToken to the nextPageToken returned by a
  53493. // previous list request to get the next page of results.
  53494. func (c *ImagesListCall) PageToken(pageToken string) *ImagesListCall {
  53495. c.urlParams_.Set("pageToken", pageToken)
  53496. return c
  53497. }
  53498. // Fields allows partial responses to be retrieved. See
  53499. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53500. // for more information.
  53501. func (c *ImagesListCall) Fields(s ...googleapi.Field) *ImagesListCall {
  53502. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  53503. return c
  53504. }
  53505. // IfNoneMatch sets the optional parameter which makes the operation
  53506. // fail if the object's ETag matches the given value. This is useful for
  53507. // getting updates only after the object has changed since the last
  53508. // request. Use googleapi.IsNotModified to check whether the response
  53509. // error from Do is the result of In-None-Match.
  53510. func (c *ImagesListCall) IfNoneMatch(entityTag string) *ImagesListCall {
  53511. c.ifNoneMatch_ = entityTag
  53512. return c
  53513. }
  53514. // Context sets the context to be used in this call's Do method. Any
  53515. // pending HTTP request will be aborted if the provided context is
  53516. // canceled.
  53517. func (c *ImagesListCall) Context(ctx context.Context) *ImagesListCall {
  53518. c.ctx_ = ctx
  53519. return c
  53520. }
  53521. // Header returns an http.Header that can be modified by the caller to
  53522. // add HTTP headers to the request.
  53523. func (c *ImagesListCall) Header() http.Header {
  53524. if c.header_ == nil {
  53525. c.header_ = make(http.Header)
  53526. }
  53527. return c.header_
  53528. }
  53529. func (c *ImagesListCall) doRequest(alt string) (*http.Response, error) {
  53530. reqHeaders := make(http.Header)
  53531. for k, v := range c.header_ {
  53532. reqHeaders[k] = v
  53533. }
  53534. reqHeaders.Set("User-Agent", c.s.userAgent())
  53535. if c.ifNoneMatch_ != "" {
  53536. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  53537. }
  53538. var body io.Reader = nil
  53539. c.urlParams_.Set("alt", alt)
  53540. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images")
  53541. urls += "?" + c.urlParams_.Encode()
  53542. req, _ := http.NewRequest("GET", urls, body)
  53543. req.Header = reqHeaders
  53544. googleapi.Expand(req.URL, map[string]string{
  53545. "project": c.project,
  53546. })
  53547. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  53548. }
  53549. // Do executes the "compute.images.list" call.
  53550. // Exactly one of *ImageList or error will be non-nil. Any non-2xx
  53551. // status code is an error. Response headers are in either
  53552. // *ImageList.ServerResponse.Header or (if a response was returned at
  53553. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  53554. // to check whether the returned error was because
  53555. // http.StatusNotModified was returned.
  53556. func (c *ImagesListCall) Do(opts ...googleapi.CallOption) (*ImageList, error) {
  53557. gensupport.SetOptions(c.urlParams_, opts...)
  53558. res, err := c.doRequest("json")
  53559. if res != nil && res.StatusCode == http.StatusNotModified {
  53560. if res.Body != nil {
  53561. res.Body.Close()
  53562. }
  53563. return nil, &googleapi.Error{
  53564. Code: res.StatusCode,
  53565. Header: res.Header,
  53566. }
  53567. }
  53568. if err != nil {
  53569. return nil, err
  53570. }
  53571. defer googleapi.CloseBody(res)
  53572. if err := googleapi.CheckResponse(res); err != nil {
  53573. return nil, err
  53574. }
  53575. ret := &ImageList{
  53576. ServerResponse: googleapi.ServerResponse{
  53577. Header: res.Header,
  53578. HTTPStatusCode: res.StatusCode,
  53579. },
  53580. }
  53581. target := &ret
  53582. if err := gensupport.DecodeResponse(target, res); err != nil {
  53583. return nil, err
  53584. }
  53585. return ret, nil
  53586. // {
  53587. // "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.",
  53588. // "httpMethod": "GET",
  53589. // "id": "compute.images.list",
  53590. // "parameterOrder": [
  53591. // "project"
  53592. // ],
  53593. // "parameters": {
  53594. // "filter": {
  53595. // "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).",
  53596. // "location": "query",
  53597. // "type": "string"
  53598. // },
  53599. // "maxResults": {
  53600. // "default": "500",
  53601. // "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)",
  53602. // "format": "uint32",
  53603. // "location": "query",
  53604. // "minimum": "0",
  53605. // "type": "integer"
  53606. // },
  53607. // "orderBy": {
  53608. // "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.",
  53609. // "location": "query",
  53610. // "type": "string"
  53611. // },
  53612. // "pageToken": {
  53613. // "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.",
  53614. // "location": "query",
  53615. // "type": "string"
  53616. // },
  53617. // "project": {
  53618. // "description": "Project ID for this request.",
  53619. // "location": "path",
  53620. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  53621. // "required": true,
  53622. // "type": "string"
  53623. // }
  53624. // },
  53625. // "path": "{project}/global/images",
  53626. // "response": {
  53627. // "$ref": "ImageList"
  53628. // },
  53629. // "scopes": [
  53630. // "https://www.googleapis.com/auth/cloud-platform",
  53631. // "https://www.googleapis.com/auth/compute",
  53632. // "https://www.googleapis.com/auth/compute.readonly"
  53633. // ]
  53634. // }
  53635. }
  53636. // Pages invokes f for each page of results.
  53637. // A non-nil error returned from f will halt the iteration.
  53638. // The provided context supersedes any context provided to the Context method.
  53639. func (c *ImagesListCall) Pages(ctx context.Context, f func(*ImageList) error) error {
  53640. c.ctx_ = ctx
  53641. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  53642. for {
  53643. x, err := c.Do()
  53644. if err != nil {
  53645. return err
  53646. }
  53647. if err := f(x); err != nil {
  53648. return err
  53649. }
  53650. if x.NextPageToken == "" {
  53651. return nil
  53652. }
  53653. c.PageToken(x.NextPageToken)
  53654. }
  53655. }
  53656. // method id "compute.images.setIamPolicy":
  53657. type ImagesSetIamPolicyCall struct {
  53658. s *Service
  53659. project string
  53660. resource string
  53661. globalsetpolicyrequest *GlobalSetPolicyRequest
  53662. urlParams_ gensupport.URLParams
  53663. ctx_ context.Context
  53664. header_ http.Header
  53665. }
  53666. // SetIamPolicy: Sets the access control policy on the specified
  53667. // resource. Replaces any existing policy.
  53668. func (r *ImagesService) SetIamPolicy(project string, resource string, globalsetpolicyrequest *GlobalSetPolicyRequest) *ImagesSetIamPolicyCall {
  53669. c := &ImagesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  53670. c.project = project
  53671. c.resource = resource
  53672. c.globalsetpolicyrequest = globalsetpolicyrequest
  53673. return c
  53674. }
  53675. // Fields allows partial responses to be retrieved. See
  53676. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53677. // for more information.
  53678. func (c *ImagesSetIamPolicyCall) Fields(s ...googleapi.Field) *ImagesSetIamPolicyCall {
  53679. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  53680. return c
  53681. }
  53682. // Context sets the context to be used in this call's Do method. Any
  53683. // pending HTTP request will be aborted if the provided context is
  53684. // canceled.
  53685. func (c *ImagesSetIamPolicyCall) Context(ctx context.Context) *ImagesSetIamPolicyCall {
  53686. c.ctx_ = ctx
  53687. return c
  53688. }
  53689. // Header returns an http.Header that can be modified by the caller to
  53690. // add HTTP headers to the request.
  53691. func (c *ImagesSetIamPolicyCall) Header() http.Header {
  53692. if c.header_ == nil {
  53693. c.header_ = make(http.Header)
  53694. }
  53695. return c.header_
  53696. }
  53697. func (c *ImagesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  53698. reqHeaders := make(http.Header)
  53699. for k, v := range c.header_ {
  53700. reqHeaders[k] = v
  53701. }
  53702. reqHeaders.Set("User-Agent", c.s.userAgent())
  53703. var body io.Reader = nil
  53704. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest)
  53705. if err != nil {
  53706. return nil, err
  53707. }
  53708. reqHeaders.Set("Content-Type", "application/json")
  53709. c.urlParams_.Set("alt", alt)
  53710. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{resource}/setIamPolicy")
  53711. urls += "?" + c.urlParams_.Encode()
  53712. req, _ := http.NewRequest("POST", urls, body)
  53713. req.Header = reqHeaders
  53714. googleapi.Expand(req.URL, map[string]string{
  53715. "project": c.project,
  53716. "resource": c.resource,
  53717. })
  53718. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  53719. }
  53720. // Do executes the "compute.images.setIamPolicy" call.
  53721. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  53722. // code is an error. Response headers are in either
  53723. // *Policy.ServerResponse.Header or (if a response was returned at all)
  53724. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  53725. // check whether the returned error was because http.StatusNotModified
  53726. // was returned.
  53727. func (c *ImagesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  53728. gensupport.SetOptions(c.urlParams_, opts...)
  53729. res, err := c.doRequest("json")
  53730. if res != nil && res.StatusCode == http.StatusNotModified {
  53731. if res.Body != nil {
  53732. res.Body.Close()
  53733. }
  53734. return nil, &googleapi.Error{
  53735. Code: res.StatusCode,
  53736. Header: res.Header,
  53737. }
  53738. }
  53739. if err != nil {
  53740. return nil, err
  53741. }
  53742. defer googleapi.CloseBody(res)
  53743. if err := googleapi.CheckResponse(res); err != nil {
  53744. return nil, err
  53745. }
  53746. ret := &Policy{
  53747. ServerResponse: googleapi.ServerResponse{
  53748. Header: res.Header,
  53749. HTTPStatusCode: res.StatusCode,
  53750. },
  53751. }
  53752. target := &ret
  53753. if err := gensupport.DecodeResponse(target, res); err != nil {
  53754. return nil, err
  53755. }
  53756. return ret, nil
  53757. // {
  53758. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  53759. // "httpMethod": "POST",
  53760. // "id": "compute.images.setIamPolicy",
  53761. // "parameterOrder": [
  53762. // "project",
  53763. // "resource"
  53764. // ],
  53765. // "parameters": {
  53766. // "project": {
  53767. // "description": "Project ID for this request.",
  53768. // "location": "path",
  53769. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  53770. // "required": true,
  53771. // "type": "string"
  53772. // },
  53773. // "resource": {
  53774. // "description": "Name of the resource for this request.",
  53775. // "location": "path",
  53776. // "pattern": "[a-z0-9](?:[-a-z0-9_]{0,61}[a-z0-9])?",
  53777. // "required": true,
  53778. // "type": "string"
  53779. // }
  53780. // },
  53781. // "path": "{project}/global/images/{resource}/setIamPolicy",
  53782. // "request": {
  53783. // "$ref": "GlobalSetPolicyRequest"
  53784. // },
  53785. // "response": {
  53786. // "$ref": "Policy"
  53787. // },
  53788. // "scopes": [
  53789. // "https://www.googleapis.com/auth/cloud-platform",
  53790. // "https://www.googleapis.com/auth/compute"
  53791. // ]
  53792. // }
  53793. }
  53794. // method id "compute.images.setLabels":
  53795. type ImagesSetLabelsCall struct {
  53796. s *Service
  53797. project string
  53798. resource string
  53799. globalsetlabelsrequest *GlobalSetLabelsRequest
  53800. urlParams_ gensupport.URLParams
  53801. ctx_ context.Context
  53802. header_ http.Header
  53803. }
  53804. // SetLabels: Sets the labels on an image. To learn more about labels,
  53805. // read the Labeling Resources documentation.
  53806. func (r *ImagesService) SetLabels(project string, resource string, globalsetlabelsrequest *GlobalSetLabelsRequest) *ImagesSetLabelsCall {
  53807. c := &ImagesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  53808. c.project = project
  53809. c.resource = resource
  53810. c.globalsetlabelsrequest = globalsetlabelsrequest
  53811. return c
  53812. }
  53813. // Fields allows partial responses to be retrieved. See
  53814. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53815. // for more information.
  53816. func (c *ImagesSetLabelsCall) Fields(s ...googleapi.Field) *ImagesSetLabelsCall {
  53817. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  53818. return c
  53819. }
  53820. // Context sets the context to be used in this call's Do method. Any
  53821. // pending HTTP request will be aborted if the provided context is
  53822. // canceled.
  53823. func (c *ImagesSetLabelsCall) Context(ctx context.Context) *ImagesSetLabelsCall {
  53824. c.ctx_ = ctx
  53825. return c
  53826. }
  53827. // Header returns an http.Header that can be modified by the caller to
  53828. // add HTTP headers to the request.
  53829. func (c *ImagesSetLabelsCall) Header() http.Header {
  53830. if c.header_ == nil {
  53831. c.header_ = make(http.Header)
  53832. }
  53833. return c.header_
  53834. }
  53835. func (c *ImagesSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  53836. reqHeaders := make(http.Header)
  53837. for k, v := range c.header_ {
  53838. reqHeaders[k] = v
  53839. }
  53840. reqHeaders.Set("User-Agent", c.s.userAgent())
  53841. var body io.Reader = nil
  53842. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest)
  53843. if err != nil {
  53844. return nil, err
  53845. }
  53846. reqHeaders.Set("Content-Type", "application/json")
  53847. c.urlParams_.Set("alt", alt)
  53848. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{resource}/setLabels")
  53849. urls += "?" + c.urlParams_.Encode()
  53850. req, _ := http.NewRequest("POST", urls, body)
  53851. req.Header = reqHeaders
  53852. googleapi.Expand(req.URL, map[string]string{
  53853. "project": c.project,
  53854. "resource": c.resource,
  53855. })
  53856. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  53857. }
  53858. // Do executes the "compute.images.setLabels" call.
  53859. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  53860. // status code is an error. Response headers are in either
  53861. // *Operation.ServerResponse.Header or (if a response was returned at
  53862. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  53863. // to check whether the returned error was because
  53864. // http.StatusNotModified was returned.
  53865. func (c *ImagesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  53866. gensupport.SetOptions(c.urlParams_, opts...)
  53867. res, err := c.doRequest("json")
  53868. if res != nil && res.StatusCode == http.StatusNotModified {
  53869. if res.Body != nil {
  53870. res.Body.Close()
  53871. }
  53872. return nil, &googleapi.Error{
  53873. Code: res.StatusCode,
  53874. Header: res.Header,
  53875. }
  53876. }
  53877. if err != nil {
  53878. return nil, err
  53879. }
  53880. defer googleapi.CloseBody(res)
  53881. if err := googleapi.CheckResponse(res); err != nil {
  53882. return nil, err
  53883. }
  53884. ret := &Operation{
  53885. ServerResponse: googleapi.ServerResponse{
  53886. Header: res.Header,
  53887. HTTPStatusCode: res.StatusCode,
  53888. },
  53889. }
  53890. target := &ret
  53891. if err := gensupport.DecodeResponse(target, res); err != nil {
  53892. return nil, err
  53893. }
  53894. return ret, nil
  53895. // {
  53896. // "description": "Sets the labels on an image. To learn more about labels, read the Labeling Resources documentation.",
  53897. // "httpMethod": "POST",
  53898. // "id": "compute.images.setLabels",
  53899. // "parameterOrder": [
  53900. // "project",
  53901. // "resource"
  53902. // ],
  53903. // "parameters": {
  53904. // "project": {
  53905. // "description": "Project ID for this request.",
  53906. // "location": "path",
  53907. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  53908. // "required": true,
  53909. // "type": "string"
  53910. // },
  53911. // "resource": {
  53912. // "description": "Name of the resource for this request.",
  53913. // "location": "path",
  53914. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?",
  53915. // "required": true,
  53916. // "type": "string"
  53917. // }
  53918. // },
  53919. // "path": "{project}/global/images/{resource}/setLabels",
  53920. // "request": {
  53921. // "$ref": "GlobalSetLabelsRequest"
  53922. // },
  53923. // "response": {
  53924. // "$ref": "Operation"
  53925. // },
  53926. // "scopes": [
  53927. // "https://www.googleapis.com/auth/cloud-platform",
  53928. // "https://www.googleapis.com/auth/compute"
  53929. // ]
  53930. // }
  53931. }
  53932. // method id "compute.images.testIamPermissions":
  53933. type ImagesTestIamPermissionsCall struct {
  53934. s *Service
  53935. project string
  53936. resource string
  53937. testpermissionsrequest *TestPermissionsRequest
  53938. urlParams_ gensupport.URLParams
  53939. ctx_ context.Context
  53940. header_ http.Header
  53941. }
  53942. // TestIamPermissions: Returns permissions that a caller has on the
  53943. // specified resource.
  53944. func (r *ImagesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *ImagesTestIamPermissionsCall {
  53945. c := &ImagesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  53946. c.project = project
  53947. c.resource = resource
  53948. c.testpermissionsrequest = testpermissionsrequest
  53949. return c
  53950. }
  53951. // Fields allows partial responses to be retrieved. See
  53952. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53953. // for more information.
  53954. func (c *ImagesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ImagesTestIamPermissionsCall {
  53955. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  53956. return c
  53957. }
  53958. // Context sets the context to be used in this call's Do method. Any
  53959. // pending HTTP request will be aborted if the provided context is
  53960. // canceled.
  53961. func (c *ImagesTestIamPermissionsCall) Context(ctx context.Context) *ImagesTestIamPermissionsCall {
  53962. c.ctx_ = ctx
  53963. return c
  53964. }
  53965. // Header returns an http.Header that can be modified by the caller to
  53966. // add HTTP headers to the request.
  53967. func (c *ImagesTestIamPermissionsCall) Header() http.Header {
  53968. if c.header_ == nil {
  53969. c.header_ = make(http.Header)
  53970. }
  53971. return c.header_
  53972. }
  53973. func (c *ImagesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  53974. reqHeaders := make(http.Header)
  53975. for k, v := range c.header_ {
  53976. reqHeaders[k] = v
  53977. }
  53978. reqHeaders.Set("User-Agent", c.s.userAgent())
  53979. var body io.Reader = nil
  53980. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  53981. if err != nil {
  53982. return nil, err
  53983. }
  53984. reqHeaders.Set("Content-Type", "application/json")
  53985. c.urlParams_.Set("alt", alt)
  53986. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{resource}/testIamPermissions")
  53987. urls += "?" + c.urlParams_.Encode()
  53988. req, _ := http.NewRequest("POST", urls, body)
  53989. req.Header = reqHeaders
  53990. googleapi.Expand(req.URL, map[string]string{
  53991. "project": c.project,
  53992. "resource": c.resource,
  53993. })
  53994. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  53995. }
  53996. // Do executes the "compute.images.testIamPermissions" call.
  53997. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  53998. // non-2xx status code is an error. Response headers are in either
  53999. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  54000. // returned at all) in error.(*googleapi.Error).Header. Use
  54001. // googleapi.IsNotModified to check whether the returned error was
  54002. // because http.StatusNotModified was returned.
  54003. func (c *ImagesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  54004. gensupport.SetOptions(c.urlParams_, opts...)
  54005. res, err := c.doRequest("json")
  54006. if res != nil && res.StatusCode == http.StatusNotModified {
  54007. if res.Body != nil {
  54008. res.Body.Close()
  54009. }
  54010. return nil, &googleapi.Error{
  54011. Code: res.StatusCode,
  54012. Header: res.Header,
  54013. }
  54014. }
  54015. if err != nil {
  54016. return nil, err
  54017. }
  54018. defer googleapi.CloseBody(res)
  54019. if err := googleapi.CheckResponse(res); err != nil {
  54020. return nil, err
  54021. }
  54022. ret := &TestPermissionsResponse{
  54023. ServerResponse: googleapi.ServerResponse{
  54024. Header: res.Header,
  54025. HTTPStatusCode: res.StatusCode,
  54026. },
  54027. }
  54028. target := &ret
  54029. if err := gensupport.DecodeResponse(target, res); err != nil {
  54030. return nil, err
  54031. }
  54032. return ret, nil
  54033. // {
  54034. // "description": "Returns permissions that a caller has on the specified resource.",
  54035. // "httpMethod": "POST",
  54036. // "id": "compute.images.testIamPermissions",
  54037. // "parameterOrder": [
  54038. // "project",
  54039. // "resource"
  54040. // ],
  54041. // "parameters": {
  54042. // "project": {
  54043. // "description": "Project ID for this request.",
  54044. // "location": "path",
  54045. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  54046. // "required": true,
  54047. // "type": "string"
  54048. // },
  54049. // "resource": {
  54050. // "description": "Name of the resource for this request.",
  54051. // "location": "path",
  54052. // "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?",
  54053. // "required": true,
  54054. // "type": "string"
  54055. // }
  54056. // },
  54057. // "path": "{project}/global/images/{resource}/testIamPermissions",
  54058. // "request": {
  54059. // "$ref": "TestPermissionsRequest"
  54060. // },
  54061. // "response": {
  54062. // "$ref": "TestPermissionsResponse"
  54063. // },
  54064. // "scopes": [
  54065. // "https://www.googleapis.com/auth/cloud-platform",
  54066. // "https://www.googleapis.com/auth/compute",
  54067. // "https://www.googleapis.com/auth/compute.readonly"
  54068. // ]
  54069. // }
  54070. }
  54071. // method id "compute.instanceGroupManagers.abandonInstances":
  54072. type InstanceGroupManagersAbandonInstancesCall struct {
  54073. s *Service
  54074. project string
  54075. zone string
  54076. instanceGroupManager string
  54077. instancegroupmanagersabandoninstancesrequest *InstanceGroupManagersAbandonInstancesRequest
  54078. urlParams_ gensupport.URLParams
  54079. ctx_ context.Context
  54080. header_ http.Header
  54081. }
  54082. // AbandonInstances: Schedules a group action to remove the specified
  54083. // instances from the managed instance group. Abandoning an instance
  54084. // does not delete the instance, but it does remove the instance from
  54085. // any target pools that are applied by the managed instance group. This
  54086. // method reduces the targetSize of the managed instance group by the
  54087. // number of instances that you abandon. This operation is marked as
  54088. // DONE when the action is scheduled even if the instances have not yet
  54089. // been removed from the group. You must separately verify the status of
  54090. // the abandoning action with the listmanagedinstances method.
  54091. //
  54092. // If the group is part of a backend service that has enabled connection
  54093. // draining, it can take up to 60 seconds after the connection draining
  54094. // duration has elapsed before the VM instance is removed or
  54095. // deleted.
  54096. //
  54097. // You can specify a maximum of 1000 instances with this method per
  54098. // request.
  54099. func (r *InstanceGroupManagersService) AbandonInstances(project string, zone string, instanceGroupManager string, instancegroupmanagersabandoninstancesrequest *InstanceGroupManagersAbandonInstancesRequest) *InstanceGroupManagersAbandonInstancesCall {
  54100. c := &InstanceGroupManagersAbandonInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  54101. c.project = project
  54102. c.zone = zone
  54103. c.instanceGroupManager = instanceGroupManager
  54104. c.instancegroupmanagersabandoninstancesrequest = instancegroupmanagersabandoninstancesrequest
  54105. return c
  54106. }
  54107. // RequestId sets the optional parameter "requestId": An optional
  54108. // request ID to identify requests. Specify a unique request ID so that
  54109. // if you must retry your request, the server will know to ignore the
  54110. // request if it has already been completed.
  54111. //
  54112. // For example, consider a situation where you make an initial request
  54113. // and the request times out. If you make the request again with the
  54114. // same request ID, the server can check if original operation with the
  54115. // same request ID was received, and if so, will ignore the second
  54116. // request. This prevents clients from accidentally creating duplicate
  54117. // commitments.
  54118. //
  54119. // The request ID must be a valid UUID with the exception that zero UUID
  54120. // is not supported (00000000-0000-0000-0000-000000000000).
  54121. func (c *InstanceGroupManagersAbandonInstancesCall) RequestId(requestId string) *InstanceGroupManagersAbandonInstancesCall {
  54122. c.urlParams_.Set("requestId", requestId)
  54123. return c
  54124. }
  54125. // Fields allows partial responses to be retrieved. See
  54126. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  54127. // for more information.
  54128. func (c *InstanceGroupManagersAbandonInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersAbandonInstancesCall {
  54129. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  54130. return c
  54131. }
  54132. // Context sets the context to be used in this call's Do method. Any
  54133. // pending HTTP request will be aborted if the provided context is
  54134. // canceled.
  54135. func (c *InstanceGroupManagersAbandonInstancesCall) Context(ctx context.Context) *InstanceGroupManagersAbandonInstancesCall {
  54136. c.ctx_ = ctx
  54137. return c
  54138. }
  54139. // Header returns an http.Header that can be modified by the caller to
  54140. // add HTTP headers to the request.
  54141. func (c *InstanceGroupManagersAbandonInstancesCall) Header() http.Header {
  54142. if c.header_ == nil {
  54143. c.header_ = make(http.Header)
  54144. }
  54145. return c.header_
  54146. }
  54147. func (c *InstanceGroupManagersAbandonInstancesCall) doRequest(alt string) (*http.Response, error) {
  54148. reqHeaders := make(http.Header)
  54149. for k, v := range c.header_ {
  54150. reqHeaders[k] = v
  54151. }
  54152. reqHeaders.Set("User-Agent", c.s.userAgent())
  54153. var body io.Reader = nil
  54154. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersabandoninstancesrequest)
  54155. if err != nil {
  54156. return nil, err
  54157. }
  54158. reqHeaders.Set("Content-Type", "application/json")
  54159. c.urlParams_.Set("alt", alt)
  54160. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances")
  54161. urls += "?" + c.urlParams_.Encode()
  54162. req, _ := http.NewRequest("POST", urls, body)
  54163. req.Header = reqHeaders
  54164. googleapi.Expand(req.URL, map[string]string{
  54165. "project": c.project,
  54166. "zone": c.zone,
  54167. "instanceGroupManager": c.instanceGroupManager,
  54168. })
  54169. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  54170. }
  54171. // Do executes the "compute.instanceGroupManagers.abandonInstances" call.
  54172. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  54173. // status code is an error. Response headers are in either
  54174. // *Operation.ServerResponse.Header or (if a response was returned at
  54175. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  54176. // to check whether the returned error was because
  54177. // http.StatusNotModified was returned.
  54178. func (c *InstanceGroupManagersAbandonInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, 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 := &Operation{
  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": "Schedules a group action to remove the specified instances from the managed instance group. Abandoning an instance does not delete the instance, but it does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method.\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.",
  54210. // "httpMethod": "POST",
  54211. // "id": "compute.instanceGroupManagers.abandonInstances",
  54212. // "parameterOrder": [
  54213. // "project",
  54214. // "zone",
  54215. // "instanceGroupManager"
  54216. // ],
  54217. // "parameters": {
  54218. // "instanceGroupManager": {
  54219. // "description": "The name of the managed instance group.",
  54220. // "location": "path",
  54221. // "required": true,
  54222. // "type": "string"
  54223. // },
  54224. // "project": {
  54225. // "description": "Project ID for this request.",
  54226. // "location": "path",
  54227. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  54228. // "required": true,
  54229. // "type": "string"
  54230. // },
  54231. // "requestId": {
  54232. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  54233. // "location": "query",
  54234. // "type": "string"
  54235. // },
  54236. // "zone": {
  54237. // "description": "The name of the zone where the managed instance group is located.",
  54238. // "location": "path",
  54239. // "required": true,
  54240. // "type": "string"
  54241. // }
  54242. // },
  54243. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances",
  54244. // "request": {
  54245. // "$ref": "InstanceGroupManagersAbandonInstancesRequest"
  54246. // },
  54247. // "response": {
  54248. // "$ref": "Operation"
  54249. // },
  54250. // "scopes": [
  54251. // "https://www.googleapis.com/auth/cloud-platform",
  54252. // "https://www.googleapis.com/auth/compute"
  54253. // ]
  54254. // }
  54255. }
  54256. // method id "compute.instanceGroupManagers.aggregatedList":
  54257. type InstanceGroupManagersAggregatedListCall struct {
  54258. s *Service
  54259. project string
  54260. urlParams_ gensupport.URLParams
  54261. ifNoneMatch_ string
  54262. ctx_ context.Context
  54263. header_ http.Header
  54264. }
  54265. // AggregatedList: Retrieves the list of managed instance groups and
  54266. // groups them by zone.
  54267. func (r *InstanceGroupManagersService) AggregatedList(project string) *InstanceGroupManagersAggregatedListCall {
  54268. c := &InstanceGroupManagersAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  54269. c.project = project
  54270. return c
  54271. }
  54272. // Filter sets the optional parameter "filter": A filter expression that
  54273. // filters resources listed in the response. The expression must specify
  54274. // the field name, a comparison operator, and the value that you want to
  54275. // use for filtering. The value must be a string, a number, or a
  54276. // boolean. The comparison operator must be either =, !=, >, or <.
  54277. //
  54278. // For example, if you are filtering Compute Engine instances, you can
  54279. // exclude instances named example-instance by specifying name !=
  54280. // example-instance.
  54281. //
  54282. // You can also filter nested fields. For example, you could specify
  54283. // scheduling.automaticRestart = false to include instances only if they
  54284. // are not scheduled for automatic restarts. You can use filtering on
  54285. // nested fields to filter based on resource labels.
  54286. //
  54287. // To filter on multiple expressions, provide each separate expression
  54288. // within parentheses. For example, (scheduling.automaticRestart = true)
  54289. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  54290. // AND expression. However, you can include AND and OR expressions
  54291. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  54292. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  54293. // true).
  54294. func (c *InstanceGroupManagersAggregatedListCall) Filter(filter string) *InstanceGroupManagersAggregatedListCall {
  54295. c.urlParams_.Set("filter", filter)
  54296. return c
  54297. }
  54298. // MaxResults sets the optional parameter "maxResults": The maximum
  54299. // number of results per page that should be returned. If the number of
  54300. // available results is larger than maxResults, Compute Engine returns a
  54301. // nextPageToken that can be used to get the next page of results in
  54302. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  54303. // (Default: 500)
  54304. func (c *InstanceGroupManagersAggregatedListCall) MaxResults(maxResults int64) *InstanceGroupManagersAggregatedListCall {
  54305. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  54306. return c
  54307. }
  54308. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  54309. // a certain order. By default, results are returned in alphanumerical
  54310. // order based on the resource name.
  54311. //
  54312. // You can also sort results in descending order based on the creation
  54313. // timestamp using orderBy="creationTimestamp desc". This sorts results
  54314. // based on the creationTimestamp field in reverse chronological order
  54315. // (newest result first). Use this to sort resources like operations so
  54316. // that the newest operation is returned first.
  54317. //
  54318. // Currently, only sorting by name or creationTimestamp desc is
  54319. // supported.
  54320. func (c *InstanceGroupManagersAggregatedListCall) OrderBy(orderBy string) *InstanceGroupManagersAggregatedListCall {
  54321. c.urlParams_.Set("orderBy", orderBy)
  54322. return c
  54323. }
  54324. // PageToken sets the optional parameter "pageToken": Specifies a page
  54325. // token to use. Set pageToken to the nextPageToken returned by a
  54326. // previous list request to get the next page of results.
  54327. func (c *InstanceGroupManagersAggregatedListCall) PageToken(pageToken string) *InstanceGroupManagersAggregatedListCall {
  54328. c.urlParams_.Set("pageToken", pageToken)
  54329. return c
  54330. }
  54331. // Fields allows partial responses to be retrieved. See
  54332. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  54333. // for more information.
  54334. func (c *InstanceGroupManagersAggregatedListCall) Fields(s ...googleapi.Field) *InstanceGroupManagersAggregatedListCall {
  54335. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  54336. return c
  54337. }
  54338. // IfNoneMatch sets the optional parameter which makes the operation
  54339. // fail if the object's ETag matches the given value. This is useful for
  54340. // getting updates only after the object has changed since the last
  54341. // request. Use googleapi.IsNotModified to check whether the response
  54342. // error from Do is the result of In-None-Match.
  54343. func (c *InstanceGroupManagersAggregatedListCall) IfNoneMatch(entityTag string) *InstanceGroupManagersAggregatedListCall {
  54344. c.ifNoneMatch_ = entityTag
  54345. return c
  54346. }
  54347. // Context sets the context to be used in this call's Do method. Any
  54348. // pending HTTP request will be aborted if the provided context is
  54349. // canceled.
  54350. func (c *InstanceGroupManagersAggregatedListCall) Context(ctx context.Context) *InstanceGroupManagersAggregatedListCall {
  54351. c.ctx_ = ctx
  54352. return c
  54353. }
  54354. // Header returns an http.Header that can be modified by the caller to
  54355. // add HTTP headers to the request.
  54356. func (c *InstanceGroupManagersAggregatedListCall) Header() http.Header {
  54357. if c.header_ == nil {
  54358. c.header_ = make(http.Header)
  54359. }
  54360. return c.header_
  54361. }
  54362. func (c *InstanceGroupManagersAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  54363. reqHeaders := make(http.Header)
  54364. for k, v := range c.header_ {
  54365. reqHeaders[k] = v
  54366. }
  54367. reqHeaders.Set("User-Agent", c.s.userAgent())
  54368. if c.ifNoneMatch_ != "" {
  54369. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  54370. }
  54371. var body io.Reader = nil
  54372. c.urlParams_.Set("alt", alt)
  54373. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/instanceGroupManagers")
  54374. urls += "?" + c.urlParams_.Encode()
  54375. req, _ := http.NewRequest("GET", urls, body)
  54376. req.Header = reqHeaders
  54377. googleapi.Expand(req.URL, map[string]string{
  54378. "project": c.project,
  54379. })
  54380. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  54381. }
  54382. // Do executes the "compute.instanceGroupManagers.aggregatedList" call.
  54383. // Exactly one of *InstanceGroupManagerAggregatedList or error will be
  54384. // non-nil. Any non-2xx status code is an error. Response headers are in
  54385. // either *InstanceGroupManagerAggregatedList.ServerResponse.Header or
  54386. // (if a response was returned at all) in
  54387. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  54388. // whether the returned error was because http.StatusNotModified was
  54389. // returned.
  54390. func (c *InstanceGroupManagersAggregatedListCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManagerAggregatedList, error) {
  54391. gensupport.SetOptions(c.urlParams_, opts...)
  54392. res, err := c.doRequest("json")
  54393. if res != nil && res.StatusCode == http.StatusNotModified {
  54394. if res.Body != nil {
  54395. res.Body.Close()
  54396. }
  54397. return nil, &googleapi.Error{
  54398. Code: res.StatusCode,
  54399. Header: res.Header,
  54400. }
  54401. }
  54402. if err != nil {
  54403. return nil, err
  54404. }
  54405. defer googleapi.CloseBody(res)
  54406. if err := googleapi.CheckResponse(res); err != nil {
  54407. return nil, err
  54408. }
  54409. ret := &InstanceGroupManagerAggregatedList{
  54410. ServerResponse: googleapi.ServerResponse{
  54411. Header: res.Header,
  54412. HTTPStatusCode: res.StatusCode,
  54413. },
  54414. }
  54415. target := &ret
  54416. if err := gensupport.DecodeResponse(target, res); err != nil {
  54417. return nil, err
  54418. }
  54419. return ret, nil
  54420. // {
  54421. // "description": "Retrieves the list of managed instance groups and groups them by zone.",
  54422. // "httpMethod": "GET",
  54423. // "id": "compute.instanceGroupManagers.aggregatedList",
  54424. // "parameterOrder": [
  54425. // "project"
  54426. // ],
  54427. // "parameters": {
  54428. // "filter": {
  54429. // "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).",
  54430. // "location": "query",
  54431. // "type": "string"
  54432. // },
  54433. // "maxResults": {
  54434. // "default": "500",
  54435. // "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)",
  54436. // "format": "uint32",
  54437. // "location": "query",
  54438. // "minimum": "0",
  54439. // "type": "integer"
  54440. // },
  54441. // "orderBy": {
  54442. // "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.",
  54443. // "location": "query",
  54444. // "type": "string"
  54445. // },
  54446. // "pageToken": {
  54447. // "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.",
  54448. // "location": "query",
  54449. // "type": "string"
  54450. // },
  54451. // "project": {
  54452. // "description": "Project ID for this request.",
  54453. // "location": "path",
  54454. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  54455. // "required": true,
  54456. // "type": "string"
  54457. // }
  54458. // },
  54459. // "path": "{project}/aggregated/instanceGroupManagers",
  54460. // "response": {
  54461. // "$ref": "InstanceGroupManagerAggregatedList"
  54462. // },
  54463. // "scopes": [
  54464. // "https://www.googleapis.com/auth/cloud-platform",
  54465. // "https://www.googleapis.com/auth/compute",
  54466. // "https://www.googleapis.com/auth/compute.readonly"
  54467. // ]
  54468. // }
  54469. }
  54470. // Pages invokes f for each page of results.
  54471. // A non-nil error returned from f will halt the iteration.
  54472. // The provided context supersedes any context provided to the Context method.
  54473. func (c *InstanceGroupManagersAggregatedListCall) Pages(ctx context.Context, f func(*InstanceGroupManagerAggregatedList) error) error {
  54474. c.ctx_ = ctx
  54475. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  54476. for {
  54477. x, err := c.Do()
  54478. if err != nil {
  54479. return err
  54480. }
  54481. if err := f(x); err != nil {
  54482. return err
  54483. }
  54484. if x.NextPageToken == "" {
  54485. return nil
  54486. }
  54487. c.PageToken(x.NextPageToken)
  54488. }
  54489. }
  54490. // method id "compute.instanceGroupManagers.applyUpdatesToInstances":
  54491. type InstanceGroupManagersApplyUpdatesToInstancesCall struct {
  54492. s *Service
  54493. project string
  54494. zone string
  54495. instanceGroupManager string
  54496. instancegroupmanagersapplyupdatesrequest *InstanceGroupManagersApplyUpdatesRequest
  54497. urlParams_ gensupport.URLParams
  54498. ctx_ context.Context
  54499. header_ http.Header
  54500. }
  54501. // ApplyUpdatesToInstances: Apply changes to selected instances on the
  54502. // managed instance group. This method can be used to apply new
  54503. // overrides and/or new versions.
  54504. func (r *InstanceGroupManagersService) ApplyUpdatesToInstances(project string, zone string, instanceGroupManager string, instancegroupmanagersapplyupdatesrequest *InstanceGroupManagersApplyUpdatesRequest) *InstanceGroupManagersApplyUpdatesToInstancesCall {
  54505. c := &InstanceGroupManagersApplyUpdatesToInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  54506. c.project = project
  54507. c.zone = zone
  54508. c.instanceGroupManager = instanceGroupManager
  54509. c.instancegroupmanagersapplyupdatesrequest = instancegroupmanagersapplyupdatesrequest
  54510. return c
  54511. }
  54512. // Fields allows partial responses to be retrieved. See
  54513. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  54514. // for more information.
  54515. func (c *InstanceGroupManagersApplyUpdatesToInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersApplyUpdatesToInstancesCall {
  54516. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  54517. return c
  54518. }
  54519. // Context sets the context to be used in this call's Do method. Any
  54520. // pending HTTP request will be aborted if the provided context is
  54521. // canceled.
  54522. func (c *InstanceGroupManagersApplyUpdatesToInstancesCall) Context(ctx context.Context) *InstanceGroupManagersApplyUpdatesToInstancesCall {
  54523. c.ctx_ = ctx
  54524. return c
  54525. }
  54526. // Header returns an http.Header that can be modified by the caller to
  54527. // add HTTP headers to the request.
  54528. func (c *InstanceGroupManagersApplyUpdatesToInstancesCall) Header() http.Header {
  54529. if c.header_ == nil {
  54530. c.header_ = make(http.Header)
  54531. }
  54532. return c.header_
  54533. }
  54534. func (c *InstanceGroupManagersApplyUpdatesToInstancesCall) doRequest(alt string) (*http.Response, error) {
  54535. reqHeaders := make(http.Header)
  54536. for k, v := range c.header_ {
  54537. reqHeaders[k] = v
  54538. }
  54539. reqHeaders.Set("User-Agent", c.s.userAgent())
  54540. var body io.Reader = nil
  54541. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersapplyupdatesrequest)
  54542. if err != nil {
  54543. return nil, err
  54544. }
  54545. reqHeaders.Set("Content-Type", "application/json")
  54546. c.urlParams_.Set("alt", alt)
  54547. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/applyUpdatesToInstances")
  54548. urls += "?" + c.urlParams_.Encode()
  54549. req, _ := http.NewRequest("POST", urls, body)
  54550. req.Header = reqHeaders
  54551. googleapi.Expand(req.URL, map[string]string{
  54552. "project": c.project,
  54553. "zone": c.zone,
  54554. "instanceGroupManager": c.instanceGroupManager,
  54555. })
  54556. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  54557. }
  54558. // Do executes the "compute.instanceGroupManagers.applyUpdatesToInstances" call.
  54559. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  54560. // status code is an error. Response headers are in either
  54561. // *Operation.ServerResponse.Header or (if a response was returned at
  54562. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  54563. // to check whether the returned error was because
  54564. // http.StatusNotModified was returned.
  54565. func (c *InstanceGroupManagersApplyUpdatesToInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  54566. gensupport.SetOptions(c.urlParams_, opts...)
  54567. res, err := c.doRequest("json")
  54568. if res != nil && res.StatusCode == http.StatusNotModified {
  54569. if res.Body != nil {
  54570. res.Body.Close()
  54571. }
  54572. return nil, &googleapi.Error{
  54573. Code: res.StatusCode,
  54574. Header: res.Header,
  54575. }
  54576. }
  54577. if err != nil {
  54578. return nil, err
  54579. }
  54580. defer googleapi.CloseBody(res)
  54581. if err := googleapi.CheckResponse(res); err != nil {
  54582. return nil, err
  54583. }
  54584. ret := &Operation{
  54585. ServerResponse: googleapi.ServerResponse{
  54586. Header: res.Header,
  54587. HTTPStatusCode: res.StatusCode,
  54588. },
  54589. }
  54590. target := &ret
  54591. if err := gensupport.DecodeResponse(target, res); err != nil {
  54592. return nil, err
  54593. }
  54594. return ret, nil
  54595. // {
  54596. // "description": "Apply changes to selected instances on the managed instance group. This method can be used to apply new overrides and/or new versions.",
  54597. // "httpMethod": "POST",
  54598. // "id": "compute.instanceGroupManagers.applyUpdatesToInstances",
  54599. // "parameterOrder": [
  54600. // "project",
  54601. // "zone",
  54602. // "instanceGroupManager"
  54603. // ],
  54604. // "parameters": {
  54605. // "instanceGroupManager": {
  54606. // "description": "The name of the managed instance group, should conform to RFC1035.",
  54607. // "location": "path",
  54608. // "required": true,
  54609. // "type": "string"
  54610. // },
  54611. // "project": {
  54612. // "description": "Project ID for this request.",
  54613. // "location": "path",
  54614. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  54615. // "required": true,
  54616. // "type": "string"
  54617. // },
  54618. // "zone": {
  54619. // "description": "The name of the zone where the managed instance group is located. Should conform to RFC1035.",
  54620. // "location": "path",
  54621. // "required": true,
  54622. // "type": "string"
  54623. // }
  54624. // },
  54625. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/applyUpdatesToInstances",
  54626. // "request": {
  54627. // "$ref": "InstanceGroupManagersApplyUpdatesRequest"
  54628. // },
  54629. // "response": {
  54630. // "$ref": "Operation"
  54631. // },
  54632. // "scopes": [
  54633. // "https://www.googleapis.com/auth/cloud-platform",
  54634. // "https://www.googleapis.com/auth/compute"
  54635. // ]
  54636. // }
  54637. }
  54638. // method id "compute.instanceGroupManagers.delete":
  54639. type InstanceGroupManagersDeleteCall struct {
  54640. s *Service
  54641. project string
  54642. zone string
  54643. instanceGroupManager string
  54644. urlParams_ gensupport.URLParams
  54645. ctx_ context.Context
  54646. header_ http.Header
  54647. }
  54648. // Delete: Deletes the specified managed instance group and all of the
  54649. // instances in that group. Note that the instance group must not belong
  54650. // to a backend service. Read Deleting an instance group for more
  54651. // information.
  54652. func (r *InstanceGroupManagersService) Delete(project string, zone string, instanceGroupManager string) *InstanceGroupManagersDeleteCall {
  54653. c := &InstanceGroupManagersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  54654. c.project = project
  54655. c.zone = zone
  54656. c.instanceGroupManager = instanceGroupManager
  54657. return c
  54658. }
  54659. // RequestId sets the optional parameter "requestId": An optional
  54660. // request ID to identify requests. Specify a unique request ID so that
  54661. // if you must retry your request, the server will know to ignore the
  54662. // request if it has already been completed.
  54663. //
  54664. // For example, consider a situation where you make an initial request
  54665. // and the request times out. If you make the request again with the
  54666. // same request ID, the server can check if original operation with the
  54667. // same request ID was received, and if so, will ignore the second
  54668. // request. This prevents clients from accidentally creating duplicate
  54669. // commitments.
  54670. //
  54671. // The request ID must be a valid UUID with the exception that zero UUID
  54672. // is not supported (00000000-0000-0000-0000-000000000000).
  54673. func (c *InstanceGroupManagersDeleteCall) RequestId(requestId string) *InstanceGroupManagersDeleteCall {
  54674. c.urlParams_.Set("requestId", requestId)
  54675. return c
  54676. }
  54677. // Fields allows partial responses to be retrieved. See
  54678. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  54679. // for more information.
  54680. func (c *InstanceGroupManagersDeleteCall) Fields(s ...googleapi.Field) *InstanceGroupManagersDeleteCall {
  54681. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  54682. return c
  54683. }
  54684. // Context sets the context to be used in this call's Do method. Any
  54685. // pending HTTP request will be aborted if the provided context is
  54686. // canceled.
  54687. func (c *InstanceGroupManagersDeleteCall) Context(ctx context.Context) *InstanceGroupManagersDeleteCall {
  54688. c.ctx_ = ctx
  54689. return c
  54690. }
  54691. // Header returns an http.Header that can be modified by the caller to
  54692. // add HTTP headers to the request.
  54693. func (c *InstanceGroupManagersDeleteCall) Header() http.Header {
  54694. if c.header_ == nil {
  54695. c.header_ = make(http.Header)
  54696. }
  54697. return c.header_
  54698. }
  54699. func (c *InstanceGroupManagersDeleteCall) doRequest(alt string) (*http.Response, error) {
  54700. reqHeaders := make(http.Header)
  54701. for k, v := range c.header_ {
  54702. reqHeaders[k] = v
  54703. }
  54704. reqHeaders.Set("User-Agent", c.s.userAgent())
  54705. var body io.Reader = nil
  54706. c.urlParams_.Set("alt", alt)
  54707. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}")
  54708. urls += "?" + c.urlParams_.Encode()
  54709. req, _ := http.NewRequest("DELETE", urls, body)
  54710. req.Header = reqHeaders
  54711. googleapi.Expand(req.URL, map[string]string{
  54712. "project": c.project,
  54713. "zone": c.zone,
  54714. "instanceGroupManager": c.instanceGroupManager,
  54715. })
  54716. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  54717. }
  54718. // Do executes the "compute.instanceGroupManagers.delete" call.
  54719. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  54720. // status code is an error. Response headers are in either
  54721. // *Operation.ServerResponse.Header or (if a response was returned at
  54722. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  54723. // to check whether the returned error was because
  54724. // http.StatusNotModified was returned.
  54725. func (c *InstanceGroupManagersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  54726. gensupport.SetOptions(c.urlParams_, opts...)
  54727. res, err := c.doRequest("json")
  54728. if res != nil && res.StatusCode == http.StatusNotModified {
  54729. if res.Body != nil {
  54730. res.Body.Close()
  54731. }
  54732. return nil, &googleapi.Error{
  54733. Code: res.StatusCode,
  54734. Header: res.Header,
  54735. }
  54736. }
  54737. if err != nil {
  54738. return nil, err
  54739. }
  54740. defer googleapi.CloseBody(res)
  54741. if err := googleapi.CheckResponse(res); err != nil {
  54742. return nil, err
  54743. }
  54744. ret := &Operation{
  54745. ServerResponse: googleapi.ServerResponse{
  54746. Header: res.Header,
  54747. HTTPStatusCode: res.StatusCode,
  54748. },
  54749. }
  54750. target := &ret
  54751. if err := gensupport.DecodeResponse(target, res); err != nil {
  54752. return nil, err
  54753. }
  54754. return ret, nil
  54755. // {
  54756. // "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.",
  54757. // "httpMethod": "DELETE",
  54758. // "id": "compute.instanceGroupManagers.delete",
  54759. // "parameterOrder": [
  54760. // "project",
  54761. // "zone",
  54762. // "instanceGroupManager"
  54763. // ],
  54764. // "parameters": {
  54765. // "instanceGroupManager": {
  54766. // "description": "The name of the managed instance group to delete.",
  54767. // "location": "path",
  54768. // "required": true,
  54769. // "type": "string"
  54770. // },
  54771. // "project": {
  54772. // "description": "Project ID for this request.",
  54773. // "location": "path",
  54774. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  54775. // "required": true,
  54776. // "type": "string"
  54777. // },
  54778. // "requestId": {
  54779. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  54780. // "location": "query",
  54781. // "type": "string"
  54782. // },
  54783. // "zone": {
  54784. // "description": "The name of the zone where the managed instance group is located.",
  54785. // "location": "path",
  54786. // "required": true,
  54787. // "type": "string"
  54788. // }
  54789. // },
  54790. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}",
  54791. // "response": {
  54792. // "$ref": "Operation"
  54793. // },
  54794. // "scopes": [
  54795. // "https://www.googleapis.com/auth/cloud-platform",
  54796. // "https://www.googleapis.com/auth/compute"
  54797. // ]
  54798. // }
  54799. }
  54800. // method id "compute.instanceGroupManagers.deleteInstances":
  54801. type InstanceGroupManagersDeleteInstancesCall struct {
  54802. s *Service
  54803. project string
  54804. zone string
  54805. instanceGroupManager string
  54806. instancegroupmanagersdeleteinstancesrequest *InstanceGroupManagersDeleteInstancesRequest
  54807. urlParams_ gensupport.URLParams
  54808. ctx_ context.Context
  54809. header_ http.Header
  54810. }
  54811. // DeleteInstances: Schedules a group action to delete the specified
  54812. // instances in the managed instance group. The instances are also
  54813. // removed from any target pools of which they were a member. This
  54814. // method reduces the targetSize of the managed instance group by the
  54815. // number of instances that you delete. This operation is marked as DONE
  54816. // when the action is scheduled even if the instances are still being
  54817. // deleted. You must separately verify the status of the deleting action
  54818. // with the listmanagedinstances method.
  54819. //
  54820. // If the group is part of a backend service that has enabled connection
  54821. // draining, it can take up to 60 seconds after the connection draining
  54822. // duration has elapsed before the VM instance is removed or
  54823. // deleted.
  54824. //
  54825. // You can specify a maximum of 1000 instances with this method per
  54826. // request.
  54827. func (r *InstanceGroupManagersService) DeleteInstances(project string, zone string, instanceGroupManager string, instancegroupmanagersdeleteinstancesrequest *InstanceGroupManagersDeleteInstancesRequest) *InstanceGroupManagersDeleteInstancesCall {
  54828. c := &InstanceGroupManagersDeleteInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  54829. c.project = project
  54830. c.zone = zone
  54831. c.instanceGroupManager = instanceGroupManager
  54832. c.instancegroupmanagersdeleteinstancesrequest = instancegroupmanagersdeleteinstancesrequest
  54833. return c
  54834. }
  54835. // RequestId sets the optional parameter "requestId": An optional
  54836. // request ID to identify requests. Specify a unique request ID so that
  54837. // if you must retry your request, the server will know to ignore the
  54838. // request if it has already been completed.
  54839. //
  54840. // For example, consider a situation where you make an initial request
  54841. // and the request times out. If you make the request again with the
  54842. // same request ID, the server can check if original operation with the
  54843. // same request ID was received, and if so, will ignore the second
  54844. // request. This prevents clients from accidentally creating duplicate
  54845. // commitments.
  54846. //
  54847. // The request ID must be a valid UUID with the exception that zero UUID
  54848. // is not supported (00000000-0000-0000-0000-000000000000).
  54849. func (c *InstanceGroupManagersDeleteInstancesCall) RequestId(requestId string) *InstanceGroupManagersDeleteInstancesCall {
  54850. c.urlParams_.Set("requestId", requestId)
  54851. return c
  54852. }
  54853. // Fields allows partial responses to be retrieved. See
  54854. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  54855. // for more information.
  54856. func (c *InstanceGroupManagersDeleteInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersDeleteInstancesCall {
  54857. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  54858. return c
  54859. }
  54860. // Context sets the context to be used in this call's Do method. Any
  54861. // pending HTTP request will be aborted if the provided context is
  54862. // canceled.
  54863. func (c *InstanceGroupManagersDeleteInstancesCall) Context(ctx context.Context) *InstanceGroupManagersDeleteInstancesCall {
  54864. c.ctx_ = ctx
  54865. return c
  54866. }
  54867. // Header returns an http.Header that can be modified by the caller to
  54868. // add HTTP headers to the request.
  54869. func (c *InstanceGroupManagersDeleteInstancesCall) Header() http.Header {
  54870. if c.header_ == nil {
  54871. c.header_ = make(http.Header)
  54872. }
  54873. return c.header_
  54874. }
  54875. func (c *InstanceGroupManagersDeleteInstancesCall) doRequest(alt string) (*http.Response, error) {
  54876. reqHeaders := make(http.Header)
  54877. for k, v := range c.header_ {
  54878. reqHeaders[k] = v
  54879. }
  54880. reqHeaders.Set("User-Agent", c.s.userAgent())
  54881. var body io.Reader = nil
  54882. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersdeleteinstancesrequest)
  54883. if err != nil {
  54884. return nil, err
  54885. }
  54886. reqHeaders.Set("Content-Type", "application/json")
  54887. c.urlParams_.Set("alt", alt)
  54888. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deleteInstances")
  54889. urls += "?" + c.urlParams_.Encode()
  54890. req, _ := http.NewRequest("POST", urls, body)
  54891. req.Header = reqHeaders
  54892. googleapi.Expand(req.URL, map[string]string{
  54893. "project": c.project,
  54894. "zone": c.zone,
  54895. "instanceGroupManager": c.instanceGroupManager,
  54896. })
  54897. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  54898. }
  54899. // Do executes the "compute.instanceGroupManagers.deleteInstances" call.
  54900. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  54901. // status code is an error. Response headers are in either
  54902. // *Operation.ServerResponse.Header or (if a response was returned at
  54903. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  54904. // to check whether the returned error was because
  54905. // http.StatusNotModified was returned.
  54906. func (c *InstanceGroupManagersDeleteInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  54907. gensupport.SetOptions(c.urlParams_, opts...)
  54908. res, err := c.doRequest("json")
  54909. if res != nil && res.StatusCode == http.StatusNotModified {
  54910. if res.Body != nil {
  54911. res.Body.Close()
  54912. }
  54913. return nil, &googleapi.Error{
  54914. Code: res.StatusCode,
  54915. Header: res.Header,
  54916. }
  54917. }
  54918. if err != nil {
  54919. return nil, err
  54920. }
  54921. defer googleapi.CloseBody(res)
  54922. if err := googleapi.CheckResponse(res); err != nil {
  54923. return nil, err
  54924. }
  54925. ret := &Operation{
  54926. ServerResponse: googleapi.ServerResponse{
  54927. Header: res.Header,
  54928. HTTPStatusCode: res.StatusCode,
  54929. },
  54930. }
  54931. target := &ret
  54932. if err := gensupport.DecodeResponse(target, res); err != nil {
  54933. return nil, err
  54934. }
  54935. return ret, nil
  54936. // {
  54937. // "description": "Schedules a group action to delete the specified instances in the managed instance group. The instances are also removed from any target pools of which they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. This operation is marked as DONE when the action is scheduled even if the instances are still being deleted. You must separately verify the status of the deleting action with the listmanagedinstances method.\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.",
  54938. // "httpMethod": "POST",
  54939. // "id": "compute.instanceGroupManagers.deleteInstances",
  54940. // "parameterOrder": [
  54941. // "project",
  54942. // "zone",
  54943. // "instanceGroupManager"
  54944. // ],
  54945. // "parameters": {
  54946. // "instanceGroupManager": {
  54947. // "description": "The name of the managed instance group.",
  54948. // "location": "path",
  54949. // "required": true,
  54950. // "type": "string"
  54951. // },
  54952. // "project": {
  54953. // "description": "Project ID for this request.",
  54954. // "location": "path",
  54955. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  54956. // "required": true,
  54957. // "type": "string"
  54958. // },
  54959. // "requestId": {
  54960. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  54961. // "location": "query",
  54962. // "type": "string"
  54963. // },
  54964. // "zone": {
  54965. // "description": "The name of the zone where the managed instance group is located.",
  54966. // "location": "path",
  54967. // "required": true,
  54968. // "type": "string"
  54969. // }
  54970. // },
  54971. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deleteInstances",
  54972. // "request": {
  54973. // "$ref": "InstanceGroupManagersDeleteInstancesRequest"
  54974. // },
  54975. // "response": {
  54976. // "$ref": "Operation"
  54977. // },
  54978. // "scopes": [
  54979. // "https://www.googleapis.com/auth/cloud-platform",
  54980. // "https://www.googleapis.com/auth/compute"
  54981. // ]
  54982. // }
  54983. }
  54984. // method id "compute.instanceGroupManagers.deletePerInstanceConfigs":
  54985. type InstanceGroupManagersDeletePerInstanceConfigsCall struct {
  54986. s *Service
  54987. project string
  54988. zone string
  54989. instanceGroupManager string
  54990. instancegroupmanagersdeleteperinstanceconfigsreq *InstanceGroupManagersDeletePerInstanceConfigsReq
  54991. urlParams_ gensupport.URLParams
  54992. ctx_ context.Context
  54993. header_ http.Header
  54994. }
  54995. // DeletePerInstanceConfigs: Deletes selected per-instance configs for
  54996. // the managed instance group.
  54997. func (r *InstanceGroupManagersService) DeletePerInstanceConfigs(project string, zone string, instanceGroupManager string, instancegroupmanagersdeleteperinstanceconfigsreq *InstanceGroupManagersDeletePerInstanceConfigsReq) *InstanceGroupManagersDeletePerInstanceConfigsCall {
  54998. c := &InstanceGroupManagersDeletePerInstanceConfigsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  54999. c.project = project
  55000. c.zone = zone
  55001. c.instanceGroupManager = instanceGroupManager
  55002. c.instancegroupmanagersdeleteperinstanceconfigsreq = instancegroupmanagersdeleteperinstanceconfigsreq
  55003. return c
  55004. }
  55005. // Fields allows partial responses to be retrieved. See
  55006. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  55007. // for more information.
  55008. func (c *InstanceGroupManagersDeletePerInstanceConfigsCall) Fields(s ...googleapi.Field) *InstanceGroupManagersDeletePerInstanceConfigsCall {
  55009. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  55010. return c
  55011. }
  55012. // Context sets the context to be used in this call's Do method. Any
  55013. // pending HTTP request will be aborted if the provided context is
  55014. // canceled.
  55015. func (c *InstanceGroupManagersDeletePerInstanceConfigsCall) Context(ctx context.Context) *InstanceGroupManagersDeletePerInstanceConfigsCall {
  55016. c.ctx_ = ctx
  55017. return c
  55018. }
  55019. // Header returns an http.Header that can be modified by the caller to
  55020. // add HTTP headers to the request.
  55021. func (c *InstanceGroupManagersDeletePerInstanceConfigsCall) Header() http.Header {
  55022. if c.header_ == nil {
  55023. c.header_ = make(http.Header)
  55024. }
  55025. return c.header_
  55026. }
  55027. func (c *InstanceGroupManagersDeletePerInstanceConfigsCall) doRequest(alt string) (*http.Response, error) {
  55028. reqHeaders := make(http.Header)
  55029. for k, v := range c.header_ {
  55030. reqHeaders[k] = v
  55031. }
  55032. reqHeaders.Set("User-Agent", c.s.userAgent())
  55033. var body io.Reader = nil
  55034. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersdeleteperinstanceconfigsreq)
  55035. if err != nil {
  55036. return nil, err
  55037. }
  55038. reqHeaders.Set("Content-Type", "application/json")
  55039. c.urlParams_.Set("alt", alt)
  55040. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deletePerInstanceConfigs")
  55041. urls += "?" + c.urlParams_.Encode()
  55042. req, _ := http.NewRequest("POST", urls, body)
  55043. req.Header = reqHeaders
  55044. googleapi.Expand(req.URL, map[string]string{
  55045. "project": c.project,
  55046. "zone": c.zone,
  55047. "instanceGroupManager": c.instanceGroupManager,
  55048. })
  55049. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  55050. }
  55051. // Do executes the "compute.instanceGroupManagers.deletePerInstanceConfigs" call.
  55052. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  55053. // status code is an error. Response headers are in either
  55054. // *Operation.ServerResponse.Header or (if a response was returned at
  55055. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  55056. // to check whether the returned error was because
  55057. // http.StatusNotModified was returned.
  55058. func (c *InstanceGroupManagersDeletePerInstanceConfigsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  55059. gensupport.SetOptions(c.urlParams_, opts...)
  55060. res, err := c.doRequest("json")
  55061. if res != nil && res.StatusCode == http.StatusNotModified {
  55062. if res.Body != nil {
  55063. res.Body.Close()
  55064. }
  55065. return nil, &googleapi.Error{
  55066. Code: res.StatusCode,
  55067. Header: res.Header,
  55068. }
  55069. }
  55070. if err != nil {
  55071. return nil, err
  55072. }
  55073. defer googleapi.CloseBody(res)
  55074. if err := googleapi.CheckResponse(res); err != nil {
  55075. return nil, err
  55076. }
  55077. ret := &Operation{
  55078. ServerResponse: googleapi.ServerResponse{
  55079. Header: res.Header,
  55080. HTTPStatusCode: res.StatusCode,
  55081. },
  55082. }
  55083. target := &ret
  55084. if err := gensupport.DecodeResponse(target, res); err != nil {
  55085. return nil, err
  55086. }
  55087. return ret, nil
  55088. // {
  55089. // "description": "Deletes selected per-instance configs for the managed instance group.",
  55090. // "httpMethod": "POST",
  55091. // "id": "compute.instanceGroupManagers.deletePerInstanceConfigs",
  55092. // "parameterOrder": [
  55093. // "project",
  55094. // "zone",
  55095. // "instanceGroupManager"
  55096. // ],
  55097. // "parameters": {
  55098. // "instanceGroupManager": {
  55099. // "description": "The name of the managed instance group. It should conform to RFC1035.",
  55100. // "location": "path",
  55101. // "required": true,
  55102. // "type": "string"
  55103. // },
  55104. // "project": {
  55105. // "description": "Project ID for this request.",
  55106. // "location": "path",
  55107. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  55108. // "required": true,
  55109. // "type": "string"
  55110. // },
  55111. // "zone": {
  55112. // "description": "The name of the zone where the managed instance group is located. It should conform to RFC1035.",
  55113. // "location": "path",
  55114. // "required": true,
  55115. // "type": "string"
  55116. // }
  55117. // },
  55118. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deletePerInstanceConfigs",
  55119. // "request": {
  55120. // "$ref": "InstanceGroupManagersDeletePerInstanceConfigsReq"
  55121. // },
  55122. // "response": {
  55123. // "$ref": "Operation"
  55124. // },
  55125. // "scopes": [
  55126. // "https://www.googleapis.com/auth/cloud-platform",
  55127. // "https://www.googleapis.com/auth/compute"
  55128. // ]
  55129. // }
  55130. }
  55131. // method id "compute.instanceGroupManagers.get":
  55132. type InstanceGroupManagersGetCall struct {
  55133. s *Service
  55134. project string
  55135. zone string
  55136. instanceGroupManager string
  55137. urlParams_ gensupport.URLParams
  55138. ifNoneMatch_ string
  55139. ctx_ context.Context
  55140. header_ http.Header
  55141. }
  55142. // Get: Returns all of the details about the specified managed instance
  55143. // group. Gets a list of available managed instance groups by making a
  55144. // list() request.
  55145. func (r *InstanceGroupManagersService) Get(project string, zone string, instanceGroupManager string) *InstanceGroupManagersGetCall {
  55146. c := &InstanceGroupManagersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  55147. c.project = project
  55148. c.zone = zone
  55149. c.instanceGroupManager = instanceGroupManager
  55150. return c
  55151. }
  55152. // Fields allows partial responses to be retrieved. See
  55153. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  55154. // for more information.
  55155. func (c *InstanceGroupManagersGetCall) Fields(s ...googleapi.Field) *InstanceGroupManagersGetCall {
  55156. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  55157. return c
  55158. }
  55159. // IfNoneMatch sets the optional parameter which makes the operation
  55160. // fail if the object's ETag matches the given value. This is useful for
  55161. // getting updates only after the object has changed since the last
  55162. // request. Use googleapi.IsNotModified to check whether the response
  55163. // error from Do is the result of In-None-Match.
  55164. func (c *InstanceGroupManagersGetCall) IfNoneMatch(entityTag string) *InstanceGroupManagersGetCall {
  55165. c.ifNoneMatch_ = entityTag
  55166. return c
  55167. }
  55168. // Context sets the context to be used in this call's Do method. Any
  55169. // pending HTTP request will be aborted if the provided context is
  55170. // canceled.
  55171. func (c *InstanceGroupManagersGetCall) Context(ctx context.Context) *InstanceGroupManagersGetCall {
  55172. c.ctx_ = ctx
  55173. return c
  55174. }
  55175. // Header returns an http.Header that can be modified by the caller to
  55176. // add HTTP headers to the request.
  55177. func (c *InstanceGroupManagersGetCall) Header() http.Header {
  55178. if c.header_ == nil {
  55179. c.header_ = make(http.Header)
  55180. }
  55181. return c.header_
  55182. }
  55183. func (c *InstanceGroupManagersGetCall) doRequest(alt string) (*http.Response, error) {
  55184. reqHeaders := make(http.Header)
  55185. for k, v := range c.header_ {
  55186. reqHeaders[k] = v
  55187. }
  55188. reqHeaders.Set("User-Agent", c.s.userAgent())
  55189. if c.ifNoneMatch_ != "" {
  55190. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  55191. }
  55192. var body io.Reader = nil
  55193. c.urlParams_.Set("alt", alt)
  55194. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}")
  55195. urls += "?" + c.urlParams_.Encode()
  55196. req, _ := http.NewRequest("GET", urls, body)
  55197. req.Header = reqHeaders
  55198. googleapi.Expand(req.URL, map[string]string{
  55199. "project": c.project,
  55200. "zone": c.zone,
  55201. "instanceGroupManager": c.instanceGroupManager,
  55202. })
  55203. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  55204. }
  55205. // Do executes the "compute.instanceGroupManagers.get" call.
  55206. // Exactly one of *InstanceGroupManager or error will be non-nil. Any
  55207. // non-2xx status code is an error. Response headers are in either
  55208. // *InstanceGroupManager.ServerResponse.Header or (if a response was
  55209. // returned at all) in error.(*googleapi.Error).Header. Use
  55210. // googleapi.IsNotModified to check whether the returned error was
  55211. // because http.StatusNotModified was returned.
  55212. func (c *InstanceGroupManagersGetCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManager, error) {
  55213. gensupport.SetOptions(c.urlParams_, opts...)
  55214. res, err := c.doRequest("json")
  55215. if res != nil && res.StatusCode == http.StatusNotModified {
  55216. if res.Body != nil {
  55217. res.Body.Close()
  55218. }
  55219. return nil, &googleapi.Error{
  55220. Code: res.StatusCode,
  55221. Header: res.Header,
  55222. }
  55223. }
  55224. if err != nil {
  55225. return nil, err
  55226. }
  55227. defer googleapi.CloseBody(res)
  55228. if err := googleapi.CheckResponse(res); err != nil {
  55229. return nil, err
  55230. }
  55231. ret := &InstanceGroupManager{
  55232. ServerResponse: googleapi.ServerResponse{
  55233. Header: res.Header,
  55234. HTTPStatusCode: res.StatusCode,
  55235. },
  55236. }
  55237. target := &ret
  55238. if err := gensupport.DecodeResponse(target, res); err != nil {
  55239. return nil, err
  55240. }
  55241. return ret, nil
  55242. // {
  55243. // "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.",
  55244. // "httpMethod": "GET",
  55245. // "id": "compute.instanceGroupManagers.get",
  55246. // "parameterOrder": [
  55247. // "project",
  55248. // "zone",
  55249. // "instanceGroupManager"
  55250. // ],
  55251. // "parameters": {
  55252. // "instanceGroupManager": {
  55253. // "description": "The name of the managed instance group.",
  55254. // "location": "path",
  55255. // "required": true,
  55256. // "type": "string"
  55257. // },
  55258. // "project": {
  55259. // "description": "Project ID for this request.",
  55260. // "location": "path",
  55261. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  55262. // "required": true,
  55263. // "type": "string"
  55264. // },
  55265. // "zone": {
  55266. // "description": "The name of the zone where the managed instance group is located.",
  55267. // "location": "path",
  55268. // "required": true,
  55269. // "type": "string"
  55270. // }
  55271. // },
  55272. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}",
  55273. // "response": {
  55274. // "$ref": "InstanceGroupManager"
  55275. // },
  55276. // "scopes": [
  55277. // "https://www.googleapis.com/auth/cloud-platform",
  55278. // "https://www.googleapis.com/auth/compute",
  55279. // "https://www.googleapis.com/auth/compute.readonly"
  55280. // ]
  55281. // }
  55282. }
  55283. // method id "compute.instanceGroupManagers.insert":
  55284. type InstanceGroupManagersInsertCall struct {
  55285. s *Service
  55286. project string
  55287. zone string
  55288. instancegroupmanager *InstanceGroupManager
  55289. urlParams_ gensupport.URLParams
  55290. ctx_ context.Context
  55291. header_ http.Header
  55292. }
  55293. // Insert: Creates a managed instance group using the information that
  55294. // you specify in the request. After the group is created, it schedules
  55295. // an action to create instances in the group using the specified
  55296. // instance template. This operation is marked as DONE when the group is
  55297. // created even if the instances in the group have not yet been created.
  55298. // You must separately verify the status of the individual instances
  55299. // with the listmanagedinstances method.
  55300. //
  55301. // A managed instance group can have up to 1000 VM instances per group.
  55302. // Please contact Cloud Support if you need an increase in this limit.
  55303. func (r *InstanceGroupManagersService) Insert(project string, zone string, instancegroupmanager *InstanceGroupManager) *InstanceGroupManagersInsertCall {
  55304. c := &InstanceGroupManagersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  55305. c.project = project
  55306. c.zone = zone
  55307. c.instancegroupmanager = instancegroupmanager
  55308. return c
  55309. }
  55310. // RequestId sets the optional parameter "requestId": An optional
  55311. // request ID to identify requests. Specify a unique request ID so that
  55312. // if you must retry your request, the server will know to ignore the
  55313. // request if it has already been completed.
  55314. //
  55315. // For example, consider a situation where you make an initial request
  55316. // and the request times out. If you make the request again with the
  55317. // same request ID, the server can check if original operation with the
  55318. // same request ID was received, and if so, will ignore the second
  55319. // request. This prevents clients from accidentally creating duplicate
  55320. // commitments.
  55321. //
  55322. // The request ID must be a valid UUID with the exception that zero UUID
  55323. // is not supported (00000000-0000-0000-0000-000000000000).
  55324. func (c *InstanceGroupManagersInsertCall) RequestId(requestId string) *InstanceGroupManagersInsertCall {
  55325. c.urlParams_.Set("requestId", requestId)
  55326. return c
  55327. }
  55328. // Fields allows partial responses to be retrieved. See
  55329. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  55330. // for more information.
  55331. func (c *InstanceGroupManagersInsertCall) Fields(s ...googleapi.Field) *InstanceGroupManagersInsertCall {
  55332. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  55333. return c
  55334. }
  55335. // Context sets the context to be used in this call's Do method. Any
  55336. // pending HTTP request will be aborted if the provided context is
  55337. // canceled.
  55338. func (c *InstanceGroupManagersInsertCall) Context(ctx context.Context) *InstanceGroupManagersInsertCall {
  55339. c.ctx_ = ctx
  55340. return c
  55341. }
  55342. // Header returns an http.Header that can be modified by the caller to
  55343. // add HTTP headers to the request.
  55344. func (c *InstanceGroupManagersInsertCall) Header() http.Header {
  55345. if c.header_ == nil {
  55346. c.header_ = make(http.Header)
  55347. }
  55348. return c.header_
  55349. }
  55350. func (c *InstanceGroupManagersInsertCall) doRequest(alt string) (*http.Response, error) {
  55351. reqHeaders := make(http.Header)
  55352. for k, v := range c.header_ {
  55353. reqHeaders[k] = v
  55354. }
  55355. reqHeaders.Set("User-Agent", c.s.userAgent())
  55356. var body io.Reader = nil
  55357. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager)
  55358. if err != nil {
  55359. return nil, err
  55360. }
  55361. reqHeaders.Set("Content-Type", "application/json")
  55362. c.urlParams_.Set("alt", alt)
  55363. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers")
  55364. urls += "?" + c.urlParams_.Encode()
  55365. req, _ := http.NewRequest("POST", urls, body)
  55366. req.Header = reqHeaders
  55367. googleapi.Expand(req.URL, map[string]string{
  55368. "project": c.project,
  55369. "zone": c.zone,
  55370. })
  55371. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  55372. }
  55373. // Do executes the "compute.instanceGroupManagers.insert" call.
  55374. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  55375. // status code is an error. Response headers are in either
  55376. // *Operation.ServerResponse.Header or (if a response was returned at
  55377. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  55378. // to check whether the returned error was because
  55379. // http.StatusNotModified was returned.
  55380. func (c *InstanceGroupManagersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  55381. gensupport.SetOptions(c.urlParams_, opts...)
  55382. res, err := c.doRequest("json")
  55383. if res != nil && res.StatusCode == http.StatusNotModified {
  55384. if res.Body != nil {
  55385. res.Body.Close()
  55386. }
  55387. return nil, &googleapi.Error{
  55388. Code: res.StatusCode,
  55389. Header: res.Header,
  55390. }
  55391. }
  55392. if err != nil {
  55393. return nil, err
  55394. }
  55395. defer googleapi.CloseBody(res)
  55396. if err := googleapi.CheckResponse(res); err != nil {
  55397. return nil, err
  55398. }
  55399. ret := &Operation{
  55400. ServerResponse: googleapi.ServerResponse{
  55401. Header: res.Header,
  55402. HTTPStatusCode: res.StatusCode,
  55403. },
  55404. }
  55405. target := &ret
  55406. if err := gensupport.DecodeResponse(target, res); err != nil {
  55407. return nil, err
  55408. }
  55409. return ret, nil
  55410. // {
  55411. // "description": "Creates a managed instance group using the information that you specify in the request. After the group is created, it schedules an action to create instances in the group using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the group have not yet been created. You must separately verify the status of the individual instances with the listmanagedinstances method.\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.",
  55412. // "httpMethod": "POST",
  55413. // "id": "compute.instanceGroupManagers.insert",
  55414. // "parameterOrder": [
  55415. // "project",
  55416. // "zone"
  55417. // ],
  55418. // "parameters": {
  55419. // "project": {
  55420. // "description": "Project ID for this request.",
  55421. // "location": "path",
  55422. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  55423. // "required": true,
  55424. // "type": "string"
  55425. // },
  55426. // "requestId": {
  55427. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  55428. // "location": "query",
  55429. // "type": "string"
  55430. // },
  55431. // "zone": {
  55432. // "description": "The name of the zone where you want to create the managed instance group.",
  55433. // "location": "path",
  55434. // "required": true,
  55435. // "type": "string"
  55436. // }
  55437. // },
  55438. // "path": "{project}/zones/{zone}/instanceGroupManagers",
  55439. // "request": {
  55440. // "$ref": "InstanceGroupManager"
  55441. // },
  55442. // "response": {
  55443. // "$ref": "Operation"
  55444. // },
  55445. // "scopes": [
  55446. // "https://www.googleapis.com/auth/cloud-platform",
  55447. // "https://www.googleapis.com/auth/compute"
  55448. // ]
  55449. // }
  55450. }
  55451. // method id "compute.instanceGroupManagers.list":
  55452. type InstanceGroupManagersListCall struct {
  55453. s *Service
  55454. project string
  55455. zone string
  55456. urlParams_ gensupport.URLParams
  55457. ifNoneMatch_ string
  55458. ctx_ context.Context
  55459. header_ http.Header
  55460. }
  55461. // List: Retrieves a list of managed instance groups that are contained
  55462. // within the specified project and zone.
  55463. func (r *InstanceGroupManagersService) List(project string, zone string) *InstanceGroupManagersListCall {
  55464. c := &InstanceGroupManagersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  55465. c.project = project
  55466. c.zone = zone
  55467. return c
  55468. }
  55469. // Filter sets the optional parameter "filter": A filter expression that
  55470. // filters resources listed in the response. The expression must specify
  55471. // the field name, a comparison operator, and the value that you want to
  55472. // use for filtering. The value must be a string, a number, or a
  55473. // boolean. The comparison operator must be either =, !=, >, or <.
  55474. //
  55475. // For example, if you are filtering Compute Engine instances, you can
  55476. // exclude instances named example-instance by specifying name !=
  55477. // example-instance.
  55478. //
  55479. // You can also filter nested fields. For example, you could specify
  55480. // scheduling.automaticRestart = false to include instances only if they
  55481. // are not scheduled for automatic restarts. You can use filtering on
  55482. // nested fields to filter based on resource labels.
  55483. //
  55484. // To filter on multiple expressions, provide each separate expression
  55485. // within parentheses. For example, (scheduling.automaticRestart = true)
  55486. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  55487. // AND expression. However, you can include AND and OR expressions
  55488. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  55489. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  55490. // true).
  55491. func (c *InstanceGroupManagersListCall) Filter(filter string) *InstanceGroupManagersListCall {
  55492. c.urlParams_.Set("filter", filter)
  55493. return c
  55494. }
  55495. // MaxResults sets the optional parameter "maxResults": The maximum
  55496. // number of results per page that should be returned. If the number of
  55497. // available results is larger than maxResults, Compute Engine returns a
  55498. // nextPageToken that can be used to get the next page of results in
  55499. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  55500. // (Default: 500)
  55501. func (c *InstanceGroupManagersListCall) MaxResults(maxResults int64) *InstanceGroupManagersListCall {
  55502. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  55503. return c
  55504. }
  55505. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  55506. // a certain order. By default, results are returned in alphanumerical
  55507. // order based on the resource name.
  55508. //
  55509. // You can also sort results in descending order based on the creation
  55510. // timestamp using orderBy="creationTimestamp desc". This sorts results
  55511. // based on the creationTimestamp field in reverse chronological order
  55512. // (newest result first). Use this to sort resources like operations so
  55513. // that the newest operation is returned first.
  55514. //
  55515. // Currently, only sorting by name or creationTimestamp desc is
  55516. // supported.
  55517. func (c *InstanceGroupManagersListCall) OrderBy(orderBy string) *InstanceGroupManagersListCall {
  55518. c.urlParams_.Set("orderBy", orderBy)
  55519. return c
  55520. }
  55521. // PageToken sets the optional parameter "pageToken": Specifies a page
  55522. // token to use. Set pageToken to the nextPageToken returned by a
  55523. // previous list request to get the next page of results.
  55524. func (c *InstanceGroupManagersListCall) PageToken(pageToken string) *InstanceGroupManagersListCall {
  55525. c.urlParams_.Set("pageToken", pageToken)
  55526. return c
  55527. }
  55528. // Fields allows partial responses to be retrieved. See
  55529. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  55530. // for more information.
  55531. func (c *InstanceGroupManagersListCall) Fields(s ...googleapi.Field) *InstanceGroupManagersListCall {
  55532. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  55533. return c
  55534. }
  55535. // IfNoneMatch sets the optional parameter which makes the operation
  55536. // fail if the object's ETag matches the given value. This is useful for
  55537. // getting updates only after the object has changed since the last
  55538. // request. Use googleapi.IsNotModified to check whether the response
  55539. // error from Do is the result of In-None-Match.
  55540. func (c *InstanceGroupManagersListCall) IfNoneMatch(entityTag string) *InstanceGroupManagersListCall {
  55541. c.ifNoneMatch_ = entityTag
  55542. return c
  55543. }
  55544. // Context sets the context to be used in this call's Do method. Any
  55545. // pending HTTP request will be aborted if the provided context is
  55546. // canceled.
  55547. func (c *InstanceGroupManagersListCall) Context(ctx context.Context) *InstanceGroupManagersListCall {
  55548. c.ctx_ = ctx
  55549. return c
  55550. }
  55551. // Header returns an http.Header that can be modified by the caller to
  55552. // add HTTP headers to the request.
  55553. func (c *InstanceGroupManagersListCall) Header() http.Header {
  55554. if c.header_ == nil {
  55555. c.header_ = make(http.Header)
  55556. }
  55557. return c.header_
  55558. }
  55559. func (c *InstanceGroupManagersListCall) doRequest(alt string) (*http.Response, error) {
  55560. reqHeaders := make(http.Header)
  55561. for k, v := range c.header_ {
  55562. reqHeaders[k] = v
  55563. }
  55564. reqHeaders.Set("User-Agent", c.s.userAgent())
  55565. if c.ifNoneMatch_ != "" {
  55566. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  55567. }
  55568. var body io.Reader = nil
  55569. c.urlParams_.Set("alt", alt)
  55570. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers")
  55571. urls += "?" + c.urlParams_.Encode()
  55572. req, _ := http.NewRequest("GET", urls, body)
  55573. req.Header = reqHeaders
  55574. googleapi.Expand(req.URL, map[string]string{
  55575. "project": c.project,
  55576. "zone": c.zone,
  55577. })
  55578. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  55579. }
  55580. // Do executes the "compute.instanceGroupManagers.list" call.
  55581. // Exactly one of *InstanceGroupManagerList or error will be non-nil.
  55582. // Any non-2xx status code is an error. Response headers are in either
  55583. // *InstanceGroupManagerList.ServerResponse.Header or (if a response was
  55584. // returned at all) in error.(*googleapi.Error).Header. Use
  55585. // googleapi.IsNotModified to check whether the returned error was
  55586. // because http.StatusNotModified was returned.
  55587. func (c *InstanceGroupManagersListCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManagerList, error) {
  55588. gensupport.SetOptions(c.urlParams_, opts...)
  55589. res, err := c.doRequest("json")
  55590. if res != nil && res.StatusCode == http.StatusNotModified {
  55591. if res.Body != nil {
  55592. res.Body.Close()
  55593. }
  55594. return nil, &googleapi.Error{
  55595. Code: res.StatusCode,
  55596. Header: res.Header,
  55597. }
  55598. }
  55599. if err != nil {
  55600. return nil, err
  55601. }
  55602. defer googleapi.CloseBody(res)
  55603. if err := googleapi.CheckResponse(res); err != nil {
  55604. return nil, err
  55605. }
  55606. ret := &InstanceGroupManagerList{
  55607. ServerResponse: googleapi.ServerResponse{
  55608. Header: res.Header,
  55609. HTTPStatusCode: res.StatusCode,
  55610. },
  55611. }
  55612. target := &ret
  55613. if err := gensupport.DecodeResponse(target, res); err != nil {
  55614. return nil, err
  55615. }
  55616. return ret, nil
  55617. // {
  55618. // "description": "Retrieves a list of managed instance groups that are contained within the specified project and zone.",
  55619. // "httpMethod": "GET",
  55620. // "id": "compute.instanceGroupManagers.list",
  55621. // "parameterOrder": [
  55622. // "project",
  55623. // "zone"
  55624. // ],
  55625. // "parameters": {
  55626. // "filter": {
  55627. // "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).",
  55628. // "location": "query",
  55629. // "type": "string"
  55630. // },
  55631. // "maxResults": {
  55632. // "default": "500",
  55633. // "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)",
  55634. // "format": "uint32",
  55635. // "location": "query",
  55636. // "minimum": "0",
  55637. // "type": "integer"
  55638. // },
  55639. // "orderBy": {
  55640. // "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.",
  55641. // "location": "query",
  55642. // "type": "string"
  55643. // },
  55644. // "pageToken": {
  55645. // "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.",
  55646. // "location": "query",
  55647. // "type": "string"
  55648. // },
  55649. // "project": {
  55650. // "description": "Project ID for this request.",
  55651. // "location": "path",
  55652. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  55653. // "required": true,
  55654. // "type": "string"
  55655. // },
  55656. // "zone": {
  55657. // "description": "The name of the zone where the managed instance group is located.",
  55658. // "location": "path",
  55659. // "required": true,
  55660. // "type": "string"
  55661. // }
  55662. // },
  55663. // "path": "{project}/zones/{zone}/instanceGroupManagers",
  55664. // "response": {
  55665. // "$ref": "InstanceGroupManagerList"
  55666. // },
  55667. // "scopes": [
  55668. // "https://www.googleapis.com/auth/cloud-platform",
  55669. // "https://www.googleapis.com/auth/compute",
  55670. // "https://www.googleapis.com/auth/compute.readonly"
  55671. // ]
  55672. // }
  55673. }
  55674. // Pages invokes f for each page of results.
  55675. // A non-nil error returned from f will halt the iteration.
  55676. // The provided context supersedes any context provided to the Context method.
  55677. func (c *InstanceGroupManagersListCall) Pages(ctx context.Context, f func(*InstanceGroupManagerList) error) error {
  55678. c.ctx_ = ctx
  55679. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  55680. for {
  55681. x, err := c.Do()
  55682. if err != nil {
  55683. return err
  55684. }
  55685. if err := f(x); err != nil {
  55686. return err
  55687. }
  55688. if x.NextPageToken == "" {
  55689. return nil
  55690. }
  55691. c.PageToken(x.NextPageToken)
  55692. }
  55693. }
  55694. // method id "compute.instanceGroupManagers.listManagedInstances":
  55695. type InstanceGroupManagersListManagedInstancesCall struct {
  55696. s *Service
  55697. project string
  55698. zone string
  55699. instanceGroupManager string
  55700. urlParams_ gensupport.URLParams
  55701. ctx_ context.Context
  55702. header_ http.Header
  55703. }
  55704. // ListManagedInstances: Lists all of the instances in the managed
  55705. // instance group. Each instance in the list has a currentAction, which
  55706. // indicates the action that the managed instance group is performing on
  55707. // the instance. For example, if the group is still creating an
  55708. // instance, the currentAction is CREATING. If a previous action failed,
  55709. // the list displays the errors for that failed action.
  55710. func (r *InstanceGroupManagersService) ListManagedInstances(project string, zone string, instanceGroupManager string) *InstanceGroupManagersListManagedInstancesCall {
  55711. c := &InstanceGroupManagersListManagedInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  55712. c.project = project
  55713. c.zone = zone
  55714. c.instanceGroupManager = instanceGroupManager
  55715. return c
  55716. }
  55717. // Filter sets the optional parameter "filter":
  55718. func (c *InstanceGroupManagersListManagedInstancesCall) Filter(filter string) *InstanceGroupManagersListManagedInstancesCall {
  55719. c.urlParams_.Set("filter", filter)
  55720. return c
  55721. }
  55722. // MaxResults sets the optional parameter "maxResults":
  55723. func (c *InstanceGroupManagersListManagedInstancesCall) MaxResults(maxResults int64) *InstanceGroupManagersListManagedInstancesCall {
  55724. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  55725. return c
  55726. }
  55727. // OrderBy sets the optional parameter "order_by":
  55728. func (c *InstanceGroupManagersListManagedInstancesCall) OrderBy(orderBy string) *InstanceGroupManagersListManagedInstancesCall {
  55729. c.urlParams_.Set("order_by", orderBy)
  55730. return c
  55731. }
  55732. // PageToken sets the optional parameter "pageToken":
  55733. func (c *InstanceGroupManagersListManagedInstancesCall) PageToken(pageToken string) *InstanceGroupManagersListManagedInstancesCall {
  55734. c.urlParams_.Set("pageToken", pageToken)
  55735. return c
  55736. }
  55737. // Fields allows partial responses to be retrieved. See
  55738. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  55739. // for more information.
  55740. func (c *InstanceGroupManagersListManagedInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersListManagedInstancesCall {
  55741. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  55742. return c
  55743. }
  55744. // Context sets the context to be used in this call's Do method. Any
  55745. // pending HTTP request will be aborted if the provided context is
  55746. // canceled.
  55747. func (c *InstanceGroupManagersListManagedInstancesCall) Context(ctx context.Context) *InstanceGroupManagersListManagedInstancesCall {
  55748. c.ctx_ = ctx
  55749. return c
  55750. }
  55751. // Header returns an http.Header that can be modified by the caller to
  55752. // add HTTP headers to the request.
  55753. func (c *InstanceGroupManagersListManagedInstancesCall) Header() http.Header {
  55754. if c.header_ == nil {
  55755. c.header_ = make(http.Header)
  55756. }
  55757. return c.header_
  55758. }
  55759. func (c *InstanceGroupManagersListManagedInstancesCall) doRequest(alt string) (*http.Response, error) {
  55760. reqHeaders := make(http.Header)
  55761. for k, v := range c.header_ {
  55762. reqHeaders[k] = v
  55763. }
  55764. reqHeaders.Set("User-Agent", c.s.userAgent())
  55765. var body io.Reader = nil
  55766. c.urlParams_.Set("alt", alt)
  55767. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances")
  55768. urls += "?" + c.urlParams_.Encode()
  55769. req, _ := http.NewRequest("POST", urls, body)
  55770. req.Header = reqHeaders
  55771. googleapi.Expand(req.URL, map[string]string{
  55772. "project": c.project,
  55773. "zone": c.zone,
  55774. "instanceGroupManager": c.instanceGroupManager,
  55775. })
  55776. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  55777. }
  55778. // Do executes the "compute.instanceGroupManagers.listManagedInstances" call.
  55779. // Exactly one of *InstanceGroupManagersListManagedInstancesResponse or
  55780. // error will be non-nil. Any non-2xx status code is an error. Response
  55781. // headers are in either
  55782. // *InstanceGroupManagersListManagedInstancesResponse.ServerResponse.Head
  55783. // er or (if a response was returned at all) in
  55784. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  55785. // whether the returned error was because http.StatusNotModified was
  55786. // returned.
  55787. func (c *InstanceGroupManagersListManagedInstancesCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManagersListManagedInstancesResponse, error) {
  55788. gensupport.SetOptions(c.urlParams_, opts...)
  55789. res, err := c.doRequest("json")
  55790. if res != nil && res.StatusCode == http.StatusNotModified {
  55791. if res.Body != nil {
  55792. res.Body.Close()
  55793. }
  55794. return nil, &googleapi.Error{
  55795. Code: res.StatusCode,
  55796. Header: res.Header,
  55797. }
  55798. }
  55799. if err != nil {
  55800. return nil, err
  55801. }
  55802. defer googleapi.CloseBody(res)
  55803. if err := googleapi.CheckResponse(res); err != nil {
  55804. return nil, err
  55805. }
  55806. ret := &InstanceGroupManagersListManagedInstancesResponse{
  55807. ServerResponse: googleapi.ServerResponse{
  55808. Header: res.Header,
  55809. HTTPStatusCode: res.StatusCode,
  55810. },
  55811. }
  55812. target := &ret
  55813. if err := gensupport.DecodeResponse(target, res); err != nil {
  55814. return nil, err
  55815. }
  55816. return ret, nil
  55817. // {
  55818. // "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.",
  55819. // "httpMethod": "POST",
  55820. // "id": "compute.instanceGroupManagers.listManagedInstances",
  55821. // "parameterOrder": [
  55822. // "project",
  55823. // "zone",
  55824. // "instanceGroupManager"
  55825. // ],
  55826. // "parameters": {
  55827. // "filter": {
  55828. // "location": "query",
  55829. // "type": "string"
  55830. // },
  55831. // "instanceGroupManager": {
  55832. // "description": "The name of the managed instance group.",
  55833. // "location": "path",
  55834. // "required": true,
  55835. // "type": "string"
  55836. // },
  55837. // "maxResults": {
  55838. // "default": "500",
  55839. // "format": "uint32",
  55840. // "location": "query",
  55841. // "minimum": "0",
  55842. // "type": "integer"
  55843. // },
  55844. // "order_by": {
  55845. // "location": "query",
  55846. // "type": "string"
  55847. // },
  55848. // "pageToken": {
  55849. // "location": "query",
  55850. // "type": "string"
  55851. // },
  55852. // "project": {
  55853. // "description": "Project ID for this request.",
  55854. // "location": "path",
  55855. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  55856. // "required": true,
  55857. // "type": "string"
  55858. // },
  55859. // "zone": {
  55860. // "description": "The name of the zone where the managed instance group is located.",
  55861. // "location": "path",
  55862. // "required": true,
  55863. // "type": "string"
  55864. // }
  55865. // },
  55866. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances",
  55867. // "response": {
  55868. // "$ref": "InstanceGroupManagersListManagedInstancesResponse"
  55869. // },
  55870. // "scopes": [
  55871. // "https://www.googleapis.com/auth/cloud-platform",
  55872. // "https://www.googleapis.com/auth/compute",
  55873. // "https://www.googleapis.com/auth/compute.readonly"
  55874. // ]
  55875. // }
  55876. }
  55877. // Pages invokes f for each page of results.
  55878. // A non-nil error returned from f will halt the iteration.
  55879. // The provided context supersedes any context provided to the Context method.
  55880. func (c *InstanceGroupManagersListManagedInstancesCall) Pages(ctx context.Context, f func(*InstanceGroupManagersListManagedInstancesResponse) error) error {
  55881. c.ctx_ = ctx
  55882. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  55883. for {
  55884. x, err := c.Do()
  55885. if err != nil {
  55886. return err
  55887. }
  55888. if err := f(x); err != nil {
  55889. return err
  55890. }
  55891. if x.NextPageToken == "" {
  55892. return nil
  55893. }
  55894. c.PageToken(x.NextPageToken)
  55895. }
  55896. }
  55897. // method id "compute.instanceGroupManagers.listPerInstanceConfigs":
  55898. type InstanceGroupManagersListPerInstanceConfigsCall struct {
  55899. s *Service
  55900. project string
  55901. zone string
  55902. instanceGroupManager string
  55903. urlParams_ gensupport.URLParams
  55904. ctx_ context.Context
  55905. header_ http.Header
  55906. }
  55907. // ListPerInstanceConfigs: Lists all of the per-instance configs defined
  55908. // for the managed instance group.
  55909. func (r *InstanceGroupManagersService) ListPerInstanceConfigs(project string, zone string, instanceGroupManager string) *InstanceGroupManagersListPerInstanceConfigsCall {
  55910. c := &InstanceGroupManagersListPerInstanceConfigsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  55911. c.project = project
  55912. c.zone = zone
  55913. c.instanceGroupManager = instanceGroupManager
  55914. return c
  55915. }
  55916. // Filter sets the optional parameter "filter": A filter expression that
  55917. // filters resources listed in the response. The expression must specify
  55918. // the field name, a comparison operator, and the value that you want to
  55919. // use for filtering. The value must be a string, a number, or a
  55920. // boolean. The comparison operator must be either =, !=, >, or <.
  55921. //
  55922. // For example, if you are filtering Compute Engine instances, you can
  55923. // exclude instances named example-instance by specifying name !=
  55924. // example-instance.
  55925. //
  55926. // You can also filter nested fields. For example, you could specify
  55927. // scheduling.automaticRestart = false to include instances only if they
  55928. // are not scheduled for automatic restarts. You can use filtering on
  55929. // nested fields to filter based on resource labels.
  55930. //
  55931. // To filter on multiple expressions, provide each separate expression
  55932. // within parentheses. For example, (scheduling.automaticRestart = true)
  55933. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  55934. // AND expression. However, you can include AND and OR expressions
  55935. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  55936. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  55937. // true).
  55938. func (c *InstanceGroupManagersListPerInstanceConfigsCall) Filter(filter string) *InstanceGroupManagersListPerInstanceConfigsCall {
  55939. c.urlParams_.Set("filter", filter)
  55940. return c
  55941. }
  55942. // MaxResults sets the optional parameter "maxResults": The maximum
  55943. // number of results per page that should be returned. If the number of
  55944. // available results is larger than maxResults, Compute Engine returns a
  55945. // nextPageToken that can be used to get the next page of results in
  55946. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  55947. // (Default: 500)
  55948. func (c *InstanceGroupManagersListPerInstanceConfigsCall) MaxResults(maxResults int64) *InstanceGroupManagersListPerInstanceConfigsCall {
  55949. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  55950. return c
  55951. }
  55952. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  55953. // a certain order. By default, results are returned in alphanumerical
  55954. // order based on the resource name.
  55955. //
  55956. // You can also sort results in descending order based on the creation
  55957. // timestamp using orderBy="creationTimestamp desc". This sorts results
  55958. // based on the creationTimestamp field in reverse chronological order
  55959. // (newest result first). Use this to sort resources like operations so
  55960. // that the newest operation is returned first.
  55961. //
  55962. // Currently, only sorting by name or creationTimestamp desc is
  55963. // supported.
  55964. func (c *InstanceGroupManagersListPerInstanceConfigsCall) OrderBy(orderBy string) *InstanceGroupManagersListPerInstanceConfigsCall {
  55965. c.urlParams_.Set("orderBy", orderBy)
  55966. return c
  55967. }
  55968. // PageToken sets the optional parameter "pageToken": Specifies a page
  55969. // token to use. Set pageToken to the nextPageToken returned by a
  55970. // previous list request to get the next page of results.
  55971. func (c *InstanceGroupManagersListPerInstanceConfigsCall) PageToken(pageToken string) *InstanceGroupManagersListPerInstanceConfigsCall {
  55972. c.urlParams_.Set("pageToken", pageToken)
  55973. return c
  55974. }
  55975. // Fields allows partial responses to be retrieved. See
  55976. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  55977. // for more information.
  55978. func (c *InstanceGroupManagersListPerInstanceConfigsCall) Fields(s ...googleapi.Field) *InstanceGroupManagersListPerInstanceConfigsCall {
  55979. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  55980. return c
  55981. }
  55982. // Context sets the context to be used in this call's Do method. Any
  55983. // pending HTTP request will be aborted if the provided context is
  55984. // canceled.
  55985. func (c *InstanceGroupManagersListPerInstanceConfigsCall) Context(ctx context.Context) *InstanceGroupManagersListPerInstanceConfigsCall {
  55986. c.ctx_ = ctx
  55987. return c
  55988. }
  55989. // Header returns an http.Header that can be modified by the caller to
  55990. // add HTTP headers to the request.
  55991. func (c *InstanceGroupManagersListPerInstanceConfigsCall) Header() http.Header {
  55992. if c.header_ == nil {
  55993. c.header_ = make(http.Header)
  55994. }
  55995. return c.header_
  55996. }
  55997. func (c *InstanceGroupManagersListPerInstanceConfigsCall) doRequest(alt string) (*http.Response, error) {
  55998. reqHeaders := make(http.Header)
  55999. for k, v := range c.header_ {
  56000. reqHeaders[k] = v
  56001. }
  56002. reqHeaders.Set("User-Agent", c.s.userAgent())
  56003. var body io.Reader = nil
  56004. c.urlParams_.Set("alt", alt)
  56005. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listPerInstanceConfigs")
  56006. urls += "?" + c.urlParams_.Encode()
  56007. req, _ := http.NewRequest("POST", urls, body)
  56008. req.Header = reqHeaders
  56009. googleapi.Expand(req.URL, map[string]string{
  56010. "project": c.project,
  56011. "zone": c.zone,
  56012. "instanceGroupManager": c.instanceGroupManager,
  56013. })
  56014. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  56015. }
  56016. // Do executes the "compute.instanceGroupManagers.listPerInstanceConfigs" call.
  56017. // Exactly one of *InstanceGroupManagersListPerInstanceConfigsResp or
  56018. // error will be non-nil. Any non-2xx status code is an error. Response
  56019. // headers are in either
  56020. // *InstanceGroupManagersListPerInstanceConfigsResp.ServerResponse.Header
  56021. // or (if a response was returned at all) in
  56022. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  56023. // whether the returned error was because http.StatusNotModified was
  56024. // returned.
  56025. func (c *InstanceGroupManagersListPerInstanceConfigsCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManagersListPerInstanceConfigsResp, error) {
  56026. gensupport.SetOptions(c.urlParams_, opts...)
  56027. res, err := c.doRequest("json")
  56028. if res != nil && res.StatusCode == http.StatusNotModified {
  56029. if res.Body != nil {
  56030. res.Body.Close()
  56031. }
  56032. return nil, &googleapi.Error{
  56033. Code: res.StatusCode,
  56034. Header: res.Header,
  56035. }
  56036. }
  56037. if err != nil {
  56038. return nil, err
  56039. }
  56040. defer googleapi.CloseBody(res)
  56041. if err := googleapi.CheckResponse(res); err != nil {
  56042. return nil, err
  56043. }
  56044. ret := &InstanceGroupManagersListPerInstanceConfigsResp{
  56045. ServerResponse: googleapi.ServerResponse{
  56046. Header: res.Header,
  56047. HTTPStatusCode: res.StatusCode,
  56048. },
  56049. }
  56050. target := &ret
  56051. if err := gensupport.DecodeResponse(target, res); err != nil {
  56052. return nil, err
  56053. }
  56054. return ret, nil
  56055. // {
  56056. // "description": "Lists all of the per-instance configs defined for the managed instance group.",
  56057. // "httpMethod": "POST",
  56058. // "id": "compute.instanceGroupManagers.listPerInstanceConfigs",
  56059. // "parameterOrder": [
  56060. // "project",
  56061. // "zone",
  56062. // "instanceGroupManager"
  56063. // ],
  56064. // "parameters": {
  56065. // "filter": {
  56066. // "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).",
  56067. // "location": "query",
  56068. // "type": "string"
  56069. // },
  56070. // "instanceGroupManager": {
  56071. // "description": "The name of the managed instance group. It should conform to RFC1035.",
  56072. // "location": "path",
  56073. // "required": true,
  56074. // "type": "string"
  56075. // },
  56076. // "maxResults": {
  56077. // "default": "500",
  56078. // "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)",
  56079. // "format": "uint32",
  56080. // "location": "query",
  56081. // "minimum": "0",
  56082. // "type": "integer"
  56083. // },
  56084. // "orderBy": {
  56085. // "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.",
  56086. // "location": "query",
  56087. // "type": "string"
  56088. // },
  56089. // "pageToken": {
  56090. // "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.",
  56091. // "location": "query",
  56092. // "type": "string"
  56093. // },
  56094. // "project": {
  56095. // "description": "Project ID for this request.",
  56096. // "location": "path",
  56097. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  56098. // "required": true,
  56099. // "type": "string"
  56100. // },
  56101. // "zone": {
  56102. // "description": "The name of the zone where the managed instance group is located. It should conform to RFC1035.",
  56103. // "location": "path",
  56104. // "required": true,
  56105. // "type": "string"
  56106. // }
  56107. // },
  56108. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listPerInstanceConfigs",
  56109. // "response": {
  56110. // "$ref": "InstanceGroupManagersListPerInstanceConfigsResp"
  56111. // },
  56112. // "scopes": [
  56113. // "https://www.googleapis.com/auth/cloud-platform",
  56114. // "https://www.googleapis.com/auth/compute",
  56115. // "https://www.googleapis.com/auth/compute.readonly"
  56116. // ]
  56117. // }
  56118. }
  56119. // Pages invokes f for each page of results.
  56120. // A non-nil error returned from f will halt the iteration.
  56121. // The provided context supersedes any context provided to the Context method.
  56122. func (c *InstanceGroupManagersListPerInstanceConfigsCall) Pages(ctx context.Context, f func(*InstanceGroupManagersListPerInstanceConfigsResp) error) error {
  56123. c.ctx_ = ctx
  56124. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  56125. for {
  56126. x, err := c.Do()
  56127. if err != nil {
  56128. return err
  56129. }
  56130. if err := f(x); err != nil {
  56131. return err
  56132. }
  56133. if x.NextPageToken == "" {
  56134. return nil
  56135. }
  56136. c.PageToken(x.NextPageToken)
  56137. }
  56138. }
  56139. // method id "compute.instanceGroupManagers.patch":
  56140. type InstanceGroupManagersPatchCall struct {
  56141. s *Service
  56142. project string
  56143. zone string
  56144. instanceGroupManager string
  56145. instancegroupmanager *InstanceGroupManager
  56146. urlParams_ gensupport.URLParams
  56147. ctx_ context.Context
  56148. header_ http.Header
  56149. }
  56150. // Patch: Updates a managed instance group using the information that
  56151. // you specify in the request. This operation is marked as DONE when the
  56152. // group is patched even if the instances in the group are still in the
  56153. // process of being patched. You must separately verify the status of
  56154. // the individual instances with the listManagedInstances method. This
  56155. // method supports PATCH semantics and uses the JSON merge patch format
  56156. // and processing rules.
  56157. func (r *InstanceGroupManagersService) Patch(project string, zone string, instanceGroupManager string, instancegroupmanager *InstanceGroupManager) *InstanceGroupManagersPatchCall {
  56158. c := &InstanceGroupManagersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  56159. c.project = project
  56160. c.zone = zone
  56161. c.instanceGroupManager = instanceGroupManager
  56162. c.instancegroupmanager = instancegroupmanager
  56163. return c
  56164. }
  56165. // RequestId sets the optional parameter "requestId": An optional
  56166. // request ID to identify requests. Specify a unique request ID so that
  56167. // if you must retry your request, the server will know to ignore the
  56168. // request if it has already been completed.
  56169. //
  56170. // For example, consider a situation where you make an initial request
  56171. // and the request times out. If you make the request again with the
  56172. // same request ID, the server can check if original operation with the
  56173. // same request ID was received, and if so, will ignore the second
  56174. // request. This prevents clients from accidentally creating duplicate
  56175. // commitments.
  56176. //
  56177. // The request ID must be a valid UUID with the exception that zero UUID
  56178. // is not supported (00000000-0000-0000-0000-000000000000).
  56179. func (c *InstanceGroupManagersPatchCall) RequestId(requestId string) *InstanceGroupManagersPatchCall {
  56180. c.urlParams_.Set("requestId", requestId)
  56181. return c
  56182. }
  56183. // Fields allows partial responses to be retrieved. See
  56184. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  56185. // for more information.
  56186. func (c *InstanceGroupManagersPatchCall) Fields(s ...googleapi.Field) *InstanceGroupManagersPatchCall {
  56187. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  56188. return c
  56189. }
  56190. // Context sets the context to be used in this call's Do method. Any
  56191. // pending HTTP request will be aborted if the provided context is
  56192. // canceled.
  56193. func (c *InstanceGroupManagersPatchCall) Context(ctx context.Context) *InstanceGroupManagersPatchCall {
  56194. c.ctx_ = ctx
  56195. return c
  56196. }
  56197. // Header returns an http.Header that can be modified by the caller to
  56198. // add HTTP headers to the request.
  56199. func (c *InstanceGroupManagersPatchCall) Header() http.Header {
  56200. if c.header_ == nil {
  56201. c.header_ = make(http.Header)
  56202. }
  56203. return c.header_
  56204. }
  56205. func (c *InstanceGroupManagersPatchCall) doRequest(alt string) (*http.Response, error) {
  56206. reqHeaders := make(http.Header)
  56207. for k, v := range c.header_ {
  56208. reqHeaders[k] = v
  56209. }
  56210. reqHeaders.Set("User-Agent", c.s.userAgent())
  56211. var body io.Reader = nil
  56212. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager)
  56213. if err != nil {
  56214. return nil, err
  56215. }
  56216. reqHeaders.Set("Content-Type", "application/json")
  56217. c.urlParams_.Set("alt", alt)
  56218. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}")
  56219. urls += "?" + c.urlParams_.Encode()
  56220. req, _ := http.NewRequest("PATCH", urls, body)
  56221. req.Header = reqHeaders
  56222. googleapi.Expand(req.URL, map[string]string{
  56223. "project": c.project,
  56224. "zone": c.zone,
  56225. "instanceGroupManager": c.instanceGroupManager,
  56226. })
  56227. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  56228. }
  56229. // Do executes the "compute.instanceGroupManagers.patch" call.
  56230. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  56231. // status code is an error. Response headers are in either
  56232. // *Operation.ServerResponse.Header or (if a response was returned at
  56233. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  56234. // to check whether the returned error was because
  56235. // http.StatusNotModified was returned.
  56236. func (c *InstanceGroupManagersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  56237. gensupport.SetOptions(c.urlParams_, opts...)
  56238. res, err := c.doRequest("json")
  56239. if res != nil && res.StatusCode == http.StatusNotModified {
  56240. if res.Body != nil {
  56241. res.Body.Close()
  56242. }
  56243. return nil, &googleapi.Error{
  56244. Code: res.StatusCode,
  56245. Header: res.Header,
  56246. }
  56247. }
  56248. if err != nil {
  56249. return nil, err
  56250. }
  56251. defer googleapi.CloseBody(res)
  56252. if err := googleapi.CheckResponse(res); err != nil {
  56253. return nil, err
  56254. }
  56255. ret := &Operation{
  56256. ServerResponse: googleapi.ServerResponse{
  56257. Header: res.Header,
  56258. HTTPStatusCode: res.StatusCode,
  56259. },
  56260. }
  56261. target := &ret
  56262. if err := gensupport.DecodeResponse(target, res); err != nil {
  56263. return nil, err
  56264. }
  56265. return ret, nil
  56266. // {
  56267. // "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.",
  56268. // "httpMethod": "PATCH",
  56269. // "id": "compute.instanceGroupManagers.patch",
  56270. // "parameterOrder": [
  56271. // "project",
  56272. // "zone",
  56273. // "instanceGroupManager"
  56274. // ],
  56275. // "parameters": {
  56276. // "instanceGroupManager": {
  56277. // "description": "The name of the instance group manager.",
  56278. // "location": "path",
  56279. // "required": true,
  56280. // "type": "string"
  56281. // },
  56282. // "project": {
  56283. // "description": "Project ID for this request.",
  56284. // "location": "path",
  56285. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  56286. // "required": true,
  56287. // "type": "string"
  56288. // },
  56289. // "requestId": {
  56290. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  56291. // "location": "query",
  56292. // "type": "string"
  56293. // },
  56294. // "zone": {
  56295. // "description": "The name of the zone where you want to create the managed instance group.",
  56296. // "location": "path",
  56297. // "required": true,
  56298. // "type": "string"
  56299. // }
  56300. // },
  56301. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}",
  56302. // "request": {
  56303. // "$ref": "InstanceGroupManager"
  56304. // },
  56305. // "response": {
  56306. // "$ref": "Operation"
  56307. // },
  56308. // "scopes": [
  56309. // "https://www.googleapis.com/auth/cloud-platform",
  56310. // "https://www.googleapis.com/auth/compute"
  56311. // ]
  56312. // }
  56313. }
  56314. // method id "compute.instanceGroupManagers.recreateInstances":
  56315. type InstanceGroupManagersRecreateInstancesCall struct {
  56316. s *Service
  56317. project string
  56318. zone string
  56319. instanceGroupManager string
  56320. instancegroupmanagersrecreateinstancesrequest *InstanceGroupManagersRecreateInstancesRequest
  56321. urlParams_ gensupport.URLParams
  56322. ctx_ context.Context
  56323. header_ http.Header
  56324. }
  56325. // RecreateInstances: Schedules a group action to recreate the specified
  56326. // instances in the managed instance group. The instances are deleted
  56327. // and recreated using the current instance template for the managed
  56328. // instance group. This operation is marked as DONE when the action is
  56329. // scheduled even if the instances have not yet been recreated. You must
  56330. // separately verify the status of the recreating action with the
  56331. // listmanagedinstances method.
  56332. //
  56333. // If the group is part of a backend service that has enabled connection
  56334. // draining, it can take up to 60 seconds after the connection draining
  56335. // duration has elapsed before the VM instance is removed or
  56336. // deleted.
  56337. //
  56338. // You can specify a maximum of 1000 instances with this method per
  56339. // request.
  56340. func (r *InstanceGroupManagersService) RecreateInstances(project string, zone string, instanceGroupManager string, instancegroupmanagersrecreateinstancesrequest *InstanceGroupManagersRecreateInstancesRequest) *InstanceGroupManagersRecreateInstancesCall {
  56341. c := &InstanceGroupManagersRecreateInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  56342. c.project = project
  56343. c.zone = zone
  56344. c.instanceGroupManager = instanceGroupManager
  56345. c.instancegroupmanagersrecreateinstancesrequest = instancegroupmanagersrecreateinstancesrequest
  56346. return c
  56347. }
  56348. // RequestId sets the optional parameter "requestId": An optional
  56349. // request ID to identify requests. Specify a unique request ID so that
  56350. // if you must retry your request, the server will know to ignore the
  56351. // request if it has already been completed.
  56352. //
  56353. // For example, consider a situation where you make an initial request
  56354. // and the request times out. If you make the request again with the
  56355. // same request ID, the server can check if original operation with the
  56356. // same request ID was received, and if so, will ignore the second
  56357. // request. This prevents clients from accidentally creating duplicate
  56358. // commitments.
  56359. //
  56360. // The request ID must be a valid UUID with the exception that zero UUID
  56361. // is not supported (00000000-0000-0000-0000-000000000000).
  56362. func (c *InstanceGroupManagersRecreateInstancesCall) RequestId(requestId string) *InstanceGroupManagersRecreateInstancesCall {
  56363. c.urlParams_.Set("requestId", requestId)
  56364. return c
  56365. }
  56366. // Fields allows partial responses to be retrieved. See
  56367. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  56368. // for more information.
  56369. func (c *InstanceGroupManagersRecreateInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersRecreateInstancesCall {
  56370. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  56371. return c
  56372. }
  56373. // Context sets the context to be used in this call's Do method. Any
  56374. // pending HTTP request will be aborted if the provided context is
  56375. // canceled.
  56376. func (c *InstanceGroupManagersRecreateInstancesCall) Context(ctx context.Context) *InstanceGroupManagersRecreateInstancesCall {
  56377. c.ctx_ = ctx
  56378. return c
  56379. }
  56380. // Header returns an http.Header that can be modified by the caller to
  56381. // add HTTP headers to the request.
  56382. func (c *InstanceGroupManagersRecreateInstancesCall) Header() http.Header {
  56383. if c.header_ == nil {
  56384. c.header_ = make(http.Header)
  56385. }
  56386. return c.header_
  56387. }
  56388. func (c *InstanceGroupManagersRecreateInstancesCall) doRequest(alt string) (*http.Response, error) {
  56389. reqHeaders := make(http.Header)
  56390. for k, v := range c.header_ {
  56391. reqHeaders[k] = v
  56392. }
  56393. reqHeaders.Set("User-Agent", c.s.userAgent())
  56394. var body io.Reader = nil
  56395. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersrecreateinstancesrequest)
  56396. if err != nil {
  56397. return nil, err
  56398. }
  56399. reqHeaders.Set("Content-Type", "application/json")
  56400. c.urlParams_.Set("alt", alt)
  56401. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/recreateInstances")
  56402. urls += "?" + c.urlParams_.Encode()
  56403. req, _ := http.NewRequest("POST", urls, body)
  56404. req.Header = reqHeaders
  56405. googleapi.Expand(req.URL, map[string]string{
  56406. "project": c.project,
  56407. "zone": c.zone,
  56408. "instanceGroupManager": c.instanceGroupManager,
  56409. })
  56410. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  56411. }
  56412. // Do executes the "compute.instanceGroupManagers.recreateInstances" call.
  56413. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  56414. // status code is an error. Response headers are in either
  56415. // *Operation.ServerResponse.Header or (if a response was returned at
  56416. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  56417. // to check whether the returned error was because
  56418. // http.StatusNotModified was returned.
  56419. func (c *InstanceGroupManagersRecreateInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  56420. gensupport.SetOptions(c.urlParams_, opts...)
  56421. res, err := c.doRequest("json")
  56422. if res != nil && res.StatusCode == http.StatusNotModified {
  56423. if res.Body != nil {
  56424. res.Body.Close()
  56425. }
  56426. return nil, &googleapi.Error{
  56427. Code: res.StatusCode,
  56428. Header: res.Header,
  56429. }
  56430. }
  56431. if err != nil {
  56432. return nil, err
  56433. }
  56434. defer googleapi.CloseBody(res)
  56435. if err := googleapi.CheckResponse(res); err != nil {
  56436. return nil, err
  56437. }
  56438. ret := &Operation{
  56439. ServerResponse: googleapi.ServerResponse{
  56440. Header: res.Header,
  56441. HTTPStatusCode: res.StatusCode,
  56442. },
  56443. }
  56444. target := &ret
  56445. if err := gensupport.DecodeResponse(target, res); err != nil {
  56446. return nil, err
  56447. }
  56448. return ret, nil
  56449. // {
  56450. // "description": "Schedules a group action to recreate the specified instances in the managed instance group. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the action is scheduled even if the instances have not yet been recreated. You must separately verify the status of the recreating action with the listmanagedinstances method.\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.",
  56451. // "httpMethod": "POST",
  56452. // "id": "compute.instanceGroupManagers.recreateInstances",
  56453. // "parameterOrder": [
  56454. // "project",
  56455. // "zone",
  56456. // "instanceGroupManager"
  56457. // ],
  56458. // "parameters": {
  56459. // "instanceGroupManager": {
  56460. // "description": "The name of the managed instance group.",
  56461. // "location": "path",
  56462. // "required": true,
  56463. // "type": "string"
  56464. // },
  56465. // "project": {
  56466. // "description": "Project ID for this request.",
  56467. // "location": "path",
  56468. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  56469. // "required": true,
  56470. // "type": "string"
  56471. // },
  56472. // "requestId": {
  56473. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  56474. // "location": "query",
  56475. // "type": "string"
  56476. // },
  56477. // "zone": {
  56478. // "description": "The name of the zone where the managed instance group is located.",
  56479. // "location": "path",
  56480. // "required": true,
  56481. // "type": "string"
  56482. // }
  56483. // },
  56484. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/recreateInstances",
  56485. // "request": {
  56486. // "$ref": "InstanceGroupManagersRecreateInstancesRequest"
  56487. // },
  56488. // "response": {
  56489. // "$ref": "Operation"
  56490. // },
  56491. // "scopes": [
  56492. // "https://www.googleapis.com/auth/cloud-platform",
  56493. // "https://www.googleapis.com/auth/compute"
  56494. // ]
  56495. // }
  56496. }
  56497. // method id "compute.instanceGroupManagers.resize":
  56498. type InstanceGroupManagersResizeCall struct {
  56499. s *Service
  56500. project string
  56501. zone string
  56502. instanceGroupManager string
  56503. urlParams_ gensupport.URLParams
  56504. ctx_ context.Context
  56505. header_ http.Header
  56506. }
  56507. // Resize: Resizes the managed instance group. If you increase the size,
  56508. // the group creates new instances using the current instance template.
  56509. // If you decrease the size, the group deletes instances. The resize
  56510. // operation is marked DONE when the resize actions are scheduled even
  56511. // if the group has not yet added or deleted any instances. You must
  56512. // separately verify the status of the creating or deleting actions with
  56513. // the listmanagedinstances method.
  56514. //
  56515. // If the group is part of a backend service that has enabled connection
  56516. // draining, it can take up to 60 seconds after the connection draining
  56517. // duration has elapsed before the VM instance is removed or deleted.
  56518. func (r *InstanceGroupManagersService) Resize(project string, zone string, instanceGroupManager string, size int64) *InstanceGroupManagersResizeCall {
  56519. c := &InstanceGroupManagersResizeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  56520. c.project = project
  56521. c.zone = zone
  56522. c.instanceGroupManager = instanceGroupManager
  56523. c.urlParams_.Set("size", fmt.Sprint(size))
  56524. return c
  56525. }
  56526. // RequestId sets the optional parameter "requestId": An optional
  56527. // request ID to identify requests. Specify a unique request ID so that
  56528. // if you must retry your request, the server will know to ignore the
  56529. // request if it has already been completed.
  56530. //
  56531. // For example, consider a situation where you make an initial request
  56532. // and the request times out. If you make the request again with the
  56533. // same request ID, the server can check if original operation with the
  56534. // same request ID was received, and if so, will ignore the second
  56535. // request. This prevents clients from accidentally creating duplicate
  56536. // commitments.
  56537. //
  56538. // The request ID must be a valid UUID with the exception that zero UUID
  56539. // is not supported (00000000-0000-0000-0000-000000000000).
  56540. func (c *InstanceGroupManagersResizeCall) RequestId(requestId string) *InstanceGroupManagersResizeCall {
  56541. c.urlParams_.Set("requestId", requestId)
  56542. return c
  56543. }
  56544. // Fields allows partial responses to be retrieved. See
  56545. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  56546. // for more information.
  56547. func (c *InstanceGroupManagersResizeCall) Fields(s ...googleapi.Field) *InstanceGroupManagersResizeCall {
  56548. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  56549. return c
  56550. }
  56551. // Context sets the context to be used in this call's Do method. Any
  56552. // pending HTTP request will be aborted if the provided context is
  56553. // canceled.
  56554. func (c *InstanceGroupManagersResizeCall) Context(ctx context.Context) *InstanceGroupManagersResizeCall {
  56555. c.ctx_ = ctx
  56556. return c
  56557. }
  56558. // Header returns an http.Header that can be modified by the caller to
  56559. // add HTTP headers to the request.
  56560. func (c *InstanceGroupManagersResizeCall) Header() http.Header {
  56561. if c.header_ == nil {
  56562. c.header_ = make(http.Header)
  56563. }
  56564. return c.header_
  56565. }
  56566. func (c *InstanceGroupManagersResizeCall) doRequest(alt string) (*http.Response, error) {
  56567. reqHeaders := make(http.Header)
  56568. for k, v := range c.header_ {
  56569. reqHeaders[k] = v
  56570. }
  56571. reqHeaders.Set("User-Agent", c.s.userAgent())
  56572. var body io.Reader = nil
  56573. c.urlParams_.Set("alt", alt)
  56574. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resize")
  56575. urls += "?" + c.urlParams_.Encode()
  56576. req, _ := http.NewRequest("POST", urls, body)
  56577. req.Header = reqHeaders
  56578. googleapi.Expand(req.URL, map[string]string{
  56579. "project": c.project,
  56580. "zone": c.zone,
  56581. "instanceGroupManager": c.instanceGroupManager,
  56582. })
  56583. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  56584. }
  56585. // Do executes the "compute.instanceGroupManagers.resize" call.
  56586. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  56587. // status code is an error. Response headers are in either
  56588. // *Operation.ServerResponse.Header or (if a response was returned at
  56589. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  56590. // to check whether the returned error was because
  56591. // http.StatusNotModified was returned.
  56592. func (c *InstanceGroupManagersResizeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  56593. gensupport.SetOptions(c.urlParams_, opts...)
  56594. res, err := c.doRequest("json")
  56595. if res != nil && res.StatusCode == http.StatusNotModified {
  56596. if res.Body != nil {
  56597. res.Body.Close()
  56598. }
  56599. return nil, &googleapi.Error{
  56600. Code: res.StatusCode,
  56601. Header: res.Header,
  56602. }
  56603. }
  56604. if err != nil {
  56605. return nil, err
  56606. }
  56607. defer googleapi.CloseBody(res)
  56608. if err := googleapi.CheckResponse(res); err != nil {
  56609. return nil, err
  56610. }
  56611. ret := &Operation{
  56612. ServerResponse: googleapi.ServerResponse{
  56613. Header: res.Header,
  56614. HTTPStatusCode: res.StatusCode,
  56615. },
  56616. }
  56617. target := &ret
  56618. if err := gensupport.DecodeResponse(target, res); err != nil {
  56619. return nil, err
  56620. }
  56621. return ret, nil
  56622. // {
  56623. // "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\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.",
  56624. // "httpMethod": "POST",
  56625. // "id": "compute.instanceGroupManagers.resize",
  56626. // "parameterOrder": [
  56627. // "project",
  56628. // "zone",
  56629. // "instanceGroupManager",
  56630. // "size"
  56631. // ],
  56632. // "parameters": {
  56633. // "instanceGroupManager": {
  56634. // "description": "The name of the managed instance group.",
  56635. // "location": "path",
  56636. // "required": true,
  56637. // "type": "string"
  56638. // },
  56639. // "project": {
  56640. // "description": "Project ID for this request.",
  56641. // "location": "path",
  56642. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  56643. // "required": true,
  56644. // "type": "string"
  56645. // },
  56646. // "requestId": {
  56647. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  56648. // "location": "query",
  56649. // "type": "string"
  56650. // },
  56651. // "size": {
  56652. // "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.",
  56653. // "format": "int32",
  56654. // "location": "query",
  56655. // "required": true,
  56656. // "type": "integer"
  56657. // },
  56658. // "zone": {
  56659. // "description": "The name of the zone where the managed instance group is located.",
  56660. // "location": "path",
  56661. // "required": true,
  56662. // "type": "string"
  56663. // }
  56664. // },
  56665. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resize",
  56666. // "response": {
  56667. // "$ref": "Operation"
  56668. // },
  56669. // "scopes": [
  56670. // "https://www.googleapis.com/auth/cloud-platform",
  56671. // "https://www.googleapis.com/auth/compute"
  56672. // ]
  56673. // }
  56674. }
  56675. // method id "compute.instanceGroupManagers.resizeAdvanced":
  56676. type InstanceGroupManagersResizeAdvancedCall struct {
  56677. s *Service
  56678. project string
  56679. zone string
  56680. instanceGroupManager string
  56681. instancegroupmanagersresizeadvancedrequest *InstanceGroupManagersResizeAdvancedRequest
  56682. urlParams_ gensupport.URLParams
  56683. ctx_ context.Context
  56684. header_ http.Header
  56685. }
  56686. // ResizeAdvanced: Resizes the managed instance group with advanced
  56687. // configuration options like disabling creation retries. This is an
  56688. // extended version of the resize method.
  56689. //
  56690. // If you increase the size of the instance group, the group creates new
  56691. // instances using the current instance template. If you decrease the
  56692. // size, the group deletes instances. The resize operation is marked
  56693. // DONE when the resize actions are scheduled even if the group has not
  56694. // yet added or deleted any instances. You must separately verify the
  56695. // status of the creating, creatingWithoutRetries, or deleting actions
  56696. // with the get or listmanagedinstances method.
  56697. //
  56698. // If the group is part of a backend service that has enabled connection
  56699. // draining, it can take up to 60 seconds after the connection draining
  56700. // duration has elapsed before the VM instance is removed or deleted.
  56701. func (r *InstanceGroupManagersService) ResizeAdvanced(project string, zone string, instanceGroupManager string, instancegroupmanagersresizeadvancedrequest *InstanceGroupManagersResizeAdvancedRequest) *InstanceGroupManagersResizeAdvancedCall {
  56702. c := &InstanceGroupManagersResizeAdvancedCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  56703. c.project = project
  56704. c.zone = zone
  56705. c.instanceGroupManager = instanceGroupManager
  56706. c.instancegroupmanagersresizeadvancedrequest = instancegroupmanagersresizeadvancedrequest
  56707. return c
  56708. }
  56709. // RequestId sets the optional parameter "requestId": An optional
  56710. // request ID to identify requests. Specify a unique request ID so that
  56711. // if you must retry your request, the server will know to ignore the
  56712. // request if it has already been completed.
  56713. //
  56714. // For example, consider a situation where you make an initial request
  56715. // and the request times out. If you make the request again with the
  56716. // same request ID, the server can check if original operation with the
  56717. // same request ID was received, and if so, will ignore the second
  56718. // request. This prevents clients from accidentally creating duplicate
  56719. // commitments.
  56720. //
  56721. // The request ID must be a valid UUID with the exception that zero UUID
  56722. // is not supported (00000000-0000-0000-0000-000000000000).
  56723. func (c *InstanceGroupManagersResizeAdvancedCall) RequestId(requestId string) *InstanceGroupManagersResizeAdvancedCall {
  56724. c.urlParams_.Set("requestId", requestId)
  56725. return c
  56726. }
  56727. // Fields allows partial responses to be retrieved. See
  56728. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  56729. // for more information.
  56730. func (c *InstanceGroupManagersResizeAdvancedCall) Fields(s ...googleapi.Field) *InstanceGroupManagersResizeAdvancedCall {
  56731. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  56732. return c
  56733. }
  56734. // Context sets the context to be used in this call's Do method. Any
  56735. // pending HTTP request will be aborted if the provided context is
  56736. // canceled.
  56737. func (c *InstanceGroupManagersResizeAdvancedCall) Context(ctx context.Context) *InstanceGroupManagersResizeAdvancedCall {
  56738. c.ctx_ = ctx
  56739. return c
  56740. }
  56741. // Header returns an http.Header that can be modified by the caller to
  56742. // add HTTP headers to the request.
  56743. func (c *InstanceGroupManagersResizeAdvancedCall) Header() http.Header {
  56744. if c.header_ == nil {
  56745. c.header_ = make(http.Header)
  56746. }
  56747. return c.header_
  56748. }
  56749. func (c *InstanceGroupManagersResizeAdvancedCall) doRequest(alt string) (*http.Response, error) {
  56750. reqHeaders := make(http.Header)
  56751. for k, v := range c.header_ {
  56752. reqHeaders[k] = v
  56753. }
  56754. reqHeaders.Set("User-Agent", c.s.userAgent())
  56755. var body io.Reader = nil
  56756. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersresizeadvancedrequest)
  56757. if err != nil {
  56758. return nil, err
  56759. }
  56760. reqHeaders.Set("Content-Type", "application/json")
  56761. c.urlParams_.Set("alt", alt)
  56762. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resizeAdvanced")
  56763. urls += "?" + c.urlParams_.Encode()
  56764. req, _ := http.NewRequest("POST", urls, body)
  56765. req.Header = reqHeaders
  56766. googleapi.Expand(req.URL, map[string]string{
  56767. "project": c.project,
  56768. "zone": c.zone,
  56769. "instanceGroupManager": c.instanceGroupManager,
  56770. })
  56771. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  56772. }
  56773. // Do executes the "compute.instanceGroupManagers.resizeAdvanced" call.
  56774. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  56775. // status code is an error. Response headers are in either
  56776. // *Operation.ServerResponse.Header or (if a response was returned at
  56777. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  56778. // to check whether the returned error was because
  56779. // http.StatusNotModified was returned.
  56780. func (c *InstanceGroupManagersResizeAdvancedCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  56781. gensupport.SetOptions(c.urlParams_, opts...)
  56782. res, err := c.doRequest("json")
  56783. if res != nil && res.StatusCode == http.StatusNotModified {
  56784. if res.Body != nil {
  56785. res.Body.Close()
  56786. }
  56787. return nil, &googleapi.Error{
  56788. Code: res.StatusCode,
  56789. Header: res.Header,
  56790. }
  56791. }
  56792. if err != nil {
  56793. return nil, err
  56794. }
  56795. defer googleapi.CloseBody(res)
  56796. if err := googleapi.CheckResponse(res); err != nil {
  56797. return nil, err
  56798. }
  56799. ret := &Operation{
  56800. ServerResponse: googleapi.ServerResponse{
  56801. Header: res.Header,
  56802. HTTPStatusCode: res.StatusCode,
  56803. },
  56804. }
  56805. target := &ret
  56806. if err := gensupport.DecodeResponse(target, res); err != nil {
  56807. return nil, err
  56808. }
  56809. return ret, nil
  56810. // {
  56811. // "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.",
  56812. // "httpMethod": "POST",
  56813. // "id": "compute.instanceGroupManagers.resizeAdvanced",
  56814. // "parameterOrder": [
  56815. // "project",
  56816. // "zone",
  56817. // "instanceGroupManager"
  56818. // ],
  56819. // "parameters": {
  56820. // "instanceGroupManager": {
  56821. // "description": "The name of the managed instance group.",
  56822. // "location": "path",
  56823. // "required": true,
  56824. // "type": "string"
  56825. // },
  56826. // "project": {
  56827. // "description": "Project ID for this request.",
  56828. // "location": "path",
  56829. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  56830. // "required": true,
  56831. // "type": "string"
  56832. // },
  56833. // "requestId": {
  56834. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  56835. // "location": "query",
  56836. // "type": "string"
  56837. // },
  56838. // "zone": {
  56839. // "description": "The name of the zone where the managed instance group is located.",
  56840. // "location": "path",
  56841. // "required": true,
  56842. // "type": "string"
  56843. // }
  56844. // },
  56845. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resizeAdvanced",
  56846. // "request": {
  56847. // "$ref": "InstanceGroupManagersResizeAdvancedRequest"
  56848. // },
  56849. // "response": {
  56850. // "$ref": "Operation"
  56851. // },
  56852. // "scopes": [
  56853. // "https://www.googleapis.com/auth/cloud-platform",
  56854. // "https://www.googleapis.com/auth/compute"
  56855. // ]
  56856. // }
  56857. }
  56858. // method id "compute.instanceGroupManagers.setAutoHealingPolicies":
  56859. type InstanceGroupManagersSetAutoHealingPoliciesCall struct {
  56860. s *Service
  56861. project string
  56862. zone string
  56863. instanceGroupManager string
  56864. instancegroupmanagerssetautohealingrequest *InstanceGroupManagersSetAutoHealingRequest
  56865. urlParams_ gensupport.URLParams
  56866. ctx_ context.Context
  56867. header_ http.Header
  56868. }
  56869. // SetAutoHealingPolicies: Modifies the autohealing policies.
  56870. func (r *InstanceGroupManagersService) SetAutoHealingPolicies(project string, zone string, instanceGroupManager string, instancegroupmanagerssetautohealingrequest *InstanceGroupManagersSetAutoHealingRequest) *InstanceGroupManagersSetAutoHealingPoliciesCall {
  56871. c := &InstanceGroupManagersSetAutoHealingPoliciesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  56872. c.project = project
  56873. c.zone = zone
  56874. c.instanceGroupManager = instanceGroupManager
  56875. c.instancegroupmanagerssetautohealingrequest = instancegroupmanagerssetautohealingrequest
  56876. return c
  56877. }
  56878. // RequestId sets the optional parameter "requestId": An optional
  56879. // request ID to identify requests. Specify a unique request ID so that
  56880. // if you must retry your request, the server will know to ignore the
  56881. // request if it has already been completed.
  56882. //
  56883. // For example, consider a situation where you make an initial request
  56884. // and the request times out. If you make the request again with the
  56885. // same request ID, the server can check if original operation with the
  56886. // same request ID was received, and if so, will ignore the second
  56887. // request. This prevents clients from accidentally creating duplicate
  56888. // commitments.
  56889. //
  56890. // The request ID must be a valid UUID with the exception that zero UUID
  56891. // is not supported (00000000-0000-0000-0000-000000000000).
  56892. func (c *InstanceGroupManagersSetAutoHealingPoliciesCall) RequestId(requestId string) *InstanceGroupManagersSetAutoHealingPoliciesCall {
  56893. c.urlParams_.Set("requestId", requestId)
  56894. return c
  56895. }
  56896. // Fields allows partial responses to be retrieved. See
  56897. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  56898. // for more information.
  56899. func (c *InstanceGroupManagersSetAutoHealingPoliciesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersSetAutoHealingPoliciesCall {
  56900. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  56901. return c
  56902. }
  56903. // Context sets the context to be used in this call's Do method. Any
  56904. // pending HTTP request will be aborted if the provided context is
  56905. // canceled.
  56906. func (c *InstanceGroupManagersSetAutoHealingPoliciesCall) Context(ctx context.Context) *InstanceGroupManagersSetAutoHealingPoliciesCall {
  56907. c.ctx_ = ctx
  56908. return c
  56909. }
  56910. // Header returns an http.Header that can be modified by the caller to
  56911. // add HTTP headers to the request.
  56912. func (c *InstanceGroupManagersSetAutoHealingPoliciesCall) Header() http.Header {
  56913. if c.header_ == nil {
  56914. c.header_ = make(http.Header)
  56915. }
  56916. return c.header_
  56917. }
  56918. func (c *InstanceGroupManagersSetAutoHealingPoliciesCall) doRequest(alt string) (*http.Response, error) {
  56919. reqHeaders := make(http.Header)
  56920. for k, v := range c.header_ {
  56921. reqHeaders[k] = v
  56922. }
  56923. reqHeaders.Set("User-Agent", c.s.userAgent())
  56924. var body io.Reader = nil
  56925. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerssetautohealingrequest)
  56926. if err != nil {
  56927. return nil, err
  56928. }
  56929. reqHeaders.Set("Content-Type", "application/json")
  56930. c.urlParams_.Set("alt", alt)
  56931. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setAutoHealingPolicies")
  56932. urls += "?" + c.urlParams_.Encode()
  56933. req, _ := http.NewRequest("POST", urls, body)
  56934. req.Header = reqHeaders
  56935. googleapi.Expand(req.URL, map[string]string{
  56936. "project": c.project,
  56937. "zone": c.zone,
  56938. "instanceGroupManager": c.instanceGroupManager,
  56939. })
  56940. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  56941. }
  56942. // Do executes the "compute.instanceGroupManagers.setAutoHealingPolicies" call.
  56943. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  56944. // status code is an error. Response headers are in either
  56945. // *Operation.ServerResponse.Header or (if a response was returned at
  56946. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  56947. // to check whether the returned error was because
  56948. // http.StatusNotModified was returned.
  56949. func (c *InstanceGroupManagersSetAutoHealingPoliciesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  56950. gensupport.SetOptions(c.urlParams_, opts...)
  56951. res, err := c.doRequest("json")
  56952. if res != nil && res.StatusCode == http.StatusNotModified {
  56953. if res.Body != nil {
  56954. res.Body.Close()
  56955. }
  56956. return nil, &googleapi.Error{
  56957. Code: res.StatusCode,
  56958. Header: res.Header,
  56959. }
  56960. }
  56961. if err != nil {
  56962. return nil, err
  56963. }
  56964. defer googleapi.CloseBody(res)
  56965. if err := googleapi.CheckResponse(res); err != nil {
  56966. return nil, err
  56967. }
  56968. ret := &Operation{
  56969. ServerResponse: googleapi.ServerResponse{
  56970. Header: res.Header,
  56971. HTTPStatusCode: res.StatusCode,
  56972. },
  56973. }
  56974. target := &ret
  56975. if err := gensupport.DecodeResponse(target, res); err != nil {
  56976. return nil, err
  56977. }
  56978. return ret, nil
  56979. // {
  56980. // "description": "Modifies the autohealing policies.",
  56981. // "httpMethod": "POST",
  56982. // "id": "compute.instanceGroupManagers.setAutoHealingPolicies",
  56983. // "parameterOrder": [
  56984. // "project",
  56985. // "zone",
  56986. // "instanceGroupManager"
  56987. // ],
  56988. // "parameters": {
  56989. // "instanceGroupManager": {
  56990. // "description": "The name of the instance group manager.",
  56991. // "location": "path",
  56992. // "required": true,
  56993. // "type": "string"
  56994. // },
  56995. // "project": {
  56996. // "description": "Project ID for this request.",
  56997. // "location": "path",
  56998. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  56999. // "required": true,
  57000. // "type": "string"
  57001. // },
  57002. // "requestId": {
  57003. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  57004. // "location": "query",
  57005. // "type": "string"
  57006. // },
  57007. // "zone": {
  57008. // "description": "The name of the zone where the managed instance group is located.",
  57009. // "location": "path",
  57010. // "required": true,
  57011. // "type": "string"
  57012. // }
  57013. // },
  57014. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setAutoHealingPolicies",
  57015. // "request": {
  57016. // "$ref": "InstanceGroupManagersSetAutoHealingRequest"
  57017. // },
  57018. // "response": {
  57019. // "$ref": "Operation"
  57020. // },
  57021. // "scopes": [
  57022. // "https://www.googleapis.com/auth/cloud-platform",
  57023. // "https://www.googleapis.com/auth/compute"
  57024. // ]
  57025. // }
  57026. }
  57027. // method id "compute.instanceGroupManagers.setInstanceTemplate":
  57028. type InstanceGroupManagersSetInstanceTemplateCall struct {
  57029. s *Service
  57030. project string
  57031. zone string
  57032. instanceGroupManager string
  57033. instancegroupmanagerssetinstancetemplaterequest *InstanceGroupManagersSetInstanceTemplateRequest
  57034. urlParams_ gensupport.URLParams
  57035. ctx_ context.Context
  57036. header_ http.Header
  57037. }
  57038. // SetInstanceTemplate: Specifies the instance template to use when
  57039. // creating new instances in this group. The templates for existing
  57040. // instances in the group do not change unless you recreate them.
  57041. func (r *InstanceGroupManagersService) SetInstanceTemplate(project string, zone string, instanceGroupManager string, instancegroupmanagerssetinstancetemplaterequest *InstanceGroupManagersSetInstanceTemplateRequest) *InstanceGroupManagersSetInstanceTemplateCall {
  57042. c := &InstanceGroupManagersSetInstanceTemplateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  57043. c.project = project
  57044. c.zone = zone
  57045. c.instanceGroupManager = instanceGroupManager
  57046. c.instancegroupmanagerssetinstancetemplaterequest = instancegroupmanagerssetinstancetemplaterequest
  57047. return c
  57048. }
  57049. // RequestId sets the optional parameter "requestId": An optional
  57050. // request ID to identify requests. Specify a unique request ID so that
  57051. // if you must retry your request, the server will know to ignore the
  57052. // request if it has already been completed.
  57053. //
  57054. // For example, consider a situation where you make an initial request
  57055. // and the request times out. If you make the request again with the
  57056. // same request ID, the server can check if original operation with the
  57057. // same request ID was received, and if so, will ignore the second
  57058. // request. This prevents clients from accidentally creating duplicate
  57059. // commitments.
  57060. //
  57061. // The request ID must be a valid UUID with the exception that zero UUID
  57062. // is not supported (00000000-0000-0000-0000-000000000000).
  57063. func (c *InstanceGroupManagersSetInstanceTemplateCall) RequestId(requestId string) *InstanceGroupManagersSetInstanceTemplateCall {
  57064. c.urlParams_.Set("requestId", requestId)
  57065. return c
  57066. }
  57067. // Fields allows partial responses to be retrieved. See
  57068. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  57069. // for more information.
  57070. func (c *InstanceGroupManagersSetInstanceTemplateCall) Fields(s ...googleapi.Field) *InstanceGroupManagersSetInstanceTemplateCall {
  57071. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  57072. return c
  57073. }
  57074. // Context sets the context to be used in this call's Do method. Any
  57075. // pending HTTP request will be aborted if the provided context is
  57076. // canceled.
  57077. func (c *InstanceGroupManagersSetInstanceTemplateCall) Context(ctx context.Context) *InstanceGroupManagersSetInstanceTemplateCall {
  57078. c.ctx_ = ctx
  57079. return c
  57080. }
  57081. // Header returns an http.Header that can be modified by the caller to
  57082. // add HTTP headers to the request.
  57083. func (c *InstanceGroupManagersSetInstanceTemplateCall) Header() http.Header {
  57084. if c.header_ == nil {
  57085. c.header_ = make(http.Header)
  57086. }
  57087. return c.header_
  57088. }
  57089. func (c *InstanceGroupManagersSetInstanceTemplateCall) doRequest(alt string) (*http.Response, error) {
  57090. reqHeaders := make(http.Header)
  57091. for k, v := range c.header_ {
  57092. reqHeaders[k] = v
  57093. }
  57094. reqHeaders.Set("User-Agent", c.s.userAgent())
  57095. var body io.Reader = nil
  57096. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerssetinstancetemplaterequest)
  57097. if err != nil {
  57098. return nil, err
  57099. }
  57100. reqHeaders.Set("Content-Type", "application/json")
  57101. c.urlParams_.Set("alt", alt)
  57102. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate")
  57103. urls += "?" + c.urlParams_.Encode()
  57104. req, _ := http.NewRequest("POST", urls, body)
  57105. req.Header = reqHeaders
  57106. googleapi.Expand(req.URL, map[string]string{
  57107. "project": c.project,
  57108. "zone": c.zone,
  57109. "instanceGroupManager": c.instanceGroupManager,
  57110. })
  57111. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  57112. }
  57113. // Do executes the "compute.instanceGroupManagers.setInstanceTemplate" call.
  57114. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  57115. // status code is an error. Response headers are in either
  57116. // *Operation.ServerResponse.Header or (if a response was returned at
  57117. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  57118. // to check whether the returned error was because
  57119. // http.StatusNotModified was returned.
  57120. func (c *InstanceGroupManagersSetInstanceTemplateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  57121. gensupport.SetOptions(c.urlParams_, opts...)
  57122. res, err := c.doRequest("json")
  57123. if res != nil && res.StatusCode == http.StatusNotModified {
  57124. if res.Body != nil {
  57125. res.Body.Close()
  57126. }
  57127. return nil, &googleapi.Error{
  57128. Code: res.StatusCode,
  57129. Header: res.Header,
  57130. }
  57131. }
  57132. if err != nil {
  57133. return nil, err
  57134. }
  57135. defer googleapi.CloseBody(res)
  57136. if err := googleapi.CheckResponse(res); err != nil {
  57137. return nil, err
  57138. }
  57139. ret := &Operation{
  57140. ServerResponse: googleapi.ServerResponse{
  57141. Header: res.Header,
  57142. HTTPStatusCode: res.StatusCode,
  57143. },
  57144. }
  57145. target := &ret
  57146. if err := gensupport.DecodeResponse(target, res); err != nil {
  57147. return nil, err
  57148. }
  57149. return ret, nil
  57150. // {
  57151. // "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.",
  57152. // "httpMethod": "POST",
  57153. // "id": "compute.instanceGroupManagers.setInstanceTemplate",
  57154. // "parameterOrder": [
  57155. // "project",
  57156. // "zone",
  57157. // "instanceGroupManager"
  57158. // ],
  57159. // "parameters": {
  57160. // "instanceGroupManager": {
  57161. // "description": "The name of the managed instance group.",
  57162. // "location": "path",
  57163. // "required": true,
  57164. // "type": "string"
  57165. // },
  57166. // "project": {
  57167. // "description": "Project ID for this request.",
  57168. // "location": "path",
  57169. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  57170. // "required": true,
  57171. // "type": "string"
  57172. // },
  57173. // "requestId": {
  57174. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  57175. // "location": "query",
  57176. // "type": "string"
  57177. // },
  57178. // "zone": {
  57179. // "description": "The name of the zone where the managed instance group is located.",
  57180. // "location": "path",
  57181. // "required": true,
  57182. // "type": "string"
  57183. // }
  57184. // },
  57185. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate",
  57186. // "request": {
  57187. // "$ref": "InstanceGroupManagersSetInstanceTemplateRequest"
  57188. // },
  57189. // "response": {
  57190. // "$ref": "Operation"
  57191. // },
  57192. // "scopes": [
  57193. // "https://www.googleapis.com/auth/cloud-platform",
  57194. // "https://www.googleapis.com/auth/compute"
  57195. // ]
  57196. // }
  57197. }
  57198. // method id "compute.instanceGroupManagers.setTargetPools":
  57199. type InstanceGroupManagersSetTargetPoolsCall struct {
  57200. s *Service
  57201. project string
  57202. zone string
  57203. instanceGroupManager string
  57204. instancegroupmanagerssettargetpoolsrequest *InstanceGroupManagersSetTargetPoolsRequest
  57205. urlParams_ gensupport.URLParams
  57206. ctx_ context.Context
  57207. header_ http.Header
  57208. }
  57209. // SetTargetPools: Modifies the target pools to which all instances in
  57210. // this managed instance group are assigned. The target pools
  57211. // automatically apply to all of the instances in the managed instance
  57212. // group. This operation is marked DONE when you make the request even
  57213. // if the instances have not yet been added to their target pools. The
  57214. // change might take some time to apply to all of the instances in the
  57215. // group depending on the size of the group.
  57216. func (r *InstanceGroupManagersService) SetTargetPools(project string, zone string, instanceGroupManager string, instancegroupmanagerssettargetpoolsrequest *InstanceGroupManagersSetTargetPoolsRequest) *InstanceGroupManagersSetTargetPoolsCall {
  57217. c := &InstanceGroupManagersSetTargetPoolsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  57218. c.project = project
  57219. c.zone = zone
  57220. c.instanceGroupManager = instanceGroupManager
  57221. c.instancegroupmanagerssettargetpoolsrequest = instancegroupmanagerssettargetpoolsrequest
  57222. return c
  57223. }
  57224. // RequestId sets the optional parameter "requestId": An optional
  57225. // request ID to identify requests. Specify a unique request ID so that
  57226. // if you must retry your request, the server will know to ignore the
  57227. // request if it has already been completed.
  57228. //
  57229. // For example, consider a situation where you make an initial request
  57230. // and the request times out. If you make the request again with the
  57231. // same request ID, the server can check if original operation with the
  57232. // same request ID was received, and if so, will ignore the second
  57233. // request. This prevents clients from accidentally creating duplicate
  57234. // commitments.
  57235. //
  57236. // The request ID must be a valid UUID with the exception that zero UUID
  57237. // is not supported (00000000-0000-0000-0000-000000000000).
  57238. func (c *InstanceGroupManagersSetTargetPoolsCall) RequestId(requestId string) *InstanceGroupManagersSetTargetPoolsCall {
  57239. c.urlParams_.Set("requestId", requestId)
  57240. return c
  57241. }
  57242. // Fields allows partial responses to be retrieved. See
  57243. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  57244. // for more information.
  57245. func (c *InstanceGroupManagersSetTargetPoolsCall) Fields(s ...googleapi.Field) *InstanceGroupManagersSetTargetPoolsCall {
  57246. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  57247. return c
  57248. }
  57249. // Context sets the context to be used in this call's Do method. Any
  57250. // pending HTTP request will be aborted if the provided context is
  57251. // canceled.
  57252. func (c *InstanceGroupManagersSetTargetPoolsCall) Context(ctx context.Context) *InstanceGroupManagersSetTargetPoolsCall {
  57253. c.ctx_ = ctx
  57254. return c
  57255. }
  57256. // Header returns an http.Header that can be modified by the caller to
  57257. // add HTTP headers to the request.
  57258. func (c *InstanceGroupManagersSetTargetPoolsCall) Header() http.Header {
  57259. if c.header_ == nil {
  57260. c.header_ = make(http.Header)
  57261. }
  57262. return c.header_
  57263. }
  57264. func (c *InstanceGroupManagersSetTargetPoolsCall) doRequest(alt string) (*http.Response, error) {
  57265. reqHeaders := make(http.Header)
  57266. for k, v := range c.header_ {
  57267. reqHeaders[k] = v
  57268. }
  57269. reqHeaders.Set("User-Agent", c.s.userAgent())
  57270. var body io.Reader = nil
  57271. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerssettargetpoolsrequest)
  57272. if err != nil {
  57273. return nil, err
  57274. }
  57275. reqHeaders.Set("Content-Type", "application/json")
  57276. c.urlParams_.Set("alt", alt)
  57277. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setTargetPools")
  57278. urls += "?" + c.urlParams_.Encode()
  57279. req, _ := http.NewRequest("POST", urls, body)
  57280. req.Header = reqHeaders
  57281. googleapi.Expand(req.URL, map[string]string{
  57282. "project": c.project,
  57283. "zone": c.zone,
  57284. "instanceGroupManager": c.instanceGroupManager,
  57285. })
  57286. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  57287. }
  57288. // Do executes the "compute.instanceGroupManagers.setTargetPools" call.
  57289. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  57290. // status code is an error. Response headers are in either
  57291. // *Operation.ServerResponse.Header or (if a response was returned at
  57292. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  57293. // to check whether the returned error was because
  57294. // http.StatusNotModified was returned.
  57295. func (c *InstanceGroupManagersSetTargetPoolsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  57296. gensupport.SetOptions(c.urlParams_, opts...)
  57297. res, err := c.doRequest("json")
  57298. if res != nil && res.StatusCode == http.StatusNotModified {
  57299. if res.Body != nil {
  57300. res.Body.Close()
  57301. }
  57302. return nil, &googleapi.Error{
  57303. Code: res.StatusCode,
  57304. Header: res.Header,
  57305. }
  57306. }
  57307. if err != nil {
  57308. return nil, err
  57309. }
  57310. defer googleapi.CloseBody(res)
  57311. if err := googleapi.CheckResponse(res); err != nil {
  57312. return nil, err
  57313. }
  57314. ret := &Operation{
  57315. ServerResponse: googleapi.ServerResponse{
  57316. Header: res.Header,
  57317. HTTPStatusCode: res.StatusCode,
  57318. },
  57319. }
  57320. target := &ret
  57321. if err := gensupport.DecodeResponse(target, res); err != nil {
  57322. return nil, err
  57323. }
  57324. return ret, nil
  57325. // {
  57326. // "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.",
  57327. // "httpMethod": "POST",
  57328. // "id": "compute.instanceGroupManagers.setTargetPools",
  57329. // "parameterOrder": [
  57330. // "project",
  57331. // "zone",
  57332. // "instanceGroupManager"
  57333. // ],
  57334. // "parameters": {
  57335. // "instanceGroupManager": {
  57336. // "description": "The name of the managed instance group.",
  57337. // "location": "path",
  57338. // "required": true,
  57339. // "type": "string"
  57340. // },
  57341. // "project": {
  57342. // "description": "Project ID for this request.",
  57343. // "location": "path",
  57344. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  57345. // "required": true,
  57346. // "type": "string"
  57347. // },
  57348. // "requestId": {
  57349. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  57350. // "location": "query",
  57351. // "type": "string"
  57352. // },
  57353. // "zone": {
  57354. // "description": "The name of the zone where the managed instance group is located.",
  57355. // "location": "path",
  57356. // "required": true,
  57357. // "type": "string"
  57358. // }
  57359. // },
  57360. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setTargetPools",
  57361. // "request": {
  57362. // "$ref": "InstanceGroupManagersSetTargetPoolsRequest"
  57363. // },
  57364. // "response": {
  57365. // "$ref": "Operation"
  57366. // },
  57367. // "scopes": [
  57368. // "https://www.googleapis.com/auth/cloud-platform",
  57369. // "https://www.googleapis.com/auth/compute"
  57370. // ]
  57371. // }
  57372. }
  57373. // method id "compute.instanceGroupManagers.testIamPermissions":
  57374. type InstanceGroupManagersTestIamPermissionsCall struct {
  57375. s *Service
  57376. project string
  57377. zone string
  57378. resource string
  57379. testpermissionsrequest *TestPermissionsRequest
  57380. urlParams_ gensupport.URLParams
  57381. ctx_ context.Context
  57382. header_ http.Header
  57383. }
  57384. // TestIamPermissions: Returns permissions that a caller has on the
  57385. // specified resource.
  57386. func (r *InstanceGroupManagersService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *InstanceGroupManagersTestIamPermissionsCall {
  57387. c := &InstanceGroupManagersTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  57388. c.project = project
  57389. c.zone = zone
  57390. c.resource = resource
  57391. c.testpermissionsrequest = testpermissionsrequest
  57392. return c
  57393. }
  57394. // Fields allows partial responses to be retrieved. See
  57395. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  57396. // for more information.
  57397. func (c *InstanceGroupManagersTestIamPermissionsCall) Fields(s ...googleapi.Field) *InstanceGroupManagersTestIamPermissionsCall {
  57398. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  57399. return c
  57400. }
  57401. // Context sets the context to be used in this call's Do method. Any
  57402. // pending HTTP request will be aborted if the provided context is
  57403. // canceled.
  57404. func (c *InstanceGroupManagersTestIamPermissionsCall) Context(ctx context.Context) *InstanceGroupManagersTestIamPermissionsCall {
  57405. c.ctx_ = ctx
  57406. return c
  57407. }
  57408. // Header returns an http.Header that can be modified by the caller to
  57409. // add HTTP headers to the request.
  57410. func (c *InstanceGroupManagersTestIamPermissionsCall) Header() http.Header {
  57411. if c.header_ == nil {
  57412. c.header_ = make(http.Header)
  57413. }
  57414. return c.header_
  57415. }
  57416. func (c *InstanceGroupManagersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  57417. reqHeaders := make(http.Header)
  57418. for k, v := range c.header_ {
  57419. reqHeaders[k] = v
  57420. }
  57421. reqHeaders.Set("User-Agent", c.s.userAgent())
  57422. var body io.Reader = nil
  57423. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  57424. if err != nil {
  57425. return nil, err
  57426. }
  57427. reqHeaders.Set("Content-Type", "application/json")
  57428. c.urlParams_.Set("alt", alt)
  57429. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{resource}/testIamPermissions")
  57430. urls += "?" + c.urlParams_.Encode()
  57431. req, _ := http.NewRequest("POST", urls, body)
  57432. req.Header = reqHeaders
  57433. googleapi.Expand(req.URL, map[string]string{
  57434. "project": c.project,
  57435. "zone": c.zone,
  57436. "resource": c.resource,
  57437. })
  57438. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  57439. }
  57440. // Do executes the "compute.instanceGroupManagers.testIamPermissions" call.
  57441. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  57442. // non-2xx status code is an error. Response headers are in either
  57443. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  57444. // returned at all) in error.(*googleapi.Error).Header. Use
  57445. // googleapi.IsNotModified to check whether the returned error was
  57446. // because http.StatusNotModified was returned.
  57447. func (c *InstanceGroupManagersTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  57448. gensupport.SetOptions(c.urlParams_, opts...)
  57449. res, err := c.doRequest("json")
  57450. if res != nil && res.StatusCode == http.StatusNotModified {
  57451. if res.Body != nil {
  57452. res.Body.Close()
  57453. }
  57454. return nil, &googleapi.Error{
  57455. Code: res.StatusCode,
  57456. Header: res.Header,
  57457. }
  57458. }
  57459. if err != nil {
  57460. return nil, err
  57461. }
  57462. defer googleapi.CloseBody(res)
  57463. if err := googleapi.CheckResponse(res); err != nil {
  57464. return nil, err
  57465. }
  57466. ret := &TestPermissionsResponse{
  57467. ServerResponse: googleapi.ServerResponse{
  57468. Header: res.Header,
  57469. HTTPStatusCode: res.StatusCode,
  57470. },
  57471. }
  57472. target := &ret
  57473. if err := gensupport.DecodeResponse(target, res); err != nil {
  57474. return nil, err
  57475. }
  57476. return ret, nil
  57477. // {
  57478. // "description": "Returns permissions that a caller has on the specified resource.",
  57479. // "httpMethod": "POST",
  57480. // "id": "compute.instanceGroupManagers.testIamPermissions",
  57481. // "parameterOrder": [
  57482. // "project",
  57483. // "zone",
  57484. // "resource"
  57485. // ],
  57486. // "parameters": {
  57487. // "project": {
  57488. // "description": "Project ID for this request.",
  57489. // "location": "path",
  57490. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  57491. // "required": true,
  57492. // "type": "string"
  57493. // },
  57494. // "resource": {
  57495. // "description": "Name of the resource for this request.",
  57496. // "location": "path",
  57497. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  57498. // "required": true,
  57499. // "type": "string"
  57500. // },
  57501. // "zone": {
  57502. // "description": "The name of the zone for this request.",
  57503. // "location": "path",
  57504. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  57505. // "required": true,
  57506. // "type": "string"
  57507. // }
  57508. // },
  57509. // "path": "{project}/zones/{zone}/instanceGroupManagers/{resource}/testIamPermissions",
  57510. // "request": {
  57511. // "$ref": "TestPermissionsRequest"
  57512. // },
  57513. // "response": {
  57514. // "$ref": "TestPermissionsResponse"
  57515. // },
  57516. // "scopes": [
  57517. // "https://www.googleapis.com/auth/cloud-platform",
  57518. // "https://www.googleapis.com/auth/compute",
  57519. // "https://www.googleapis.com/auth/compute.readonly"
  57520. // ]
  57521. // }
  57522. }
  57523. // method id "compute.instanceGroupManagers.update":
  57524. type InstanceGroupManagersUpdateCall struct {
  57525. s *Service
  57526. project string
  57527. zone string
  57528. instanceGroupManager string
  57529. instancegroupmanager *InstanceGroupManager
  57530. urlParams_ gensupport.URLParams
  57531. ctx_ context.Context
  57532. header_ http.Header
  57533. }
  57534. // Update: Updates a managed instance group using the information that
  57535. // you specify in the request. This operation is marked as DONE when the
  57536. // group is updated even if the instances in the group have not yet been
  57537. // updated. You must separately verify the status of the individual
  57538. // instances with the listManagedInstances method.
  57539. func (r *InstanceGroupManagersService) Update(project string, zone string, instanceGroupManager string, instancegroupmanager *InstanceGroupManager) *InstanceGroupManagersUpdateCall {
  57540. c := &InstanceGroupManagersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  57541. c.project = project
  57542. c.zone = zone
  57543. c.instanceGroupManager = instanceGroupManager
  57544. c.instancegroupmanager = instancegroupmanager
  57545. return c
  57546. }
  57547. // RequestId sets the optional parameter "requestId": An optional
  57548. // request ID to identify requests. Specify a unique request ID so that
  57549. // if you must retry your request, the server will know to ignore the
  57550. // request if it has already been completed.
  57551. //
  57552. // For example, consider a situation where you make an initial request
  57553. // and the request times out. If you make the request again with the
  57554. // same request ID, the server can check if original operation with the
  57555. // same request ID was received, and if so, will ignore the second
  57556. // request. This prevents clients from accidentally creating duplicate
  57557. // commitments.
  57558. //
  57559. // The request ID must be a valid UUID with the exception that zero UUID
  57560. // is not supported (00000000-0000-0000-0000-000000000000).
  57561. func (c *InstanceGroupManagersUpdateCall) RequestId(requestId string) *InstanceGroupManagersUpdateCall {
  57562. c.urlParams_.Set("requestId", requestId)
  57563. return c
  57564. }
  57565. // Fields allows partial responses to be retrieved. See
  57566. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  57567. // for more information.
  57568. func (c *InstanceGroupManagersUpdateCall) Fields(s ...googleapi.Field) *InstanceGroupManagersUpdateCall {
  57569. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  57570. return c
  57571. }
  57572. // Context sets the context to be used in this call's Do method. Any
  57573. // pending HTTP request will be aborted if the provided context is
  57574. // canceled.
  57575. func (c *InstanceGroupManagersUpdateCall) Context(ctx context.Context) *InstanceGroupManagersUpdateCall {
  57576. c.ctx_ = ctx
  57577. return c
  57578. }
  57579. // Header returns an http.Header that can be modified by the caller to
  57580. // add HTTP headers to the request.
  57581. func (c *InstanceGroupManagersUpdateCall) Header() http.Header {
  57582. if c.header_ == nil {
  57583. c.header_ = make(http.Header)
  57584. }
  57585. return c.header_
  57586. }
  57587. func (c *InstanceGroupManagersUpdateCall) doRequest(alt string) (*http.Response, error) {
  57588. reqHeaders := make(http.Header)
  57589. for k, v := range c.header_ {
  57590. reqHeaders[k] = v
  57591. }
  57592. reqHeaders.Set("User-Agent", c.s.userAgent())
  57593. var body io.Reader = nil
  57594. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager)
  57595. if err != nil {
  57596. return nil, err
  57597. }
  57598. reqHeaders.Set("Content-Type", "application/json")
  57599. c.urlParams_.Set("alt", alt)
  57600. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}")
  57601. urls += "?" + c.urlParams_.Encode()
  57602. req, _ := http.NewRequest("PUT", urls, body)
  57603. req.Header = reqHeaders
  57604. googleapi.Expand(req.URL, map[string]string{
  57605. "project": c.project,
  57606. "zone": c.zone,
  57607. "instanceGroupManager": c.instanceGroupManager,
  57608. })
  57609. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  57610. }
  57611. // Do executes the "compute.instanceGroupManagers.update" call.
  57612. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  57613. // status code is an error. Response headers are in either
  57614. // *Operation.ServerResponse.Header or (if a response was returned at
  57615. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  57616. // to check whether the returned error was because
  57617. // http.StatusNotModified was returned.
  57618. func (c *InstanceGroupManagersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  57619. gensupport.SetOptions(c.urlParams_, opts...)
  57620. res, err := c.doRequest("json")
  57621. if res != nil && res.StatusCode == http.StatusNotModified {
  57622. if res.Body != nil {
  57623. res.Body.Close()
  57624. }
  57625. return nil, &googleapi.Error{
  57626. Code: res.StatusCode,
  57627. Header: res.Header,
  57628. }
  57629. }
  57630. if err != nil {
  57631. return nil, err
  57632. }
  57633. defer googleapi.CloseBody(res)
  57634. if err := googleapi.CheckResponse(res); err != nil {
  57635. return nil, err
  57636. }
  57637. ret := &Operation{
  57638. ServerResponse: googleapi.ServerResponse{
  57639. Header: res.Header,
  57640. HTTPStatusCode: res.StatusCode,
  57641. },
  57642. }
  57643. target := &ret
  57644. if err := gensupport.DecodeResponse(target, res); err != nil {
  57645. return nil, err
  57646. }
  57647. return ret, nil
  57648. // {
  57649. // "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.",
  57650. // "httpMethod": "PUT",
  57651. // "id": "compute.instanceGroupManagers.update",
  57652. // "parameterOrder": [
  57653. // "project",
  57654. // "zone",
  57655. // "instanceGroupManager"
  57656. // ],
  57657. // "parameters": {
  57658. // "instanceGroupManager": {
  57659. // "description": "The name of the instance group manager.",
  57660. // "location": "path",
  57661. // "required": true,
  57662. // "type": "string"
  57663. // },
  57664. // "project": {
  57665. // "description": "Project ID for this request.",
  57666. // "location": "path",
  57667. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  57668. // "required": true,
  57669. // "type": "string"
  57670. // },
  57671. // "requestId": {
  57672. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  57673. // "location": "query",
  57674. // "type": "string"
  57675. // },
  57676. // "zone": {
  57677. // "description": "The name of the zone where you want to create the managed instance group.",
  57678. // "location": "path",
  57679. // "required": true,
  57680. // "type": "string"
  57681. // }
  57682. // },
  57683. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}",
  57684. // "request": {
  57685. // "$ref": "InstanceGroupManager"
  57686. // },
  57687. // "response": {
  57688. // "$ref": "Operation"
  57689. // },
  57690. // "scopes": [
  57691. // "https://www.googleapis.com/auth/cloud-platform",
  57692. // "https://www.googleapis.com/auth/compute"
  57693. // ]
  57694. // }
  57695. }
  57696. // method id "compute.instanceGroupManagers.updatePerInstanceConfigs":
  57697. type InstanceGroupManagersUpdatePerInstanceConfigsCall struct {
  57698. s *Service
  57699. project string
  57700. zone string
  57701. instanceGroupManager string
  57702. instancegroupmanagersupdateperinstanceconfigsreq *InstanceGroupManagersUpdatePerInstanceConfigsReq
  57703. urlParams_ gensupport.URLParams
  57704. ctx_ context.Context
  57705. header_ http.Header
  57706. }
  57707. // UpdatePerInstanceConfigs: Insert or patch (for the ones that already
  57708. // exist) per-instance configs for the managed instance group.
  57709. // perInstanceConfig.instance serves as a key used to distinguish
  57710. // whether to perform insert or patch.
  57711. func (r *InstanceGroupManagersService) UpdatePerInstanceConfigs(project string, zone string, instanceGroupManager string, instancegroupmanagersupdateperinstanceconfigsreq *InstanceGroupManagersUpdatePerInstanceConfigsReq) *InstanceGroupManagersUpdatePerInstanceConfigsCall {
  57712. c := &InstanceGroupManagersUpdatePerInstanceConfigsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  57713. c.project = project
  57714. c.zone = zone
  57715. c.instanceGroupManager = instanceGroupManager
  57716. c.instancegroupmanagersupdateperinstanceconfigsreq = instancegroupmanagersupdateperinstanceconfigsreq
  57717. return c
  57718. }
  57719. // RequestId sets the optional parameter "requestId": An optional
  57720. // request ID to identify requests. Specify a unique request ID so that
  57721. // if you must retry your request, the server will know to ignore the
  57722. // request if it has already been completed.
  57723. //
  57724. // For example, consider a situation where you make an initial request
  57725. // and the request times out. If you make the request again with the
  57726. // same request ID, the server can check if original operation with the
  57727. // same request ID was received, and if so, will ignore the second
  57728. // request. This prevents clients from accidentally creating duplicate
  57729. // commitments.
  57730. //
  57731. // The request ID must be a valid UUID with the exception that zero UUID
  57732. // is not supported (00000000-0000-0000-0000-000000000000).
  57733. func (c *InstanceGroupManagersUpdatePerInstanceConfigsCall) RequestId(requestId string) *InstanceGroupManagersUpdatePerInstanceConfigsCall {
  57734. c.urlParams_.Set("requestId", requestId)
  57735. return c
  57736. }
  57737. // Fields allows partial responses to be retrieved. See
  57738. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  57739. // for more information.
  57740. func (c *InstanceGroupManagersUpdatePerInstanceConfigsCall) Fields(s ...googleapi.Field) *InstanceGroupManagersUpdatePerInstanceConfigsCall {
  57741. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  57742. return c
  57743. }
  57744. // Context sets the context to be used in this call's Do method. Any
  57745. // pending HTTP request will be aborted if the provided context is
  57746. // canceled.
  57747. func (c *InstanceGroupManagersUpdatePerInstanceConfigsCall) Context(ctx context.Context) *InstanceGroupManagersUpdatePerInstanceConfigsCall {
  57748. c.ctx_ = ctx
  57749. return c
  57750. }
  57751. // Header returns an http.Header that can be modified by the caller to
  57752. // add HTTP headers to the request.
  57753. func (c *InstanceGroupManagersUpdatePerInstanceConfigsCall) Header() http.Header {
  57754. if c.header_ == nil {
  57755. c.header_ = make(http.Header)
  57756. }
  57757. return c.header_
  57758. }
  57759. func (c *InstanceGroupManagersUpdatePerInstanceConfigsCall) doRequest(alt string) (*http.Response, error) {
  57760. reqHeaders := make(http.Header)
  57761. for k, v := range c.header_ {
  57762. reqHeaders[k] = v
  57763. }
  57764. reqHeaders.Set("User-Agent", c.s.userAgent())
  57765. var body io.Reader = nil
  57766. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersupdateperinstanceconfigsreq)
  57767. if err != nil {
  57768. return nil, err
  57769. }
  57770. reqHeaders.Set("Content-Type", "application/json")
  57771. c.urlParams_.Set("alt", alt)
  57772. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/updatePerInstanceConfigs")
  57773. urls += "?" + c.urlParams_.Encode()
  57774. req, _ := http.NewRequest("POST", urls, body)
  57775. req.Header = reqHeaders
  57776. googleapi.Expand(req.URL, map[string]string{
  57777. "project": c.project,
  57778. "zone": c.zone,
  57779. "instanceGroupManager": c.instanceGroupManager,
  57780. })
  57781. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  57782. }
  57783. // Do executes the "compute.instanceGroupManagers.updatePerInstanceConfigs" call.
  57784. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  57785. // status code is an error. Response headers are in either
  57786. // *Operation.ServerResponse.Header or (if a response was returned at
  57787. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  57788. // to check whether the returned error was because
  57789. // http.StatusNotModified was returned.
  57790. func (c *InstanceGroupManagersUpdatePerInstanceConfigsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  57791. gensupport.SetOptions(c.urlParams_, opts...)
  57792. res, err := c.doRequest("json")
  57793. if res != nil && res.StatusCode == http.StatusNotModified {
  57794. if res.Body != nil {
  57795. res.Body.Close()
  57796. }
  57797. return nil, &googleapi.Error{
  57798. Code: res.StatusCode,
  57799. Header: res.Header,
  57800. }
  57801. }
  57802. if err != nil {
  57803. return nil, err
  57804. }
  57805. defer googleapi.CloseBody(res)
  57806. if err := googleapi.CheckResponse(res); err != nil {
  57807. return nil, err
  57808. }
  57809. ret := &Operation{
  57810. ServerResponse: googleapi.ServerResponse{
  57811. Header: res.Header,
  57812. HTTPStatusCode: res.StatusCode,
  57813. },
  57814. }
  57815. target := &ret
  57816. if err := gensupport.DecodeResponse(target, res); err != nil {
  57817. return nil, err
  57818. }
  57819. return ret, nil
  57820. // {
  57821. // "description": "Insert or patch (for the ones that already exist) per-instance configs for the managed instance group. perInstanceConfig.instance serves as a key used to distinguish whether to perform insert or patch.",
  57822. // "httpMethod": "POST",
  57823. // "id": "compute.instanceGroupManagers.updatePerInstanceConfigs",
  57824. // "parameterOrder": [
  57825. // "project",
  57826. // "zone",
  57827. // "instanceGroupManager"
  57828. // ],
  57829. // "parameters": {
  57830. // "instanceGroupManager": {
  57831. // "description": "The name of the managed instance group. It should conform to RFC1035.",
  57832. // "location": "path",
  57833. // "required": true,
  57834. // "type": "string"
  57835. // },
  57836. // "project": {
  57837. // "description": "Project ID for this request.",
  57838. // "location": "path",
  57839. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  57840. // "required": true,
  57841. // "type": "string"
  57842. // },
  57843. // "requestId": {
  57844. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  57845. // "location": "query",
  57846. // "type": "string"
  57847. // },
  57848. // "zone": {
  57849. // "description": "The name of the zone where the managed instance group is located. It should conform to RFC1035.",
  57850. // "location": "path",
  57851. // "required": true,
  57852. // "type": "string"
  57853. // }
  57854. // },
  57855. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/updatePerInstanceConfigs",
  57856. // "request": {
  57857. // "$ref": "InstanceGroupManagersUpdatePerInstanceConfigsReq"
  57858. // },
  57859. // "response": {
  57860. // "$ref": "Operation"
  57861. // },
  57862. // "scopes": [
  57863. // "https://www.googleapis.com/auth/cloud-platform",
  57864. // "https://www.googleapis.com/auth/compute"
  57865. // ]
  57866. // }
  57867. }
  57868. // method id "compute.instanceGroups.addInstances":
  57869. type InstanceGroupsAddInstancesCall struct {
  57870. s *Service
  57871. project string
  57872. zone string
  57873. instanceGroup string
  57874. instancegroupsaddinstancesrequest *InstanceGroupsAddInstancesRequest
  57875. urlParams_ gensupport.URLParams
  57876. ctx_ context.Context
  57877. header_ http.Header
  57878. }
  57879. // AddInstances: Adds a list of instances to the specified instance
  57880. // group. All of the instances in the instance group must be in the same
  57881. // network/subnetwork. Read Adding instances for more information.
  57882. func (r *InstanceGroupsService) AddInstances(project string, zone string, instanceGroup string, instancegroupsaddinstancesrequest *InstanceGroupsAddInstancesRequest) *InstanceGroupsAddInstancesCall {
  57883. c := &InstanceGroupsAddInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  57884. c.project = project
  57885. c.zone = zone
  57886. c.instanceGroup = instanceGroup
  57887. c.instancegroupsaddinstancesrequest = instancegroupsaddinstancesrequest
  57888. return c
  57889. }
  57890. // RequestId sets the optional parameter "requestId": An optional
  57891. // request ID to identify requests. Specify a unique request ID so that
  57892. // if you must retry your request, the server will know to ignore the
  57893. // request if it has already been completed.
  57894. //
  57895. // For example, consider a situation where you make an initial request
  57896. // and the request times out. If you make the request again with the
  57897. // same request ID, the server can check if original operation with the
  57898. // same request ID was received, and if so, will ignore the second
  57899. // request. This prevents clients from accidentally creating duplicate
  57900. // commitments.
  57901. //
  57902. // The request ID must be a valid UUID with the exception that zero UUID
  57903. // is not supported (00000000-0000-0000-0000-000000000000).
  57904. func (c *InstanceGroupsAddInstancesCall) RequestId(requestId string) *InstanceGroupsAddInstancesCall {
  57905. c.urlParams_.Set("requestId", requestId)
  57906. return c
  57907. }
  57908. // Fields allows partial responses to be retrieved. See
  57909. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  57910. // for more information.
  57911. func (c *InstanceGroupsAddInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupsAddInstancesCall {
  57912. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  57913. return c
  57914. }
  57915. // Context sets the context to be used in this call's Do method. Any
  57916. // pending HTTP request will be aborted if the provided context is
  57917. // canceled.
  57918. func (c *InstanceGroupsAddInstancesCall) Context(ctx context.Context) *InstanceGroupsAddInstancesCall {
  57919. c.ctx_ = ctx
  57920. return c
  57921. }
  57922. // Header returns an http.Header that can be modified by the caller to
  57923. // add HTTP headers to the request.
  57924. func (c *InstanceGroupsAddInstancesCall) Header() http.Header {
  57925. if c.header_ == nil {
  57926. c.header_ = make(http.Header)
  57927. }
  57928. return c.header_
  57929. }
  57930. func (c *InstanceGroupsAddInstancesCall) doRequest(alt string) (*http.Response, error) {
  57931. reqHeaders := make(http.Header)
  57932. for k, v := range c.header_ {
  57933. reqHeaders[k] = v
  57934. }
  57935. reqHeaders.Set("User-Agent", c.s.userAgent())
  57936. var body io.Reader = nil
  57937. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupsaddinstancesrequest)
  57938. if err != nil {
  57939. return nil, err
  57940. }
  57941. reqHeaders.Set("Content-Type", "application/json")
  57942. c.urlParams_.Set("alt", alt)
  57943. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}/addInstances")
  57944. urls += "?" + c.urlParams_.Encode()
  57945. req, _ := http.NewRequest("POST", urls, body)
  57946. req.Header = reqHeaders
  57947. googleapi.Expand(req.URL, map[string]string{
  57948. "project": c.project,
  57949. "zone": c.zone,
  57950. "instanceGroup": c.instanceGroup,
  57951. })
  57952. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  57953. }
  57954. // Do executes the "compute.instanceGroups.addInstances" call.
  57955. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  57956. // status code is an error. Response headers are in either
  57957. // *Operation.ServerResponse.Header or (if a response was returned at
  57958. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  57959. // to check whether the returned error was because
  57960. // http.StatusNotModified was returned.
  57961. func (c *InstanceGroupsAddInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  57962. gensupport.SetOptions(c.urlParams_, opts...)
  57963. res, err := c.doRequest("json")
  57964. if res != nil && res.StatusCode == http.StatusNotModified {
  57965. if res.Body != nil {
  57966. res.Body.Close()
  57967. }
  57968. return nil, &googleapi.Error{
  57969. Code: res.StatusCode,
  57970. Header: res.Header,
  57971. }
  57972. }
  57973. if err != nil {
  57974. return nil, err
  57975. }
  57976. defer googleapi.CloseBody(res)
  57977. if err := googleapi.CheckResponse(res); err != nil {
  57978. return nil, err
  57979. }
  57980. ret := &Operation{
  57981. ServerResponse: googleapi.ServerResponse{
  57982. Header: res.Header,
  57983. HTTPStatusCode: res.StatusCode,
  57984. },
  57985. }
  57986. target := &ret
  57987. if err := gensupport.DecodeResponse(target, res); err != nil {
  57988. return nil, err
  57989. }
  57990. return ret, nil
  57991. // {
  57992. // "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.",
  57993. // "httpMethod": "POST",
  57994. // "id": "compute.instanceGroups.addInstances",
  57995. // "parameterOrder": [
  57996. // "project",
  57997. // "zone",
  57998. // "instanceGroup"
  57999. // ],
  58000. // "parameters": {
  58001. // "instanceGroup": {
  58002. // "description": "The name of the instance group where you are adding instances.",
  58003. // "location": "path",
  58004. // "required": true,
  58005. // "type": "string"
  58006. // },
  58007. // "project": {
  58008. // "description": "Project ID for this request.",
  58009. // "location": "path",
  58010. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  58011. // "required": true,
  58012. // "type": "string"
  58013. // },
  58014. // "requestId": {
  58015. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  58016. // "location": "query",
  58017. // "type": "string"
  58018. // },
  58019. // "zone": {
  58020. // "description": "The name of the zone where the instance group is located.",
  58021. // "location": "path",
  58022. // "required": true,
  58023. // "type": "string"
  58024. // }
  58025. // },
  58026. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/addInstances",
  58027. // "request": {
  58028. // "$ref": "InstanceGroupsAddInstancesRequest"
  58029. // },
  58030. // "response": {
  58031. // "$ref": "Operation"
  58032. // },
  58033. // "scopes": [
  58034. // "https://www.googleapis.com/auth/cloud-platform",
  58035. // "https://www.googleapis.com/auth/compute"
  58036. // ]
  58037. // }
  58038. }
  58039. // method id "compute.instanceGroups.aggregatedList":
  58040. type InstanceGroupsAggregatedListCall struct {
  58041. s *Service
  58042. project string
  58043. urlParams_ gensupport.URLParams
  58044. ifNoneMatch_ string
  58045. ctx_ context.Context
  58046. header_ http.Header
  58047. }
  58048. // AggregatedList: Retrieves the list of instance groups and sorts them
  58049. // by zone.
  58050. func (r *InstanceGroupsService) AggregatedList(project string) *InstanceGroupsAggregatedListCall {
  58051. c := &InstanceGroupsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  58052. c.project = project
  58053. return c
  58054. }
  58055. // Filter sets the optional parameter "filter": A filter expression that
  58056. // filters resources listed in the response. The expression must specify
  58057. // the field name, a comparison operator, and the value that you want to
  58058. // use for filtering. The value must be a string, a number, or a
  58059. // boolean. The comparison operator must be either =, !=, >, or <.
  58060. //
  58061. // For example, if you are filtering Compute Engine instances, you can
  58062. // exclude instances named example-instance by specifying name !=
  58063. // example-instance.
  58064. //
  58065. // You can also filter nested fields. For example, you could specify
  58066. // scheduling.automaticRestart = false to include instances only if they
  58067. // are not scheduled for automatic restarts. You can use filtering on
  58068. // nested fields to filter based on resource labels.
  58069. //
  58070. // To filter on multiple expressions, provide each separate expression
  58071. // within parentheses. For example, (scheduling.automaticRestart = true)
  58072. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  58073. // AND expression. However, you can include AND and OR expressions
  58074. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  58075. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  58076. // true).
  58077. func (c *InstanceGroupsAggregatedListCall) Filter(filter string) *InstanceGroupsAggregatedListCall {
  58078. c.urlParams_.Set("filter", filter)
  58079. return c
  58080. }
  58081. // MaxResults sets the optional parameter "maxResults": The maximum
  58082. // number of results per page that should be returned. If the number of
  58083. // available results is larger than maxResults, Compute Engine returns a
  58084. // nextPageToken that can be used to get the next page of results in
  58085. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  58086. // (Default: 500)
  58087. func (c *InstanceGroupsAggregatedListCall) MaxResults(maxResults int64) *InstanceGroupsAggregatedListCall {
  58088. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  58089. return c
  58090. }
  58091. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  58092. // a certain order. By default, results are returned in alphanumerical
  58093. // order based on the resource name.
  58094. //
  58095. // You can also sort results in descending order based on the creation
  58096. // timestamp using orderBy="creationTimestamp desc". This sorts results
  58097. // based on the creationTimestamp field in reverse chronological order
  58098. // (newest result first). Use this to sort resources like operations so
  58099. // that the newest operation is returned first.
  58100. //
  58101. // Currently, only sorting by name or creationTimestamp desc is
  58102. // supported.
  58103. func (c *InstanceGroupsAggregatedListCall) OrderBy(orderBy string) *InstanceGroupsAggregatedListCall {
  58104. c.urlParams_.Set("orderBy", orderBy)
  58105. return c
  58106. }
  58107. // PageToken sets the optional parameter "pageToken": Specifies a page
  58108. // token to use. Set pageToken to the nextPageToken returned by a
  58109. // previous list request to get the next page of results.
  58110. func (c *InstanceGroupsAggregatedListCall) PageToken(pageToken string) *InstanceGroupsAggregatedListCall {
  58111. c.urlParams_.Set("pageToken", pageToken)
  58112. return c
  58113. }
  58114. // Fields allows partial responses to be retrieved. See
  58115. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  58116. // for more information.
  58117. func (c *InstanceGroupsAggregatedListCall) Fields(s ...googleapi.Field) *InstanceGroupsAggregatedListCall {
  58118. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  58119. return c
  58120. }
  58121. // IfNoneMatch sets the optional parameter which makes the operation
  58122. // fail if the object's ETag matches the given value. This is useful for
  58123. // getting updates only after the object has changed since the last
  58124. // request. Use googleapi.IsNotModified to check whether the response
  58125. // error from Do is the result of In-None-Match.
  58126. func (c *InstanceGroupsAggregatedListCall) IfNoneMatch(entityTag string) *InstanceGroupsAggregatedListCall {
  58127. c.ifNoneMatch_ = entityTag
  58128. return c
  58129. }
  58130. // Context sets the context to be used in this call's Do method. Any
  58131. // pending HTTP request will be aborted if the provided context is
  58132. // canceled.
  58133. func (c *InstanceGroupsAggregatedListCall) Context(ctx context.Context) *InstanceGroupsAggregatedListCall {
  58134. c.ctx_ = ctx
  58135. return c
  58136. }
  58137. // Header returns an http.Header that can be modified by the caller to
  58138. // add HTTP headers to the request.
  58139. func (c *InstanceGroupsAggregatedListCall) Header() http.Header {
  58140. if c.header_ == nil {
  58141. c.header_ = make(http.Header)
  58142. }
  58143. return c.header_
  58144. }
  58145. func (c *InstanceGroupsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  58146. reqHeaders := make(http.Header)
  58147. for k, v := range c.header_ {
  58148. reqHeaders[k] = v
  58149. }
  58150. reqHeaders.Set("User-Agent", c.s.userAgent())
  58151. if c.ifNoneMatch_ != "" {
  58152. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  58153. }
  58154. var body io.Reader = nil
  58155. c.urlParams_.Set("alt", alt)
  58156. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/instanceGroups")
  58157. urls += "?" + c.urlParams_.Encode()
  58158. req, _ := http.NewRequest("GET", urls, body)
  58159. req.Header = reqHeaders
  58160. googleapi.Expand(req.URL, map[string]string{
  58161. "project": c.project,
  58162. })
  58163. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  58164. }
  58165. // Do executes the "compute.instanceGroups.aggregatedList" call.
  58166. // Exactly one of *InstanceGroupAggregatedList or error will be non-nil.
  58167. // Any non-2xx status code is an error. Response headers are in either
  58168. // *InstanceGroupAggregatedList.ServerResponse.Header or (if a response
  58169. // was returned at all) in error.(*googleapi.Error).Header. Use
  58170. // googleapi.IsNotModified to check whether the returned error was
  58171. // because http.StatusNotModified was returned.
  58172. func (c *InstanceGroupsAggregatedListCall) Do(opts ...googleapi.CallOption) (*InstanceGroupAggregatedList, error) {
  58173. gensupport.SetOptions(c.urlParams_, opts...)
  58174. res, err := c.doRequest("json")
  58175. if res != nil && res.StatusCode == http.StatusNotModified {
  58176. if res.Body != nil {
  58177. res.Body.Close()
  58178. }
  58179. return nil, &googleapi.Error{
  58180. Code: res.StatusCode,
  58181. Header: res.Header,
  58182. }
  58183. }
  58184. if err != nil {
  58185. return nil, err
  58186. }
  58187. defer googleapi.CloseBody(res)
  58188. if err := googleapi.CheckResponse(res); err != nil {
  58189. return nil, err
  58190. }
  58191. ret := &InstanceGroupAggregatedList{
  58192. ServerResponse: googleapi.ServerResponse{
  58193. Header: res.Header,
  58194. HTTPStatusCode: res.StatusCode,
  58195. },
  58196. }
  58197. target := &ret
  58198. if err := gensupport.DecodeResponse(target, res); err != nil {
  58199. return nil, err
  58200. }
  58201. return ret, nil
  58202. // {
  58203. // "description": "Retrieves the list of instance groups and sorts them by zone.",
  58204. // "httpMethod": "GET",
  58205. // "id": "compute.instanceGroups.aggregatedList",
  58206. // "parameterOrder": [
  58207. // "project"
  58208. // ],
  58209. // "parameters": {
  58210. // "filter": {
  58211. // "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).",
  58212. // "location": "query",
  58213. // "type": "string"
  58214. // },
  58215. // "maxResults": {
  58216. // "default": "500",
  58217. // "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)",
  58218. // "format": "uint32",
  58219. // "location": "query",
  58220. // "minimum": "0",
  58221. // "type": "integer"
  58222. // },
  58223. // "orderBy": {
  58224. // "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.",
  58225. // "location": "query",
  58226. // "type": "string"
  58227. // },
  58228. // "pageToken": {
  58229. // "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.",
  58230. // "location": "query",
  58231. // "type": "string"
  58232. // },
  58233. // "project": {
  58234. // "description": "Project ID for this request.",
  58235. // "location": "path",
  58236. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  58237. // "required": true,
  58238. // "type": "string"
  58239. // }
  58240. // },
  58241. // "path": "{project}/aggregated/instanceGroups",
  58242. // "response": {
  58243. // "$ref": "InstanceGroupAggregatedList"
  58244. // },
  58245. // "scopes": [
  58246. // "https://www.googleapis.com/auth/cloud-platform",
  58247. // "https://www.googleapis.com/auth/compute",
  58248. // "https://www.googleapis.com/auth/compute.readonly"
  58249. // ]
  58250. // }
  58251. }
  58252. // Pages invokes f for each page of results.
  58253. // A non-nil error returned from f will halt the iteration.
  58254. // The provided context supersedes any context provided to the Context method.
  58255. func (c *InstanceGroupsAggregatedListCall) Pages(ctx context.Context, f func(*InstanceGroupAggregatedList) error) error {
  58256. c.ctx_ = ctx
  58257. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  58258. for {
  58259. x, err := c.Do()
  58260. if err != nil {
  58261. return err
  58262. }
  58263. if err := f(x); err != nil {
  58264. return err
  58265. }
  58266. if x.NextPageToken == "" {
  58267. return nil
  58268. }
  58269. c.PageToken(x.NextPageToken)
  58270. }
  58271. }
  58272. // method id "compute.instanceGroups.delete":
  58273. type InstanceGroupsDeleteCall struct {
  58274. s *Service
  58275. project string
  58276. zone string
  58277. instanceGroup string
  58278. urlParams_ gensupport.URLParams
  58279. ctx_ context.Context
  58280. header_ http.Header
  58281. }
  58282. // Delete: Deletes the specified instance group. The instances in the
  58283. // group are not deleted. Note that instance group must not belong to a
  58284. // backend service. Read Deleting an instance group for more
  58285. // information.
  58286. func (r *InstanceGroupsService) Delete(project string, zone string, instanceGroup string) *InstanceGroupsDeleteCall {
  58287. c := &InstanceGroupsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  58288. c.project = project
  58289. c.zone = zone
  58290. c.instanceGroup = instanceGroup
  58291. return c
  58292. }
  58293. // RequestId sets the optional parameter "requestId": An optional
  58294. // request ID to identify requests. Specify a unique request ID so that
  58295. // if you must retry your request, the server will know to ignore the
  58296. // request if it has already been completed.
  58297. //
  58298. // For example, consider a situation where you make an initial request
  58299. // and the request times out. If you make the request again with the
  58300. // same request ID, the server can check if original operation with the
  58301. // same request ID was received, and if so, will ignore the second
  58302. // request. This prevents clients from accidentally creating duplicate
  58303. // commitments.
  58304. //
  58305. // The request ID must be a valid UUID with the exception that zero UUID
  58306. // is not supported (00000000-0000-0000-0000-000000000000).
  58307. func (c *InstanceGroupsDeleteCall) RequestId(requestId string) *InstanceGroupsDeleteCall {
  58308. c.urlParams_.Set("requestId", requestId)
  58309. return c
  58310. }
  58311. // Fields allows partial responses to be retrieved. See
  58312. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  58313. // for more information.
  58314. func (c *InstanceGroupsDeleteCall) Fields(s ...googleapi.Field) *InstanceGroupsDeleteCall {
  58315. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  58316. return c
  58317. }
  58318. // Context sets the context to be used in this call's Do method. Any
  58319. // pending HTTP request will be aborted if the provided context is
  58320. // canceled.
  58321. func (c *InstanceGroupsDeleteCall) Context(ctx context.Context) *InstanceGroupsDeleteCall {
  58322. c.ctx_ = ctx
  58323. return c
  58324. }
  58325. // Header returns an http.Header that can be modified by the caller to
  58326. // add HTTP headers to the request.
  58327. func (c *InstanceGroupsDeleteCall) Header() http.Header {
  58328. if c.header_ == nil {
  58329. c.header_ = make(http.Header)
  58330. }
  58331. return c.header_
  58332. }
  58333. func (c *InstanceGroupsDeleteCall) doRequest(alt string) (*http.Response, error) {
  58334. reqHeaders := make(http.Header)
  58335. for k, v := range c.header_ {
  58336. reqHeaders[k] = v
  58337. }
  58338. reqHeaders.Set("User-Agent", c.s.userAgent())
  58339. var body io.Reader = nil
  58340. c.urlParams_.Set("alt", alt)
  58341. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}")
  58342. urls += "?" + c.urlParams_.Encode()
  58343. req, _ := http.NewRequest("DELETE", urls, body)
  58344. req.Header = reqHeaders
  58345. googleapi.Expand(req.URL, map[string]string{
  58346. "project": c.project,
  58347. "zone": c.zone,
  58348. "instanceGroup": c.instanceGroup,
  58349. })
  58350. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  58351. }
  58352. // Do executes the "compute.instanceGroups.delete" call.
  58353. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  58354. // status code is an error. Response headers are in either
  58355. // *Operation.ServerResponse.Header or (if a response was returned at
  58356. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  58357. // to check whether the returned error was because
  58358. // http.StatusNotModified was returned.
  58359. func (c *InstanceGroupsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  58360. gensupport.SetOptions(c.urlParams_, opts...)
  58361. res, err := c.doRequest("json")
  58362. if res != nil && res.StatusCode == http.StatusNotModified {
  58363. if res.Body != nil {
  58364. res.Body.Close()
  58365. }
  58366. return nil, &googleapi.Error{
  58367. Code: res.StatusCode,
  58368. Header: res.Header,
  58369. }
  58370. }
  58371. if err != nil {
  58372. return nil, err
  58373. }
  58374. defer googleapi.CloseBody(res)
  58375. if err := googleapi.CheckResponse(res); err != nil {
  58376. return nil, err
  58377. }
  58378. ret := &Operation{
  58379. ServerResponse: googleapi.ServerResponse{
  58380. Header: res.Header,
  58381. HTTPStatusCode: res.StatusCode,
  58382. },
  58383. }
  58384. target := &ret
  58385. if err := gensupport.DecodeResponse(target, res); err != nil {
  58386. return nil, err
  58387. }
  58388. return ret, nil
  58389. // {
  58390. // "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.",
  58391. // "httpMethod": "DELETE",
  58392. // "id": "compute.instanceGroups.delete",
  58393. // "parameterOrder": [
  58394. // "project",
  58395. // "zone",
  58396. // "instanceGroup"
  58397. // ],
  58398. // "parameters": {
  58399. // "instanceGroup": {
  58400. // "description": "The name of the instance group to delete.",
  58401. // "location": "path",
  58402. // "required": true,
  58403. // "type": "string"
  58404. // },
  58405. // "project": {
  58406. // "description": "Project ID for this request.",
  58407. // "location": "path",
  58408. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  58409. // "required": true,
  58410. // "type": "string"
  58411. // },
  58412. // "requestId": {
  58413. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  58414. // "location": "query",
  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}",
  58425. // "response": {
  58426. // "$ref": "Operation"
  58427. // },
  58428. // "scopes": [
  58429. // "https://www.googleapis.com/auth/cloud-platform",
  58430. // "https://www.googleapis.com/auth/compute"
  58431. // ]
  58432. // }
  58433. }
  58434. // method id "compute.instanceGroups.get":
  58435. type InstanceGroupsGetCall struct {
  58436. s *Service
  58437. project string
  58438. zone string
  58439. instanceGroup string
  58440. urlParams_ gensupport.URLParams
  58441. ifNoneMatch_ string
  58442. ctx_ context.Context
  58443. header_ http.Header
  58444. }
  58445. // Get: Returns the specified instance group. Gets a list of available
  58446. // instance groups by making a list() request.
  58447. func (r *InstanceGroupsService) Get(project string, zone string, instanceGroup string) *InstanceGroupsGetCall {
  58448. c := &InstanceGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  58449. c.project = project
  58450. c.zone = zone
  58451. c.instanceGroup = instanceGroup
  58452. return c
  58453. }
  58454. // Fields allows partial responses to be retrieved. See
  58455. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  58456. // for more information.
  58457. func (c *InstanceGroupsGetCall) Fields(s ...googleapi.Field) *InstanceGroupsGetCall {
  58458. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  58459. return c
  58460. }
  58461. // IfNoneMatch sets the optional parameter which makes the operation
  58462. // fail if the object's ETag matches the given value. This is useful for
  58463. // getting updates only after the object has changed since the last
  58464. // request. Use googleapi.IsNotModified to check whether the response
  58465. // error from Do is the result of In-None-Match.
  58466. func (c *InstanceGroupsGetCall) IfNoneMatch(entityTag string) *InstanceGroupsGetCall {
  58467. c.ifNoneMatch_ = entityTag
  58468. return c
  58469. }
  58470. // Context sets the context to be used in this call's Do method. Any
  58471. // pending HTTP request will be aborted if the provided context is
  58472. // canceled.
  58473. func (c *InstanceGroupsGetCall) Context(ctx context.Context) *InstanceGroupsGetCall {
  58474. c.ctx_ = ctx
  58475. return c
  58476. }
  58477. // Header returns an http.Header that can be modified by the caller to
  58478. // add HTTP headers to the request.
  58479. func (c *InstanceGroupsGetCall) Header() http.Header {
  58480. if c.header_ == nil {
  58481. c.header_ = make(http.Header)
  58482. }
  58483. return c.header_
  58484. }
  58485. func (c *InstanceGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  58486. reqHeaders := make(http.Header)
  58487. for k, v := range c.header_ {
  58488. reqHeaders[k] = v
  58489. }
  58490. reqHeaders.Set("User-Agent", c.s.userAgent())
  58491. if c.ifNoneMatch_ != "" {
  58492. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  58493. }
  58494. var body io.Reader = nil
  58495. c.urlParams_.Set("alt", alt)
  58496. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}")
  58497. urls += "?" + c.urlParams_.Encode()
  58498. req, _ := http.NewRequest("GET", urls, body)
  58499. req.Header = reqHeaders
  58500. googleapi.Expand(req.URL, map[string]string{
  58501. "project": c.project,
  58502. "zone": c.zone,
  58503. "instanceGroup": c.instanceGroup,
  58504. })
  58505. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  58506. }
  58507. // Do executes the "compute.instanceGroups.get" call.
  58508. // Exactly one of *InstanceGroup or error will be non-nil. Any non-2xx
  58509. // status code is an error. Response headers are in either
  58510. // *InstanceGroup.ServerResponse.Header or (if a response was returned
  58511. // at all) in error.(*googleapi.Error).Header. Use
  58512. // googleapi.IsNotModified to check whether the returned error was
  58513. // because http.StatusNotModified was returned.
  58514. func (c *InstanceGroupsGetCall) Do(opts ...googleapi.CallOption) (*InstanceGroup, error) {
  58515. gensupport.SetOptions(c.urlParams_, opts...)
  58516. res, err := c.doRequest("json")
  58517. if res != nil && res.StatusCode == http.StatusNotModified {
  58518. if res.Body != nil {
  58519. res.Body.Close()
  58520. }
  58521. return nil, &googleapi.Error{
  58522. Code: res.StatusCode,
  58523. Header: res.Header,
  58524. }
  58525. }
  58526. if err != nil {
  58527. return nil, err
  58528. }
  58529. defer googleapi.CloseBody(res)
  58530. if err := googleapi.CheckResponse(res); err != nil {
  58531. return nil, err
  58532. }
  58533. ret := &InstanceGroup{
  58534. ServerResponse: googleapi.ServerResponse{
  58535. Header: res.Header,
  58536. HTTPStatusCode: res.StatusCode,
  58537. },
  58538. }
  58539. target := &ret
  58540. if err := gensupport.DecodeResponse(target, res); err != nil {
  58541. return nil, err
  58542. }
  58543. return ret, nil
  58544. // {
  58545. // "description": "Returns the specified instance group. Gets a list of available instance groups by making a list() request.",
  58546. // "httpMethod": "GET",
  58547. // "id": "compute.instanceGroups.get",
  58548. // "parameterOrder": [
  58549. // "project",
  58550. // "zone",
  58551. // "instanceGroup"
  58552. // ],
  58553. // "parameters": {
  58554. // "instanceGroup": {
  58555. // "description": "The name of the instance group.",
  58556. // "location": "path",
  58557. // "required": true,
  58558. // "type": "string"
  58559. // },
  58560. // "project": {
  58561. // "description": "Project ID for this request.",
  58562. // "location": "path",
  58563. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  58564. // "required": true,
  58565. // "type": "string"
  58566. // },
  58567. // "zone": {
  58568. // "description": "The name of the zone where the instance group is located.",
  58569. // "location": "path",
  58570. // "required": true,
  58571. // "type": "string"
  58572. // }
  58573. // },
  58574. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}",
  58575. // "response": {
  58576. // "$ref": "InstanceGroup"
  58577. // },
  58578. // "scopes": [
  58579. // "https://www.googleapis.com/auth/cloud-platform",
  58580. // "https://www.googleapis.com/auth/compute",
  58581. // "https://www.googleapis.com/auth/compute.readonly"
  58582. // ]
  58583. // }
  58584. }
  58585. // method id "compute.instanceGroups.insert":
  58586. type InstanceGroupsInsertCall struct {
  58587. s *Service
  58588. project string
  58589. zone string
  58590. instancegroup *InstanceGroup
  58591. urlParams_ gensupport.URLParams
  58592. ctx_ context.Context
  58593. header_ http.Header
  58594. }
  58595. // Insert: Creates an instance group in the specified project using the
  58596. // parameters that are included in the request.
  58597. func (r *InstanceGroupsService) Insert(project string, zone string, instancegroup *InstanceGroup) *InstanceGroupsInsertCall {
  58598. c := &InstanceGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  58599. c.project = project
  58600. c.zone = zone
  58601. c.instancegroup = instancegroup
  58602. return c
  58603. }
  58604. // RequestId sets the optional parameter "requestId": An optional
  58605. // request ID to identify requests. Specify a unique request ID so that
  58606. // if you must retry your request, the server will know to ignore the
  58607. // request if it has already been completed.
  58608. //
  58609. // For example, consider a situation where you make an initial request
  58610. // and the request times out. If you make the request again with the
  58611. // same request ID, the server can check if original operation with the
  58612. // same request ID was received, and if so, will ignore the second
  58613. // request. This prevents clients from accidentally creating duplicate
  58614. // commitments.
  58615. //
  58616. // The request ID must be a valid UUID with the exception that zero UUID
  58617. // is not supported (00000000-0000-0000-0000-000000000000).
  58618. func (c *InstanceGroupsInsertCall) RequestId(requestId string) *InstanceGroupsInsertCall {
  58619. c.urlParams_.Set("requestId", requestId)
  58620. return c
  58621. }
  58622. // Fields allows partial responses to be retrieved. See
  58623. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  58624. // for more information.
  58625. func (c *InstanceGroupsInsertCall) Fields(s ...googleapi.Field) *InstanceGroupsInsertCall {
  58626. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  58627. return c
  58628. }
  58629. // Context sets the context to be used in this call's Do method. Any
  58630. // pending HTTP request will be aborted if the provided context is
  58631. // canceled.
  58632. func (c *InstanceGroupsInsertCall) Context(ctx context.Context) *InstanceGroupsInsertCall {
  58633. c.ctx_ = ctx
  58634. return c
  58635. }
  58636. // Header returns an http.Header that can be modified by the caller to
  58637. // add HTTP headers to the request.
  58638. func (c *InstanceGroupsInsertCall) Header() http.Header {
  58639. if c.header_ == nil {
  58640. c.header_ = make(http.Header)
  58641. }
  58642. return c.header_
  58643. }
  58644. func (c *InstanceGroupsInsertCall) doRequest(alt string) (*http.Response, error) {
  58645. reqHeaders := make(http.Header)
  58646. for k, v := range c.header_ {
  58647. reqHeaders[k] = v
  58648. }
  58649. reqHeaders.Set("User-Agent", c.s.userAgent())
  58650. var body io.Reader = nil
  58651. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroup)
  58652. if err != nil {
  58653. return nil, err
  58654. }
  58655. reqHeaders.Set("Content-Type", "application/json")
  58656. c.urlParams_.Set("alt", alt)
  58657. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups")
  58658. urls += "?" + c.urlParams_.Encode()
  58659. req, _ := http.NewRequest("POST", urls, body)
  58660. req.Header = reqHeaders
  58661. googleapi.Expand(req.URL, map[string]string{
  58662. "project": c.project,
  58663. "zone": c.zone,
  58664. })
  58665. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  58666. }
  58667. // Do executes the "compute.instanceGroups.insert" call.
  58668. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  58669. // status code is an error. Response headers are in either
  58670. // *Operation.ServerResponse.Header or (if a response was returned at
  58671. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  58672. // to check whether the returned error was because
  58673. // http.StatusNotModified was returned.
  58674. func (c *InstanceGroupsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  58675. gensupport.SetOptions(c.urlParams_, opts...)
  58676. res, err := c.doRequest("json")
  58677. if res != nil && res.StatusCode == http.StatusNotModified {
  58678. if res.Body != nil {
  58679. res.Body.Close()
  58680. }
  58681. return nil, &googleapi.Error{
  58682. Code: res.StatusCode,
  58683. Header: res.Header,
  58684. }
  58685. }
  58686. if err != nil {
  58687. return nil, err
  58688. }
  58689. defer googleapi.CloseBody(res)
  58690. if err := googleapi.CheckResponse(res); err != nil {
  58691. return nil, err
  58692. }
  58693. ret := &Operation{
  58694. ServerResponse: googleapi.ServerResponse{
  58695. Header: res.Header,
  58696. HTTPStatusCode: res.StatusCode,
  58697. },
  58698. }
  58699. target := &ret
  58700. if err := gensupport.DecodeResponse(target, res); err != nil {
  58701. return nil, err
  58702. }
  58703. return ret, nil
  58704. // {
  58705. // "description": "Creates an instance group in the specified project using the parameters that are included in the request.",
  58706. // "httpMethod": "POST",
  58707. // "id": "compute.instanceGroups.insert",
  58708. // "parameterOrder": [
  58709. // "project",
  58710. // "zone"
  58711. // ],
  58712. // "parameters": {
  58713. // "project": {
  58714. // "description": "Project ID for this request.",
  58715. // "location": "path",
  58716. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  58717. // "required": true,
  58718. // "type": "string"
  58719. // },
  58720. // "requestId": {
  58721. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  58722. // "location": "query",
  58723. // "type": "string"
  58724. // },
  58725. // "zone": {
  58726. // "description": "The name of the zone where you want to create the instance group.",
  58727. // "location": "path",
  58728. // "required": true,
  58729. // "type": "string"
  58730. // }
  58731. // },
  58732. // "path": "{project}/zones/{zone}/instanceGroups",
  58733. // "request": {
  58734. // "$ref": "InstanceGroup"
  58735. // },
  58736. // "response": {
  58737. // "$ref": "Operation"
  58738. // },
  58739. // "scopes": [
  58740. // "https://www.googleapis.com/auth/cloud-platform",
  58741. // "https://www.googleapis.com/auth/compute"
  58742. // ]
  58743. // }
  58744. }
  58745. // method id "compute.instanceGroups.list":
  58746. type InstanceGroupsListCall struct {
  58747. s *Service
  58748. project string
  58749. zone string
  58750. urlParams_ gensupport.URLParams
  58751. ifNoneMatch_ string
  58752. ctx_ context.Context
  58753. header_ http.Header
  58754. }
  58755. // List: Retrieves the list of instance groups that are located in the
  58756. // specified project and zone.
  58757. func (r *InstanceGroupsService) List(project string, zone string) *InstanceGroupsListCall {
  58758. c := &InstanceGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  58759. c.project = project
  58760. c.zone = zone
  58761. return c
  58762. }
  58763. // Filter sets the optional parameter "filter": A filter expression that
  58764. // filters resources listed in the response. The expression must specify
  58765. // the field name, a comparison operator, and the value that you want to
  58766. // use for filtering. The value must be a string, a number, or a
  58767. // boolean. The comparison operator must be either =, !=, >, or <.
  58768. //
  58769. // For example, if you are filtering Compute Engine instances, you can
  58770. // exclude instances named example-instance by specifying name !=
  58771. // example-instance.
  58772. //
  58773. // You can also filter nested fields. For example, you could specify
  58774. // scheduling.automaticRestart = false to include instances only if they
  58775. // are not scheduled for automatic restarts. You can use filtering on
  58776. // nested fields to filter based on resource labels.
  58777. //
  58778. // To filter on multiple expressions, provide each separate expression
  58779. // within parentheses. For example, (scheduling.automaticRestart = true)
  58780. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  58781. // AND expression. However, you can include AND and OR expressions
  58782. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  58783. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  58784. // true).
  58785. func (c *InstanceGroupsListCall) Filter(filter string) *InstanceGroupsListCall {
  58786. c.urlParams_.Set("filter", filter)
  58787. return c
  58788. }
  58789. // MaxResults sets the optional parameter "maxResults": The maximum
  58790. // number of results per page that should be returned. If the number of
  58791. // available results is larger than maxResults, Compute Engine returns a
  58792. // nextPageToken that can be used to get the next page of results in
  58793. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  58794. // (Default: 500)
  58795. func (c *InstanceGroupsListCall) MaxResults(maxResults int64) *InstanceGroupsListCall {
  58796. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  58797. return c
  58798. }
  58799. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  58800. // a certain order. By default, results are returned in alphanumerical
  58801. // order based on the resource name.
  58802. //
  58803. // You can also sort results in descending order based on the creation
  58804. // timestamp using orderBy="creationTimestamp desc". This sorts results
  58805. // based on the creationTimestamp field in reverse chronological order
  58806. // (newest result first). Use this to sort resources like operations so
  58807. // that the newest operation is returned first.
  58808. //
  58809. // Currently, only sorting by name or creationTimestamp desc is
  58810. // supported.
  58811. func (c *InstanceGroupsListCall) OrderBy(orderBy string) *InstanceGroupsListCall {
  58812. c.urlParams_.Set("orderBy", orderBy)
  58813. return c
  58814. }
  58815. // PageToken sets the optional parameter "pageToken": Specifies a page
  58816. // token to use. Set pageToken to the nextPageToken returned by a
  58817. // previous list request to get the next page of results.
  58818. func (c *InstanceGroupsListCall) PageToken(pageToken string) *InstanceGroupsListCall {
  58819. c.urlParams_.Set("pageToken", pageToken)
  58820. return c
  58821. }
  58822. // Fields allows partial responses to be retrieved. See
  58823. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  58824. // for more information.
  58825. func (c *InstanceGroupsListCall) Fields(s ...googleapi.Field) *InstanceGroupsListCall {
  58826. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  58827. return c
  58828. }
  58829. // IfNoneMatch sets the optional parameter which makes the operation
  58830. // fail if the object's ETag matches the given value. This is useful for
  58831. // getting updates only after the object has changed since the last
  58832. // request. Use googleapi.IsNotModified to check whether the response
  58833. // error from Do is the result of In-None-Match.
  58834. func (c *InstanceGroupsListCall) IfNoneMatch(entityTag string) *InstanceGroupsListCall {
  58835. c.ifNoneMatch_ = entityTag
  58836. return c
  58837. }
  58838. // Context sets the context to be used in this call's Do method. Any
  58839. // pending HTTP request will be aborted if the provided context is
  58840. // canceled.
  58841. func (c *InstanceGroupsListCall) Context(ctx context.Context) *InstanceGroupsListCall {
  58842. c.ctx_ = ctx
  58843. return c
  58844. }
  58845. // Header returns an http.Header that can be modified by the caller to
  58846. // add HTTP headers to the request.
  58847. func (c *InstanceGroupsListCall) Header() http.Header {
  58848. if c.header_ == nil {
  58849. c.header_ = make(http.Header)
  58850. }
  58851. return c.header_
  58852. }
  58853. func (c *InstanceGroupsListCall) doRequest(alt string) (*http.Response, error) {
  58854. reqHeaders := make(http.Header)
  58855. for k, v := range c.header_ {
  58856. reqHeaders[k] = v
  58857. }
  58858. reqHeaders.Set("User-Agent", c.s.userAgent())
  58859. if c.ifNoneMatch_ != "" {
  58860. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  58861. }
  58862. var body io.Reader = nil
  58863. c.urlParams_.Set("alt", alt)
  58864. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups")
  58865. urls += "?" + c.urlParams_.Encode()
  58866. req, _ := http.NewRequest("GET", urls, body)
  58867. req.Header = reqHeaders
  58868. googleapi.Expand(req.URL, map[string]string{
  58869. "project": c.project,
  58870. "zone": c.zone,
  58871. })
  58872. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  58873. }
  58874. // Do executes the "compute.instanceGroups.list" call.
  58875. // Exactly one of *InstanceGroupList or error will be non-nil. Any
  58876. // non-2xx status code is an error. Response headers are in either
  58877. // *InstanceGroupList.ServerResponse.Header or (if a response was
  58878. // returned at all) in error.(*googleapi.Error).Header. Use
  58879. // googleapi.IsNotModified to check whether the returned error was
  58880. // because http.StatusNotModified was returned.
  58881. func (c *InstanceGroupsListCall) Do(opts ...googleapi.CallOption) (*InstanceGroupList, error) {
  58882. gensupport.SetOptions(c.urlParams_, opts...)
  58883. res, err := c.doRequest("json")
  58884. if res != nil && res.StatusCode == http.StatusNotModified {
  58885. if res.Body != nil {
  58886. res.Body.Close()
  58887. }
  58888. return nil, &googleapi.Error{
  58889. Code: res.StatusCode,
  58890. Header: res.Header,
  58891. }
  58892. }
  58893. if err != nil {
  58894. return nil, err
  58895. }
  58896. defer googleapi.CloseBody(res)
  58897. if err := googleapi.CheckResponse(res); err != nil {
  58898. return nil, err
  58899. }
  58900. ret := &InstanceGroupList{
  58901. ServerResponse: googleapi.ServerResponse{
  58902. Header: res.Header,
  58903. HTTPStatusCode: res.StatusCode,
  58904. },
  58905. }
  58906. target := &ret
  58907. if err := gensupport.DecodeResponse(target, res); err != nil {
  58908. return nil, err
  58909. }
  58910. return ret, nil
  58911. // {
  58912. // "description": "Retrieves the list of instance groups that are located in the specified project and zone.",
  58913. // "httpMethod": "GET",
  58914. // "id": "compute.instanceGroups.list",
  58915. // "parameterOrder": [
  58916. // "project",
  58917. // "zone"
  58918. // ],
  58919. // "parameters": {
  58920. // "filter": {
  58921. // "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).",
  58922. // "location": "query",
  58923. // "type": "string"
  58924. // },
  58925. // "maxResults": {
  58926. // "default": "500",
  58927. // "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)",
  58928. // "format": "uint32",
  58929. // "location": "query",
  58930. // "minimum": "0",
  58931. // "type": "integer"
  58932. // },
  58933. // "orderBy": {
  58934. // "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.",
  58935. // "location": "query",
  58936. // "type": "string"
  58937. // },
  58938. // "pageToken": {
  58939. // "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.",
  58940. // "location": "query",
  58941. // "type": "string"
  58942. // },
  58943. // "project": {
  58944. // "description": "Project ID for this request.",
  58945. // "location": "path",
  58946. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  58947. // "required": true,
  58948. // "type": "string"
  58949. // },
  58950. // "zone": {
  58951. // "description": "The name of the zone where the instance group is located.",
  58952. // "location": "path",
  58953. // "required": true,
  58954. // "type": "string"
  58955. // }
  58956. // },
  58957. // "path": "{project}/zones/{zone}/instanceGroups",
  58958. // "response": {
  58959. // "$ref": "InstanceGroupList"
  58960. // },
  58961. // "scopes": [
  58962. // "https://www.googleapis.com/auth/cloud-platform",
  58963. // "https://www.googleapis.com/auth/compute",
  58964. // "https://www.googleapis.com/auth/compute.readonly"
  58965. // ]
  58966. // }
  58967. }
  58968. // Pages invokes f for each page of results.
  58969. // A non-nil error returned from f will halt the iteration.
  58970. // The provided context supersedes any context provided to the Context method.
  58971. func (c *InstanceGroupsListCall) Pages(ctx context.Context, f func(*InstanceGroupList) error) error {
  58972. c.ctx_ = ctx
  58973. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  58974. for {
  58975. x, err := c.Do()
  58976. if err != nil {
  58977. return err
  58978. }
  58979. if err := f(x); err != nil {
  58980. return err
  58981. }
  58982. if x.NextPageToken == "" {
  58983. return nil
  58984. }
  58985. c.PageToken(x.NextPageToken)
  58986. }
  58987. }
  58988. // method id "compute.instanceGroups.listInstances":
  58989. type InstanceGroupsListInstancesCall struct {
  58990. s *Service
  58991. project string
  58992. zone string
  58993. instanceGroup string
  58994. instancegroupslistinstancesrequest *InstanceGroupsListInstancesRequest
  58995. urlParams_ gensupport.URLParams
  58996. ctx_ context.Context
  58997. header_ http.Header
  58998. }
  58999. // ListInstances: Lists the instances in the specified instance group.
  59000. func (r *InstanceGroupsService) ListInstances(project string, zone string, instanceGroup string, instancegroupslistinstancesrequest *InstanceGroupsListInstancesRequest) *InstanceGroupsListInstancesCall {
  59001. c := &InstanceGroupsListInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  59002. c.project = project
  59003. c.zone = zone
  59004. c.instanceGroup = instanceGroup
  59005. c.instancegroupslistinstancesrequest = instancegroupslistinstancesrequest
  59006. return c
  59007. }
  59008. // Filter sets the optional parameter "filter": A filter expression that
  59009. // filters resources listed in the response. The expression must specify
  59010. // the field name, a comparison operator, and the value that you want to
  59011. // use for filtering. The value must be a string, a number, or a
  59012. // boolean. The comparison operator must be either =, !=, >, or <.
  59013. //
  59014. // For example, if you are filtering Compute Engine instances, you can
  59015. // exclude instances named example-instance by specifying name !=
  59016. // example-instance.
  59017. //
  59018. // You can also filter nested fields. For example, you could specify
  59019. // scheduling.automaticRestart = false to include instances only if they
  59020. // are not scheduled for automatic restarts. You can use filtering on
  59021. // nested fields to filter based on resource labels.
  59022. //
  59023. // To filter on multiple expressions, provide each separate expression
  59024. // within parentheses. For example, (scheduling.automaticRestart = true)
  59025. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  59026. // AND expression. However, you can include AND and OR expressions
  59027. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  59028. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  59029. // true).
  59030. func (c *InstanceGroupsListInstancesCall) Filter(filter string) *InstanceGroupsListInstancesCall {
  59031. c.urlParams_.Set("filter", filter)
  59032. return c
  59033. }
  59034. // MaxResults sets the optional parameter "maxResults": The maximum
  59035. // number of results per page that should be returned. If the number of
  59036. // available results is larger than maxResults, Compute Engine returns a
  59037. // nextPageToken that can be used to get the next page of results in
  59038. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  59039. // (Default: 500)
  59040. func (c *InstanceGroupsListInstancesCall) MaxResults(maxResults int64) *InstanceGroupsListInstancesCall {
  59041. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  59042. return c
  59043. }
  59044. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  59045. // a certain order. By default, results are returned in alphanumerical
  59046. // order based on the resource name.
  59047. //
  59048. // You can also sort results in descending order based on the creation
  59049. // timestamp using orderBy="creationTimestamp desc". This sorts results
  59050. // based on the creationTimestamp field in reverse chronological order
  59051. // (newest result first). Use this to sort resources like operations so
  59052. // that the newest operation is returned first.
  59053. //
  59054. // Currently, only sorting by name or creationTimestamp desc is
  59055. // supported.
  59056. func (c *InstanceGroupsListInstancesCall) OrderBy(orderBy string) *InstanceGroupsListInstancesCall {
  59057. c.urlParams_.Set("orderBy", orderBy)
  59058. return c
  59059. }
  59060. // PageToken sets the optional parameter "pageToken": Specifies a page
  59061. // token to use. Set pageToken to the nextPageToken returned by a
  59062. // previous list request to get the next page of results.
  59063. func (c *InstanceGroupsListInstancesCall) PageToken(pageToken string) *InstanceGroupsListInstancesCall {
  59064. c.urlParams_.Set("pageToken", pageToken)
  59065. return c
  59066. }
  59067. // Fields allows partial responses to be retrieved. See
  59068. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  59069. // for more information.
  59070. func (c *InstanceGroupsListInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupsListInstancesCall {
  59071. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  59072. return c
  59073. }
  59074. // Context sets the context to be used in this call's Do method. Any
  59075. // pending HTTP request will be aborted if the provided context is
  59076. // canceled.
  59077. func (c *InstanceGroupsListInstancesCall) Context(ctx context.Context) *InstanceGroupsListInstancesCall {
  59078. c.ctx_ = ctx
  59079. return c
  59080. }
  59081. // Header returns an http.Header that can be modified by the caller to
  59082. // add HTTP headers to the request.
  59083. func (c *InstanceGroupsListInstancesCall) Header() http.Header {
  59084. if c.header_ == nil {
  59085. c.header_ = make(http.Header)
  59086. }
  59087. return c.header_
  59088. }
  59089. func (c *InstanceGroupsListInstancesCall) doRequest(alt string) (*http.Response, error) {
  59090. reqHeaders := make(http.Header)
  59091. for k, v := range c.header_ {
  59092. reqHeaders[k] = v
  59093. }
  59094. reqHeaders.Set("User-Agent", c.s.userAgent())
  59095. var body io.Reader = nil
  59096. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupslistinstancesrequest)
  59097. if err != nil {
  59098. return nil, err
  59099. }
  59100. reqHeaders.Set("Content-Type", "application/json")
  59101. c.urlParams_.Set("alt", alt)
  59102. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}/listInstances")
  59103. urls += "?" + c.urlParams_.Encode()
  59104. req, _ := http.NewRequest("POST", urls, body)
  59105. req.Header = reqHeaders
  59106. googleapi.Expand(req.URL, map[string]string{
  59107. "project": c.project,
  59108. "zone": c.zone,
  59109. "instanceGroup": c.instanceGroup,
  59110. })
  59111. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  59112. }
  59113. // Do executes the "compute.instanceGroups.listInstances" call.
  59114. // Exactly one of *InstanceGroupsListInstances or error will be non-nil.
  59115. // Any non-2xx status code is an error. Response headers are in either
  59116. // *InstanceGroupsListInstances.ServerResponse.Header or (if a response
  59117. // was returned at all) in error.(*googleapi.Error).Header. Use
  59118. // googleapi.IsNotModified to check whether the returned error was
  59119. // because http.StatusNotModified was returned.
  59120. func (c *InstanceGroupsListInstancesCall) Do(opts ...googleapi.CallOption) (*InstanceGroupsListInstances, error) {
  59121. gensupport.SetOptions(c.urlParams_, opts...)
  59122. res, err := c.doRequest("json")
  59123. if res != nil && res.StatusCode == http.StatusNotModified {
  59124. if res.Body != nil {
  59125. res.Body.Close()
  59126. }
  59127. return nil, &googleapi.Error{
  59128. Code: res.StatusCode,
  59129. Header: res.Header,
  59130. }
  59131. }
  59132. if err != nil {
  59133. return nil, err
  59134. }
  59135. defer googleapi.CloseBody(res)
  59136. if err := googleapi.CheckResponse(res); err != nil {
  59137. return nil, err
  59138. }
  59139. ret := &InstanceGroupsListInstances{
  59140. ServerResponse: googleapi.ServerResponse{
  59141. Header: res.Header,
  59142. HTTPStatusCode: res.StatusCode,
  59143. },
  59144. }
  59145. target := &ret
  59146. if err := gensupport.DecodeResponse(target, res); err != nil {
  59147. return nil, err
  59148. }
  59149. return ret, nil
  59150. // {
  59151. // "description": "Lists the instances in the specified instance group.",
  59152. // "httpMethod": "POST",
  59153. // "id": "compute.instanceGroups.listInstances",
  59154. // "parameterOrder": [
  59155. // "project",
  59156. // "zone",
  59157. // "instanceGroup"
  59158. // ],
  59159. // "parameters": {
  59160. // "filter": {
  59161. // "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).",
  59162. // "location": "query",
  59163. // "type": "string"
  59164. // },
  59165. // "instanceGroup": {
  59166. // "description": "The name of the instance group from which you want to generate a list of included instances.",
  59167. // "location": "path",
  59168. // "required": true,
  59169. // "type": "string"
  59170. // },
  59171. // "maxResults": {
  59172. // "default": "500",
  59173. // "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)",
  59174. // "format": "uint32",
  59175. // "location": "query",
  59176. // "minimum": "0",
  59177. // "type": "integer"
  59178. // },
  59179. // "orderBy": {
  59180. // "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.",
  59181. // "location": "query",
  59182. // "type": "string"
  59183. // },
  59184. // "pageToken": {
  59185. // "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.",
  59186. // "location": "query",
  59187. // "type": "string"
  59188. // },
  59189. // "project": {
  59190. // "description": "Project ID for this request.",
  59191. // "location": "path",
  59192. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  59193. // "required": true,
  59194. // "type": "string"
  59195. // },
  59196. // "zone": {
  59197. // "description": "The name of the zone where the instance group is located.",
  59198. // "location": "path",
  59199. // "required": true,
  59200. // "type": "string"
  59201. // }
  59202. // },
  59203. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/listInstances",
  59204. // "request": {
  59205. // "$ref": "InstanceGroupsListInstancesRequest"
  59206. // },
  59207. // "response": {
  59208. // "$ref": "InstanceGroupsListInstances"
  59209. // },
  59210. // "scopes": [
  59211. // "https://www.googleapis.com/auth/cloud-platform",
  59212. // "https://www.googleapis.com/auth/compute",
  59213. // "https://www.googleapis.com/auth/compute.readonly"
  59214. // ]
  59215. // }
  59216. }
  59217. // Pages invokes f for each page of results.
  59218. // A non-nil error returned from f will halt the iteration.
  59219. // The provided context supersedes any context provided to the Context method.
  59220. func (c *InstanceGroupsListInstancesCall) Pages(ctx context.Context, f func(*InstanceGroupsListInstances) error) error {
  59221. c.ctx_ = ctx
  59222. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  59223. for {
  59224. x, err := c.Do()
  59225. if err != nil {
  59226. return err
  59227. }
  59228. if err := f(x); err != nil {
  59229. return err
  59230. }
  59231. if x.NextPageToken == "" {
  59232. return nil
  59233. }
  59234. c.PageToken(x.NextPageToken)
  59235. }
  59236. }
  59237. // method id "compute.instanceGroups.removeInstances":
  59238. type InstanceGroupsRemoveInstancesCall struct {
  59239. s *Service
  59240. project string
  59241. zone string
  59242. instanceGroup string
  59243. instancegroupsremoveinstancesrequest *InstanceGroupsRemoveInstancesRequest
  59244. urlParams_ gensupport.URLParams
  59245. ctx_ context.Context
  59246. header_ http.Header
  59247. }
  59248. // RemoveInstances: Removes one or more instances from the specified
  59249. // instance group, but does not delete those instances.
  59250. //
  59251. // If the group is part of a backend service that has enabled connection
  59252. // draining, it can take up to 60 seconds after the connection draining
  59253. // duration before the VM instance is removed or deleted.
  59254. func (r *InstanceGroupsService) RemoveInstances(project string, zone string, instanceGroup string, instancegroupsremoveinstancesrequest *InstanceGroupsRemoveInstancesRequest) *InstanceGroupsRemoveInstancesCall {
  59255. c := &InstanceGroupsRemoveInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  59256. c.project = project
  59257. c.zone = zone
  59258. c.instanceGroup = instanceGroup
  59259. c.instancegroupsremoveinstancesrequest = instancegroupsremoveinstancesrequest
  59260. return c
  59261. }
  59262. // RequestId sets the optional parameter "requestId": An optional
  59263. // request ID to identify requests. Specify a unique request ID so that
  59264. // if you must retry your request, the server will know to ignore the
  59265. // request if it has already been completed.
  59266. //
  59267. // For example, consider a situation where you make an initial request
  59268. // and the request times out. If you make the request again with the
  59269. // same request ID, the server can check if original operation with the
  59270. // same request ID was received, and if so, will ignore the second
  59271. // request. This prevents clients from accidentally creating duplicate
  59272. // commitments.
  59273. //
  59274. // The request ID must be a valid UUID with the exception that zero UUID
  59275. // is not supported (00000000-0000-0000-0000-000000000000).
  59276. func (c *InstanceGroupsRemoveInstancesCall) RequestId(requestId string) *InstanceGroupsRemoveInstancesCall {
  59277. c.urlParams_.Set("requestId", requestId)
  59278. return c
  59279. }
  59280. // Fields allows partial responses to be retrieved. See
  59281. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  59282. // for more information.
  59283. func (c *InstanceGroupsRemoveInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupsRemoveInstancesCall {
  59284. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  59285. return c
  59286. }
  59287. // Context sets the context to be used in this call's Do method. Any
  59288. // pending HTTP request will be aborted if the provided context is
  59289. // canceled.
  59290. func (c *InstanceGroupsRemoveInstancesCall) Context(ctx context.Context) *InstanceGroupsRemoveInstancesCall {
  59291. c.ctx_ = ctx
  59292. return c
  59293. }
  59294. // Header returns an http.Header that can be modified by the caller to
  59295. // add HTTP headers to the request.
  59296. func (c *InstanceGroupsRemoveInstancesCall) Header() http.Header {
  59297. if c.header_ == nil {
  59298. c.header_ = make(http.Header)
  59299. }
  59300. return c.header_
  59301. }
  59302. func (c *InstanceGroupsRemoveInstancesCall) doRequest(alt string) (*http.Response, error) {
  59303. reqHeaders := make(http.Header)
  59304. for k, v := range c.header_ {
  59305. reqHeaders[k] = v
  59306. }
  59307. reqHeaders.Set("User-Agent", c.s.userAgent())
  59308. var body io.Reader = nil
  59309. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupsremoveinstancesrequest)
  59310. if err != nil {
  59311. return nil, err
  59312. }
  59313. reqHeaders.Set("Content-Type", "application/json")
  59314. c.urlParams_.Set("alt", alt)
  59315. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}/removeInstances")
  59316. urls += "?" + c.urlParams_.Encode()
  59317. req, _ := http.NewRequest("POST", urls, body)
  59318. req.Header = reqHeaders
  59319. googleapi.Expand(req.URL, map[string]string{
  59320. "project": c.project,
  59321. "zone": c.zone,
  59322. "instanceGroup": c.instanceGroup,
  59323. })
  59324. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  59325. }
  59326. // Do executes the "compute.instanceGroups.removeInstances" call.
  59327. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  59328. // status code is an error. Response headers are in either
  59329. // *Operation.ServerResponse.Header or (if a response was returned at
  59330. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  59331. // to check whether the returned error was because
  59332. // http.StatusNotModified was returned.
  59333. func (c *InstanceGroupsRemoveInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  59334. gensupport.SetOptions(c.urlParams_, opts...)
  59335. res, err := c.doRequest("json")
  59336. if res != nil && res.StatusCode == http.StatusNotModified {
  59337. if res.Body != nil {
  59338. res.Body.Close()
  59339. }
  59340. return nil, &googleapi.Error{
  59341. Code: res.StatusCode,
  59342. Header: res.Header,
  59343. }
  59344. }
  59345. if err != nil {
  59346. return nil, err
  59347. }
  59348. defer googleapi.CloseBody(res)
  59349. if err := googleapi.CheckResponse(res); err != nil {
  59350. return nil, err
  59351. }
  59352. ret := &Operation{
  59353. ServerResponse: googleapi.ServerResponse{
  59354. Header: res.Header,
  59355. HTTPStatusCode: res.StatusCode,
  59356. },
  59357. }
  59358. target := &ret
  59359. if err := gensupport.DecodeResponse(target, res); err != nil {
  59360. return nil, err
  59361. }
  59362. return ret, nil
  59363. // {
  59364. // "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.",
  59365. // "httpMethod": "POST",
  59366. // "id": "compute.instanceGroups.removeInstances",
  59367. // "parameterOrder": [
  59368. // "project",
  59369. // "zone",
  59370. // "instanceGroup"
  59371. // ],
  59372. // "parameters": {
  59373. // "instanceGroup": {
  59374. // "description": "The name of the instance group where the specified instances will be removed.",
  59375. // "location": "path",
  59376. // "required": true,
  59377. // "type": "string"
  59378. // },
  59379. // "project": {
  59380. // "description": "Project ID for this request.",
  59381. // "location": "path",
  59382. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  59383. // "required": true,
  59384. // "type": "string"
  59385. // },
  59386. // "requestId": {
  59387. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  59388. // "location": "query",
  59389. // "type": "string"
  59390. // },
  59391. // "zone": {
  59392. // "description": "The name of the zone where the instance group is located.",
  59393. // "location": "path",
  59394. // "required": true,
  59395. // "type": "string"
  59396. // }
  59397. // },
  59398. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/removeInstances",
  59399. // "request": {
  59400. // "$ref": "InstanceGroupsRemoveInstancesRequest"
  59401. // },
  59402. // "response": {
  59403. // "$ref": "Operation"
  59404. // },
  59405. // "scopes": [
  59406. // "https://www.googleapis.com/auth/cloud-platform",
  59407. // "https://www.googleapis.com/auth/compute"
  59408. // ]
  59409. // }
  59410. }
  59411. // method id "compute.instanceGroups.setNamedPorts":
  59412. type InstanceGroupsSetNamedPortsCall struct {
  59413. s *Service
  59414. project string
  59415. zone string
  59416. instanceGroup string
  59417. instancegroupssetnamedportsrequest *InstanceGroupsSetNamedPortsRequest
  59418. urlParams_ gensupport.URLParams
  59419. ctx_ context.Context
  59420. header_ http.Header
  59421. }
  59422. // SetNamedPorts: Sets the named ports for the specified instance group.
  59423. func (r *InstanceGroupsService) SetNamedPorts(project string, zone string, instanceGroup string, instancegroupssetnamedportsrequest *InstanceGroupsSetNamedPortsRequest) *InstanceGroupsSetNamedPortsCall {
  59424. c := &InstanceGroupsSetNamedPortsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  59425. c.project = project
  59426. c.zone = zone
  59427. c.instanceGroup = instanceGroup
  59428. c.instancegroupssetnamedportsrequest = instancegroupssetnamedportsrequest
  59429. return c
  59430. }
  59431. // RequestId sets the optional parameter "requestId": An optional
  59432. // request ID to identify requests. Specify a unique request ID so that
  59433. // if you must retry your request, the server will know to ignore the
  59434. // request if it has already been completed.
  59435. //
  59436. // For example, consider a situation where you make an initial request
  59437. // and the request times out. If you make the request again with the
  59438. // same request ID, the server can check if original operation with the
  59439. // same request ID was received, and if so, will ignore the second
  59440. // request. This prevents clients from accidentally creating duplicate
  59441. // commitments.
  59442. //
  59443. // The request ID must be a valid UUID with the exception that zero UUID
  59444. // is not supported (00000000-0000-0000-0000-000000000000).
  59445. func (c *InstanceGroupsSetNamedPortsCall) RequestId(requestId string) *InstanceGroupsSetNamedPortsCall {
  59446. c.urlParams_.Set("requestId", requestId)
  59447. return c
  59448. }
  59449. // Fields allows partial responses to be retrieved. See
  59450. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  59451. // for more information.
  59452. func (c *InstanceGroupsSetNamedPortsCall) Fields(s ...googleapi.Field) *InstanceGroupsSetNamedPortsCall {
  59453. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  59454. return c
  59455. }
  59456. // Context sets the context to be used in this call's Do method. Any
  59457. // pending HTTP request will be aborted if the provided context is
  59458. // canceled.
  59459. func (c *InstanceGroupsSetNamedPortsCall) Context(ctx context.Context) *InstanceGroupsSetNamedPortsCall {
  59460. c.ctx_ = ctx
  59461. return c
  59462. }
  59463. // Header returns an http.Header that can be modified by the caller to
  59464. // add HTTP headers to the request.
  59465. func (c *InstanceGroupsSetNamedPortsCall) Header() http.Header {
  59466. if c.header_ == nil {
  59467. c.header_ = make(http.Header)
  59468. }
  59469. return c.header_
  59470. }
  59471. func (c *InstanceGroupsSetNamedPortsCall) doRequest(alt string) (*http.Response, error) {
  59472. reqHeaders := make(http.Header)
  59473. for k, v := range c.header_ {
  59474. reqHeaders[k] = v
  59475. }
  59476. reqHeaders.Set("User-Agent", c.s.userAgent())
  59477. var body io.Reader = nil
  59478. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupssetnamedportsrequest)
  59479. if err != nil {
  59480. return nil, err
  59481. }
  59482. reqHeaders.Set("Content-Type", "application/json")
  59483. c.urlParams_.Set("alt", alt)
  59484. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}/setNamedPorts")
  59485. urls += "?" + c.urlParams_.Encode()
  59486. req, _ := http.NewRequest("POST", urls, body)
  59487. req.Header = reqHeaders
  59488. googleapi.Expand(req.URL, map[string]string{
  59489. "project": c.project,
  59490. "zone": c.zone,
  59491. "instanceGroup": c.instanceGroup,
  59492. })
  59493. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  59494. }
  59495. // Do executes the "compute.instanceGroups.setNamedPorts" call.
  59496. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  59497. // status code is an error. Response headers are in either
  59498. // *Operation.ServerResponse.Header or (if a response was returned at
  59499. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  59500. // to check whether the returned error was because
  59501. // http.StatusNotModified was returned.
  59502. func (c *InstanceGroupsSetNamedPortsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  59503. gensupport.SetOptions(c.urlParams_, opts...)
  59504. res, err := c.doRequest("json")
  59505. if res != nil && res.StatusCode == http.StatusNotModified {
  59506. if res.Body != nil {
  59507. res.Body.Close()
  59508. }
  59509. return nil, &googleapi.Error{
  59510. Code: res.StatusCode,
  59511. Header: res.Header,
  59512. }
  59513. }
  59514. if err != nil {
  59515. return nil, err
  59516. }
  59517. defer googleapi.CloseBody(res)
  59518. if err := googleapi.CheckResponse(res); err != nil {
  59519. return nil, err
  59520. }
  59521. ret := &Operation{
  59522. ServerResponse: googleapi.ServerResponse{
  59523. Header: res.Header,
  59524. HTTPStatusCode: res.StatusCode,
  59525. },
  59526. }
  59527. target := &ret
  59528. if err := gensupport.DecodeResponse(target, res); err != nil {
  59529. return nil, err
  59530. }
  59531. return ret, nil
  59532. // {
  59533. // "description": "Sets the named ports for the specified instance group.",
  59534. // "httpMethod": "POST",
  59535. // "id": "compute.instanceGroups.setNamedPorts",
  59536. // "parameterOrder": [
  59537. // "project",
  59538. // "zone",
  59539. // "instanceGroup"
  59540. // ],
  59541. // "parameters": {
  59542. // "instanceGroup": {
  59543. // "description": "The name of the instance group where the named ports are updated.",
  59544. // "location": "path",
  59545. // "required": true,
  59546. // "type": "string"
  59547. // },
  59548. // "project": {
  59549. // "description": "Project ID for this request.",
  59550. // "location": "path",
  59551. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  59552. // "required": true,
  59553. // "type": "string"
  59554. // },
  59555. // "requestId": {
  59556. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  59557. // "location": "query",
  59558. // "type": "string"
  59559. // },
  59560. // "zone": {
  59561. // "description": "The name of the zone where the instance group is located.",
  59562. // "location": "path",
  59563. // "required": true,
  59564. // "type": "string"
  59565. // }
  59566. // },
  59567. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/setNamedPorts",
  59568. // "request": {
  59569. // "$ref": "InstanceGroupsSetNamedPortsRequest"
  59570. // },
  59571. // "response": {
  59572. // "$ref": "Operation"
  59573. // },
  59574. // "scopes": [
  59575. // "https://www.googleapis.com/auth/cloud-platform",
  59576. // "https://www.googleapis.com/auth/compute"
  59577. // ]
  59578. // }
  59579. }
  59580. // method id "compute.instanceGroups.testIamPermissions":
  59581. type InstanceGroupsTestIamPermissionsCall struct {
  59582. s *Service
  59583. project string
  59584. zone string
  59585. resource string
  59586. testpermissionsrequest *TestPermissionsRequest
  59587. urlParams_ gensupport.URLParams
  59588. ctx_ context.Context
  59589. header_ http.Header
  59590. }
  59591. // TestIamPermissions: Returns permissions that a caller has on the
  59592. // specified resource.
  59593. func (r *InstanceGroupsService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *InstanceGroupsTestIamPermissionsCall {
  59594. c := &InstanceGroupsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  59595. c.project = project
  59596. c.zone = zone
  59597. c.resource = resource
  59598. c.testpermissionsrequest = testpermissionsrequest
  59599. return c
  59600. }
  59601. // Fields allows partial responses to be retrieved. See
  59602. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  59603. // for more information.
  59604. func (c *InstanceGroupsTestIamPermissionsCall) Fields(s ...googleapi.Field) *InstanceGroupsTestIamPermissionsCall {
  59605. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  59606. return c
  59607. }
  59608. // Context sets the context to be used in this call's Do method. Any
  59609. // pending HTTP request will be aborted if the provided context is
  59610. // canceled.
  59611. func (c *InstanceGroupsTestIamPermissionsCall) Context(ctx context.Context) *InstanceGroupsTestIamPermissionsCall {
  59612. c.ctx_ = ctx
  59613. return c
  59614. }
  59615. // Header returns an http.Header that can be modified by the caller to
  59616. // add HTTP headers to the request.
  59617. func (c *InstanceGroupsTestIamPermissionsCall) Header() http.Header {
  59618. if c.header_ == nil {
  59619. c.header_ = make(http.Header)
  59620. }
  59621. return c.header_
  59622. }
  59623. func (c *InstanceGroupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  59624. reqHeaders := make(http.Header)
  59625. for k, v := range c.header_ {
  59626. reqHeaders[k] = v
  59627. }
  59628. reqHeaders.Set("User-Agent", c.s.userAgent())
  59629. var body io.Reader = nil
  59630. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  59631. if err != nil {
  59632. return nil, err
  59633. }
  59634. reqHeaders.Set("Content-Type", "application/json")
  59635. c.urlParams_.Set("alt", alt)
  59636. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{resource}/testIamPermissions")
  59637. urls += "?" + c.urlParams_.Encode()
  59638. req, _ := http.NewRequest("POST", urls, body)
  59639. req.Header = reqHeaders
  59640. googleapi.Expand(req.URL, map[string]string{
  59641. "project": c.project,
  59642. "zone": c.zone,
  59643. "resource": c.resource,
  59644. })
  59645. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  59646. }
  59647. // Do executes the "compute.instanceGroups.testIamPermissions" call.
  59648. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  59649. // non-2xx status code is an error. Response headers are in either
  59650. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  59651. // returned at all) in error.(*googleapi.Error).Header. Use
  59652. // googleapi.IsNotModified to check whether the returned error was
  59653. // because http.StatusNotModified was returned.
  59654. func (c *InstanceGroupsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  59655. gensupport.SetOptions(c.urlParams_, opts...)
  59656. res, err := c.doRequest("json")
  59657. if res != nil && res.StatusCode == http.StatusNotModified {
  59658. if res.Body != nil {
  59659. res.Body.Close()
  59660. }
  59661. return nil, &googleapi.Error{
  59662. Code: res.StatusCode,
  59663. Header: res.Header,
  59664. }
  59665. }
  59666. if err != nil {
  59667. return nil, err
  59668. }
  59669. defer googleapi.CloseBody(res)
  59670. if err := googleapi.CheckResponse(res); err != nil {
  59671. return nil, err
  59672. }
  59673. ret := &TestPermissionsResponse{
  59674. ServerResponse: googleapi.ServerResponse{
  59675. Header: res.Header,
  59676. HTTPStatusCode: res.StatusCode,
  59677. },
  59678. }
  59679. target := &ret
  59680. if err := gensupport.DecodeResponse(target, res); err != nil {
  59681. return nil, err
  59682. }
  59683. return ret, nil
  59684. // {
  59685. // "description": "Returns permissions that a caller has on the specified resource.",
  59686. // "httpMethod": "POST",
  59687. // "id": "compute.instanceGroups.testIamPermissions",
  59688. // "parameterOrder": [
  59689. // "project",
  59690. // "zone",
  59691. // "resource"
  59692. // ],
  59693. // "parameters": {
  59694. // "project": {
  59695. // "description": "Project ID for this request.",
  59696. // "location": "path",
  59697. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  59698. // "required": true,
  59699. // "type": "string"
  59700. // },
  59701. // "resource": {
  59702. // "description": "Name of the resource for this request.",
  59703. // "location": "path",
  59704. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  59705. // "required": true,
  59706. // "type": "string"
  59707. // },
  59708. // "zone": {
  59709. // "description": "The name of the zone for this request.",
  59710. // "location": "path",
  59711. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  59712. // "required": true,
  59713. // "type": "string"
  59714. // }
  59715. // },
  59716. // "path": "{project}/zones/{zone}/instanceGroups/{resource}/testIamPermissions",
  59717. // "request": {
  59718. // "$ref": "TestPermissionsRequest"
  59719. // },
  59720. // "response": {
  59721. // "$ref": "TestPermissionsResponse"
  59722. // },
  59723. // "scopes": [
  59724. // "https://www.googleapis.com/auth/cloud-platform",
  59725. // "https://www.googleapis.com/auth/compute",
  59726. // "https://www.googleapis.com/auth/compute.readonly"
  59727. // ]
  59728. // }
  59729. }
  59730. // method id "compute.instanceTemplates.delete":
  59731. type InstanceTemplatesDeleteCall struct {
  59732. s *Service
  59733. project string
  59734. instanceTemplate string
  59735. urlParams_ gensupport.URLParams
  59736. ctx_ context.Context
  59737. header_ http.Header
  59738. }
  59739. // Delete: Deletes the specified instance template. Deleting an instance
  59740. // template is permanent and cannot be undone. It's not possible to
  59741. // delete templates which are in use by an instance group.
  59742. // For details, see https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/delete
  59743. func (r *InstanceTemplatesService) Delete(project string, instanceTemplate string) *InstanceTemplatesDeleteCall {
  59744. c := &InstanceTemplatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  59745. c.project = project
  59746. c.instanceTemplate = instanceTemplate
  59747. return c
  59748. }
  59749. // RequestId sets the optional parameter "requestId": An optional
  59750. // request ID to identify requests. Specify a unique request ID so that
  59751. // if you must retry your request, the server will know to ignore the
  59752. // request if it has already been completed.
  59753. //
  59754. // For example, consider a situation where you make an initial request
  59755. // and the request times out. If you make the request again with the
  59756. // same request ID, the server can check if original operation with the
  59757. // same request ID was received, and if so, will ignore the second
  59758. // request. This prevents clients from accidentally creating duplicate
  59759. // commitments.
  59760. //
  59761. // The request ID must be a valid UUID with the exception that zero UUID
  59762. // is not supported (00000000-0000-0000-0000-000000000000).
  59763. func (c *InstanceTemplatesDeleteCall) RequestId(requestId string) *InstanceTemplatesDeleteCall {
  59764. c.urlParams_.Set("requestId", requestId)
  59765. return c
  59766. }
  59767. // Fields allows partial responses to be retrieved. See
  59768. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  59769. // for more information.
  59770. func (c *InstanceTemplatesDeleteCall) Fields(s ...googleapi.Field) *InstanceTemplatesDeleteCall {
  59771. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  59772. return c
  59773. }
  59774. // Context sets the context to be used in this call's Do method. Any
  59775. // pending HTTP request will be aborted if the provided context is
  59776. // canceled.
  59777. func (c *InstanceTemplatesDeleteCall) Context(ctx context.Context) *InstanceTemplatesDeleteCall {
  59778. c.ctx_ = ctx
  59779. return c
  59780. }
  59781. // Header returns an http.Header that can be modified by the caller to
  59782. // add HTTP headers to the request.
  59783. func (c *InstanceTemplatesDeleteCall) Header() http.Header {
  59784. if c.header_ == nil {
  59785. c.header_ = make(http.Header)
  59786. }
  59787. return c.header_
  59788. }
  59789. func (c *InstanceTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) {
  59790. reqHeaders := make(http.Header)
  59791. for k, v := range c.header_ {
  59792. reqHeaders[k] = v
  59793. }
  59794. reqHeaders.Set("User-Agent", c.s.userAgent())
  59795. var body io.Reader = nil
  59796. c.urlParams_.Set("alt", alt)
  59797. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates/{instanceTemplate}")
  59798. urls += "?" + c.urlParams_.Encode()
  59799. req, _ := http.NewRequest("DELETE", urls, body)
  59800. req.Header = reqHeaders
  59801. googleapi.Expand(req.URL, map[string]string{
  59802. "project": c.project,
  59803. "instanceTemplate": c.instanceTemplate,
  59804. })
  59805. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  59806. }
  59807. // Do executes the "compute.instanceTemplates.delete" call.
  59808. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  59809. // status code is an error. Response headers are in either
  59810. // *Operation.ServerResponse.Header or (if a response was returned at
  59811. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  59812. // to check whether the returned error was because
  59813. // http.StatusNotModified was returned.
  59814. func (c *InstanceTemplatesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  59815. gensupport.SetOptions(c.urlParams_, opts...)
  59816. res, err := c.doRequest("json")
  59817. if res != nil && res.StatusCode == http.StatusNotModified {
  59818. if res.Body != nil {
  59819. res.Body.Close()
  59820. }
  59821. return nil, &googleapi.Error{
  59822. Code: res.StatusCode,
  59823. Header: res.Header,
  59824. }
  59825. }
  59826. if err != nil {
  59827. return nil, err
  59828. }
  59829. defer googleapi.CloseBody(res)
  59830. if err := googleapi.CheckResponse(res); err != nil {
  59831. return nil, err
  59832. }
  59833. ret := &Operation{
  59834. ServerResponse: googleapi.ServerResponse{
  59835. Header: res.Header,
  59836. HTTPStatusCode: res.StatusCode,
  59837. },
  59838. }
  59839. target := &ret
  59840. if err := gensupport.DecodeResponse(target, res); err != nil {
  59841. return nil, err
  59842. }
  59843. return ret, nil
  59844. // {
  59845. // "description": "Deletes the specified instance template. Deleting an instance template is permanent and cannot be undone. It's not possible to delete templates which are in use by an instance group.",
  59846. // "httpMethod": "DELETE",
  59847. // "id": "compute.instanceTemplates.delete",
  59848. // "parameterOrder": [
  59849. // "project",
  59850. // "instanceTemplate"
  59851. // ],
  59852. // "parameters": {
  59853. // "instanceTemplate": {
  59854. // "description": "The name of the instance template to delete.",
  59855. // "location": "path",
  59856. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  59857. // "required": true,
  59858. // "type": "string"
  59859. // },
  59860. // "project": {
  59861. // "description": "Project ID for this request.",
  59862. // "location": "path",
  59863. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  59864. // "required": true,
  59865. // "type": "string"
  59866. // },
  59867. // "requestId": {
  59868. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  59869. // "location": "query",
  59870. // "type": "string"
  59871. // }
  59872. // },
  59873. // "path": "{project}/global/instanceTemplates/{instanceTemplate}",
  59874. // "response": {
  59875. // "$ref": "Operation"
  59876. // },
  59877. // "scopes": [
  59878. // "https://www.googleapis.com/auth/cloud-platform",
  59879. // "https://www.googleapis.com/auth/compute"
  59880. // ]
  59881. // }
  59882. }
  59883. // method id "compute.instanceTemplates.get":
  59884. type InstanceTemplatesGetCall struct {
  59885. s *Service
  59886. project string
  59887. instanceTemplate string
  59888. urlParams_ gensupport.URLParams
  59889. ifNoneMatch_ string
  59890. ctx_ context.Context
  59891. header_ http.Header
  59892. }
  59893. // Get: Returns the specified instance template. Gets a list of
  59894. // available instance templates by making a list() request.
  59895. // For details, see https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/get
  59896. func (r *InstanceTemplatesService) Get(project string, instanceTemplate string) *InstanceTemplatesGetCall {
  59897. c := &InstanceTemplatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  59898. c.project = project
  59899. c.instanceTemplate = instanceTemplate
  59900. return c
  59901. }
  59902. // Fields allows partial responses to be retrieved. See
  59903. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  59904. // for more information.
  59905. func (c *InstanceTemplatesGetCall) Fields(s ...googleapi.Field) *InstanceTemplatesGetCall {
  59906. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  59907. return c
  59908. }
  59909. // IfNoneMatch sets the optional parameter which makes the operation
  59910. // fail if the object's ETag matches the given value. This is useful for
  59911. // getting updates only after the object has changed since the last
  59912. // request. Use googleapi.IsNotModified to check whether the response
  59913. // error from Do is the result of In-None-Match.
  59914. func (c *InstanceTemplatesGetCall) IfNoneMatch(entityTag string) *InstanceTemplatesGetCall {
  59915. c.ifNoneMatch_ = entityTag
  59916. return c
  59917. }
  59918. // Context sets the context to be used in this call's Do method. Any
  59919. // pending HTTP request will be aborted if the provided context is
  59920. // canceled.
  59921. func (c *InstanceTemplatesGetCall) Context(ctx context.Context) *InstanceTemplatesGetCall {
  59922. c.ctx_ = ctx
  59923. return c
  59924. }
  59925. // Header returns an http.Header that can be modified by the caller to
  59926. // add HTTP headers to the request.
  59927. func (c *InstanceTemplatesGetCall) Header() http.Header {
  59928. if c.header_ == nil {
  59929. c.header_ = make(http.Header)
  59930. }
  59931. return c.header_
  59932. }
  59933. func (c *InstanceTemplatesGetCall) doRequest(alt string) (*http.Response, error) {
  59934. reqHeaders := make(http.Header)
  59935. for k, v := range c.header_ {
  59936. reqHeaders[k] = v
  59937. }
  59938. reqHeaders.Set("User-Agent", c.s.userAgent())
  59939. if c.ifNoneMatch_ != "" {
  59940. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  59941. }
  59942. var body io.Reader = nil
  59943. c.urlParams_.Set("alt", alt)
  59944. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates/{instanceTemplate}")
  59945. urls += "?" + c.urlParams_.Encode()
  59946. req, _ := http.NewRequest("GET", urls, body)
  59947. req.Header = reqHeaders
  59948. googleapi.Expand(req.URL, map[string]string{
  59949. "project": c.project,
  59950. "instanceTemplate": c.instanceTemplate,
  59951. })
  59952. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  59953. }
  59954. // Do executes the "compute.instanceTemplates.get" call.
  59955. // Exactly one of *InstanceTemplate or error will be non-nil. Any
  59956. // non-2xx status code is an error. Response headers are in either
  59957. // *InstanceTemplate.ServerResponse.Header or (if a response was
  59958. // returned at all) in error.(*googleapi.Error).Header. Use
  59959. // googleapi.IsNotModified to check whether the returned error was
  59960. // because http.StatusNotModified was returned.
  59961. func (c *InstanceTemplatesGetCall) Do(opts ...googleapi.CallOption) (*InstanceTemplate, error) {
  59962. gensupport.SetOptions(c.urlParams_, opts...)
  59963. res, err := c.doRequest("json")
  59964. if res != nil && res.StatusCode == http.StatusNotModified {
  59965. if res.Body != nil {
  59966. res.Body.Close()
  59967. }
  59968. return nil, &googleapi.Error{
  59969. Code: res.StatusCode,
  59970. Header: res.Header,
  59971. }
  59972. }
  59973. if err != nil {
  59974. return nil, err
  59975. }
  59976. defer googleapi.CloseBody(res)
  59977. if err := googleapi.CheckResponse(res); err != nil {
  59978. return nil, err
  59979. }
  59980. ret := &InstanceTemplate{
  59981. ServerResponse: googleapi.ServerResponse{
  59982. Header: res.Header,
  59983. HTTPStatusCode: res.StatusCode,
  59984. },
  59985. }
  59986. target := &ret
  59987. if err := gensupport.DecodeResponse(target, res); err != nil {
  59988. return nil, err
  59989. }
  59990. return ret, nil
  59991. // {
  59992. // "description": "Returns the specified instance template. Gets a list of available instance templates by making a list() request.",
  59993. // "httpMethod": "GET",
  59994. // "id": "compute.instanceTemplates.get",
  59995. // "parameterOrder": [
  59996. // "project",
  59997. // "instanceTemplate"
  59998. // ],
  59999. // "parameters": {
  60000. // "instanceTemplate": {
  60001. // "description": "The name of the instance template.",
  60002. // "location": "path",
  60003. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  60004. // "required": true,
  60005. // "type": "string"
  60006. // },
  60007. // "project": {
  60008. // "description": "Project ID for this request.",
  60009. // "location": "path",
  60010. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  60011. // "required": true,
  60012. // "type": "string"
  60013. // }
  60014. // },
  60015. // "path": "{project}/global/instanceTemplates/{instanceTemplate}",
  60016. // "response": {
  60017. // "$ref": "InstanceTemplate"
  60018. // },
  60019. // "scopes": [
  60020. // "https://www.googleapis.com/auth/cloud-platform",
  60021. // "https://www.googleapis.com/auth/compute",
  60022. // "https://www.googleapis.com/auth/compute.readonly"
  60023. // ]
  60024. // }
  60025. }
  60026. // method id "compute.instanceTemplates.insert":
  60027. type InstanceTemplatesInsertCall struct {
  60028. s *Service
  60029. project string
  60030. instancetemplate *InstanceTemplate
  60031. urlParams_ gensupport.URLParams
  60032. ctx_ context.Context
  60033. header_ http.Header
  60034. }
  60035. // Insert: Creates an instance template in the specified project using
  60036. // the data that is included in the request. If you are creating a new
  60037. // template to update an existing instance group, your new instance
  60038. // template must use the same network or, if applicable, the same
  60039. // subnetwork as the original template.
  60040. // For details, see https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/insert
  60041. func (r *InstanceTemplatesService) Insert(project string, instancetemplate *InstanceTemplate) *InstanceTemplatesInsertCall {
  60042. c := &InstanceTemplatesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  60043. c.project = project
  60044. c.instancetemplate = instancetemplate
  60045. return c
  60046. }
  60047. // RequestId sets the optional parameter "requestId": An optional
  60048. // request ID to identify requests. Specify a unique request ID so that
  60049. // if you must retry your request, the server will know to ignore the
  60050. // request if it has already been completed.
  60051. //
  60052. // For example, consider a situation where you make an initial request
  60053. // and the request times out. If you make the request again with the
  60054. // same request ID, the server can check if original operation with the
  60055. // same request ID was received, and if so, will ignore the second
  60056. // request. This prevents clients from accidentally creating duplicate
  60057. // commitments.
  60058. //
  60059. // The request ID must be a valid UUID with the exception that zero UUID
  60060. // is not supported (00000000-0000-0000-0000-000000000000).
  60061. func (c *InstanceTemplatesInsertCall) RequestId(requestId string) *InstanceTemplatesInsertCall {
  60062. c.urlParams_.Set("requestId", requestId)
  60063. return c
  60064. }
  60065. // Fields allows partial responses to be retrieved. See
  60066. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  60067. // for more information.
  60068. func (c *InstanceTemplatesInsertCall) Fields(s ...googleapi.Field) *InstanceTemplatesInsertCall {
  60069. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  60070. return c
  60071. }
  60072. // Context sets the context to be used in this call's Do method. Any
  60073. // pending HTTP request will be aborted if the provided context is
  60074. // canceled.
  60075. func (c *InstanceTemplatesInsertCall) Context(ctx context.Context) *InstanceTemplatesInsertCall {
  60076. c.ctx_ = ctx
  60077. return c
  60078. }
  60079. // Header returns an http.Header that can be modified by the caller to
  60080. // add HTTP headers to the request.
  60081. func (c *InstanceTemplatesInsertCall) Header() http.Header {
  60082. if c.header_ == nil {
  60083. c.header_ = make(http.Header)
  60084. }
  60085. return c.header_
  60086. }
  60087. func (c *InstanceTemplatesInsertCall) doRequest(alt string) (*http.Response, error) {
  60088. reqHeaders := make(http.Header)
  60089. for k, v := range c.header_ {
  60090. reqHeaders[k] = v
  60091. }
  60092. reqHeaders.Set("User-Agent", c.s.userAgent())
  60093. var body io.Reader = nil
  60094. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancetemplate)
  60095. if err != nil {
  60096. return nil, err
  60097. }
  60098. reqHeaders.Set("Content-Type", "application/json")
  60099. c.urlParams_.Set("alt", alt)
  60100. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates")
  60101. urls += "?" + c.urlParams_.Encode()
  60102. req, _ := http.NewRequest("POST", urls, body)
  60103. req.Header = reqHeaders
  60104. googleapi.Expand(req.URL, map[string]string{
  60105. "project": c.project,
  60106. })
  60107. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  60108. }
  60109. // Do executes the "compute.instanceTemplates.insert" call.
  60110. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  60111. // status code is an error. Response headers are in either
  60112. // *Operation.ServerResponse.Header or (if a response was returned at
  60113. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  60114. // to check whether the returned error was because
  60115. // http.StatusNotModified was returned.
  60116. func (c *InstanceTemplatesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  60117. gensupport.SetOptions(c.urlParams_, opts...)
  60118. res, err := c.doRequest("json")
  60119. if res != nil && res.StatusCode == http.StatusNotModified {
  60120. if res.Body != nil {
  60121. res.Body.Close()
  60122. }
  60123. return nil, &googleapi.Error{
  60124. Code: res.StatusCode,
  60125. Header: res.Header,
  60126. }
  60127. }
  60128. if err != nil {
  60129. return nil, err
  60130. }
  60131. defer googleapi.CloseBody(res)
  60132. if err := googleapi.CheckResponse(res); err != nil {
  60133. return nil, err
  60134. }
  60135. ret := &Operation{
  60136. ServerResponse: googleapi.ServerResponse{
  60137. Header: res.Header,
  60138. HTTPStatusCode: res.StatusCode,
  60139. },
  60140. }
  60141. target := &ret
  60142. if err := gensupport.DecodeResponse(target, res); err != nil {
  60143. return nil, err
  60144. }
  60145. return ret, nil
  60146. // {
  60147. // "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.",
  60148. // "httpMethod": "POST",
  60149. // "id": "compute.instanceTemplates.insert",
  60150. // "parameterOrder": [
  60151. // "project"
  60152. // ],
  60153. // "parameters": {
  60154. // "project": {
  60155. // "description": "Project ID for this request.",
  60156. // "location": "path",
  60157. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  60158. // "required": true,
  60159. // "type": "string"
  60160. // },
  60161. // "requestId": {
  60162. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  60163. // "location": "query",
  60164. // "type": "string"
  60165. // }
  60166. // },
  60167. // "path": "{project}/global/instanceTemplates",
  60168. // "request": {
  60169. // "$ref": "InstanceTemplate"
  60170. // },
  60171. // "response": {
  60172. // "$ref": "Operation"
  60173. // },
  60174. // "scopes": [
  60175. // "https://www.googleapis.com/auth/cloud-platform",
  60176. // "https://www.googleapis.com/auth/compute"
  60177. // ]
  60178. // }
  60179. }
  60180. // method id "compute.instanceTemplates.list":
  60181. type InstanceTemplatesListCall struct {
  60182. s *Service
  60183. project string
  60184. urlParams_ gensupport.URLParams
  60185. ifNoneMatch_ string
  60186. ctx_ context.Context
  60187. header_ http.Header
  60188. }
  60189. // List: Retrieves a list of instance templates that are contained
  60190. // within the specified project and zone.
  60191. // For details, see https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/list
  60192. func (r *InstanceTemplatesService) List(project string) *InstanceTemplatesListCall {
  60193. c := &InstanceTemplatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  60194. c.project = project
  60195. return c
  60196. }
  60197. // Filter sets the optional parameter "filter": A filter expression that
  60198. // filters resources listed in the response. The expression must specify
  60199. // the field name, a comparison operator, and the value that you want to
  60200. // use for filtering. The value must be a string, a number, or a
  60201. // boolean. The comparison operator must be either =, !=, >, or <.
  60202. //
  60203. // For example, if you are filtering Compute Engine instances, you can
  60204. // exclude instances named example-instance by specifying name !=
  60205. // example-instance.
  60206. //
  60207. // You can also filter nested fields. For example, you could specify
  60208. // scheduling.automaticRestart = false to include instances only if they
  60209. // are not scheduled for automatic restarts. You can use filtering on
  60210. // nested fields to filter based on resource labels.
  60211. //
  60212. // To filter on multiple expressions, provide each separate expression
  60213. // within parentheses. For example, (scheduling.automaticRestart = true)
  60214. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  60215. // AND expression. However, you can include AND and OR expressions
  60216. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  60217. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  60218. // true).
  60219. func (c *InstanceTemplatesListCall) Filter(filter string) *InstanceTemplatesListCall {
  60220. c.urlParams_.Set("filter", filter)
  60221. return c
  60222. }
  60223. // MaxResults sets the optional parameter "maxResults": The maximum
  60224. // number of results per page that should be returned. If the number of
  60225. // available results is larger than maxResults, Compute Engine returns a
  60226. // nextPageToken that can be used to get the next page of results in
  60227. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  60228. // (Default: 500)
  60229. func (c *InstanceTemplatesListCall) MaxResults(maxResults int64) *InstanceTemplatesListCall {
  60230. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  60231. return c
  60232. }
  60233. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  60234. // a certain order. By default, results are returned in alphanumerical
  60235. // order based on the resource name.
  60236. //
  60237. // You can also sort results in descending order based on the creation
  60238. // timestamp using orderBy="creationTimestamp desc". This sorts results
  60239. // based on the creationTimestamp field in reverse chronological order
  60240. // (newest result first). Use this to sort resources like operations so
  60241. // that the newest operation is returned first.
  60242. //
  60243. // Currently, only sorting by name or creationTimestamp desc is
  60244. // supported.
  60245. func (c *InstanceTemplatesListCall) OrderBy(orderBy string) *InstanceTemplatesListCall {
  60246. c.urlParams_.Set("orderBy", orderBy)
  60247. return c
  60248. }
  60249. // PageToken sets the optional parameter "pageToken": Specifies a page
  60250. // token to use. Set pageToken to the nextPageToken returned by a
  60251. // previous list request to get the next page of results.
  60252. func (c *InstanceTemplatesListCall) PageToken(pageToken string) *InstanceTemplatesListCall {
  60253. c.urlParams_.Set("pageToken", pageToken)
  60254. return c
  60255. }
  60256. // Fields allows partial responses to be retrieved. See
  60257. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  60258. // for more information.
  60259. func (c *InstanceTemplatesListCall) Fields(s ...googleapi.Field) *InstanceTemplatesListCall {
  60260. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  60261. return c
  60262. }
  60263. // IfNoneMatch sets the optional parameter which makes the operation
  60264. // fail if the object's ETag matches the given value. This is useful for
  60265. // getting updates only after the object has changed since the last
  60266. // request. Use googleapi.IsNotModified to check whether the response
  60267. // error from Do is the result of In-None-Match.
  60268. func (c *InstanceTemplatesListCall) IfNoneMatch(entityTag string) *InstanceTemplatesListCall {
  60269. c.ifNoneMatch_ = entityTag
  60270. return c
  60271. }
  60272. // Context sets the context to be used in this call's Do method. Any
  60273. // pending HTTP request will be aborted if the provided context is
  60274. // canceled.
  60275. func (c *InstanceTemplatesListCall) Context(ctx context.Context) *InstanceTemplatesListCall {
  60276. c.ctx_ = ctx
  60277. return c
  60278. }
  60279. // Header returns an http.Header that can be modified by the caller to
  60280. // add HTTP headers to the request.
  60281. func (c *InstanceTemplatesListCall) Header() http.Header {
  60282. if c.header_ == nil {
  60283. c.header_ = make(http.Header)
  60284. }
  60285. return c.header_
  60286. }
  60287. func (c *InstanceTemplatesListCall) doRequest(alt string) (*http.Response, error) {
  60288. reqHeaders := make(http.Header)
  60289. for k, v := range c.header_ {
  60290. reqHeaders[k] = v
  60291. }
  60292. reqHeaders.Set("User-Agent", c.s.userAgent())
  60293. if c.ifNoneMatch_ != "" {
  60294. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  60295. }
  60296. var body io.Reader = nil
  60297. c.urlParams_.Set("alt", alt)
  60298. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates")
  60299. urls += "?" + c.urlParams_.Encode()
  60300. req, _ := http.NewRequest("GET", urls, body)
  60301. req.Header = reqHeaders
  60302. googleapi.Expand(req.URL, map[string]string{
  60303. "project": c.project,
  60304. })
  60305. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  60306. }
  60307. // Do executes the "compute.instanceTemplates.list" call.
  60308. // Exactly one of *InstanceTemplateList or error will be non-nil. Any
  60309. // non-2xx status code is an error. Response headers are in either
  60310. // *InstanceTemplateList.ServerResponse.Header or (if a response was
  60311. // returned at all) in error.(*googleapi.Error).Header. Use
  60312. // googleapi.IsNotModified to check whether the returned error was
  60313. // because http.StatusNotModified was returned.
  60314. func (c *InstanceTemplatesListCall) Do(opts ...googleapi.CallOption) (*InstanceTemplateList, error) {
  60315. gensupport.SetOptions(c.urlParams_, opts...)
  60316. res, err := c.doRequest("json")
  60317. if res != nil && res.StatusCode == http.StatusNotModified {
  60318. if res.Body != nil {
  60319. res.Body.Close()
  60320. }
  60321. return nil, &googleapi.Error{
  60322. Code: res.StatusCode,
  60323. Header: res.Header,
  60324. }
  60325. }
  60326. if err != nil {
  60327. return nil, err
  60328. }
  60329. defer googleapi.CloseBody(res)
  60330. if err := googleapi.CheckResponse(res); err != nil {
  60331. return nil, err
  60332. }
  60333. ret := &InstanceTemplateList{
  60334. ServerResponse: googleapi.ServerResponse{
  60335. Header: res.Header,
  60336. HTTPStatusCode: res.StatusCode,
  60337. },
  60338. }
  60339. target := &ret
  60340. if err := gensupport.DecodeResponse(target, res); err != nil {
  60341. return nil, err
  60342. }
  60343. return ret, nil
  60344. // {
  60345. // "description": "Retrieves a list of instance templates that are contained within the specified project and zone.",
  60346. // "httpMethod": "GET",
  60347. // "id": "compute.instanceTemplates.list",
  60348. // "parameterOrder": [
  60349. // "project"
  60350. // ],
  60351. // "parameters": {
  60352. // "filter": {
  60353. // "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).",
  60354. // "location": "query",
  60355. // "type": "string"
  60356. // },
  60357. // "maxResults": {
  60358. // "default": "500",
  60359. // "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)",
  60360. // "format": "uint32",
  60361. // "location": "query",
  60362. // "minimum": "0",
  60363. // "type": "integer"
  60364. // },
  60365. // "orderBy": {
  60366. // "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.",
  60367. // "location": "query",
  60368. // "type": "string"
  60369. // },
  60370. // "pageToken": {
  60371. // "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.",
  60372. // "location": "query",
  60373. // "type": "string"
  60374. // },
  60375. // "project": {
  60376. // "description": "Project ID for this request.",
  60377. // "location": "path",
  60378. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  60379. // "required": true,
  60380. // "type": "string"
  60381. // }
  60382. // },
  60383. // "path": "{project}/global/instanceTemplates",
  60384. // "response": {
  60385. // "$ref": "InstanceTemplateList"
  60386. // },
  60387. // "scopes": [
  60388. // "https://www.googleapis.com/auth/cloud-platform",
  60389. // "https://www.googleapis.com/auth/compute",
  60390. // "https://www.googleapis.com/auth/compute.readonly"
  60391. // ]
  60392. // }
  60393. }
  60394. // Pages invokes f for each page of results.
  60395. // A non-nil error returned from f will halt the iteration.
  60396. // The provided context supersedes any context provided to the Context method.
  60397. func (c *InstanceTemplatesListCall) Pages(ctx context.Context, f func(*InstanceTemplateList) error) error {
  60398. c.ctx_ = ctx
  60399. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  60400. for {
  60401. x, err := c.Do()
  60402. if err != nil {
  60403. return err
  60404. }
  60405. if err := f(x); err != nil {
  60406. return err
  60407. }
  60408. if x.NextPageToken == "" {
  60409. return nil
  60410. }
  60411. c.PageToken(x.NextPageToken)
  60412. }
  60413. }
  60414. // method id "compute.instanceTemplates.testIamPermissions":
  60415. type InstanceTemplatesTestIamPermissionsCall struct {
  60416. s *Service
  60417. project string
  60418. resource string
  60419. testpermissionsrequest *TestPermissionsRequest
  60420. urlParams_ gensupport.URLParams
  60421. ctx_ context.Context
  60422. header_ http.Header
  60423. }
  60424. // TestIamPermissions: Returns permissions that a caller has on the
  60425. // specified resource.
  60426. func (r *InstanceTemplatesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *InstanceTemplatesTestIamPermissionsCall {
  60427. c := &InstanceTemplatesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  60428. c.project = project
  60429. c.resource = resource
  60430. c.testpermissionsrequest = testpermissionsrequest
  60431. return c
  60432. }
  60433. // Fields allows partial responses to be retrieved. See
  60434. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  60435. // for more information.
  60436. func (c *InstanceTemplatesTestIamPermissionsCall) Fields(s ...googleapi.Field) *InstanceTemplatesTestIamPermissionsCall {
  60437. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  60438. return c
  60439. }
  60440. // Context sets the context to be used in this call's Do method. Any
  60441. // pending HTTP request will be aborted if the provided context is
  60442. // canceled.
  60443. func (c *InstanceTemplatesTestIamPermissionsCall) Context(ctx context.Context) *InstanceTemplatesTestIamPermissionsCall {
  60444. c.ctx_ = ctx
  60445. return c
  60446. }
  60447. // Header returns an http.Header that can be modified by the caller to
  60448. // add HTTP headers to the request.
  60449. func (c *InstanceTemplatesTestIamPermissionsCall) Header() http.Header {
  60450. if c.header_ == nil {
  60451. c.header_ = make(http.Header)
  60452. }
  60453. return c.header_
  60454. }
  60455. func (c *InstanceTemplatesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  60456. reqHeaders := make(http.Header)
  60457. for k, v := range c.header_ {
  60458. reqHeaders[k] = v
  60459. }
  60460. reqHeaders.Set("User-Agent", c.s.userAgent())
  60461. var body io.Reader = nil
  60462. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  60463. if err != nil {
  60464. return nil, err
  60465. }
  60466. reqHeaders.Set("Content-Type", "application/json")
  60467. c.urlParams_.Set("alt", alt)
  60468. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates/{resource}/testIamPermissions")
  60469. urls += "?" + c.urlParams_.Encode()
  60470. req, _ := http.NewRequest("POST", urls, body)
  60471. req.Header = reqHeaders
  60472. googleapi.Expand(req.URL, map[string]string{
  60473. "project": c.project,
  60474. "resource": c.resource,
  60475. })
  60476. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  60477. }
  60478. // Do executes the "compute.instanceTemplates.testIamPermissions" call.
  60479. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  60480. // non-2xx status code is an error. Response headers are in either
  60481. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  60482. // returned at all) in error.(*googleapi.Error).Header. Use
  60483. // googleapi.IsNotModified to check whether the returned error was
  60484. // because http.StatusNotModified was returned.
  60485. func (c *InstanceTemplatesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  60486. gensupport.SetOptions(c.urlParams_, opts...)
  60487. res, err := c.doRequest("json")
  60488. if res != nil && res.StatusCode == http.StatusNotModified {
  60489. if res.Body != nil {
  60490. res.Body.Close()
  60491. }
  60492. return nil, &googleapi.Error{
  60493. Code: res.StatusCode,
  60494. Header: res.Header,
  60495. }
  60496. }
  60497. if err != nil {
  60498. return nil, err
  60499. }
  60500. defer googleapi.CloseBody(res)
  60501. if err := googleapi.CheckResponse(res); err != nil {
  60502. return nil, err
  60503. }
  60504. ret := &TestPermissionsResponse{
  60505. ServerResponse: googleapi.ServerResponse{
  60506. Header: res.Header,
  60507. HTTPStatusCode: res.StatusCode,
  60508. },
  60509. }
  60510. target := &ret
  60511. if err := gensupport.DecodeResponse(target, res); err != nil {
  60512. return nil, err
  60513. }
  60514. return ret, nil
  60515. // {
  60516. // "description": "Returns permissions that a caller has on the specified resource.",
  60517. // "httpMethod": "POST",
  60518. // "id": "compute.instanceTemplates.testIamPermissions",
  60519. // "parameterOrder": [
  60520. // "project",
  60521. // "resource"
  60522. // ],
  60523. // "parameters": {
  60524. // "project": {
  60525. // "description": "Project ID for this request.",
  60526. // "location": "path",
  60527. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  60528. // "required": true,
  60529. // "type": "string"
  60530. // },
  60531. // "resource": {
  60532. // "description": "Name of the resource for this request.",
  60533. // "location": "path",
  60534. // "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?",
  60535. // "required": true,
  60536. // "type": "string"
  60537. // }
  60538. // },
  60539. // "path": "{project}/global/instanceTemplates/{resource}/testIamPermissions",
  60540. // "request": {
  60541. // "$ref": "TestPermissionsRequest"
  60542. // },
  60543. // "response": {
  60544. // "$ref": "TestPermissionsResponse"
  60545. // },
  60546. // "scopes": [
  60547. // "https://www.googleapis.com/auth/cloud-platform",
  60548. // "https://www.googleapis.com/auth/compute",
  60549. // "https://www.googleapis.com/auth/compute.readonly"
  60550. // ]
  60551. // }
  60552. }
  60553. // method id "compute.instances.addAccessConfig":
  60554. type InstancesAddAccessConfigCall struct {
  60555. s *Service
  60556. project string
  60557. zone string
  60558. instance string
  60559. accessconfig *AccessConfig
  60560. urlParams_ gensupport.URLParams
  60561. ctx_ context.Context
  60562. header_ http.Header
  60563. }
  60564. // AddAccessConfig: Adds an access config to an instance's network
  60565. // interface.
  60566. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/addAccessConfig
  60567. func (r *InstancesService) AddAccessConfig(project string, zone string, instance string, networkInterface string, accessconfig *AccessConfig) *InstancesAddAccessConfigCall {
  60568. c := &InstancesAddAccessConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  60569. c.project = project
  60570. c.zone = zone
  60571. c.instance = instance
  60572. c.urlParams_.Set("networkInterface", networkInterface)
  60573. c.accessconfig = accessconfig
  60574. return c
  60575. }
  60576. // RequestId sets the optional parameter "requestId": An optional
  60577. // request ID to identify requests. Specify a unique request ID so that
  60578. // if you must retry your request, the server will know to ignore the
  60579. // request if it has already been completed.
  60580. //
  60581. // For example, consider a situation where you make an initial request
  60582. // and the request times out. If you make the request again with the
  60583. // same request ID, the server can check if original operation with the
  60584. // same request ID was received, and if so, will ignore the second
  60585. // request. This prevents clients from accidentally creating duplicate
  60586. // commitments.
  60587. //
  60588. // The request ID must be a valid UUID with the exception that zero UUID
  60589. // is not supported (00000000-0000-0000-0000-000000000000).
  60590. func (c *InstancesAddAccessConfigCall) RequestId(requestId string) *InstancesAddAccessConfigCall {
  60591. c.urlParams_.Set("requestId", requestId)
  60592. return c
  60593. }
  60594. // Fields allows partial responses to be retrieved. See
  60595. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  60596. // for more information.
  60597. func (c *InstancesAddAccessConfigCall) Fields(s ...googleapi.Field) *InstancesAddAccessConfigCall {
  60598. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  60599. return c
  60600. }
  60601. // Context sets the context to be used in this call's Do method. Any
  60602. // pending HTTP request will be aborted if the provided context is
  60603. // canceled.
  60604. func (c *InstancesAddAccessConfigCall) Context(ctx context.Context) *InstancesAddAccessConfigCall {
  60605. c.ctx_ = ctx
  60606. return c
  60607. }
  60608. // Header returns an http.Header that can be modified by the caller to
  60609. // add HTTP headers to the request.
  60610. func (c *InstancesAddAccessConfigCall) Header() http.Header {
  60611. if c.header_ == nil {
  60612. c.header_ = make(http.Header)
  60613. }
  60614. return c.header_
  60615. }
  60616. func (c *InstancesAddAccessConfigCall) doRequest(alt string) (*http.Response, error) {
  60617. reqHeaders := make(http.Header)
  60618. for k, v := range c.header_ {
  60619. reqHeaders[k] = v
  60620. }
  60621. reqHeaders.Set("User-Agent", c.s.userAgent())
  60622. var body io.Reader = nil
  60623. body, err := googleapi.WithoutDataWrapper.JSONReader(c.accessconfig)
  60624. if err != nil {
  60625. return nil, err
  60626. }
  60627. reqHeaders.Set("Content-Type", "application/json")
  60628. c.urlParams_.Set("alt", alt)
  60629. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/addAccessConfig")
  60630. urls += "?" + c.urlParams_.Encode()
  60631. req, _ := http.NewRequest("POST", urls, body)
  60632. req.Header = reqHeaders
  60633. googleapi.Expand(req.URL, map[string]string{
  60634. "project": c.project,
  60635. "zone": c.zone,
  60636. "instance": c.instance,
  60637. })
  60638. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  60639. }
  60640. // Do executes the "compute.instances.addAccessConfig" call.
  60641. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  60642. // status code is an error. Response headers are in either
  60643. // *Operation.ServerResponse.Header or (if a response was returned at
  60644. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  60645. // to check whether the returned error was because
  60646. // http.StatusNotModified was returned.
  60647. func (c *InstancesAddAccessConfigCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  60648. gensupport.SetOptions(c.urlParams_, opts...)
  60649. res, err := c.doRequest("json")
  60650. if res != nil && res.StatusCode == http.StatusNotModified {
  60651. if res.Body != nil {
  60652. res.Body.Close()
  60653. }
  60654. return nil, &googleapi.Error{
  60655. Code: res.StatusCode,
  60656. Header: res.Header,
  60657. }
  60658. }
  60659. if err != nil {
  60660. return nil, err
  60661. }
  60662. defer googleapi.CloseBody(res)
  60663. if err := googleapi.CheckResponse(res); err != nil {
  60664. return nil, err
  60665. }
  60666. ret := &Operation{
  60667. ServerResponse: googleapi.ServerResponse{
  60668. Header: res.Header,
  60669. HTTPStatusCode: res.StatusCode,
  60670. },
  60671. }
  60672. target := &ret
  60673. if err := gensupport.DecodeResponse(target, res); err != nil {
  60674. return nil, err
  60675. }
  60676. return ret, nil
  60677. // {
  60678. // "description": "Adds an access config to an instance's network interface.",
  60679. // "httpMethod": "POST",
  60680. // "id": "compute.instances.addAccessConfig",
  60681. // "parameterOrder": [
  60682. // "project",
  60683. // "zone",
  60684. // "instance",
  60685. // "networkInterface"
  60686. // ],
  60687. // "parameters": {
  60688. // "instance": {
  60689. // "description": "The instance name for this request.",
  60690. // "location": "path",
  60691. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  60692. // "required": true,
  60693. // "type": "string"
  60694. // },
  60695. // "networkInterface": {
  60696. // "description": "The name of the network interface to add to this instance.",
  60697. // "location": "query",
  60698. // "required": true,
  60699. // "type": "string"
  60700. // },
  60701. // "project": {
  60702. // "description": "Project ID for this request.",
  60703. // "location": "path",
  60704. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  60705. // "required": true,
  60706. // "type": "string"
  60707. // },
  60708. // "requestId": {
  60709. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  60710. // "location": "query",
  60711. // "type": "string"
  60712. // },
  60713. // "zone": {
  60714. // "description": "The name of the zone for this request.",
  60715. // "location": "path",
  60716. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  60717. // "required": true,
  60718. // "type": "string"
  60719. // }
  60720. // },
  60721. // "path": "{project}/zones/{zone}/instances/{instance}/addAccessConfig",
  60722. // "request": {
  60723. // "$ref": "AccessConfig"
  60724. // },
  60725. // "response": {
  60726. // "$ref": "Operation"
  60727. // },
  60728. // "scopes": [
  60729. // "https://www.googleapis.com/auth/cloud-platform",
  60730. // "https://www.googleapis.com/auth/compute"
  60731. // ]
  60732. // }
  60733. }
  60734. // method id "compute.instances.addResourcePolicies":
  60735. type InstancesAddResourcePoliciesCall struct {
  60736. s *Service
  60737. project string
  60738. zone string
  60739. instance string
  60740. instancesaddresourcepoliciesrequest *InstancesAddResourcePoliciesRequest
  60741. urlParams_ gensupport.URLParams
  60742. ctx_ context.Context
  60743. header_ http.Header
  60744. }
  60745. // AddResourcePolicies: Adds existing resource policies to an instance.
  60746. // You can only add one policy right now which will be applied to this
  60747. // instance for scheduling live migrations.
  60748. func (r *InstancesService) AddResourcePolicies(project string, zone string, instance string, instancesaddresourcepoliciesrequest *InstancesAddResourcePoliciesRequest) *InstancesAddResourcePoliciesCall {
  60749. c := &InstancesAddResourcePoliciesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  60750. c.project = project
  60751. c.zone = zone
  60752. c.instance = instance
  60753. c.instancesaddresourcepoliciesrequest = instancesaddresourcepoliciesrequest
  60754. return c
  60755. }
  60756. // RequestId sets the optional parameter "requestId": An optional
  60757. // request ID to identify requests. Specify a unique request ID so that
  60758. // if you must retry your request, the server will know to ignore the
  60759. // request if it has already been completed.
  60760. //
  60761. // For example, consider a situation where you make an initial request
  60762. // and the request times out. If you make the request again with the
  60763. // same request ID, the server can check if original operation with the
  60764. // same request ID was received, and if so, will ignore the second
  60765. // request. This prevents clients from accidentally creating duplicate
  60766. // commitments.
  60767. //
  60768. // The request ID must be a valid UUID with the exception that zero UUID
  60769. // is not supported (00000000-0000-0000-0000-000000000000).
  60770. func (c *InstancesAddResourcePoliciesCall) RequestId(requestId string) *InstancesAddResourcePoliciesCall {
  60771. c.urlParams_.Set("requestId", requestId)
  60772. return c
  60773. }
  60774. // Fields allows partial responses to be retrieved. See
  60775. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  60776. // for more information.
  60777. func (c *InstancesAddResourcePoliciesCall) Fields(s ...googleapi.Field) *InstancesAddResourcePoliciesCall {
  60778. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  60779. return c
  60780. }
  60781. // Context sets the context to be used in this call's Do method. Any
  60782. // pending HTTP request will be aborted if the provided context is
  60783. // canceled.
  60784. func (c *InstancesAddResourcePoliciesCall) Context(ctx context.Context) *InstancesAddResourcePoliciesCall {
  60785. c.ctx_ = ctx
  60786. return c
  60787. }
  60788. // Header returns an http.Header that can be modified by the caller to
  60789. // add HTTP headers to the request.
  60790. func (c *InstancesAddResourcePoliciesCall) Header() http.Header {
  60791. if c.header_ == nil {
  60792. c.header_ = make(http.Header)
  60793. }
  60794. return c.header_
  60795. }
  60796. func (c *InstancesAddResourcePoliciesCall) doRequest(alt string) (*http.Response, error) {
  60797. reqHeaders := make(http.Header)
  60798. for k, v := range c.header_ {
  60799. reqHeaders[k] = v
  60800. }
  60801. reqHeaders.Set("User-Agent", c.s.userAgent())
  60802. var body io.Reader = nil
  60803. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesaddresourcepoliciesrequest)
  60804. if err != nil {
  60805. return nil, err
  60806. }
  60807. reqHeaders.Set("Content-Type", "application/json")
  60808. c.urlParams_.Set("alt", alt)
  60809. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/addResourcePolicies")
  60810. urls += "?" + c.urlParams_.Encode()
  60811. req, _ := http.NewRequest("POST", urls, body)
  60812. req.Header = reqHeaders
  60813. googleapi.Expand(req.URL, map[string]string{
  60814. "project": c.project,
  60815. "zone": c.zone,
  60816. "instance": c.instance,
  60817. })
  60818. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  60819. }
  60820. // Do executes the "compute.instances.addResourcePolicies" call.
  60821. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  60822. // status code is an error. Response headers are in either
  60823. // *Operation.ServerResponse.Header or (if a response was returned at
  60824. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  60825. // to check whether the returned error was because
  60826. // http.StatusNotModified was returned.
  60827. func (c *InstancesAddResourcePoliciesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  60828. gensupport.SetOptions(c.urlParams_, opts...)
  60829. res, err := c.doRequest("json")
  60830. if res != nil && res.StatusCode == http.StatusNotModified {
  60831. if res.Body != nil {
  60832. res.Body.Close()
  60833. }
  60834. return nil, &googleapi.Error{
  60835. Code: res.StatusCode,
  60836. Header: res.Header,
  60837. }
  60838. }
  60839. if err != nil {
  60840. return nil, err
  60841. }
  60842. defer googleapi.CloseBody(res)
  60843. if err := googleapi.CheckResponse(res); err != nil {
  60844. return nil, err
  60845. }
  60846. ret := &Operation{
  60847. ServerResponse: googleapi.ServerResponse{
  60848. Header: res.Header,
  60849. HTTPStatusCode: res.StatusCode,
  60850. },
  60851. }
  60852. target := &ret
  60853. if err := gensupport.DecodeResponse(target, res); err != nil {
  60854. return nil, err
  60855. }
  60856. return ret, nil
  60857. // {
  60858. // "description": "Adds existing resource policies to an instance. You can only add one policy right now which will be applied to this instance for scheduling live migrations.",
  60859. // "httpMethod": "POST",
  60860. // "id": "compute.instances.addResourcePolicies",
  60861. // "parameterOrder": [
  60862. // "project",
  60863. // "zone",
  60864. // "instance"
  60865. // ],
  60866. // "parameters": {
  60867. // "instance": {
  60868. // "description": "The instance name for this request.",
  60869. // "location": "path",
  60870. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  60871. // "required": true,
  60872. // "type": "string"
  60873. // },
  60874. // "project": {
  60875. // "description": "Project ID for this request.",
  60876. // "location": "path",
  60877. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  60878. // "required": true,
  60879. // "type": "string"
  60880. // },
  60881. // "requestId": {
  60882. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  60883. // "location": "query",
  60884. // "type": "string"
  60885. // },
  60886. // "zone": {
  60887. // "description": "The name of the zone for this request.",
  60888. // "location": "path",
  60889. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  60890. // "required": true,
  60891. // "type": "string"
  60892. // }
  60893. // },
  60894. // "path": "{project}/zones/{zone}/instances/{instance}/addResourcePolicies",
  60895. // "request": {
  60896. // "$ref": "InstancesAddResourcePoliciesRequest"
  60897. // },
  60898. // "response": {
  60899. // "$ref": "Operation"
  60900. // },
  60901. // "scopes": [
  60902. // "https://www.googleapis.com/auth/cloud-platform",
  60903. // "https://www.googleapis.com/auth/compute"
  60904. // ]
  60905. // }
  60906. }
  60907. // method id "compute.instances.aggregatedList":
  60908. type InstancesAggregatedListCall struct {
  60909. s *Service
  60910. project string
  60911. urlParams_ gensupport.URLParams
  60912. ifNoneMatch_ string
  60913. ctx_ context.Context
  60914. header_ http.Header
  60915. }
  60916. // AggregatedList: Retrieves aggregated list of instances.
  60917. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/aggregatedList
  60918. func (r *InstancesService) AggregatedList(project string) *InstancesAggregatedListCall {
  60919. c := &InstancesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  60920. c.project = project
  60921. return c
  60922. }
  60923. // Filter sets the optional parameter "filter": A filter expression that
  60924. // filters resources listed in the response. The expression must specify
  60925. // the field name, a comparison operator, and the value that you want to
  60926. // use for filtering. The value must be a string, a number, or a
  60927. // boolean. The comparison operator must be either =, !=, >, or <.
  60928. //
  60929. // For example, if you are filtering Compute Engine instances, you can
  60930. // exclude instances named example-instance by specifying name !=
  60931. // example-instance.
  60932. //
  60933. // You can also filter nested fields. For example, you could specify
  60934. // scheduling.automaticRestart = false to include instances only if they
  60935. // are not scheduled for automatic restarts. You can use filtering on
  60936. // nested fields to filter based on resource labels.
  60937. //
  60938. // To filter on multiple expressions, provide each separate expression
  60939. // within parentheses. For example, (scheduling.automaticRestart = true)
  60940. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  60941. // AND expression. However, you can include AND and OR expressions
  60942. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  60943. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  60944. // true).
  60945. func (c *InstancesAggregatedListCall) Filter(filter string) *InstancesAggregatedListCall {
  60946. c.urlParams_.Set("filter", filter)
  60947. return c
  60948. }
  60949. // MaxResults sets the optional parameter "maxResults": The maximum
  60950. // number of results per page that should be returned. If the number of
  60951. // available results is larger than maxResults, Compute Engine returns a
  60952. // nextPageToken that can be used to get the next page of results in
  60953. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  60954. // (Default: 500)
  60955. func (c *InstancesAggregatedListCall) MaxResults(maxResults int64) *InstancesAggregatedListCall {
  60956. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  60957. return c
  60958. }
  60959. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  60960. // a certain order. By default, results are returned in alphanumerical
  60961. // order based on the resource name.
  60962. //
  60963. // You can also sort results in descending order based on the creation
  60964. // timestamp using orderBy="creationTimestamp desc". This sorts results
  60965. // based on the creationTimestamp field in reverse chronological order
  60966. // (newest result first). Use this to sort resources like operations so
  60967. // that the newest operation is returned first.
  60968. //
  60969. // Currently, only sorting by name or creationTimestamp desc is
  60970. // supported.
  60971. func (c *InstancesAggregatedListCall) OrderBy(orderBy string) *InstancesAggregatedListCall {
  60972. c.urlParams_.Set("orderBy", orderBy)
  60973. return c
  60974. }
  60975. // PageToken sets the optional parameter "pageToken": Specifies a page
  60976. // token to use. Set pageToken to the nextPageToken returned by a
  60977. // previous list request to get the next page of results.
  60978. func (c *InstancesAggregatedListCall) PageToken(pageToken string) *InstancesAggregatedListCall {
  60979. c.urlParams_.Set("pageToken", pageToken)
  60980. return c
  60981. }
  60982. // Fields allows partial responses to be retrieved. See
  60983. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  60984. // for more information.
  60985. func (c *InstancesAggregatedListCall) Fields(s ...googleapi.Field) *InstancesAggregatedListCall {
  60986. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  60987. return c
  60988. }
  60989. // IfNoneMatch sets the optional parameter which makes the operation
  60990. // fail if the object's ETag matches the given value. This is useful for
  60991. // getting updates only after the object has changed since the last
  60992. // request. Use googleapi.IsNotModified to check whether the response
  60993. // error from Do is the result of In-None-Match.
  60994. func (c *InstancesAggregatedListCall) IfNoneMatch(entityTag string) *InstancesAggregatedListCall {
  60995. c.ifNoneMatch_ = entityTag
  60996. return c
  60997. }
  60998. // Context sets the context to be used in this call's Do method. Any
  60999. // pending HTTP request will be aborted if the provided context is
  61000. // canceled.
  61001. func (c *InstancesAggregatedListCall) Context(ctx context.Context) *InstancesAggregatedListCall {
  61002. c.ctx_ = ctx
  61003. return c
  61004. }
  61005. // Header returns an http.Header that can be modified by the caller to
  61006. // add HTTP headers to the request.
  61007. func (c *InstancesAggregatedListCall) Header() http.Header {
  61008. if c.header_ == nil {
  61009. c.header_ = make(http.Header)
  61010. }
  61011. return c.header_
  61012. }
  61013. func (c *InstancesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  61014. reqHeaders := make(http.Header)
  61015. for k, v := range c.header_ {
  61016. reqHeaders[k] = v
  61017. }
  61018. reqHeaders.Set("User-Agent", c.s.userAgent())
  61019. if c.ifNoneMatch_ != "" {
  61020. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  61021. }
  61022. var body io.Reader = nil
  61023. c.urlParams_.Set("alt", alt)
  61024. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/instances")
  61025. urls += "?" + c.urlParams_.Encode()
  61026. req, _ := http.NewRequest("GET", urls, body)
  61027. req.Header = reqHeaders
  61028. googleapi.Expand(req.URL, map[string]string{
  61029. "project": c.project,
  61030. })
  61031. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  61032. }
  61033. // Do executes the "compute.instances.aggregatedList" call.
  61034. // Exactly one of *InstanceAggregatedList or error will be non-nil. Any
  61035. // non-2xx status code is an error. Response headers are in either
  61036. // *InstanceAggregatedList.ServerResponse.Header or (if a response was
  61037. // returned at all) in error.(*googleapi.Error).Header. Use
  61038. // googleapi.IsNotModified to check whether the returned error was
  61039. // because http.StatusNotModified was returned.
  61040. func (c *InstancesAggregatedListCall) Do(opts ...googleapi.CallOption) (*InstanceAggregatedList, error) {
  61041. gensupport.SetOptions(c.urlParams_, opts...)
  61042. res, err := c.doRequest("json")
  61043. if res != nil && res.StatusCode == http.StatusNotModified {
  61044. if res.Body != nil {
  61045. res.Body.Close()
  61046. }
  61047. return nil, &googleapi.Error{
  61048. Code: res.StatusCode,
  61049. Header: res.Header,
  61050. }
  61051. }
  61052. if err != nil {
  61053. return nil, err
  61054. }
  61055. defer googleapi.CloseBody(res)
  61056. if err := googleapi.CheckResponse(res); err != nil {
  61057. return nil, err
  61058. }
  61059. ret := &InstanceAggregatedList{
  61060. ServerResponse: googleapi.ServerResponse{
  61061. Header: res.Header,
  61062. HTTPStatusCode: res.StatusCode,
  61063. },
  61064. }
  61065. target := &ret
  61066. if err := gensupport.DecodeResponse(target, res); err != nil {
  61067. return nil, err
  61068. }
  61069. return ret, nil
  61070. // {
  61071. // "description": "Retrieves aggregated list of instances.",
  61072. // "httpMethod": "GET",
  61073. // "id": "compute.instances.aggregatedList",
  61074. // "parameterOrder": [
  61075. // "project"
  61076. // ],
  61077. // "parameters": {
  61078. // "filter": {
  61079. // "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).",
  61080. // "location": "query",
  61081. // "type": "string"
  61082. // },
  61083. // "maxResults": {
  61084. // "default": "500",
  61085. // "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)",
  61086. // "format": "uint32",
  61087. // "location": "query",
  61088. // "minimum": "0",
  61089. // "type": "integer"
  61090. // },
  61091. // "orderBy": {
  61092. // "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.",
  61093. // "location": "query",
  61094. // "type": "string"
  61095. // },
  61096. // "pageToken": {
  61097. // "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.",
  61098. // "location": "query",
  61099. // "type": "string"
  61100. // },
  61101. // "project": {
  61102. // "description": "Project ID for this request.",
  61103. // "location": "path",
  61104. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  61105. // "required": true,
  61106. // "type": "string"
  61107. // }
  61108. // },
  61109. // "path": "{project}/aggregated/instances",
  61110. // "response": {
  61111. // "$ref": "InstanceAggregatedList"
  61112. // },
  61113. // "scopes": [
  61114. // "https://www.googleapis.com/auth/cloud-platform",
  61115. // "https://www.googleapis.com/auth/compute",
  61116. // "https://www.googleapis.com/auth/compute.readonly"
  61117. // ]
  61118. // }
  61119. }
  61120. // Pages invokes f for each page of results.
  61121. // A non-nil error returned from f will halt the iteration.
  61122. // The provided context supersedes any context provided to the Context method.
  61123. func (c *InstancesAggregatedListCall) Pages(ctx context.Context, f func(*InstanceAggregatedList) error) error {
  61124. c.ctx_ = ctx
  61125. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  61126. for {
  61127. x, err := c.Do()
  61128. if err != nil {
  61129. return err
  61130. }
  61131. if err := f(x); err != nil {
  61132. return err
  61133. }
  61134. if x.NextPageToken == "" {
  61135. return nil
  61136. }
  61137. c.PageToken(x.NextPageToken)
  61138. }
  61139. }
  61140. // method id "compute.instances.attachDisk":
  61141. type InstancesAttachDiskCall struct {
  61142. s *Service
  61143. project string
  61144. zone string
  61145. instance string
  61146. attacheddisk *AttachedDisk
  61147. urlParams_ gensupport.URLParams
  61148. ctx_ context.Context
  61149. header_ http.Header
  61150. }
  61151. // AttachDisk: Attaches an existing Disk resource to an instance. You
  61152. // must first create the disk before you can attach it. It is not
  61153. // possible to create and attach a disk at the same time. For more
  61154. // information, read Adding a persistent disk to your instance.
  61155. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/attachDisk
  61156. func (r *InstancesService) AttachDisk(project string, zone string, instance string, attacheddisk *AttachedDisk) *InstancesAttachDiskCall {
  61157. c := &InstancesAttachDiskCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  61158. c.project = project
  61159. c.zone = zone
  61160. c.instance = instance
  61161. c.attacheddisk = attacheddisk
  61162. return c
  61163. }
  61164. // ForceAttach sets the optional parameter "forceAttach": Whether to
  61165. // force attach the disk even if it's currently attached to another
  61166. // instance. This is only available for regional disks.
  61167. func (c *InstancesAttachDiskCall) ForceAttach(forceAttach bool) *InstancesAttachDiskCall {
  61168. c.urlParams_.Set("forceAttach", fmt.Sprint(forceAttach))
  61169. return c
  61170. }
  61171. // RequestId sets the optional parameter "requestId": An optional
  61172. // request ID to identify requests. Specify a unique request ID so that
  61173. // if you must retry your request, the server will know to ignore the
  61174. // request if it has already been completed.
  61175. //
  61176. // For example, consider a situation where you make an initial request
  61177. // and the request times out. If you make the request again with the
  61178. // same request ID, the server can check if original operation with the
  61179. // same request ID was received, and if so, will ignore the second
  61180. // request. This prevents clients from accidentally creating duplicate
  61181. // commitments.
  61182. //
  61183. // The request ID must be a valid UUID with the exception that zero UUID
  61184. // is not supported (00000000-0000-0000-0000-000000000000).
  61185. func (c *InstancesAttachDiskCall) RequestId(requestId string) *InstancesAttachDiskCall {
  61186. c.urlParams_.Set("requestId", requestId)
  61187. return c
  61188. }
  61189. // Fields allows partial responses to be retrieved. See
  61190. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  61191. // for more information.
  61192. func (c *InstancesAttachDiskCall) Fields(s ...googleapi.Field) *InstancesAttachDiskCall {
  61193. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  61194. return c
  61195. }
  61196. // Context sets the context to be used in this call's Do method. Any
  61197. // pending HTTP request will be aborted if the provided context is
  61198. // canceled.
  61199. func (c *InstancesAttachDiskCall) Context(ctx context.Context) *InstancesAttachDiskCall {
  61200. c.ctx_ = ctx
  61201. return c
  61202. }
  61203. // Header returns an http.Header that can be modified by the caller to
  61204. // add HTTP headers to the request.
  61205. func (c *InstancesAttachDiskCall) Header() http.Header {
  61206. if c.header_ == nil {
  61207. c.header_ = make(http.Header)
  61208. }
  61209. return c.header_
  61210. }
  61211. func (c *InstancesAttachDiskCall) doRequest(alt string) (*http.Response, error) {
  61212. reqHeaders := make(http.Header)
  61213. for k, v := range c.header_ {
  61214. reqHeaders[k] = v
  61215. }
  61216. reqHeaders.Set("User-Agent", c.s.userAgent())
  61217. var body io.Reader = nil
  61218. body, err := googleapi.WithoutDataWrapper.JSONReader(c.attacheddisk)
  61219. if err != nil {
  61220. return nil, err
  61221. }
  61222. reqHeaders.Set("Content-Type", "application/json")
  61223. c.urlParams_.Set("alt", alt)
  61224. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/attachDisk")
  61225. urls += "?" + c.urlParams_.Encode()
  61226. req, _ := http.NewRequest("POST", urls, body)
  61227. req.Header = reqHeaders
  61228. googleapi.Expand(req.URL, map[string]string{
  61229. "project": c.project,
  61230. "zone": c.zone,
  61231. "instance": c.instance,
  61232. })
  61233. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  61234. }
  61235. // Do executes the "compute.instances.attachDisk" call.
  61236. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  61237. // status code is an error. Response headers are in either
  61238. // *Operation.ServerResponse.Header or (if a response was returned at
  61239. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  61240. // to check whether the returned error was because
  61241. // http.StatusNotModified was returned.
  61242. func (c *InstancesAttachDiskCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  61243. gensupport.SetOptions(c.urlParams_, opts...)
  61244. res, err := c.doRequest("json")
  61245. if res != nil && res.StatusCode == http.StatusNotModified {
  61246. if res.Body != nil {
  61247. res.Body.Close()
  61248. }
  61249. return nil, &googleapi.Error{
  61250. Code: res.StatusCode,
  61251. Header: res.Header,
  61252. }
  61253. }
  61254. if err != nil {
  61255. return nil, err
  61256. }
  61257. defer googleapi.CloseBody(res)
  61258. if err := googleapi.CheckResponse(res); err != nil {
  61259. return nil, err
  61260. }
  61261. ret := &Operation{
  61262. ServerResponse: googleapi.ServerResponse{
  61263. Header: res.Header,
  61264. HTTPStatusCode: res.StatusCode,
  61265. },
  61266. }
  61267. target := &ret
  61268. if err := gensupport.DecodeResponse(target, res); err != nil {
  61269. return nil, err
  61270. }
  61271. return ret, nil
  61272. // {
  61273. // "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.",
  61274. // "httpMethod": "POST",
  61275. // "id": "compute.instances.attachDisk",
  61276. // "parameterOrder": [
  61277. // "project",
  61278. // "zone",
  61279. // "instance"
  61280. // ],
  61281. // "parameters": {
  61282. // "forceAttach": {
  61283. // "description": "Whether to force attach the disk even if it's currently attached to another instance. This is only available for regional disks.",
  61284. // "location": "query",
  61285. // "type": "boolean"
  61286. // },
  61287. // "instance": {
  61288. // "description": "The instance name for this request.",
  61289. // "location": "path",
  61290. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  61291. // "required": true,
  61292. // "type": "string"
  61293. // },
  61294. // "project": {
  61295. // "description": "Project ID for this request.",
  61296. // "location": "path",
  61297. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  61298. // "required": true,
  61299. // "type": "string"
  61300. // },
  61301. // "requestId": {
  61302. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  61303. // "location": "query",
  61304. // "type": "string"
  61305. // },
  61306. // "zone": {
  61307. // "description": "The name of the zone for this request.",
  61308. // "location": "path",
  61309. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  61310. // "required": true,
  61311. // "type": "string"
  61312. // }
  61313. // },
  61314. // "path": "{project}/zones/{zone}/instances/{instance}/attachDisk",
  61315. // "request": {
  61316. // "$ref": "AttachedDisk"
  61317. // },
  61318. // "response": {
  61319. // "$ref": "Operation"
  61320. // },
  61321. // "scopes": [
  61322. // "https://www.googleapis.com/auth/cloud-platform",
  61323. // "https://www.googleapis.com/auth/compute"
  61324. // ]
  61325. // }
  61326. }
  61327. // method id "compute.instances.delete":
  61328. type InstancesDeleteCall struct {
  61329. s *Service
  61330. project string
  61331. zone string
  61332. instance string
  61333. urlParams_ gensupport.URLParams
  61334. ctx_ context.Context
  61335. header_ http.Header
  61336. }
  61337. // Delete: Deletes the specified Instance resource. For more
  61338. // information, see Stopping or Deleting an Instance.
  61339. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/delete
  61340. func (r *InstancesService) Delete(project string, zone string, instance string) *InstancesDeleteCall {
  61341. c := &InstancesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  61342. c.project = project
  61343. c.zone = zone
  61344. c.instance = instance
  61345. return c
  61346. }
  61347. // RequestId sets the optional parameter "requestId": An optional
  61348. // request ID to identify requests. Specify a unique request ID so that
  61349. // if you must retry your request, the server will know to ignore the
  61350. // request if it has already been completed.
  61351. //
  61352. // For example, consider a situation where you make an initial request
  61353. // and the request times out. If you make the request again with the
  61354. // same request ID, the server can check if original operation with the
  61355. // same request ID was received, and if so, will ignore the second
  61356. // request. This prevents clients from accidentally creating duplicate
  61357. // commitments.
  61358. //
  61359. // The request ID must be a valid UUID with the exception that zero UUID
  61360. // is not supported (00000000-0000-0000-0000-000000000000).
  61361. func (c *InstancesDeleteCall) RequestId(requestId string) *InstancesDeleteCall {
  61362. c.urlParams_.Set("requestId", requestId)
  61363. return c
  61364. }
  61365. // Fields allows partial responses to be retrieved. See
  61366. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  61367. // for more information.
  61368. func (c *InstancesDeleteCall) Fields(s ...googleapi.Field) *InstancesDeleteCall {
  61369. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  61370. return c
  61371. }
  61372. // Context sets the context to be used in this call's Do method. Any
  61373. // pending HTTP request will be aborted if the provided context is
  61374. // canceled.
  61375. func (c *InstancesDeleteCall) Context(ctx context.Context) *InstancesDeleteCall {
  61376. c.ctx_ = ctx
  61377. return c
  61378. }
  61379. // Header returns an http.Header that can be modified by the caller to
  61380. // add HTTP headers to the request.
  61381. func (c *InstancesDeleteCall) Header() http.Header {
  61382. if c.header_ == nil {
  61383. c.header_ = make(http.Header)
  61384. }
  61385. return c.header_
  61386. }
  61387. func (c *InstancesDeleteCall) doRequest(alt string) (*http.Response, error) {
  61388. reqHeaders := make(http.Header)
  61389. for k, v := range c.header_ {
  61390. reqHeaders[k] = v
  61391. }
  61392. reqHeaders.Set("User-Agent", c.s.userAgent())
  61393. var body io.Reader = nil
  61394. c.urlParams_.Set("alt", alt)
  61395. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}")
  61396. urls += "?" + c.urlParams_.Encode()
  61397. req, _ := http.NewRequest("DELETE", urls, body)
  61398. req.Header = reqHeaders
  61399. googleapi.Expand(req.URL, map[string]string{
  61400. "project": c.project,
  61401. "zone": c.zone,
  61402. "instance": c.instance,
  61403. })
  61404. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  61405. }
  61406. // Do executes the "compute.instances.delete" call.
  61407. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  61408. // status code is an error. Response headers are in either
  61409. // *Operation.ServerResponse.Header or (if a response was returned at
  61410. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  61411. // to check whether the returned error was because
  61412. // http.StatusNotModified was returned.
  61413. func (c *InstancesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  61414. gensupport.SetOptions(c.urlParams_, opts...)
  61415. res, err := c.doRequest("json")
  61416. if res != nil && res.StatusCode == http.StatusNotModified {
  61417. if res.Body != nil {
  61418. res.Body.Close()
  61419. }
  61420. return nil, &googleapi.Error{
  61421. Code: res.StatusCode,
  61422. Header: res.Header,
  61423. }
  61424. }
  61425. if err != nil {
  61426. return nil, err
  61427. }
  61428. defer googleapi.CloseBody(res)
  61429. if err := googleapi.CheckResponse(res); err != nil {
  61430. return nil, err
  61431. }
  61432. ret := &Operation{
  61433. ServerResponse: googleapi.ServerResponse{
  61434. Header: res.Header,
  61435. HTTPStatusCode: res.StatusCode,
  61436. },
  61437. }
  61438. target := &ret
  61439. if err := gensupport.DecodeResponse(target, res); err != nil {
  61440. return nil, err
  61441. }
  61442. return ret, nil
  61443. // {
  61444. // "description": "Deletes the specified Instance resource. For more information, see Stopping or Deleting an Instance.",
  61445. // "httpMethod": "DELETE",
  61446. // "id": "compute.instances.delete",
  61447. // "parameterOrder": [
  61448. // "project",
  61449. // "zone",
  61450. // "instance"
  61451. // ],
  61452. // "parameters": {
  61453. // "instance": {
  61454. // "description": "Name of the instance resource to delete.",
  61455. // "location": "path",
  61456. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  61457. // "required": true,
  61458. // "type": "string"
  61459. // },
  61460. // "project": {
  61461. // "description": "Project ID for this request.",
  61462. // "location": "path",
  61463. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  61464. // "required": true,
  61465. // "type": "string"
  61466. // },
  61467. // "requestId": {
  61468. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  61469. // "location": "query",
  61470. // "type": "string"
  61471. // },
  61472. // "zone": {
  61473. // "description": "The name of the zone for this request.",
  61474. // "location": "path",
  61475. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  61476. // "required": true,
  61477. // "type": "string"
  61478. // }
  61479. // },
  61480. // "path": "{project}/zones/{zone}/instances/{instance}",
  61481. // "response": {
  61482. // "$ref": "Operation"
  61483. // },
  61484. // "scopes": [
  61485. // "https://www.googleapis.com/auth/cloud-platform",
  61486. // "https://www.googleapis.com/auth/compute"
  61487. // ]
  61488. // }
  61489. }
  61490. // method id "compute.instances.deleteAccessConfig":
  61491. type InstancesDeleteAccessConfigCall struct {
  61492. s *Service
  61493. project string
  61494. zone string
  61495. instance string
  61496. urlParams_ gensupport.URLParams
  61497. ctx_ context.Context
  61498. header_ http.Header
  61499. }
  61500. // DeleteAccessConfig: Deletes an access config from an instance's
  61501. // network interface.
  61502. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/deleteAccessConfig
  61503. func (r *InstancesService) DeleteAccessConfig(project string, zone string, instance string, accessConfig string, networkInterface string) *InstancesDeleteAccessConfigCall {
  61504. c := &InstancesDeleteAccessConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  61505. c.project = project
  61506. c.zone = zone
  61507. c.instance = instance
  61508. c.urlParams_.Set("accessConfig", accessConfig)
  61509. c.urlParams_.Set("networkInterface", networkInterface)
  61510. return c
  61511. }
  61512. // RequestId sets the optional parameter "requestId": An optional
  61513. // request ID to identify requests. Specify a unique request ID so that
  61514. // if you must retry your request, the server will know to ignore the
  61515. // request if it has already been completed.
  61516. //
  61517. // For example, consider a situation where you make an initial request
  61518. // and the request times out. If you make the request again with the
  61519. // same request ID, the server can check if original operation with the
  61520. // same request ID was received, and if so, will ignore the second
  61521. // request. This prevents clients from accidentally creating duplicate
  61522. // commitments.
  61523. //
  61524. // The request ID must be a valid UUID with the exception that zero UUID
  61525. // is not supported (00000000-0000-0000-0000-000000000000).
  61526. func (c *InstancesDeleteAccessConfigCall) RequestId(requestId string) *InstancesDeleteAccessConfigCall {
  61527. c.urlParams_.Set("requestId", requestId)
  61528. return c
  61529. }
  61530. // Fields allows partial responses to be retrieved. See
  61531. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  61532. // for more information.
  61533. func (c *InstancesDeleteAccessConfigCall) Fields(s ...googleapi.Field) *InstancesDeleteAccessConfigCall {
  61534. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  61535. return c
  61536. }
  61537. // Context sets the context to be used in this call's Do method. Any
  61538. // pending HTTP request will be aborted if the provided context is
  61539. // canceled.
  61540. func (c *InstancesDeleteAccessConfigCall) Context(ctx context.Context) *InstancesDeleteAccessConfigCall {
  61541. c.ctx_ = ctx
  61542. return c
  61543. }
  61544. // Header returns an http.Header that can be modified by the caller to
  61545. // add HTTP headers to the request.
  61546. func (c *InstancesDeleteAccessConfigCall) Header() http.Header {
  61547. if c.header_ == nil {
  61548. c.header_ = make(http.Header)
  61549. }
  61550. return c.header_
  61551. }
  61552. func (c *InstancesDeleteAccessConfigCall) doRequest(alt string) (*http.Response, error) {
  61553. reqHeaders := make(http.Header)
  61554. for k, v := range c.header_ {
  61555. reqHeaders[k] = v
  61556. }
  61557. reqHeaders.Set("User-Agent", c.s.userAgent())
  61558. var body io.Reader = nil
  61559. c.urlParams_.Set("alt", alt)
  61560. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/deleteAccessConfig")
  61561. urls += "?" + c.urlParams_.Encode()
  61562. req, _ := http.NewRequest("POST", urls, body)
  61563. req.Header = reqHeaders
  61564. googleapi.Expand(req.URL, map[string]string{
  61565. "project": c.project,
  61566. "zone": c.zone,
  61567. "instance": c.instance,
  61568. })
  61569. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  61570. }
  61571. // Do executes the "compute.instances.deleteAccessConfig" call.
  61572. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  61573. // status code is an error. Response headers are in either
  61574. // *Operation.ServerResponse.Header or (if a response was returned at
  61575. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  61576. // to check whether the returned error was because
  61577. // http.StatusNotModified was returned.
  61578. func (c *InstancesDeleteAccessConfigCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  61579. gensupport.SetOptions(c.urlParams_, opts...)
  61580. res, err := c.doRequest("json")
  61581. if res != nil && res.StatusCode == http.StatusNotModified {
  61582. if res.Body != nil {
  61583. res.Body.Close()
  61584. }
  61585. return nil, &googleapi.Error{
  61586. Code: res.StatusCode,
  61587. Header: res.Header,
  61588. }
  61589. }
  61590. if err != nil {
  61591. return nil, err
  61592. }
  61593. defer googleapi.CloseBody(res)
  61594. if err := googleapi.CheckResponse(res); err != nil {
  61595. return nil, err
  61596. }
  61597. ret := &Operation{
  61598. ServerResponse: googleapi.ServerResponse{
  61599. Header: res.Header,
  61600. HTTPStatusCode: res.StatusCode,
  61601. },
  61602. }
  61603. target := &ret
  61604. if err := gensupport.DecodeResponse(target, res); err != nil {
  61605. return nil, err
  61606. }
  61607. return ret, nil
  61608. // {
  61609. // "description": "Deletes an access config from an instance's network interface.",
  61610. // "httpMethod": "POST",
  61611. // "id": "compute.instances.deleteAccessConfig",
  61612. // "parameterOrder": [
  61613. // "project",
  61614. // "zone",
  61615. // "instance",
  61616. // "accessConfig",
  61617. // "networkInterface"
  61618. // ],
  61619. // "parameters": {
  61620. // "accessConfig": {
  61621. // "description": "The name of the access config to delete.",
  61622. // "location": "query",
  61623. // "required": true,
  61624. // "type": "string"
  61625. // },
  61626. // "instance": {
  61627. // "description": "The instance name for this request.",
  61628. // "location": "path",
  61629. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  61630. // "required": true,
  61631. // "type": "string"
  61632. // },
  61633. // "networkInterface": {
  61634. // "description": "The name of the network interface.",
  61635. // "location": "query",
  61636. // "required": true,
  61637. // "type": "string"
  61638. // },
  61639. // "project": {
  61640. // "description": "Project ID for this request.",
  61641. // "location": "path",
  61642. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  61643. // "required": true,
  61644. // "type": "string"
  61645. // },
  61646. // "requestId": {
  61647. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  61648. // "location": "query",
  61649. // "type": "string"
  61650. // },
  61651. // "zone": {
  61652. // "description": "The name of the zone for this request.",
  61653. // "location": "path",
  61654. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  61655. // "required": true,
  61656. // "type": "string"
  61657. // }
  61658. // },
  61659. // "path": "{project}/zones/{zone}/instances/{instance}/deleteAccessConfig",
  61660. // "response": {
  61661. // "$ref": "Operation"
  61662. // },
  61663. // "scopes": [
  61664. // "https://www.googleapis.com/auth/cloud-platform",
  61665. // "https://www.googleapis.com/auth/compute"
  61666. // ]
  61667. // }
  61668. }
  61669. // method id "compute.instances.detachDisk":
  61670. type InstancesDetachDiskCall struct {
  61671. s *Service
  61672. project string
  61673. zone string
  61674. instance string
  61675. urlParams_ gensupport.URLParams
  61676. ctx_ context.Context
  61677. header_ http.Header
  61678. }
  61679. // DetachDisk: Detaches a disk from an instance.
  61680. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/detachDisk
  61681. func (r *InstancesService) DetachDisk(project string, zone string, instance string, deviceName string) *InstancesDetachDiskCall {
  61682. c := &InstancesDetachDiskCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  61683. c.project = project
  61684. c.zone = zone
  61685. c.instance = instance
  61686. c.urlParams_.Set("deviceName", deviceName)
  61687. return c
  61688. }
  61689. // RequestId sets the optional parameter "requestId": An optional
  61690. // request ID to identify requests. Specify a unique request ID so that
  61691. // if you must retry your request, the server will know to ignore the
  61692. // request if it has already been completed.
  61693. //
  61694. // For example, consider a situation where you make an initial request
  61695. // and the request times out. If you make the request again with the
  61696. // same request ID, the server can check if original operation with the
  61697. // same request ID was received, and if so, will ignore the second
  61698. // request. This prevents clients from accidentally creating duplicate
  61699. // commitments.
  61700. //
  61701. // The request ID must be a valid UUID with the exception that zero UUID
  61702. // is not supported (00000000-0000-0000-0000-000000000000).
  61703. func (c *InstancesDetachDiskCall) RequestId(requestId string) *InstancesDetachDiskCall {
  61704. c.urlParams_.Set("requestId", requestId)
  61705. return c
  61706. }
  61707. // Fields allows partial responses to be retrieved. See
  61708. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  61709. // for more information.
  61710. func (c *InstancesDetachDiskCall) Fields(s ...googleapi.Field) *InstancesDetachDiskCall {
  61711. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  61712. return c
  61713. }
  61714. // Context sets the context to be used in this call's Do method. Any
  61715. // pending HTTP request will be aborted if the provided context is
  61716. // canceled.
  61717. func (c *InstancesDetachDiskCall) Context(ctx context.Context) *InstancesDetachDiskCall {
  61718. c.ctx_ = ctx
  61719. return c
  61720. }
  61721. // Header returns an http.Header that can be modified by the caller to
  61722. // add HTTP headers to the request.
  61723. func (c *InstancesDetachDiskCall) Header() http.Header {
  61724. if c.header_ == nil {
  61725. c.header_ = make(http.Header)
  61726. }
  61727. return c.header_
  61728. }
  61729. func (c *InstancesDetachDiskCall) doRequest(alt string) (*http.Response, error) {
  61730. reqHeaders := make(http.Header)
  61731. for k, v := range c.header_ {
  61732. reqHeaders[k] = v
  61733. }
  61734. reqHeaders.Set("User-Agent", c.s.userAgent())
  61735. var body io.Reader = nil
  61736. c.urlParams_.Set("alt", alt)
  61737. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/detachDisk")
  61738. urls += "?" + c.urlParams_.Encode()
  61739. req, _ := http.NewRequest("POST", urls, body)
  61740. req.Header = reqHeaders
  61741. googleapi.Expand(req.URL, map[string]string{
  61742. "project": c.project,
  61743. "zone": c.zone,
  61744. "instance": c.instance,
  61745. })
  61746. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  61747. }
  61748. // Do executes the "compute.instances.detachDisk" call.
  61749. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  61750. // status code is an error. Response headers are in either
  61751. // *Operation.ServerResponse.Header or (if a response was returned at
  61752. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  61753. // to check whether the returned error was because
  61754. // http.StatusNotModified was returned.
  61755. func (c *InstancesDetachDiskCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  61756. gensupport.SetOptions(c.urlParams_, opts...)
  61757. res, err := c.doRequest("json")
  61758. if res != nil && res.StatusCode == http.StatusNotModified {
  61759. if res.Body != nil {
  61760. res.Body.Close()
  61761. }
  61762. return nil, &googleapi.Error{
  61763. Code: res.StatusCode,
  61764. Header: res.Header,
  61765. }
  61766. }
  61767. if err != nil {
  61768. return nil, err
  61769. }
  61770. defer googleapi.CloseBody(res)
  61771. if err := googleapi.CheckResponse(res); err != nil {
  61772. return nil, err
  61773. }
  61774. ret := &Operation{
  61775. ServerResponse: googleapi.ServerResponse{
  61776. Header: res.Header,
  61777. HTTPStatusCode: res.StatusCode,
  61778. },
  61779. }
  61780. target := &ret
  61781. if err := gensupport.DecodeResponse(target, res); err != nil {
  61782. return nil, err
  61783. }
  61784. return ret, nil
  61785. // {
  61786. // "description": "Detaches a disk from an instance.",
  61787. // "httpMethod": "POST",
  61788. // "id": "compute.instances.detachDisk",
  61789. // "parameterOrder": [
  61790. // "project",
  61791. // "zone",
  61792. // "instance",
  61793. // "deviceName"
  61794. // ],
  61795. // "parameters": {
  61796. // "deviceName": {
  61797. // "description": "Disk device name to detach.",
  61798. // "location": "query",
  61799. // "required": true,
  61800. // "type": "string"
  61801. // },
  61802. // "instance": {
  61803. // "description": "Instance name.",
  61804. // "location": "path",
  61805. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  61806. // "required": true,
  61807. // "type": "string"
  61808. // },
  61809. // "project": {
  61810. // "description": "Project ID for this request.",
  61811. // "location": "path",
  61812. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  61813. // "required": true,
  61814. // "type": "string"
  61815. // },
  61816. // "requestId": {
  61817. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  61818. // "location": "query",
  61819. // "type": "string"
  61820. // },
  61821. // "zone": {
  61822. // "description": "The name of the zone for this request.",
  61823. // "location": "path",
  61824. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  61825. // "required": true,
  61826. // "type": "string"
  61827. // }
  61828. // },
  61829. // "path": "{project}/zones/{zone}/instances/{instance}/detachDisk",
  61830. // "response": {
  61831. // "$ref": "Operation"
  61832. // },
  61833. // "scopes": [
  61834. // "https://www.googleapis.com/auth/cloud-platform",
  61835. // "https://www.googleapis.com/auth/compute"
  61836. // ]
  61837. // }
  61838. }
  61839. // method id "compute.instances.get":
  61840. type InstancesGetCall struct {
  61841. s *Service
  61842. project string
  61843. zone string
  61844. instance string
  61845. urlParams_ gensupport.URLParams
  61846. ifNoneMatch_ string
  61847. ctx_ context.Context
  61848. header_ http.Header
  61849. }
  61850. // Get: Returns the specified Instance resource. Gets a list of
  61851. // available instances by making a list() request.
  61852. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/get
  61853. func (r *InstancesService) Get(project string, zone string, instance string) *InstancesGetCall {
  61854. c := &InstancesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  61855. c.project = project
  61856. c.zone = zone
  61857. c.instance = instance
  61858. return c
  61859. }
  61860. // Fields allows partial responses to be retrieved. See
  61861. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  61862. // for more information.
  61863. func (c *InstancesGetCall) Fields(s ...googleapi.Field) *InstancesGetCall {
  61864. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  61865. return c
  61866. }
  61867. // IfNoneMatch sets the optional parameter which makes the operation
  61868. // fail if the object's ETag matches the given value. This is useful for
  61869. // getting updates only after the object has changed since the last
  61870. // request. Use googleapi.IsNotModified to check whether the response
  61871. // error from Do is the result of In-None-Match.
  61872. func (c *InstancesGetCall) IfNoneMatch(entityTag string) *InstancesGetCall {
  61873. c.ifNoneMatch_ = entityTag
  61874. return c
  61875. }
  61876. // Context sets the context to be used in this call's Do method. Any
  61877. // pending HTTP request will be aborted if the provided context is
  61878. // canceled.
  61879. func (c *InstancesGetCall) Context(ctx context.Context) *InstancesGetCall {
  61880. c.ctx_ = ctx
  61881. return c
  61882. }
  61883. // Header returns an http.Header that can be modified by the caller to
  61884. // add HTTP headers to the request.
  61885. func (c *InstancesGetCall) Header() http.Header {
  61886. if c.header_ == nil {
  61887. c.header_ = make(http.Header)
  61888. }
  61889. return c.header_
  61890. }
  61891. func (c *InstancesGetCall) doRequest(alt string) (*http.Response, error) {
  61892. reqHeaders := make(http.Header)
  61893. for k, v := range c.header_ {
  61894. reqHeaders[k] = v
  61895. }
  61896. reqHeaders.Set("User-Agent", c.s.userAgent())
  61897. if c.ifNoneMatch_ != "" {
  61898. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  61899. }
  61900. var body io.Reader = nil
  61901. c.urlParams_.Set("alt", alt)
  61902. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}")
  61903. urls += "?" + c.urlParams_.Encode()
  61904. req, _ := http.NewRequest("GET", urls, body)
  61905. req.Header = reqHeaders
  61906. googleapi.Expand(req.URL, map[string]string{
  61907. "project": c.project,
  61908. "zone": c.zone,
  61909. "instance": c.instance,
  61910. })
  61911. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  61912. }
  61913. // Do executes the "compute.instances.get" call.
  61914. // Exactly one of *Instance or error will be non-nil. Any non-2xx status
  61915. // code is an error. Response headers are in either
  61916. // *Instance.ServerResponse.Header or (if a response was returned at
  61917. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  61918. // to check whether the returned error was because
  61919. // http.StatusNotModified was returned.
  61920. func (c *InstancesGetCall) Do(opts ...googleapi.CallOption) (*Instance, error) {
  61921. gensupport.SetOptions(c.urlParams_, opts...)
  61922. res, err := c.doRequest("json")
  61923. if res != nil && res.StatusCode == http.StatusNotModified {
  61924. if res.Body != nil {
  61925. res.Body.Close()
  61926. }
  61927. return nil, &googleapi.Error{
  61928. Code: res.StatusCode,
  61929. Header: res.Header,
  61930. }
  61931. }
  61932. if err != nil {
  61933. return nil, err
  61934. }
  61935. defer googleapi.CloseBody(res)
  61936. if err := googleapi.CheckResponse(res); err != nil {
  61937. return nil, err
  61938. }
  61939. ret := &Instance{
  61940. ServerResponse: googleapi.ServerResponse{
  61941. Header: res.Header,
  61942. HTTPStatusCode: res.StatusCode,
  61943. },
  61944. }
  61945. target := &ret
  61946. if err := gensupport.DecodeResponse(target, res); err != nil {
  61947. return nil, err
  61948. }
  61949. return ret, nil
  61950. // {
  61951. // "description": "Returns the specified Instance resource. Gets a list of available instances by making a list() request.",
  61952. // "httpMethod": "GET",
  61953. // "id": "compute.instances.get",
  61954. // "parameterOrder": [
  61955. // "project",
  61956. // "zone",
  61957. // "instance"
  61958. // ],
  61959. // "parameters": {
  61960. // "instance": {
  61961. // "description": "Name of the instance resource to return.",
  61962. // "location": "path",
  61963. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  61964. // "required": true,
  61965. // "type": "string"
  61966. // },
  61967. // "project": {
  61968. // "description": "Project ID for this request.",
  61969. // "location": "path",
  61970. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  61971. // "required": true,
  61972. // "type": "string"
  61973. // },
  61974. // "zone": {
  61975. // "description": "The name of the zone for this request.",
  61976. // "location": "path",
  61977. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  61978. // "required": true,
  61979. // "type": "string"
  61980. // }
  61981. // },
  61982. // "path": "{project}/zones/{zone}/instances/{instance}",
  61983. // "response": {
  61984. // "$ref": "Instance"
  61985. // },
  61986. // "scopes": [
  61987. // "https://www.googleapis.com/auth/cloud-platform",
  61988. // "https://www.googleapis.com/auth/compute",
  61989. // "https://www.googleapis.com/auth/compute.readonly"
  61990. // ]
  61991. // }
  61992. }
  61993. // method id "compute.instances.getGuestAttributes":
  61994. type InstancesGetGuestAttributesCall struct {
  61995. s *Service
  61996. project string
  61997. zone string
  61998. instance string
  61999. urlParams_ gensupport.URLParams
  62000. ifNoneMatch_ string
  62001. ctx_ context.Context
  62002. header_ http.Header
  62003. }
  62004. // GetGuestAttributes: Returns the specified guest attributes entry.
  62005. func (r *InstancesService) GetGuestAttributes(project string, zone string, instance string) *InstancesGetGuestAttributesCall {
  62006. c := &InstancesGetGuestAttributesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  62007. c.project = project
  62008. c.zone = zone
  62009. c.instance = instance
  62010. return c
  62011. }
  62012. // VariableKey sets the optional parameter "variableKey": Specifies the
  62013. // key for the guest attributes entry.
  62014. func (c *InstancesGetGuestAttributesCall) VariableKey(variableKey string) *InstancesGetGuestAttributesCall {
  62015. c.urlParams_.Set("variableKey", variableKey)
  62016. return c
  62017. }
  62018. // Fields allows partial responses to be retrieved. See
  62019. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  62020. // for more information.
  62021. func (c *InstancesGetGuestAttributesCall) Fields(s ...googleapi.Field) *InstancesGetGuestAttributesCall {
  62022. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  62023. return c
  62024. }
  62025. // IfNoneMatch sets the optional parameter which makes the operation
  62026. // fail if the object's ETag matches the given value. This is useful for
  62027. // getting updates only after the object has changed since the last
  62028. // request. Use googleapi.IsNotModified to check whether the response
  62029. // error from Do is the result of In-None-Match.
  62030. func (c *InstancesGetGuestAttributesCall) IfNoneMatch(entityTag string) *InstancesGetGuestAttributesCall {
  62031. c.ifNoneMatch_ = entityTag
  62032. return c
  62033. }
  62034. // Context sets the context to be used in this call's Do method. Any
  62035. // pending HTTP request will be aborted if the provided context is
  62036. // canceled.
  62037. func (c *InstancesGetGuestAttributesCall) Context(ctx context.Context) *InstancesGetGuestAttributesCall {
  62038. c.ctx_ = ctx
  62039. return c
  62040. }
  62041. // Header returns an http.Header that can be modified by the caller to
  62042. // add HTTP headers to the request.
  62043. func (c *InstancesGetGuestAttributesCall) Header() http.Header {
  62044. if c.header_ == nil {
  62045. c.header_ = make(http.Header)
  62046. }
  62047. return c.header_
  62048. }
  62049. func (c *InstancesGetGuestAttributesCall) doRequest(alt string) (*http.Response, error) {
  62050. reqHeaders := make(http.Header)
  62051. for k, v := range c.header_ {
  62052. reqHeaders[k] = v
  62053. }
  62054. reqHeaders.Set("User-Agent", c.s.userAgent())
  62055. if c.ifNoneMatch_ != "" {
  62056. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  62057. }
  62058. var body io.Reader = nil
  62059. c.urlParams_.Set("alt", alt)
  62060. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/getGuestAttributes")
  62061. urls += "?" + c.urlParams_.Encode()
  62062. req, _ := http.NewRequest("GET", urls, body)
  62063. req.Header = reqHeaders
  62064. googleapi.Expand(req.URL, map[string]string{
  62065. "project": c.project,
  62066. "zone": c.zone,
  62067. "instance": c.instance,
  62068. })
  62069. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  62070. }
  62071. // Do executes the "compute.instances.getGuestAttributes" call.
  62072. // Exactly one of *GuestAttributes or error will be non-nil. Any non-2xx
  62073. // status code is an error. Response headers are in either
  62074. // *GuestAttributes.ServerResponse.Header or (if a response was returned
  62075. // at all) in error.(*googleapi.Error).Header. Use
  62076. // googleapi.IsNotModified to check whether the returned error was
  62077. // because http.StatusNotModified was returned.
  62078. func (c *InstancesGetGuestAttributesCall) Do(opts ...googleapi.CallOption) (*GuestAttributes, error) {
  62079. gensupport.SetOptions(c.urlParams_, opts...)
  62080. res, err := c.doRequest("json")
  62081. if res != nil && res.StatusCode == http.StatusNotModified {
  62082. if res.Body != nil {
  62083. res.Body.Close()
  62084. }
  62085. return nil, &googleapi.Error{
  62086. Code: res.StatusCode,
  62087. Header: res.Header,
  62088. }
  62089. }
  62090. if err != nil {
  62091. return nil, err
  62092. }
  62093. defer googleapi.CloseBody(res)
  62094. if err := googleapi.CheckResponse(res); err != nil {
  62095. return nil, err
  62096. }
  62097. ret := &GuestAttributes{
  62098. ServerResponse: googleapi.ServerResponse{
  62099. Header: res.Header,
  62100. HTTPStatusCode: res.StatusCode,
  62101. },
  62102. }
  62103. target := &ret
  62104. if err := gensupport.DecodeResponse(target, res); err != nil {
  62105. return nil, err
  62106. }
  62107. return ret, nil
  62108. // {
  62109. // "description": "Returns the specified guest attributes entry.",
  62110. // "httpMethod": "GET",
  62111. // "id": "compute.instances.getGuestAttributes",
  62112. // "parameterOrder": [
  62113. // "project",
  62114. // "zone",
  62115. // "instance"
  62116. // ],
  62117. // "parameters": {
  62118. // "instance": {
  62119. // "description": "Name of the instance scoping this request.",
  62120. // "location": "path",
  62121. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  62122. // "required": true,
  62123. // "type": "string"
  62124. // },
  62125. // "project": {
  62126. // "description": "Project ID for this request.",
  62127. // "location": "path",
  62128. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  62129. // "required": true,
  62130. // "type": "string"
  62131. // },
  62132. // "variableKey": {
  62133. // "description": "Specifies the key for the guest attributes entry.",
  62134. // "location": "query",
  62135. // "type": "string"
  62136. // },
  62137. // "zone": {
  62138. // "description": "The name of the zone for this request.",
  62139. // "location": "path",
  62140. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  62141. // "required": true,
  62142. // "type": "string"
  62143. // }
  62144. // },
  62145. // "path": "{project}/zones/{zone}/instances/{instance}/getGuestAttributes",
  62146. // "response": {
  62147. // "$ref": "GuestAttributes"
  62148. // },
  62149. // "scopes": [
  62150. // "https://www.googleapis.com/auth/cloud-platform",
  62151. // "https://www.googleapis.com/auth/compute",
  62152. // "https://www.googleapis.com/auth/compute.readonly"
  62153. // ]
  62154. // }
  62155. }
  62156. // method id "compute.instances.getIamPolicy":
  62157. type InstancesGetIamPolicyCall struct {
  62158. s *Service
  62159. project string
  62160. zone string
  62161. resource string
  62162. urlParams_ gensupport.URLParams
  62163. ifNoneMatch_ string
  62164. ctx_ context.Context
  62165. header_ http.Header
  62166. }
  62167. // GetIamPolicy: Gets the access control policy for a resource. May be
  62168. // empty if no such policy or resource exists.
  62169. func (r *InstancesService) GetIamPolicy(project string, zone string, resource string) *InstancesGetIamPolicyCall {
  62170. c := &InstancesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  62171. c.project = project
  62172. c.zone = zone
  62173. c.resource = resource
  62174. return c
  62175. }
  62176. // Fields allows partial responses to be retrieved. See
  62177. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  62178. // for more information.
  62179. func (c *InstancesGetIamPolicyCall) Fields(s ...googleapi.Field) *InstancesGetIamPolicyCall {
  62180. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  62181. return c
  62182. }
  62183. // IfNoneMatch sets the optional parameter which makes the operation
  62184. // fail if the object's ETag matches the given value. This is useful for
  62185. // getting updates only after the object has changed since the last
  62186. // request. Use googleapi.IsNotModified to check whether the response
  62187. // error from Do is the result of In-None-Match.
  62188. func (c *InstancesGetIamPolicyCall) IfNoneMatch(entityTag string) *InstancesGetIamPolicyCall {
  62189. c.ifNoneMatch_ = entityTag
  62190. return c
  62191. }
  62192. // Context sets the context to be used in this call's Do method. Any
  62193. // pending HTTP request will be aborted if the provided context is
  62194. // canceled.
  62195. func (c *InstancesGetIamPolicyCall) Context(ctx context.Context) *InstancesGetIamPolicyCall {
  62196. c.ctx_ = ctx
  62197. return c
  62198. }
  62199. // Header returns an http.Header that can be modified by the caller to
  62200. // add HTTP headers to the request.
  62201. func (c *InstancesGetIamPolicyCall) Header() http.Header {
  62202. if c.header_ == nil {
  62203. c.header_ = make(http.Header)
  62204. }
  62205. return c.header_
  62206. }
  62207. func (c *InstancesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  62208. reqHeaders := make(http.Header)
  62209. for k, v := range c.header_ {
  62210. reqHeaders[k] = v
  62211. }
  62212. reqHeaders.Set("User-Agent", c.s.userAgent())
  62213. if c.ifNoneMatch_ != "" {
  62214. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  62215. }
  62216. var body io.Reader = nil
  62217. c.urlParams_.Set("alt", alt)
  62218. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{resource}/getIamPolicy")
  62219. urls += "?" + c.urlParams_.Encode()
  62220. req, _ := http.NewRequest("GET", urls, body)
  62221. req.Header = reqHeaders
  62222. googleapi.Expand(req.URL, map[string]string{
  62223. "project": c.project,
  62224. "zone": c.zone,
  62225. "resource": c.resource,
  62226. })
  62227. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  62228. }
  62229. // Do executes the "compute.instances.getIamPolicy" call.
  62230. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  62231. // code is an error. Response headers are in either
  62232. // *Policy.ServerResponse.Header or (if a response was returned at all)
  62233. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  62234. // check whether the returned error was because http.StatusNotModified
  62235. // was returned.
  62236. func (c *InstancesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  62237. gensupport.SetOptions(c.urlParams_, opts...)
  62238. res, err := c.doRequest("json")
  62239. if res != nil && res.StatusCode == http.StatusNotModified {
  62240. if res.Body != nil {
  62241. res.Body.Close()
  62242. }
  62243. return nil, &googleapi.Error{
  62244. Code: res.StatusCode,
  62245. Header: res.Header,
  62246. }
  62247. }
  62248. if err != nil {
  62249. return nil, err
  62250. }
  62251. defer googleapi.CloseBody(res)
  62252. if err := googleapi.CheckResponse(res); err != nil {
  62253. return nil, err
  62254. }
  62255. ret := &Policy{
  62256. ServerResponse: googleapi.ServerResponse{
  62257. Header: res.Header,
  62258. HTTPStatusCode: res.StatusCode,
  62259. },
  62260. }
  62261. target := &ret
  62262. if err := gensupport.DecodeResponse(target, res); err != nil {
  62263. return nil, err
  62264. }
  62265. return ret, nil
  62266. // {
  62267. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  62268. // "httpMethod": "GET",
  62269. // "id": "compute.instances.getIamPolicy",
  62270. // "parameterOrder": [
  62271. // "project",
  62272. // "zone",
  62273. // "resource"
  62274. // ],
  62275. // "parameters": {
  62276. // "project": {
  62277. // "description": "Project ID for this request.",
  62278. // "location": "path",
  62279. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  62280. // "required": true,
  62281. // "type": "string"
  62282. // },
  62283. // "resource": {
  62284. // "description": "Name of the resource for this request.",
  62285. // "location": "path",
  62286. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  62287. // "required": true,
  62288. // "type": "string"
  62289. // },
  62290. // "zone": {
  62291. // "description": "The name of the zone for this request.",
  62292. // "location": "path",
  62293. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  62294. // "required": true,
  62295. // "type": "string"
  62296. // }
  62297. // },
  62298. // "path": "{project}/zones/{zone}/instances/{resource}/getIamPolicy",
  62299. // "response": {
  62300. // "$ref": "Policy"
  62301. // },
  62302. // "scopes": [
  62303. // "https://www.googleapis.com/auth/cloud-platform",
  62304. // "https://www.googleapis.com/auth/compute",
  62305. // "https://www.googleapis.com/auth/compute.readonly"
  62306. // ]
  62307. // }
  62308. }
  62309. // method id "compute.instances.getSerialPortOutput":
  62310. type InstancesGetSerialPortOutputCall struct {
  62311. s *Service
  62312. project string
  62313. zone string
  62314. instance string
  62315. urlParams_ gensupport.URLParams
  62316. ifNoneMatch_ string
  62317. ctx_ context.Context
  62318. header_ http.Header
  62319. }
  62320. // GetSerialPortOutput: Returns the specified instance's serial port
  62321. // output.
  62322. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/getSerialPortOutput
  62323. func (r *InstancesService) GetSerialPortOutput(project string, zone string, instance string) *InstancesGetSerialPortOutputCall {
  62324. c := &InstancesGetSerialPortOutputCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  62325. c.project = project
  62326. c.zone = zone
  62327. c.instance = instance
  62328. return c
  62329. }
  62330. // Port sets the optional parameter "port": Specifies which COM or
  62331. // serial port to retrieve data from.
  62332. func (c *InstancesGetSerialPortOutputCall) Port(port int64) *InstancesGetSerialPortOutputCall {
  62333. c.urlParams_.Set("port", fmt.Sprint(port))
  62334. return c
  62335. }
  62336. // Start sets the optional parameter "start": Returns output starting
  62337. // from a specific byte position. Use this to page through output when
  62338. // the output is too large to return in a single request. For the
  62339. // initial request, leave this field unspecified. For subsequent calls,
  62340. // this field should be set to the next value returned in the previous
  62341. // call.
  62342. func (c *InstancesGetSerialPortOutputCall) Start(start int64) *InstancesGetSerialPortOutputCall {
  62343. c.urlParams_.Set("start", fmt.Sprint(start))
  62344. return c
  62345. }
  62346. // Fields allows partial responses to be retrieved. See
  62347. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  62348. // for more information.
  62349. func (c *InstancesGetSerialPortOutputCall) Fields(s ...googleapi.Field) *InstancesGetSerialPortOutputCall {
  62350. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  62351. return c
  62352. }
  62353. // IfNoneMatch sets the optional parameter which makes the operation
  62354. // fail if the object's ETag matches the given value. This is useful for
  62355. // getting updates only after the object has changed since the last
  62356. // request. Use googleapi.IsNotModified to check whether the response
  62357. // error from Do is the result of In-None-Match.
  62358. func (c *InstancesGetSerialPortOutputCall) IfNoneMatch(entityTag string) *InstancesGetSerialPortOutputCall {
  62359. c.ifNoneMatch_ = entityTag
  62360. return c
  62361. }
  62362. // Context sets the context to be used in this call's Do method. Any
  62363. // pending HTTP request will be aborted if the provided context is
  62364. // canceled.
  62365. func (c *InstancesGetSerialPortOutputCall) Context(ctx context.Context) *InstancesGetSerialPortOutputCall {
  62366. c.ctx_ = ctx
  62367. return c
  62368. }
  62369. // Header returns an http.Header that can be modified by the caller to
  62370. // add HTTP headers to the request.
  62371. func (c *InstancesGetSerialPortOutputCall) Header() http.Header {
  62372. if c.header_ == nil {
  62373. c.header_ = make(http.Header)
  62374. }
  62375. return c.header_
  62376. }
  62377. func (c *InstancesGetSerialPortOutputCall) doRequest(alt string) (*http.Response, error) {
  62378. reqHeaders := make(http.Header)
  62379. for k, v := range c.header_ {
  62380. reqHeaders[k] = v
  62381. }
  62382. reqHeaders.Set("User-Agent", c.s.userAgent())
  62383. if c.ifNoneMatch_ != "" {
  62384. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  62385. }
  62386. var body io.Reader = nil
  62387. c.urlParams_.Set("alt", alt)
  62388. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/serialPort")
  62389. urls += "?" + c.urlParams_.Encode()
  62390. req, _ := http.NewRequest("GET", urls, body)
  62391. req.Header = reqHeaders
  62392. googleapi.Expand(req.URL, map[string]string{
  62393. "project": c.project,
  62394. "zone": c.zone,
  62395. "instance": c.instance,
  62396. })
  62397. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  62398. }
  62399. // Do executes the "compute.instances.getSerialPortOutput" call.
  62400. // Exactly one of *SerialPortOutput or error will be non-nil. Any
  62401. // non-2xx status code is an error. Response headers are in either
  62402. // *SerialPortOutput.ServerResponse.Header or (if a response was
  62403. // returned at all) in error.(*googleapi.Error).Header. Use
  62404. // googleapi.IsNotModified to check whether the returned error was
  62405. // because http.StatusNotModified was returned.
  62406. func (c *InstancesGetSerialPortOutputCall) Do(opts ...googleapi.CallOption) (*SerialPortOutput, error) {
  62407. gensupport.SetOptions(c.urlParams_, opts...)
  62408. res, err := c.doRequest("json")
  62409. if res != nil && res.StatusCode == http.StatusNotModified {
  62410. if res.Body != nil {
  62411. res.Body.Close()
  62412. }
  62413. return nil, &googleapi.Error{
  62414. Code: res.StatusCode,
  62415. Header: res.Header,
  62416. }
  62417. }
  62418. if err != nil {
  62419. return nil, err
  62420. }
  62421. defer googleapi.CloseBody(res)
  62422. if err := googleapi.CheckResponse(res); err != nil {
  62423. return nil, err
  62424. }
  62425. ret := &SerialPortOutput{
  62426. ServerResponse: googleapi.ServerResponse{
  62427. Header: res.Header,
  62428. HTTPStatusCode: res.StatusCode,
  62429. },
  62430. }
  62431. target := &ret
  62432. if err := gensupport.DecodeResponse(target, res); err != nil {
  62433. return nil, err
  62434. }
  62435. return ret, nil
  62436. // {
  62437. // "description": "Returns the specified instance's serial port output.",
  62438. // "httpMethod": "GET",
  62439. // "id": "compute.instances.getSerialPortOutput",
  62440. // "parameterOrder": [
  62441. // "project",
  62442. // "zone",
  62443. // "instance"
  62444. // ],
  62445. // "parameters": {
  62446. // "instance": {
  62447. // "description": "Name of the instance scoping this request.",
  62448. // "location": "path",
  62449. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  62450. // "required": true,
  62451. // "type": "string"
  62452. // },
  62453. // "port": {
  62454. // "default": "1",
  62455. // "description": "Specifies which COM or serial port to retrieve data from.",
  62456. // "format": "int32",
  62457. // "location": "query",
  62458. // "maximum": "4",
  62459. // "minimum": "1",
  62460. // "type": "integer"
  62461. // },
  62462. // "project": {
  62463. // "description": "Project ID for this request.",
  62464. // "location": "path",
  62465. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  62466. // "required": true,
  62467. // "type": "string"
  62468. // },
  62469. // "start": {
  62470. // "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.",
  62471. // "format": "int64",
  62472. // "location": "query",
  62473. // "type": "string"
  62474. // },
  62475. // "zone": {
  62476. // "description": "The name of the zone for this request.",
  62477. // "location": "path",
  62478. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  62479. // "required": true,
  62480. // "type": "string"
  62481. // }
  62482. // },
  62483. // "path": "{project}/zones/{zone}/instances/{instance}/serialPort",
  62484. // "response": {
  62485. // "$ref": "SerialPortOutput"
  62486. // },
  62487. // "scopes": [
  62488. // "https://www.googleapis.com/auth/cloud-platform",
  62489. // "https://www.googleapis.com/auth/compute",
  62490. // "https://www.googleapis.com/auth/compute.readonly"
  62491. // ]
  62492. // }
  62493. }
  62494. // method id "compute.instances.insert":
  62495. type InstancesInsertCall struct {
  62496. s *Service
  62497. project string
  62498. zone string
  62499. instance *Instance
  62500. urlParams_ gensupport.URLParams
  62501. ctx_ context.Context
  62502. header_ http.Header
  62503. }
  62504. // Insert: Creates an instance resource in the specified project using
  62505. // the data included in the request.
  62506. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/insert
  62507. func (r *InstancesService) Insert(project string, zone string, instance *Instance) *InstancesInsertCall {
  62508. c := &InstancesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  62509. c.project = project
  62510. c.zone = zone
  62511. c.instance = instance
  62512. return c
  62513. }
  62514. // RequestId sets the optional parameter "requestId": An optional
  62515. // request ID to identify requests. Specify a unique request ID so that
  62516. // if you must retry your request, the server will know to ignore the
  62517. // request if it has already been completed.
  62518. //
  62519. // For example, consider a situation where you make an initial request
  62520. // and the request times out. If you make the request again with the
  62521. // same request ID, the server can check if original operation with the
  62522. // same request ID was received, and if so, will ignore the second
  62523. // request. This prevents clients from accidentally creating duplicate
  62524. // commitments.
  62525. //
  62526. // The request ID must be a valid UUID with the exception that zero UUID
  62527. // is not supported (00000000-0000-0000-0000-000000000000).
  62528. func (c *InstancesInsertCall) RequestId(requestId string) *InstancesInsertCall {
  62529. c.urlParams_.Set("requestId", requestId)
  62530. return c
  62531. }
  62532. // SourceInstanceTemplate sets the optional parameter
  62533. // "sourceInstanceTemplate": Specifies instance template to create the
  62534. // instance.
  62535. //
  62536. // This field is optional. It can be a full or partial URL. For example,
  62537. // the following are all valid URLs to an instance template:
  62538. // -
  62539. // https://www.googleapis.com/compute/v1/projects/project/global/global/instanceTemplates/instanceTemplate
  62540. // - projects/project/global/global/instanceTemplates/instanceTemplate
  62541. //
  62542. // - global/instancesTemplates/instanceTemplate
  62543. func (c *InstancesInsertCall) SourceInstanceTemplate(sourceInstanceTemplate string) *InstancesInsertCall {
  62544. c.urlParams_.Set("sourceInstanceTemplate", sourceInstanceTemplate)
  62545. return c
  62546. }
  62547. // Fields allows partial responses to be retrieved. See
  62548. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  62549. // for more information.
  62550. func (c *InstancesInsertCall) Fields(s ...googleapi.Field) *InstancesInsertCall {
  62551. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  62552. return c
  62553. }
  62554. // Context sets the context to be used in this call's Do method. Any
  62555. // pending HTTP request will be aborted if the provided context is
  62556. // canceled.
  62557. func (c *InstancesInsertCall) Context(ctx context.Context) *InstancesInsertCall {
  62558. c.ctx_ = ctx
  62559. return c
  62560. }
  62561. // Header returns an http.Header that can be modified by the caller to
  62562. // add HTTP headers to the request.
  62563. func (c *InstancesInsertCall) Header() http.Header {
  62564. if c.header_ == nil {
  62565. c.header_ = make(http.Header)
  62566. }
  62567. return c.header_
  62568. }
  62569. func (c *InstancesInsertCall) doRequest(alt string) (*http.Response, error) {
  62570. reqHeaders := make(http.Header)
  62571. for k, v := range c.header_ {
  62572. reqHeaders[k] = v
  62573. }
  62574. reqHeaders.Set("User-Agent", c.s.userAgent())
  62575. var body io.Reader = nil
  62576. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance)
  62577. if err != nil {
  62578. return nil, err
  62579. }
  62580. reqHeaders.Set("Content-Type", "application/json")
  62581. c.urlParams_.Set("alt", alt)
  62582. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances")
  62583. urls += "?" + c.urlParams_.Encode()
  62584. req, _ := http.NewRequest("POST", urls, body)
  62585. req.Header = reqHeaders
  62586. googleapi.Expand(req.URL, map[string]string{
  62587. "project": c.project,
  62588. "zone": c.zone,
  62589. })
  62590. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  62591. }
  62592. // Do executes the "compute.instances.insert" call.
  62593. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  62594. // status code is an error. Response headers are in either
  62595. // *Operation.ServerResponse.Header or (if a response was returned at
  62596. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  62597. // to check whether the returned error was because
  62598. // http.StatusNotModified was returned.
  62599. func (c *InstancesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  62600. gensupport.SetOptions(c.urlParams_, opts...)
  62601. res, err := c.doRequest("json")
  62602. if res != nil && res.StatusCode == http.StatusNotModified {
  62603. if res.Body != nil {
  62604. res.Body.Close()
  62605. }
  62606. return nil, &googleapi.Error{
  62607. Code: res.StatusCode,
  62608. Header: res.Header,
  62609. }
  62610. }
  62611. if err != nil {
  62612. return nil, err
  62613. }
  62614. defer googleapi.CloseBody(res)
  62615. if err := googleapi.CheckResponse(res); err != nil {
  62616. return nil, err
  62617. }
  62618. ret := &Operation{
  62619. ServerResponse: googleapi.ServerResponse{
  62620. Header: res.Header,
  62621. HTTPStatusCode: res.StatusCode,
  62622. },
  62623. }
  62624. target := &ret
  62625. if err := gensupport.DecodeResponse(target, res); err != nil {
  62626. return nil, err
  62627. }
  62628. return ret, nil
  62629. // {
  62630. // "description": "Creates an instance resource in the specified project using the data included in the request.",
  62631. // "httpMethod": "POST",
  62632. // "id": "compute.instances.insert",
  62633. // "parameterOrder": [
  62634. // "project",
  62635. // "zone"
  62636. // ],
  62637. // "parameters": {
  62638. // "project": {
  62639. // "description": "Project ID for this request.",
  62640. // "location": "path",
  62641. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  62642. // "required": true,
  62643. // "type": "string"
  62644. // },
  62645. // "requestId": {
  62646. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  62647. // "location": "query",
  62648. // "type": "string"
  62649. // },
  62650. // "sourceInstanceTemplate": {
  62651. // "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/global/instanceTemplates/instanceTemplate \n- projects/project/global/global/instanceTemplates/instanceTemplate \n- global/instancesTemplates/instanceTemplate",
  62652. // "location": "query",
  62653. // "type": "string"
  62654. // },
  62655. // "zone": {
  62656. // "description": "The name of the zone for this request.",
  62657. // "location": "path",
  62658. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  62659. // "required": true,
  62660. // "type": "string"
  62661. // }
  62662. // },
  62663. // "path": "{project}/zones/{zone}/instances",
  62664. // "request": {
  62665. // "$ref": "Instance"
  62666. // },
  62667. // "response": {
  62668. // "$ref": "Operation"
  62669. // },
  62670. // "scopes": [
  62671. // "https://www.googleapis.com/auth/cloud-platform",
  62672. // "https://www.googleapis.com/auth/compute"
  62673. // ]
  62674. // }
  62675. }
  62676. // method id "compute.instances.list":
  62677. type InstancesListCall struct {
  62678. s *Service
  62679. project string
  62680. zone string
  62681. urlParams_ gensupport.URLParams
  62682. ifNoneMatch_ string
  62683. ctx_ context.Context
  62684. header_ http.Header
  62685. }
  62686. // List: Retrieves the list of instances contained within the specified
  62687. // zone.
  62688. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/list
  62689. func (r *InstancesService) List(project string, zone string) *InstancesListCall {
  62690. c := &InstancesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  62691. c.project = project
  62692. c.zone = zone
  62693. return c
  62694. }
  62695. // Filter sets the optional parameter "filter": A filter expression that
  62696. // filters resources listed in the response. The expression must specify
  62697. // the field name, a comparison operator, and the value that you want to
  62698. // use for filtering. The value must be a string, a number, or a
  62699. // boolean. The comparison operator must be either =, !=, >, or <.
  62700. //
  62701. // For example, if you are filtering Compute Engine instances, you can
  62702. // exclude instances named example-instance by specifying name !=
  62703. // example-instance.
  62704. //
  62705. // You can also filter nested fields. For example, you could specify
  62706. // scheduling.automaticRestart = false to include instances only if they
  62707. // are not scheduled for automatic restarts. You can use filtering on
  62708. // nested fields to filter based on resource labels.
  62709. //
  62710. // To filter on multiple expressions, provide each separate expression
  62711. // within parentheses. For example, (scheduling.automaticRestart = true)
  62712. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  62713. // AND expression. However, you can include AND and OR expressions
  62714. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  62715. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  62716. // true).
  62717. func (c *InstancesListCall) Filter(filter string) *InstancesListCall {
  62718. c.urlParams_.Set("filter", filter)
  62719. return c
  62720. }
  62721. // MaxResults sets the optional parameter "maxResults": The maximum
  62722. // number of results per page that should be returned. If the number of
  62723. // available results is larger than maxResults, Compute Engine returns a
  62724. // nextPageToken that can be used to get the next page of results in
  62725. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  62726. // (Default: 500)
  62727. func (c *InstancesListCall) MaxResults(maxResults int64) *InstancesListCall {
  62728. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  62729. return c
  62730. }
  62731. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  62732. // a certain order. By default, results are returned in alphanumerical
  62733. // order based on the resource name.
  62734. //
  62735. // You can also sort results in descending order based on the creation
  62736. // timestamp using orderBy="creationTimestamp desc". This sorts results
  62737. // based on the creationTimestamp field in reverse chronological order
  62738. // (newest result first). Use this to sort resources like operations so
  62739. // that the newest operation is returned first.
  62740. //
  62741. // Currently, only sorting by name or creationTimestamp desc is
  62742. // supported.
  62743. func (c *InstancesListCall) OrderBy(orderBy string) *InstancesListCall {
  62744. c.urlParams_.Set("orderBy", orderBy)
  62745. return c
  62746. }
  62747. // PageToken sets the optional parameter "pageToken": Specifies a page
  62748. // token to use. Set pageToken to the nextPageToken returned by a
  62749. // previous list request to get the next page of results.
  62750. func (c *InstancesListCall) PageToken(pageToken string) *InstancesListCall {
  62751. c.urlParams_.Set("pageToken", pageToken)
  62752. return c
  62753. }
  62754. // Fields allows partial responses to be retrieved. See
  62755. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  62756. // for more information.
  62757. func (c *InstancesListCall) Fields(s ...googleapi.Field) *InstancesListCall {
  62758. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  62759. return c
  62760. }
  62761. // IfNoneMatch sets the optional parameter which makes the operation
  62762. // fail if the object's ETag matches the given value. This is useful for
  62763. // getting updates only after the object has changed since the last
  62764. // request. Use googleapi.IsNotModified to check whether the response
  62765. // error from Do is the result of In-None-Match.
  62766. func (c *InstancesListCall) IfNoneMatch(entityTag string) *InstancesListCall {
  62767. c.ifNoneMatch_ = entityTag
  62768. return c
  62769. }
  62770. // Context sets the context to be used in this call's Do method. Any
  62771. // pending HTTP request will be aborted if the provided context is
  62772. // canceled.
  62773. func (c *InstancesListCall) Context(ctx context.Context) *InstancesListCall {
  62774. c.ctx_ = ctx
  62775. return c
  62776. }
  62777. // Header returns an http.Header that can be modified by the caller to
  62778. // add HTTP headers to the request.
  62779. func (c *InstancesListCall) Header() http.Header {
  62780. if c.header_ == nil {
  62781. c.header_ = make(http.Header)
  62782. }
  62783. return c.header_
  62784. }
  62785. func (c *InstancesListCall) doRequest(alt string) (*http.Response, error) {
  62786. reqHeaders := make(http.Header)
  62787. for k, v := range c.header_ {
  62788. reqHeaders[k] = v
  62789. }
  62790. reqHeaders.Set("User-Agent", c.s.userAgent())
  62791. if c.ifNoneMatch_ != "" {
  62792. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  62793. }
  62794. var body io.Reader = nil
  62795. c.urlParams_.Set("alt", alt)
  62796. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances")
  62797. urls += "?" + c.urlParams_.Encode()
  62798. req, _ := http.NewRequest("GET", urls, body)
  62799. req.Header = reqHeaders
  62800. googleapi.Expand(req.URL, map[string]string{
  62801. "project": c.project,
  62802. "zone": c.zone,
  62803. })
  62804. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  62805. }
  62806. // Do executes the "compute.instances.list" call.
  62807. // Exactly one of *InstanceList or error will be non-nil. Any non-2xx
  62808. // status code is an error. Response headers are in either
  62809. // *InstanceList.ServerResponse.Header or (if a response was returned at
  62810. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  62811. // to check whether the returned error was because
  62812. // http.StatusNotModified was returned.
  62813. func (c *InstancesListCall) Do(opts ...googleapi.CallOption) (*InstanceList, error) {
  62814. gensupport.SetOptions(c.urlParams_, opts...)
  62815. res, err := c.doRequest("json")
  62816. if res != nil && res.StatusCode == http.StatusNotModified {
  62817. if res.Body != nil {
  62818. res.Body.Close()
  62819. }
  62820. return nil, &googleapi.Error{
  62821. Code: res.StatusCode,
  62822. Header: res.Header,
  62823. }
  62824. }
  62825. if err != nil {
  62826. return nil, err
  62827. }
  62828. defer googleapi.CloseBody(res)
  62829. if err := googleapi.CheckResponse(res); err != nil {
  62830. return nil, err
  62831. }
  62832. ret := &InstanceList{
  62833. ServerResponse: googleapi.ServerResponse{
  62834. Header: res.Header,
  62835. HTTPStatusCode: res.StatusCode,
  62836. },
  62837. }
  62838. target := &ret
  62839. if err := gensupport.DecodeResponse(target, res); err != nil {
  62840. return nil, err
  62841. }
  62842. return ret, nil
  62843. // {
  62844. // "description": "Retrieves the list of instances contained within the specified zone.",
  62845. // "httpMethod": "GET",
  62846. // "id": "compute.instances.list",
  62847. // "parameterOrder": [
  62848. // "project",
  62849. // "zone"
  62850. // ],
  62851. // "parameters": {
  62852. // "filter": {
  62853. // "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).",
  62854. // "location": "query",
  62855. // "type": "string"
  62856. // },
  62857. // "maxResults": {
  62858. // "default": "500",
  62859. // "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)",
  62860. // "format": "uint32",
  62861. // "location": "query",
  62862. // "minimum": "0",
  62863. // "type": "integer"
  62864. // },
  62865. // "orderBy": {
  62866. // "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.",
  62867. // "location": "query",
  62868. // "type": "string"
  62869. // },
  62870. // "pageToken": {
  62871. // "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.",
  62872. // "location": "query",
  62873. // "type": "string"
  62874. // },
  62875. // "project": {
  62876. // "description": "Project ID for this request.",
  62877. // "location": "path",
  62878. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  62879. // "required": true,
  62880. // "type": "string"
  62881. // },
  62882. // "zone": {
  62883. // "description": "The name of the zone for this request.",
  62884. // "location": "path",
  62885. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  62886. // "required": true,
  62887. // "type": "string"
  62888. // }
  62889. // },
  62890. // "path": "{project}/zones/{zone}/instances",
  62891. // "response": {
  62892. // "$ref": "InstanceList"
  62893. // },
  62894. // "scopes": [
  62895. // "https://www.googleapis.com/auth/cloud-platform",
  62896. // "https://www.googleapis.com/auth/compute",
  62897. // "https://www.googleapis.com/auth/compute.readonly"
  62898. // ]
  62899. // }
  62900. }
  62901. // Pages invokes f for each page of results.
  62902. // A non-nil error returned from f will halt the iteration.
  62903. // The provided context supersedes any context provided to the Context method.
  62904. func (c *InstancesListCall) Pages(ctx context.Context, f func(*InstanceList) error) error {
  62905. c.ctx_ = ctx
  62906. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  62907. for {
  62908. x, err := c.Do()
  62909. if err != nil {
  62910. return err
  62911. }
  62912. if err := f(x); err != nil {
  62913. return err
  62914. }
  62915. if x.NextPageToken == "" {
  62916. return nil
  62917. }
  62918. c.PageToken(x.NextPageToken)
  62919. }
  62920. }
  62921. // method id "compute.instances.listReferrers":
  62922. type InstancesListReferrersCall struct {
  62923. s *Service
  62924. project string
  62925. zone string
  62926. instance string
  62927. urlParams_ gensupport.URLParams
  62928. ifNoneMatch_ string
  62929. ctx_ context.Context
  62930. header_ http.Header
  62931. }
  62932. // ListReferrers: Retrieves the list of referrers to instances contained
  62933. // within the specified zone.
  62934. func (r *InstancesService) ListReferrers(project string, zone string, instance string) *InstancesListReferrersCall {
  62935. c := &InstancesListReferrersCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  62936. c.project = project
  62937. c.zone = zone
  62938. c.instance = instance
  62939. return c
  62940. }
  62941. // Filter sets the optional parameter "filter": A filter expression that
  62942. // filters resources listed in the response. The expression must specify
  62943. // the field name, a comparison operator, and the value that you want to
  62944. // use for filtering. The value must be a string, a number, or a
  62945. // boolean. The comparison operator must be either =, !=, >, or <.
  62946. //
  62947. // For example, if you are filtering Compute Engine instances, you can
  62948. // exclude instances named example-instance by specifying name !=
  62949. // example-instance.
  62950. //
  62951. // You can also filter nested fields. For example, you could specify
  62952. // scheduling.automaticRestart = false to include instances only if they
  62953. // are not scheduled for automatic restarts. You can use filtering on
  62954. // nested fields to filter based on resource labels.
  62955. //
  62956. // To filter on multiple expressions, provide each separate expression
  62957. // within parentheses. For example, (scheduling.automaticRestart = true)
  62958. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  62959. // AND expression. However, you can include AND and OR expressions
  62960. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  62961. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  62962. // true).
  62963. func (c *InstancesListReferrersCall) Filter(filter string) *InstancesListReferrersCall {
  62964. c.urlParams_.Set("filter", filter)
  62965. return c
  62966. }
  62967. // MaxResults sets the optional parameter "maxResults": The maximum
  62968. // number of results per page that should be returned. If the number of
  62969. // available results is larger than maxResults, Compute Engine returns a
  62970. // nextPageToken that can be used to get the next page of results in
  62971. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  62972. // (Default: 500)
  62973. func (c *InstancesListReferrersCall) MaxResults(maxResults int64) *InstancesListReferrersCall {
  62974. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  62975. return c
  62976. }
  62977. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  62978. // a certain order. By default, results are returned in alphanumerical
  62979. // order based on the resource name.
  62980. //
  62981. // You can also sort results in descending order based on the creation
  62982. // timestamp using orderBy="creationTimestamp desc". This sorts results
  62983. // based on the creationTimestamp field in reverse chronological order
  62984. // (newest result first). Use this to sort resources like operations so
  62985. // that the newest operation is returned first.
  62986. //
  62987. // Currently, only sorting by name or creationTimestamp desc is
  62988. // supported.
  62989. func (c *InstancesListReferrersCall) OrderBy(orderBy string) *InstancesListReferrersCall {
  62990. c.urlParams_.Set("orderBy", orderBy)
  62991. return c
  62992. }
  62993. // PageToken sets the optional parameter "pageToken": Specifies a page
  62994. // token to use. Set pageToken to the nextPageToken returned by a
  62995. // previous list request to get the next page of results.
  62996. func (c *InstancesListReferrersCall) PageToken(pageToken string) *InstancesListReferrersCall {
  62997. c.urlParams_.Set("pageToken", pageToken)
  62998. return c
  62999. }
  63000. // Fields allows partial responses to be retrieved. See
  63001. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  63002. // for more information.
  63003. func (c *InstancesListReferrersCall) Fields(s ...googleapi.Field) *InstancesListReferrersCall {
  63004. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  63005. return c
  63006. }
  63007. // IfNoneMatch sets the optional parameter which makes the operation
  63008. // fail if the object's ETag matches the given value. This is useful for
  63009. // getting updates only after the object has changed since the last
  63010. // request. Use googleapi.IsNotModified to check whether the response
  63011. // error from Do is the result of In-None-Match.
  63012. func (c *InstancesListReferrersCall) IfNoneMatch(entityTag string) *InstancesListReferrersCall {
  63013. c.ifNoneMatch_ = entityTag
  63014. return c
  63015. }
  63016. // Context sets the context to be used in this call's Do method. Any
  63017. // pending HTTP request will be aborted if the provided context is
  63018. // canceled.
  63019. func (c *InstancesListReferrersCall) Context(ctx context.Context) *InstancesListReferrersCall {
  63020. c.ctx_ = ctx
  63021. return c
  63022. }
  63023. // Header returns an http.Header that can be modified by the caller to
  63024. // add HTTP headers to the request.
  63025. func (c *InstancesListReferrersCall) Header() http.Header {
  63026. if c.header_ == nil {
  63027. c.header_ = make(http.Header)
  63028. }
  63029. return c.header_
  63030. }
  63031. func (c *InstancesListReferrersCall) doRequest(alt string) (*http.Response, error) {
  63032. reqHeaders := make(http.Header)
  63033. for k, v := range c.header_ {
  63034. reqHeaders[k] = v
  63035. }
  63036. reqHeaders.Set("User-Agent", c.s.userAgent())
  63037. if c.ifNoneMatch_ != "" {
  63038. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  63039. }
  63040. var body io.Reader = nil
  63041. c.urlParams_.Set("alt", alt)
  63042. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/referrers")
  63043. urls += "?" + c.urlParams_.Encode()
  63044. req, _ := http.NewRequest("GET", urls, body)
  63045. req.Header = reqHeaders
  63046. googleapi.Expand(req.URL, map[string]string{
  63047. "project": c.project,
  63048. "zone": c.zone,
  63049. "instance": c.instance,
  63050. })
  63051. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  63052. }
  63053. // Do executes the "compute.instances.listReferrers" call.
  63054. // Exactly one of *InstanceListReferrers or error will be non-nil. Any
  63055. // non-2xx status code is an error. Response headers are in either
  63056. // *InstanceListReferrers.ServerResponse.Header or (if a response was
  63057. // returned at all) in error.(*googleapi.Error).Header. Use
  63058. // googleapi.IsNotModified to check whether the returned error was
  63059. // because http.StatusNotModified was returned.
  63060. func (c *InstancesListReferrersCall) Do(opts ...googleapi.CallOption) (*InstanceListReferrers, error) {
  63061. gensupport.SetOptions(c.urlParams_, opts...)
  63062. res, err := c.doRequest("json")
  63063. if res != nil && res.StatusCode == http.StatusNotModified {
  63064. if res.Body != nil {
  63065. res.Body.Close()
  63066. }
  63067. return nil, &googleapi.Error{
  63068. Code: res.StatusCode,
  63069. Header: res.Header,
  63070. }
  63071. }
  63072. if err != nil {
  63073. return nil, err
  63074. }
  63075. defer googleapi.CloseBody(res)
  63076. if err := googleapi.CheckResponse(res); err != nil {
  63077. return nil, err
  63078. }
  63079. ret := &InstanceListReferrers{
  63080. ServerResponse: googleapi.ServerResponse{
  63081. Header: res.Header,
  63082. HTTPStatusCode: res.StatusCode,
  63083. },
  63084. }
  63085. target := &ret
  63086. if err := gensupport.DecodeResponse(target, res); err != nil {
  63087. return nil, err
  63088. }
  63089. return ret, nil
  63090. // {
  63091. // "description": "Retrieves the list of referrers to instances contained within the specified zone.",
  63092. // "httpMethod": "GET",
  63093. // "id": "compute.instances.listReferrers",
  63094. // "parameterOrder": [
  63095. // "project",
  63096. // "zone",
  63097. // "instance"
  63098. // ],
  63099. // "parameters": {
  63100. // "filter": {
  63101. // "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).",
  63102. // "location": "query",
  63103. // "type": "string"
  63104. // },
  63105. // "instance": {
  63106. // "description": "Name of the target instance scoping this request, or '-' if the request should span over all instances in the container.",
  63107. // "location": "path",
  63108. // "pattern": "-|[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  63109. // "required": true,
  63110. // "type": "string"
  63111. // },
  63112. // "maxResults": {
  63113. // "default": "500",
  63114. // "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)",
  63115. // "format": "uint32",
  63116. // "location": "query",
  63117. // "minimum": "0",
  63118. // "type": "integer"
  63119. // },
  63120. // "orderBy": {
  63121. // "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.",
  63122. // "location": "query",
  63123. // "type": "string"
  63124. // },
  63125. // "pageToken": {
  63126. // "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.",
  63127. // "location": "query",
  63128. // "type": "string"
  63129. // },
  63130. // "project": {
  63131. // "description": "Project ID for this request.",
  63132. // "location": "path",
  63133. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  63134. // "required": true,
  63135. // "type": "string"
  63136. // },
  63137. // "zone": {
  63138. // "description": "The name of the zone for this request.",
  63139. // "location": "path",
  63140. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  63141. // "required": true,
  63142. // "type": "string"
  63143. // }
  63144. // },
  63145. // "path": "{project}/zones/{zone}/instances/{instance}/referrers",
  63146. // "response": {
  63147. // "$ref": "InstanceListReferrers"
  63148. // },
  63149. // "scopes": [
  63150. // "https://www.googleapis.com/auth/cloud-platform",
  63151. // "https://www.googleapis.com/auth/compute",
  63152. // "https://www.googleapis.com/auth/compute.readonly"
  63153. // ]
  63154. // }
  63155. }
  63156. // Pages invokes f for each page of results.
  63157. // A non-nil error returned from f will halt the iteration.
  63158. // The provided context supersedes any context provided to the Context method.
  63159. func (c *InstancesListReferrersCall) Pages(ctx context.Context, f func(*InstanceListReferrers) error) error {
  63160. c.ctx_ = ctx
  63161. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  63162. for {
  63163. x, err := c.Do()
  63164. if err != nil {
  63165. return err
  63166. }
  63167. if err := f(x); err != nil {
  63168. return err
  63169. }
  63170. if x.NextPageToken == "" {
  63171. return nil
  63172. }
  63173. c.PageToken(x.NextPageToken)
  63174. }
  63175. }
  63176. // method id "compute.instances.removeResourcePolicies":
  63177. type InstancesRemoveResourcePoliciesCall struct {
  63178. s *Service
  63179. project string
  63180. zone string
  63181. instance string
  63182. instancesremoveresourcepoliciesrequest *InstancesRemoveResourcePoliciesRequest
  63183. urlParams_ gensupport.URLParams
  63184. ctx_ context.Context
  63185. header_ http.Header
  63186. }
  63187. // RemoveResourcePolicies: Removes resource policies from an instance.
  63188. func (r *InstancesService) RemoveResourcePolicies(project string, zone string, instance string, instancesremoveresourcepoliciesrequest *InstancesRemoveResourcePoliciesRequest) *InstancesRemoveResourcePoliciesCall {
  63189. c := &InstancesRemoveResourcePoliciesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  63190. c.project = project
  63191. c.zone = zone
  63192. c.instance = instance
  63193. c.instancesremoveresourcepoliciesrequest = instancesremoveresourcepoliciesrequest
  63194. return c
  63195. }
  63196. // RequestId sets the optional parameter "requestId": An optional
  63197. // request ID to identify requests. Specify a unique request ID so that
  63198. // if you must retry your request, the server will know to ignore the
  63199. // request if it has already been completed.
  63200. //
  63201. // For example, consider a situation where you make an initial request
  63202. // and the request times out. If you make the request again with the
  63203. // same request ID, the server can check if original operation with the
  63204. // same request ID was received, and if so, will ignore the second
  63205. // request. This prevents clients from accidentally creating duplicate
  63206. // commitments.
  63207. //
  63208. // The request ID must be a valid UUID with the exception that zero UUID
  63209. // is not supported (00000000-0000-0000-0000-000000000000).
  63210. func (c *InstancesRemoveResourcePoliciesCall) RequestId(requestId string) *InstancesRemoveResourcePoliciesCall {
  63211. c.urlParams_.Set("requestId", requestId)
  63212. return c
  63213. }
  63214. // Fields allows partial responses to be retrieved. See
  63215. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  63216. // for more information.
  63217. func (c *InstancesRemoveResourcePoliciesCall) Fields(s ...googleapi.Field) *InstancesRemoveResourcePoliciesCall {
  63218. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  63219. return c
  63220. }
  63221. // Context sets the context to be used in this call's Do method. Any
  63222. // pending HTTP request will be aborted if the provided context is
  63223. // canceled.
  63224. func (c *InstancesRemoveResourcePoliciesCall) Context(ctx context.Context) *InstancesRemoveResourcePoliciesCall {
  63225. c.ctx_ = ctx
  63226. return c
  63227. }
  63228. // Header returns an http.Header that can be modified by the caller to
  63229. // add HTTP headers to the request.
  63230. func (c *InstancesRemoveResourcePoliciesCall) Header() http.Header {
  63231. if c.header_ == nil {
  63232. c.header_ = make(http.Header)
  63233. }
  63234. return c.header_
  63235. }
  63236. func (c *InstancesRemoveResourcePoliciesCall) doRequest(alt string) (*http.Response, error) {
  63237. reqHeaders := make(http.Header)
  63238. for k, v := range c.header_ {
  63239. reqHeaders[k] = v
  63240. }
  63241. reqHeaders.Set("User-Agent", c.s.userAgent())
  63242. var body io.Reader = nil
  63243. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesremoveresourcepoliciesrequest)
  63244. if err != nil {
  63245. return nil, err
  63246. }
  63247. reqHeaders.Set("Content-Type", "application/json")
  63248. c.urlParams_.Set("alt", alt)
  63249. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/removeResourcePolicies")
  63250. urls += "?" + c.urlParams_.Encode()
  63251. req, _ := http.NewRequest("POST", urls, body)
  63252. req.Header = reqHeaders
  63253. googleapi.Expand(req.URL, map[string]string{
  63254. "project": c.project,
  63255. "zone": c.zone,
  63256. "instance": c.instance,
  63257. })
  63258. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  63259. }
  63260. // Do executes the "compute.instances.removeResourcePolicies" call.
  63261. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  63262. // status code is an error. Response headers are in either
  63263. // *Operation.ServerResponse.Header or (if a response was returned at
  63264. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  63265. // to check whether the returned error was because
  63266. // http.StatusNotModified was returned.
  63267. func (c *InstancesRemoveResourcePoliciesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  63268. gensupport.SetOptions(c.urlParams_, opts...)
  63269. res, err := c.doRequest("json")
  63270. if res != nil && res.StatusCode == http.StatusNotModified {
  63271. if res.Body != nil {
  63272. res.Body.Close()
  63273. }
  63274. return nil, &googleapi.Error{
  63275. Code: res.StatusCode,
  63276. Header: res.Header,
  63277. }
  63278. }
  63279. if err != nil {
  63280. return nil, err
  63281. }
  63282. defer googleapi.CloseBody(res)
  63283. if err := googleapi.CheckResponse(res); err != nil {
  63284. return nil, err
  63285. }
  63286. ret := &Operation{
  63287. ServerResponse: googleapi.ServerResponse{
  63288. Header: res.Header,
  63289. HTTPStatusCode: res.StatusCode,
  63290. },
  63291. }
  63292. target := &ret
  63293. if err := gensupport.DecodeResponse(target, res); err != nil {
  63294. return nil, err
  63295. }
  63296. return ret, nil
  63297. // {
  63298. // "description": "Removes resource policies from an instance.",
  63299. // "httpMethod": "POST",
  63300. // "id": "compute.instances.removeResourcePolicies",
  63301. // "parameterOrder": [
  63302. // "project",
  63303. // "zone",
  63304. // "instance"
  63305. // ],
  63306. // "parameters": {
  63307. // "instance": {
  63308. // "description": "The instance name for this request.",
  63309. // "location": "path",
  63310. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  63311. // "required": true,
  63312. // "type": "string"
  63313. // },
  63314. // "project": {
  63315. // "description": "Project ID for this request.",
  63316. // "location": "path",
  63317. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  63318. // "required": true,
  63319. // "type": "string"
  63320. // },
  63321. // "requestId": {
  63322. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  63323. // "location": "query",
  63324. // "type": "string"
  63325. // },
  63326. // "zone": {
  63327. // "description": "The name of the zone for this request.",
  63328. // "location": "path",
  63329. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  63330. // "required": true,
  63331. // "type": "string"
  63332. // }
  63333. // },
  63334. // "path": "{project}/zones/{zone}/instances/{instance}/removeResourcePolicies",
  63335. // "request": {
  63336. // "$ref": "InstancesRemoveResourcePoliciesRequest"
  63337. // },
  63338. // "response": {
  63339. // "$ref": "Operation"
  63340. // },
  63341. // "scopes": [
  63342. // "https://www.googleapis.com/auth/cloud-platform",
  63343. // "https://www.googleapis.com/auth/compute"
  63344. // ]
  63345. // }
  63346. }
  63347. // method id "compute.instances.reset":
  63348. type InstancesResetCall struct {
  63349. s *Service
  63350. project string
  63351. zone string
  63352. instance string
  63353. urlParams_ gensupport.URLParams
  63354. ctx_ context.Context
  63355. header_ http.Header
  63356. }
  63357. // Reset: Performs a reset on the instance. For more information, see
  63358. // Resetting an instance.
  63359. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/reset
  63360. func (r *InstancesService) Reset(project string, zone string, instance string) *InstancesResetCall {
  63361. c := &InstancesResetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  63362. c.project = project
  63363. c.zone = zone
  63364. c.instance = instance
  63365. return c
  63366. }
  63367. // RequestId sets the optional parameter "requestId": An optional
  63368. // request ID to identify requests. Specify a unique request ID so that
  63369. // if you must retry your request, the server will know to ignore the
  63370. // request if it has already been completed.
  63371. //
  63372. // For example, consider a situation where you make an initial request
  63373. // and the request times out. If you make the request again with the
  63374. // same request ID, the server can check if original operation with the
  63375. // same request ID was received, and if so, will ignore the second
  63376. // request. This prevents clients from accidentally creating duplicate
  63377. // commitments.
  63378. //
  63379. // The request ID must be a valid UUID with the exception that zero UUID
  63380. // is not supported (00000000-0000-0000-0000-000000000000).
  63381. func (c *InstancesResetCall) RequestId(requestId string) *InstancesResetCall {
  63382. c.urlParams_.Set("requestId", requestId)
  63383. return c
  63384. }
  63385. // Fields allows partial responses to be retrieved. See
  63386. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  63387. // for more information.
  63388. func (c *InstancesResetCall) Fields(s ...googleapi.Field) *InstancesResetCall {
  63389. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  63390. return c
  63391. }
  63392. // Context sets the context to be used in this call's Do method. Any
  63393. // pending HTTP request will be aborted if the provided context is
  63394. // canceled.
  63395. func (c *InstancesResetCall) Context(ctx context.Context) *InstancesResetCall {
  63396. c.ctx_ = ctx
  63397. return c
  63398. }
  63399. // Header returns an http.Header that can be modified by the caller to
  63400. // add HTTP headers to the request.
  63401. func (c *InstancesResetCall) Header() http.Header {
  63402. if c.header_ == nil {
  63403. c.header_ = make(http.Header)
  63404. }
  63405. return c.header_
  63406. }
  63407. func (c *InstancesResetCall) doRequest(alt string) (*http.Response, error) {
  63408. reqHeaders := make(http.Header)
  63409. for k, v := range c.header_ {
  63410. reqHeaders[k] = v
  63411. }
  63412. reqHeaders.Set("User-Agent", c.s.userAgent())
  63413. var body io.Reader = nil
  63414. c.urlParams_.Set("alt", alt)
  63415. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/reset")
  63416. urls += "?" + c.urlParams_.Encode()
  63417. req, _ := http.NewRequest("POST", urls, body)
  63418. req.Header = reqHeaders
  63419. googleapi.Expand(req.URL, map[string]string{
  63420. "project": c.project,
  63421. "zone": c.zone,
  63422. "instance": c.instance,
  63423. })
  63424. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  63425. }
  63426. // Do executes the "compute.instances.reset" call.
  63427. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  63428. // status code is an error. Response headers are in either
  63429. // *Operation.ServerResponse.Header or (if a response was returned at
  63430. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  63431. // to check whether the returned error was because
  63432. // http.StatusNotModified was returned.
  63433. func (c *InstancesResetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  63434. gensupport.SetOptions(c.urlParams_, opts...)
  63435. res, err := c.doRequest("json")
  63436. if res != nil && res.StatusCode == http.StatusNotModified {
  63437. if res.Body != nil {
  63438. res.Body.Close()
  63439. }
  63440. return nil, &googleapi.Error{
  63441. Code: res.StatusCode,
  63442. Header: res.Header,
  63443. }
  63444. }
  63445. if err != nil {
  63446. return nil, err
  63447. }
  63448. defer googleapi.CloseBody(res)
  63449. if err := googleapi.CheckResponse(res); err != nil {
  63450. return nil, err
  63451. }
  63452. ret := &Operation{
  63453. ServerResponse: googleapi.ServerResponse{
  63454. Header: res.Header,
  63455. HTTPStatusCode: res.StatusCode,
  63456. },
  63457. }
  63458. target := &ret
  63459. if err := gensupport.DecodeResponse(target, res); err != nil {
  63460. return nil, err
  63461. }
  63462. return ret, nil
  63463. // {
  63464. // "description": "Performs a reset on the instance. For more information, see Resetting an instance.",
  63465. // "httpMethod": "POST",
  63466. // "id": "compute.instances.reset",
  63467. // "parameterOrder": [
  63468. // "project",
  63469. // "zone",
  63470. // "instance"
  63471. // ],
  63472. // "parameters": {
  63473. // "instance": {
  63474. // "description": "Name of the instance scoping this request.",
  63475. // "location": "path",
  63476. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  63477. // "required": true,
  63478. // "type": "string"
  63479. // },
  63480. // "project": {
  63481. // "description": "Project ID for this request.",
  63482. // "location": "path",
  63483. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  63484. // "required": true,
  63485. // "type": "string"
  63486. // },
  63487. // "requestId": {
  63488. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  63489. // "location": "query",
  63490. // "type": "string"
  63491. // },
  63492. // "zone": {
  63493. // "description": "The name of the zone for this request.",
  63494. // "location": "path",
  63495. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  63496. // "required": true,
  63497. // "type": "string"
  63498. // }
  63499. // },
  63500. // "path": "{project}/zones/{zone}/instances/{instance}/reset",
  63501. // "response": {
  63502. // "$ref": "Operation"
  63503. // },
  63504. // "scopes": [
  63505. // "https://www.googleapis.com/auth/cloud-platform",
  63506. // "https://www.googleapis.com/auth/compute"
  63507. // ]
  63508. // }
  63509. }
  63510. // method id "compute.instances.resume":
  63511. type InstancesResumeCall struct {
  63512. s *Service
  63513. project string
  63514. zone string
  63515. instance string
  63516. instancesresumerequest *InstancesResumeRequest
  63517. urlParams_ gensupport.URLParams
  63518. ctx_ context.Context
  63519. header_ http.Header
  63520. }
  63521. // Resume: Resumes an instance that was suspended using the
  63522. // instances().suspend method.
  63523. func (r *InstancesService) Resume(project string, zone string, instance string, instancesresumerequest *InstancesResumeRequest) *InstancesResumeCall {
  63524. c := &InstancesResumeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  63525. c.project = project
  63526. c.zone = zone
  63527. c.instance = instance
  63528. c.instancesresumerequest = instancesresumerequest
  63529. return c
  63530. }
  63531. // RequestId sets the optional parameter "requestId": An optional
  63532. // request ID to identify requests. Specify a unique request ID so that
  63533. // if you must retry your request, the server will know to ignore the
  63534. // request if it has already been completed.
  63535. //
  63536. // For example, consider a situation where you make an initial request
  63537. // and the request times out. If you make the request again with the
  63538. // same request ID, the server can check if original operation with the
  63539. // same request ID was received, and if so, will ignore the second
  63540. // request. This prevents clients from accidentally creating duplicate
  63541. // commitments.
  63542. //
  63543. // The request ID must be a valid UUID with the exception that zero UUID
  63544. // is not supported (00000000-0000-0000-0000-000000000000).
  63545. func (c *InstancesResumeCall) RequestId(requestId string) *InstancesResumeCall {
  63546. c.urlParams_.Set("requestId", requestId)
  63547. return c
  63548. }
  63549. // Fields allows partial responses to be retrieved. See
  63550. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  63551. // for more information.
  63552. func (c *InstancesResumeCall) Fields(s ...googleapi.Field) *InstancesResumeCall {
  63553. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  63554. return c
  63555. }
  63556. // Context sets the context to be used in this call's Do method. Any
  63557. // pending HTTP request will be aborted if the provided context is
  63558. // canceled.
  63559. func (c *InstancesResumeCall) Context(ctx context.Context) *InstancesResumeCall {
  63560. c.ctx_ = ctx
  63561. return c
  63562. }
  63563. // Header returns an http.Header that can be modified by the caller to
  63564. // add HTTP headers to the request.
  63565. func (c *InstancesResumeCall) Header() http.Header {
  63566. if c.header_ == nil {
  63567. c.header_ = make(http.Header)
  63568. }
  63569. return c.header_
  63570. }
  63571. func (c *InstancesResumeCall) doRequest(alt string) (*http.Response, error) {
  63572. reqHeaders := make(http.Header)
  63573. for k, v := range c.header_ {
  63574. reqHeaders[k] = v
  63575. }
  63576. reqHeaders.Set("User-Agent", c.s.userAgent())
  63577. var body io.Reader = nil
  63578. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesresumerequest)
  63579. if err != nil {
  63580. return nil, err
  63581. }
  63582. reqHeaders.Set("Content-Type", "application/json")
  63583. c.urlParams_.Set("alt", alt)
  63584. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/resume")
  63585. urls += "?" + c.urlParams_.Encode()
  63586. req, _ := http.NewRequest("POST", urls, body)
  63587. req.Header = reqHeaders
  63588. googleapi.Expand(req.URL, map[string]string{
  63589. "project": c.project,
  63590. "zone": c.zone,
  63591. "instance": c.instance,
  63592. })
  63593. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  63594. }
  63595. // Do executes the "compute.instances.resume" call.
  63596. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  63597. // status code is an error. Response headers are in either
  63598. // *Operation.ServerResponse.Header or (if a response was returned at
  63599. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  63600. // to check whether the returned error was because
  63601. // http.StatusNotModified was returned.
  63602. func (c *InstancesResumeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  63603. gensupport.SetOptions(c.urlParams_, opts...)
  63604. res, err := c.doRequest("json")
  63605. if res != nil && res.StatusCode == http.StatusNotModified {
  63606. if res.Body != nil {
  63607. res.Body.Close()
  63608. }
  63609. return nil, &googleapi.Error{
  63610. Code: res.StatusCode,
  63611. Header: res.Header,
  63612. }
  63613. }
  63614. if err != nil {
  63615. return nil, err
  63616. }
  63617. defer googleapi.CloseBody(res)
  63618. if err := googleapi.CheckResponse(res); err != nil {
  63619. return nil, err
  63620. }
  63621. ret := &Operation{
  63622. ServerResponse: googleapi.ServerResponse{
  63623. Header: res.Header,
  63624. HTTPStatusCode: res.StatusCode,
  63625. },
  63626. }
  63627. target := &ret
  63628. if err := gensupport.DecodeResponse(target, res); err != nil {
  63629. return nil, err
  63630. }
  63631. return ret, nil
  63632. // {
  63633. // "description": "Resumes an instance that was suspended using the instances().suspend method.",
  63634. // "httpMethod": "POST",
  63635. // "id": "compute.instances.resume",
  63636. // "parameterOrder": [
  63637. // "project",
  63638. // "zone",
  63639. // "instance"
  63640. // ],
  63641. // "parameters": {
  63642. // "instance": {
  63643. // "description": "Name of the instance resource to resume.",
  63644. // "location": "path",
  63645. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  63646. // "required": true,
  63647. // "type": "string"
  63648. // },
  63649. // "project": {
  63650. // "description": "Project ID for this request.",
  63651. // "location": "path",
  63652. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  63653. // "required": true,
  63654. // "type": "string"
  63655. // },
  63656. // "requestId": {
  63657. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  63658. // "location": "query",
  63659. // "type": "string"
  63660. // },
  63661. // "zone": {
  63662. // "description": "The name of the zone for this request.",
  63663. // "location": "path",
  63664. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  63665. // "required": true,
  63666. // "type": "string"
  63667. // }
  63668. // },
  63669. // "path": "{project}/zones/{zone}/instances/{instance}/resume",
  63670. // "request": {
  63671. // "$ref": "InstancesResumeRequest"
  63672. // },
  63673. // "response": {
  63674. // "$ref": "Operation"
  63675. // },
  63676. // "scopes": [
  63677. // "https://www.googleapis.com/auth/cloud-platform",
  63678. // "https://www.googleapis.com/auth/compute"
  63679. // ]
  63680. // }
  63681. }
  63682. // method id "compute.instances.setDeletionProtection":
  63683. type InstancesSetDeletionProtectionCall struct {
  63684. s *Service
  63685. project string
  63686. zone string
  63687. resource string
  63688. urlParams_ gensupport.URLParams
  63689. ctx_ context.Context
  63690. header_ http.Header
  63691. }
  63692. // SetDeletionProtection: Sets deletion protection on the instance.
  63693. func (r *InstancesService) SetDeletionProtection(project string, zone string, resource string) *InstancesSetDeletionProtectionCall {
  63694. c := &InstancesSetDeletionProtectionCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  63695. c.project = project
  63696. c.zone = zone
  63697. c.resource = resource
  63698. return c
  63699. }
  63700. // DeletionProtection sets the optional parameter "deletionProtection":
  63701. // Whether the resource should be protected against deletion.
  63702. func (c *InstancesSetDeletionProtectionCall) DeletionProtection(deletionProtection bool) *InstancesSetDeletionProtectionCall {
  63703. c.urlParams_.Set("deletionProtection", fmt.Sprint(deletionProtection))
  63704. return c
  63705. }
  63706. // RequestId sets the optional parameter "requestId": An optional
  63707. // request ID to identify requests. Specify a unique request ID so that
  63708. // if you must retry your request, the server will know to ignore the
  63709. // request if it has already been completed.
  63710. //
  63711. // For example, consider a situation where you make an initial request
  63712. // and the request times out. If you make the request again with the
  63713. // same request ID, the server can check if original operation with the
  63714. // same request ID was received, and if so, will ignore the second
  63715. // request. This prevents clients from accidentally creating duplicate
  63716. // commitments.
  63717. //
  63718. // The request ID must be a valid UUID with the exception that zero UUID
  63719. // is not supported (00000000-0000-0000-0000-000000000000).
  63720. func (c *InstancesSetDeletionProtectionCall) RequestId(requestId string) *InstancesSetDeletionProtectionCall {
  63721. c.urlParams_.Set("requestId", requestId)
  63722. return c
  63723. }
  63724. // Fields allows partial responses to be retrieved. See
  63725. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  63726. // for more information.
  63727. func (c *InstancesSetDeletionProtectionCall) Fields(s ...googleapi.Field) *InstancesSetDeletionProtectionCall {
  63728. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  63729. return c
  63730. }
  63731. // Context sets the context to be used in this call's Do method. Any
  63732. // pending HTTP request will be aborted if the provided context is
  63733. // canceled.
  63734. func (c *InstancesSetDeletionProtectionCall) Context(ctx context.Context) *InstancesSetDeletionProtectionCall {
  63735. c.ctx_ = ctx
  63736. return c
  63737. }
  63738. // Header returns an http.Header that can be modified by the caller to
  63739. // add HTTP headers to the request.
  63740. func (c *InstancesSetDeletionProtectionCall) Header() http.Header {
  63741. if c.header_ == nil {
  63742. c.header_ = make(http.Header)
  63743. }
  63744. return c.header_
  63745. }
  63746. func (c *InstancesSetDeletionProtectionCall) doRequest(alt string) (*http.Response, error) {
  63747. reqHeaders := make(http.Header)
  63748. for k, v := range c.header_ {
  63749. reqHeaders[k] = v
  63750. }
  63751. reqHeaders.Set("User-Agent", c.s.userAgent())
  63752. var body io.Reader = nil
  63753. c.urlParams_.Set("alt", alt)
  63754. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{resource}/setDeletionProtection")
  63755. urls += "?" + c.urlParams_.Encode()
  63756. req, _ := http.NewRequest("POST", urls, body)
  63757. req.Header = reqHeaders
  63758. googleapi.Expand(req.URL, map[string]string{
  63759. "project": c.project,
  63760. "zone": c.zone,
  63761. "resource": c.resource,
  63762. })
  63763. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  63764. }
  63765. // Do executes the "compute.instances.setDeletionProtection" call.
  63766. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  63767. // status code is an error. Response headers are in either
  63768. // *Operation.ServerResponse.Header or (if a response was returned at
  63769. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  63770. // to check whether the returned error was because
  63771. // http.StatusNotModified was returned.
  63772. func (c *InstancesSetDeletionProtectionCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  63773. gensupport.SetOptions(c.urlParams_, opts...)
  63774. res, err := c.doRequest("json")
  63775. if res != nil && res.StatusCode == http.StatusNotModified {
  63776. if res.Body != nil {
  63777. res.Body.Close()
  63778. }
  63779. return nil, &googleapi.Error{
  63780. Code: res.StatusCode,
  63781. Header: res.Header,
  63782. }
  63783. }
  63784. if err != nil {
  63785. return nil, err
  63786. }
  63787. defer googleapi.CloseBody(res)
  63788. if err := googleapi.CheckResponse(res); err != nil {
  63789. return nil, err
  63790. }
  63791. ret := &Operation{
  63792. ServerResponse: googleapi.ServerResponse{
  63793. Header: res.Header,
  63794. HTTPStatusCode: res.StatusCode,
  63795. },
  63796. }
  63797. target := &ret
  63798. if err := gensupport.DecodeResponse(target, res); err != nil {
  63799. return nil, err
  63800. }
  63801. return ret, nil
  63802. // {
  63803. // "description": "Sets deletion protection on the instance.",
  63804. // "httpMethod": "POST",
  63805. // "id": "compute.instances.setDeletionProtection",
  63806. // "parameterOrder": [
  63807. // "project",
  63808. // "zone",
  63809. // "resource"
  63810. // ],
  63811. // "parameters": {
  63812. // "deletionProtection": {
  63813. // "default": "true",
  63814. // "description": "Whether the resource should be protected against deletion.",
  63815. // "location": "query",
  63816. // "type": "boolean"
  63817. // },
  63818. // "project": {
  63819. // "description": "Project ID for this request.",
  63820. // "location": "path",
  63821. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  63822. // "required": true,
  63823. // "type": "string"
  63824. // },
  63825. // "requestId": {
  63826. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  63827. // "location": "query",
  63828. // "type": "string"
  63829. // },
  63830. // "resource": {
  63831. // "description": "Name of the resource for this request.",
  63832. // "location": "path",
  63833. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  63834. // "required": true,
  63835. // "type": "string"
  63836. // },
  63837. // "zone": {
  63838. // "description": "The name of the zone for this request.",
  63839. // "location": "path",
  63840. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  63841. // "required": true,
  63842. // "type": "string"
  63843. // }
  63844. // },
  63845. // "path": "{project}/zones/{zone}/instances/{resource}/setDeletionProtection",
  63846. // "response": {
  63847. // "$ref": "Operation"
  63848. // },
  63849. // "scopes": [
  63850. // "https://www.googleapis.com/auth/cloud-platform",
  63851. // "https://www.googleapis.com/auth/compute"
  63852. // ]
  63853. // }
  63854. }
  63855. // method id "compute.instances.setDiskAutoDelete":
  63856. type InstancesSetDiskAutoDeleteCall struct {
  63857. s *Service
  63858. project string
  63859. zone string
  63860. instance string
  63861. urlParams_ gensupport.URLParams
  63862. ctx_ context.Context
  63863. header_ http.Header
  63864. }
  63865. // SetDiskAutoDelete: Sets the auto-delete flag for a disk attached to
  63866. // an instance.
  63867. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/setDiskAutoDelete
  63868. func (r *InstancesService) SetDiskAutoDelete(project string, zone string, instance string, autoDelete bool, deviceName string) *InstancesSetDiskAutoDeleteCall {
  63869. c := &InstancesSetDiskAutoDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  63870. c.project = project
  63871. c.zone = zone
  63872. c.instance = instance
  63873. c.urlParams_.Set("autoDelete", fmt.Sprint(autoDelete))
  63874. c.urlParams_.Set("deviceName", deviceName)
  63875. return c
  63876. }
  63877. // RequestId sets the optional parameter "requestId": An optional
  63878. // request ID to identify requests. Specify a unique request ID so that
  63879. // if you must retry your request, the server will know to ignore the
  63880. // request if it has already been completed.
  63881. //
  63882. // For example, consider a situation where you make an initial request
  63883. // and the request times out. If you make the request again with the
  63884. // same request ID, the server can check if original operation with the
  63885. // same request ID was received, and if so, will ignore the second
  63886. // request. This prevents clients from accidentally creating duplicate
  63887. // commitments.
  63888. //
  63889. // The request ID must be a valid UUID with the exception that zero UUID
  63890. // is not supported (00000000-0000-0000-0000-000000000000).
  63891. func (c *InstancesSetDiskAutoDeleteCall) RequestId(requestId string) *InstancesSetDiskAutoDeleteCall {
  63892. c.urlParams_.Set("requestId", requestId)
  63893. return c
  63894. }
  63895. // Fields allows partial responses to be retrieved. See
  63896. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  63897. // for more information.
  63898. func (c *InstancesSetDiskAutoDeleteCall) Fields(s ...googleapi.Field) *InstancesSetDiskAutoDeleteCall {
  63899. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  63900. return c
  63901. }
  63902. // Context sets the context to be used in this call's Do method. Any
  63903. // pending HTTP request will be aborted if the provided context is
  63904. // canceled.
  63905. func (c *InstancesSetDiskAutoDeleteCall) Context(ctx context.Context) *InstancesSetDiskAutoDeleteCall {
  63906. c.ctx_ = ctx
  63907. return c
  63908. }
  63909. // Header returns an http.Header that can be modified by the caller to
  63910. // add HTTP headers to the request.
  63911. func (c *InstancesSetDiskAutoDeleteCall) Header() http.Header {
  63912. if c.header_ == nil {
  63913. c.header_ = make(http.Header)
  63914. }
  63915. return c.header_
  63916. }
  63917. func (c *InstancesSetDiskAutoDeleteCall) doRequest(alt string) (*http.Response, error) {
  63918. reqHeaders := make(http.Header)
  63919. for k, v := range c.header_ {
  63920. reqHeaders[k] = v
  63921. }
  63922. reqHeaders.Set("User-Agent", c.s.userAgent())
  63923. var body io.Reader = nil
  63924. c.urlParams_.Set("alt", alt)
  63925. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setDiskAutoDelete")
  63926. urls += "?" + c.urlParams_.Encode()
  63927. req, _ := http.NewRequest("POST", urls, body)
  63928. req.Header = reqHeaders
  63929. googleapi.Expand(req.URL, map[string]string{
  63930. "project": c.project,
  63931. "zone": c.zone,
  63932. "instance": c.instance,
  63933. })
  63934. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  63935. }
  63936. // Do executes the "compute.instances.setDiskAutoDelete" call.
  63937. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  63938. // status code is an error. Response headers are in either
  63939. // *Operation.ServerResponse.Header or (if a response was returned at
  63940. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  63941. // to check whether the returned error was because
  63942. // http.StatusNotModified was returned.
  63943. func (c *InstancesSetDiskAutoDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  63944. gensupport.SetOptions(c.urlParams_, opts...)
  63945. res, err := c.doRequest("json")
  63946. if res != nil && res.StatusCode == http.StatusNotModified {
  63947. if res.Body != nil {
  63948. res.Body.Close()
  63949. }
  63950. return nil, &googleapi.Error{
  63951. Code: res.StatusCode,
  63952. Header: res.Header,
  63953. }
  63954. }
  63955. if err != nil {
  63956. return nil, err
  63957. }
  63958. defer googleapi.CloseBody(res)
  63959. if err := googleapi.CheckResponse(res); err != nil {
  63960. return nil, err
  63961. }
  63962. ret := &Operation{
  63963. ServerResponse: googleapi.ServerResponse{
  63964. Header: res.Header,
  63965. HTTPStatusCode: res.StatusCode,
  63966. },
  63967. }
  63968. target := &ret
  63969. if err := gensupport.DecodeResponse(target, res); err != nil {
  63970. return nil, err
  63971. }
  63972. return ret, nil
  63973. // {
  63974. // "description": "Sets the auto-delete flag for a disk attached to an instance.",
  63975. // "httpMethod": "POST",
  63976. // "id": "compute.instances.setDiskAutoDelete",
  63977. // "parameterOrder": [
  63978. // "project",
  63979. // "zone",
  63980. // "instance",
  63981. // "autoDelete",
  63982. // "deviceName"
  63983. // ],
  63984. // "parameters": {
  63985. // "autoDelete": {
  63986. // "description": "Whether to auto-delete the disk when the instance is deleted.",
  63987. // "location": "query",
  63988. // "required": true,
  63989. // "type": "boolean"
  63990. // },
  63991. // "deviceName": {
  63992. // "description": "The device name of the disk to modify.",
  63993. // "location": "query",
  63994. // "pattern": "\\w[\\w.-]{0,254}",
  63995. // "required": true,
  63996. // "type": "string"
  63997. // },
  63998. // "instance": {
  63999. // "description": "The instance name.",
  64000. // "location": "path",
  64001. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  64002. // "required": true,
  64003. // "type": "string"
  64004. // },
  64005. // "project": {
  64006. // "description": "Project ID for this request.",
  64007. // "location": "path",
  64008. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  64009. // "required": true,
  64010. // "type": "string"
  64011. // },
  64012. // "requestId": {
  64013. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  64014. // "location": "query",
  64015. // "type": "string"
  64016. // },
  64017. // "zone": {
  64018. // "description": "The name of the zone for this request.",
  64019. // "location": "path",
  64020. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  64021. // "required": true,
  64022. // "type": "string"
  64023. // }
  64024. // },
  64025. // "path": "{project}/zones/{zone}/instances/{instance}/setDiskAutoDelete",
  64026. // "response": {
  64027. // "$ref": "Operation"
  64028. // },
  64029. // "scopes": [
  64030. // "https://www.googleapis.com/auth/cloud-platform",
  64031. // "https://www.googleapis.com/auth/compute"
  64032. // ]
  64033. // }
  64034. }
  64035. // method id "compute.instances.setIamPolicy":
  64036. type InstancesSetIamPolicyCall struct {
  64037. s *Service
  64038. project string
  64039. zone string
  64040. resource string
  64041. zonesetpolicyrequest *ZoneSetPolicyRequest
  64042. urlParams_ gensupport.URLParams
  64043. ctx_ context.Context
  64044. header_ http.Header
  64045. }
  64046. // SetIamPolicy: Sets the access control policy on the specified
  64047. // resource. Replaces any existing policy.
  64048. func (r *InstancesService) SetIamPolicy(project string, zone string, resource string, zonesetpolicyrequest *ZoneSetPolicyRequest) *InstancesSetIamPolicyCall {
  64049. c := &InstancesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  64050. c.project = project
  64051. c.zone = zone
  64052. c.resource = resource
  64053. c.zonesetpolicyrequest = zonesetpolicyrequest
  64054. return c
  64055. }
  64056. // Fields allows partial responses to be retrieved. See
  64057. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  64058. // for more information.
  64059. func (c *InstancesSetIamPolicyCall) Fields(s ...googleapi.Field) *InstancesSetIamPolicyCall {
  64060. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  64061. return c
  64062. }
  64063. // Context sets the context to be used in this call's Do method. Any
  64064. // pending HTTP request will be aborted if the provided context is
  64065. // canceled.
  64066. func (c *InstancesSetIamPolicyCall) Context(ctx context.Context) *InstancesSetIamPolicyCall {
  64067. c.ctx_ = ctx
  64068. return c
  64069. }
  64070. // Header returns an http.Header that can be modified by the caller to
  64071. // add HTTP headers to the request.
  64072. func (c *InstancesSetIamPolicyCall) Header() http.Header {
  64073. if c.header_ == nil {
  64074. c.header_ = make(http.Header)
  64075. }
  64076. return c.header_
  64077. }
  64078. func (c *InstancesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  64079. reqHeaders := make(http.Header)
  64080. for k, v := range c.header_ {
  64081. reqHeaders[k] = v
  64082. }
  64083. reqHeaders.Set("User-Agent", c.s.userAgent())
  64084. var body io.Reader = nil
  64085. body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetpolicyrequest)
  64086. if err != nil {
  64087. return nil, err
  64088. }
  64089. reqHeaders.Set("Content-Type", "application/json")
  64090. c.urlParams_.Set("alt", alt)
  64091. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{resource}/setIamPolicy")
  64092. urls += "?" + c.urlParams_.Encode()
  64093. req, _ := http.NewRequest("POST", urls, body)
  64094. req.Header = reqHeaders
  64095. googleapi.Expand(req.URL, map[string]string{
  64096. "project": c.project,
  64097. "zone": c.zone,
  64098. "resource": c.resource,
  64099. })
  64100. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  64101. }
  64102. // Do executes the "compute.instances.setIamPolicy" call.
  64103. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  64104. // code is an error. Response headers are in either
  64105. // *Policy.ServerResponse.Header or (if a response was returned at all)
  64106. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  64107. // check whether the returned error was because http.StatusNotModified
  64108. // was returned.
  64109. func (c *InstancesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  64110. gensupport.SetOptions(c.urlParams_, opts...)
  64111. res, err := c.doRequest("json")
  64112. if res != nil && res.StatusCode == http.StatusNotModified {
  64113. if res.Body != nil {
  64114. res.Body.Close()
  64115. }
  64116. return nil, &googleapi.Error{
  64117. Code: res.StatusCode,
  64118. Header: res.Header,
  64119. }
  64120. }
  64121. if err != nil {
  64122. return nil, err
  64123. }
  64124. defer googleapi.CloseBody(res)
  64125. if err := googleapi.CheckResponse(res); err != nil {
  64126. return nil, err
  64127. }
  64128. ret := &Policy{
  64129. ServerResponse: googleapi.ServerResponse{
  64130. Header: res.Header,
  64131. HTTPStatusCode: res.StatusCode,
  64132. },
  64133. }
  64134. target := &ret
  64135. if err := gensupport.DecodeResponse(target, res); err != nil {
  64136. return nil, err
  64137. }
  64138. return ret, nil
  64139. // {
  64140. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  64141. // "httpMethod": "POST",
  64142. // "id": "compute.instances.setIamPolicy",
  64143. // "parameterOrder": [
  64144. // "project",
  64145. // "zone",
  64146. // "resource"
  64147. // ],
  64148. // "parameters": {
  64149. // "project": {
  64150. // "description": "Project ID for this request.",
  64151. // "location": "path",
  64152. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  64153. // "required": true,
  64154. // "type": "string"
  64155. // },
  64156. // "resource": {
  64157. // "description": "Name of the resource for this request.",
  64158. // "location": "path",
  64159. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  64160. // "required": true,
  64161. // "type": "string"
  64162. // },
  64163. // "zone": {
  64164. // "description": "The name of the zone for this request.",
  64165. // "location": "path",
  64166. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  64167. // "required": true,
  64168. // "type": "string"
  64169. // }
  64170. // },
  64171. // "path": "{project}/zones/{zone}/instances/{resource}/setIamPolicy",
  64172. // "request": {
  64173. // "$ref": "ZoneSetPolicyRequest"
  64174. // },
  64175. // "response": {
  64176. // "$ref": "Policy"
  64177. // },
  64178. // "scopes": [
  64179. // "https://www.googleapis.com/auth/cloud-platform",
  64180. // "https://www.googleapis.com/auth/compute"
  64181. // ]
  64182. // }
  64183. }
  64184. // method id "compute.instances.setLabels":
  64185. type InstancesSetLabelsCall struct {
  64186. s *Service
  64187. project string
  64188. zone string
  64189. instance string
  64190. instancessetlabelsrequest *InstancesSetLabelsRequest
  64191. urlParams_ gensupport.URLParams
  64192. ctx_ context.Context
  64193. header_ http.Header
  64194. }
  64195. // SetLabels: Sets labels on an instance. To learn more about labels,
  64196. // read the Labeling Resources documentation.
  64197. func (r *InstancesService) SetLabels(project string, zone string, instance string, instancessetlabelsrequest *InstancesSetLabelsRequest) *InstancesSetLabelsCall {
  64198. c := &InstancesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  64199. c.project = project
  64200. c.zone = zone
  64201. c.instance = instance
  64202. c.instancessetlabelsrequest = instancessetlabelsrequest
  64203. return c
  64204. }
  64205. // RequestId sets the optional parameter "requestId": An optional
  64206. // request ID to identify requests. Specify a unique request ID so that
  64207. // if you must retry your request, the server will know to ignore the
  64208. // request if it has already been completed.
  64209. //
  64210. // For example, consider a situation where you make an initial request
  64211. // and the request times out. If you make the request again with the
  64212. // same request ID, the server can check if original operation with the
  64213. // same request ID was received, and if so, will ignore the second
  64214. // request. This prevents clients from accidentally creating duplicate
  64215. // commitments.
  64216. //
  64217. // The request ID must be a valid UUID with the exception that zero UUID
  64218. // is not supported (00000000-0000-0000-0000-000000000000).
  64219. func (c *InstancesSetLabelsCall) RequestId(requestId string) *InstancesSetLabelsCall {
  64220. c.urlParams_.Set("requestId", requestId)
  64221. return c
  64222. }
  64223. // Fields allows partial responses to be retrieved. See
  64224. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  64225. // for more information.
  64226. func (c *InstancesSetLabelsCall) Fields(s ...googleapi.Field) *InstancesSetLabelsCall {
  64227. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  64228. return c
  64229. }
  64230. // Context sets the context to be used in this call's Do method. Any
  64231. // pending HTTP request will be aborted if the provided context is
  64232. // canceled.
  64233. func (c *InstancesSetLabelsCall) Context(ctx context.Context) *InstancesSetLabelsCall {
  64234. c.ctx_ = ctx
  64235. return c
  64236. }
  64237. // Header returns an http.Header that can be modified by the caller to
  64238. // add HTTP headers to the request.
  64239. func (c *InstancesSetLabelsCall) Header() http.Header {
  64240. if c.header_ == nil {
  64241. c.header_ = make(http.Header)
  64242. }
  64243. return c.header_
  64244. }
  64245. func (c *InstancesSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  64246. reqHeaders := make(http.Header)
  64247. for k, v := range c.header_ {
  64248. reqHeaders[k] = v
  64249. }
  64250. reqHeaders.Set("User-Agent", c.s.userAgent())
  64251. var body io.Reader = nil
  64252. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetlabelsrequest)
  64253. if err != nil {
  64254. return nil, err
  64255. }
  64256. reqHeaders.Set("Content-Type", "application/json")
  64257. c.urlParams_.Set("alt", alt)
  64258. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setLabels")
  64259. urls += "?" + c.urlParams_.Encode()
  64260. req, _ := http.NewRequest("POST", urls, body)
  64261. req.Header = reqHeaders
  64262. googleapi.Expand(req.URL, map[string]string{
  64263. "project": c.project,
  64264. "zone": c.zone,
  64265. "instance": c.instance,
  64266. })
  64267. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  64268. }
  64269. // Do executes the "compute.instances.setLabels" call.
  64270. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  64271. // status code is an error. Response headers are in either
  64272. // *Operation.ServerResponse.Header or (if a response was returned at
  64273. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  64274. // to check whether the returned error was because
  64275. // http.StatusNotModified was returned.
  64276. func (c *InstancesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  64277. gensupport.SetOptions(c.urlParams_, opts...)
  64278. res, err := c.doRequest("json")
  64279. if res != nil && res.StatusCode == http.StatusNotModified {
  64280. if res.Body != nil {
  64281. res.Body.Close()
  64282. }
  64283. return nil, &googleapi.Error{
  64284. Code: res.StatusCode,
  64285. Header: res.Header,
  64286. }
  64287. }
  64288. if err != nil {
  64289. return nil, err
  64290. }
  64291. defer googleapi.CloseBody(res)
  64292. if err := googleapi.CheckResponse(res); err != nil {
  64293. return nil, err
  64294. }
  64295. ret := &Operation{
  64296. ServerResponse: googleapi.ServerResponse{
  64297. Header: res.Header,
  64298. HTTPStatusCode: res.StatusCode,
  64299. },
  64300. }
  64301. target := &ret
  64302. if err := gensupport.DecodeResponse(target, res); err != nil {
  64303. return nil, err
  64304. }
  64305. return ret, nil
  64306. // {
  64307. // "description": "Sets labels on an instance. To learn more about labels, read the Labeling Resources documentation.",
  64308. // "httpMethod": "POST",
  64309. // "id": "compute.instances.setLabels",
  64310. // "parameterOrder": [
  64311. // "project",
  64312. // "zone",
  64313. // "instance"
  64314. // ],
  64315. // "parameters": {
  64316. // "instance": {
  64317. // "description": "Name of the instance scoping this request.",
  64318. // "location": "path",
  64319. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  64320. // "required": true,
  64321. // "type": "string"
  64322. // },
  64323. // "project": {
  64324. // "description": "Project ID for this request.",
  64325. // "location": "path",
  64326. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  64327. // "required": true,
  64328. // "type": "string"
  64329. // },
  64330. // "requestId": {
  64331. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  64332. // "location": "query",
  64333. // "type": "string"
  64334. // },
  64335. // "zone": {
  64336. // "description": "The name of the zone for this request.",
  64337. // "location": "path",
  64338. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  64339. // "required": true,
  64340. // "type": "string"
  64341. // }
  64342. // },
  64343. // "path": "{project}/zones/{zone}/instances/{instance}/setLabels",
  64344. // "request": {
  64345. // "$ref": "InstancesSetLabelsRequest"
  64346. // },
  64347. // "response": {
  64348. // "$ref": "Operation"
  64349. // },
  64350. // "scopes": [
  64351. // "https://www.googleapis.com/auth/cloud-platform",
  64352. // "https://www.googleapis.com/auth/compute"
  64353. // ]
  64354. // }
  64355. }
  64356. // method id "compute.instances.setMachineResources":
  64357. type InstancesSetMachineResourcesCall struct {
  64358. s *Service
  64359. project string
  64360. zone string
  64361. instance string
  64362. instancessetmachineresourcesrequest *InstancesSetMachineResourcesRequest
  64363. urlParams_ gensupport.URLParams
  64364. ctx_ context.Context
  64365. header_ http.Header
  64366. }
  64367. // SetMachineResources: Changes the number and/or type of accelerator
  64368. // for a stopped instance to the values specified in the request.
  64369. func (r *InstancesService) SetMachineResources(project string, zone string, instance string, instancessetmachineresourcesrequest *InstancesSetMachineResourcesRequest) *InstancesSetMachineResourcesCall {
  64370. c := &InstancesSetMachineResourcesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  64371. c.project = project
  64372. c.zone = zone
  64373. c.instance = instance
  64374. c.instancessetmachineresourcesrequest = instancessetmachineresourcesrequest
  64375. return c
  64376. }
  64377. // RequestId sets the optional parameter "requestId": An optional
  64378. // request ID to identify requests. Specify a unique request ID so that
  64379. // if you must retry your request, the server will know to ignore the
  64380. // request if it has already been completed.
  64381. //
  64382. // For example, consider a situation where you make an initial request
  64383. // and the request times out. If you make the request again with the
  64384. // same request ID, the server can check if original operation with the
  64385. // same request ID was received, and if so, will ignore the second
  64386. // request. This prevents clients from accidentally creating duplicate
  64387. // commitments.
  64388. //
  64389. // The request ID must be a valid UUID with the exception that zero UUID
  64390. // is not supported (00000000-0000-0000-0000-000000000000).
  64391. func (c *InstancesSetMachineResourcesCall) RequestId(requestId string) *InstancesSetMachineResourcesCall {
  64392. c.urlParams_.Set("requestId", requestId)
  64393. return c
  64394. }
  64395. // Fields allows partial responses to be retrieved. See
  64396. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  64397. // for more information.
  64398. func (c *InstancesSetMachineResourcesCall) Fields(s ...googleapi.Field) *InstancesSetMachineResourcesCall {
  64399. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  64400. return c
  64401. }
  64402. // Context sets the context to be used in this call's Do method. Any
  64403. // pending HTTP request will be aborted if the provided context is
  64404. // canceled.
  64405. func (c *InstancesSetMachineResourcesCall) Context(ctx context.Context) *InstancesSetMachineResourcesCall {
  64406. c.ctx_ = ctx
  64407. return c
  64408. }
  64409. // Header returns an http.Header that can be modified by the caller to
  64410. // add HTTP headers to the request.
  64411. func (c *InstancesSetMachineResourcesCall) Header() http.Header {
  64412. if c.header_ == nil {
  64413. c.header_ = make(http.Header)
  64414. }
  64415. return c.header_
  64416. }
  64417. func (c *InstancesSetMachineResourcesCall) doRequest(alt string) (*http.Response, error) {
  64418. reqHeaders := make(http.Header)
  64419. for k, v := range c.header_ {
  64420. reqHeaders[k] = v
  64421. }
  64422. reqHeaders.Set("User-Agent", c.s.userAgent())
  64423. var body io.Reader = nil
  64424. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetmachineresourcesrequest)
  64425. if err != nil {
  64426. return nil, err
  64427. }
  64428. reqHeaders.Set("Content-Type", "application/json")
  64429. c.urlParams_.Set("alt", alt)
  64430. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setMachineResources")
  64431. urls += "?" + c.urlParams_.Encode()
  64432. req, _ := http.NewRequest("POST", urls, body)
  64433. req.Header = reqHeaders
  64434. googleapi.Expand(req.URL, map[string]string{
  64435. "project": c.project,
  64436. "zone": c.zone,
  64437. "instance": c.instance,
  64438. })
  64439. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  64440. }
  64441. // Do executes the "compute.instances.setMachineResources" call.
  64442. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  64443. // status code is an error. Response headers are in either
  64444. // *Operation.ServerResponse.Header or (if a response was returned at
  64445. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  64446. // to check whether the returned error was because
  64447. // http.StatusNotModified was returned.
  64448. func (c *InstancesSetMachineResourcesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  64449. gensupport.SetOptions(c.urlParams_, opts...)
  64450. res, err := c.doRequest("json")
  64451. if res != nil && res.StatusCode == http.StatusNotModified {
  64452. if res.Body != nil {
  64453. res.Body.Close()
  64454. }
  64455. return nil, &googleapi.Error{
  64456. Code: res.StatusCode,
  64457. Header: res.Header,
  64458. }
  64459. }
  64460. if err != nil {
  64461. return nil, err
  64462. }
  64463. defer googleapi.CloseBody(res)
  64464. if err := googleapi.CheckResponse(res); err != nil {
  64465. return nil, err
  64466. }
  64467. ret := &Operation{
  64468. ServerResponse: googleapi.ServerResponse{
  64469. Header: res.Header,
  64470. HTTPStatusCode: res.StatusCode,
  64471. },
  64472. }
  64473. target := &ret
  64474. if err := gensupport.DecodeResponse(target, res); err != nil {
  64475. return nil, err
  64476. }
  64477. return ret, nil
  64478. // {
  64479. // "description": "Changes the number and/or type of accelerator for a stopped instance to the values specified in the request.",
  64480. // "httpMethod": "POST",
  64481. // "id": "compute.instances.setMachineResources",
  64482. // "parameterOrder": [
  64483. // "project",
  64484. // "zone",
  64485. // "instance"
  64486. // ],
  64487. // "parameters": {
  64488. // "instance": {
  64489. // "description": "Name of the instance scoping this request.",
  64490. // "location": "path",
  64491. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  64492. // "required": true,
  64493. // "type": "string"
  64494. // },
  64495. // "project": {
  64496. // "description": "Project ID for this request.",
  64497. // "location": "path",
  64498. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  64499. // "required": true,
  64500. // "type": "string"
  64501. // },
  64502. // "requestId": {
  64503. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  64504. // "location": "query",
  64505. // "type": "string"
  64506. // },
  64507. // "zone": {
  64508. // "description": "The name of the zone for this request.",
  64509. // "location": "path",
  64510. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  64511. // "required": true,
  64512. // "type": "string"
  64513. // }
  64514. // },
  64515. // "path": "{project}/zones/{zone}/instances/{instance}/setMachineResources",
  64516. // "request": {
  64517. // "$ref": "InstancesSetMachineResourcesRequest"
  64518. // },
  64519. // "response": {
  64520. // "$ref": "Operation"
  64521. // },
  64522. // "scopes": [
  64523. // "https://www.googleapis.com/auth/cloud-platform",
  64524. // "https://www.googleapis.com/auth/compute"
  64525. // ]
  64526. // }
  64527. }
  64528. // method id "compute.instances.setMachineType":
  64529. type InstancesSetMachineTypeCall struct {
  64530. s *Service
  64531. project string
  64532. zone string
  64533. instance string
  64534. instancessetmachinetyperequest *InstancesSetMachineTypeRequest
  64535. urlParams_ gensupport.URLParams
  64536. ctx_ context.Context
  64537. header_ http.Header
  64538. }
  64539. // SetMachineType: Changes the machine type for a stopped instance to
  64540. // the machine type specified in the request.
  64541. func (r *InstancesService) SetMachineType(project string, zone string, instance string, instancessetmachinetyperequest *InstancesSetMachineTypeRequest) *InstancesSetMachineTypeCall {
  64542. c := &InstancesSetMachineTypeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  64543. c.project = project
  64544. c.zone = zone
  64545. c.instance = instance
  64546. c.instancessetmachinetyperequest = instancessetmachinetyperequest
  64547. return c
  64548. }
  64549. // RequestId sets the optional parameter "requestId": An optional
  64550. // request ID to identify requests. Specify a unique request ID so that
  64551. // if you must retry your request, the server will know to ignore the
  64552. // request if it has already been completed.
  64553. //
  64554. // For example, consider a situation where you make an initial request
  64555. // and the request times out. If you make the request again with the
  64556. // same request ID, the server can check if original operation with the
  64557. // same request ID was received, and if so, will ignore the second
  64558. // request. This prevents clients from accidentally creating duplicate
  64559. // commitments.
  64560. //
  64561. // The request ID must be a valid UUID with the exception that zero UUID
  64562. // is not supported (00000000-0000-0000-0000-000000000000).
  64563. func (c *InstancesSetMachineTypeCall) RequestId(requestId string) *InstancesSetMachineTypeCall {
  64564. c.urlParams_.Set("requestId", requestId)
  64565. return c
  64566. }
  64567. // Fields allows partial responses to be retrieved. See
  64568. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  64569. // for more information.
  64570. func (c *InstancesSetMachineTypeCall) Fields(s ...googleapi.Field) *InstancesSetMachineTypeCall {
  64571. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  64572. return c
  64573. }
  64574. // Context sets the context to be used in this call's Do method. Any
  64575. // pending HTTP request will be aborted if the provided context is
  64576. // canceled.
  64577. func (c *InstancesSetMachineTypeCall) Context(ctx context.Context) *InstancesSetMachineTypeCall {
  64578. c.ctx_ = ctx
  64579. return c
  64580. }
  64581. // Header returns an http.Header that can be modified by the caller to
  64582. // add HTTP headers to the request.
  64583. func (c *InstancesSetMachineTypeCall) Header() http.Header {
  64584. if c.header_ == nil {
  64585. c.header_ = make(http.Header)
  64586. }
  64587. return c.header_
  64588. }
  64589. func (c *InstancesSetMachineTypeCall) doRequest(alt string) (*http.Response, error) {
  64590. reqHeaders := make(http.Header)
  64591. for k, v := range c.header_ {
  64592. reqHeaders[k] = v
  64593. }
  64594. reqHeaders.Set("User-Agent", c.s.userAgent())
  64595. var body io.Reader = nil
  64596. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetmachinetyperequest)
  64597. if err != nil {
  64598. return nil, err
  64599. }
  64600. reqHeaders.Set("Content-Type", "application/json")
  64601. c.urlParams_.Set("alt", alt)
  64602. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setMachineType")
  64603. urls += "?" + c.urlParams_.Encode()
  64604. req, _ := http.NewRequest("POST", urls, body)
  64605. req.Header = reqHeaders
  64606. googleapi.Expand(req.URL, map[string]string{
  64607. "project": c.project,
  64608. "zone": c.zone,
  64609. "instance": c.instance,
  64610. })
  64611. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  64612. }
  64613. // Do executes the "compute.instances.setMachineType" call.
  64614. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  64615. // status code is an error. Response headers are in either
  64616. // *Operation.ServerResponse.Header or (if a response was returned at
  64617. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  64618. // to check whether the returned error was because
  64619. // http.StatusNotModified was returned.
  64620. func (c *InstancesSetMachineTypeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  64621. gensupport.SetOptions(c.urlParams_, opts...)
  64622. res, err := c.doRequest("json")
  64623. if res != nil && res.StatusCode == http.StatusNotModified {
  64624. if res.Body != nil {
  64625. res.Body.Close()
  64626. }
  64627. return nil, &googleapi.Error{
  64628. Code: res.StatusCode,
  64629. Header: res.Header,
  64630. }
  64631. }
  64632. if err != nil {
  64633. return nil, err
  64634. }
  64635. defer googleapi.CloseBody(res)
  64636. if err := googleapi.CheckResponse(res); err != nil {
  64637. return nil, err
  64638. }
  64639. ret := &Operation{
  64640. ServerResponse: googleapi.ServerResponse{
  64641. Header: res.Header,
  64642. HTTPStatusCode: res.StatusCode,
  64643. },
  64644. }
  64645. target := &ret
  64646. if err := gensupport.DecodeResponse(target, res); err != nil {
  64647. return nil, err
  64648. }
  64649. return ret, nil
  64650. // {
  64651. // "description": "Changes the machine type for a stopped instance to the machine type specified in the request.",
  64652. // "httpMethod": "POST",
  64653. // "id": "compute.instances.setMachineType",
  64654. // "parameterOrder": [
  64655. // "project",
  64656. // "zone",
  64657. // "instance"
  64658. // ],
  64659. // "parameters": {
  64660. // "instance": {
  64661. // "description": "Name of the instance scoping this request.",
  64662. // "location": "path",
  64663. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  64664. // "required": true,
  64665. // "type": "string"
  64666. // },
  64667. // "project": {
  64668. // "description": "Project ID for this request.",
  64669. // "location": "path",
  64670. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  64671. // "required": true,
  64672. // "type": "string"
  64673. // },
  64674. // "requestId": {
  64675. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  64676. // "location": "query",
  64677. // "type": "string"
  64678. // },
  64679. // "zone": {
  64680. // "description": "The name of the zone for this request.",
  64681. // "location": "path",
  64682. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  64683. // "required": true,
  64684. // "type": "string"
  64685. // }
  64686. // },
  64687. // "path": "{project}/zones/{zone}/instances/{instance}/setMachineType",
  64688. // "request": {
  64689. // "$ref": "InstancesSetMachineTypeRequest"
  64690. // },
  64691. // "response": {
  64692. // "$ref": "Operation"
  64693. // },
  64694. // "scopes": [
  64695. // "https://www.googleapis.com/auth/cloud-platform",
  64696. // "https://www.googleapis.com/auth/compute"
  64697. // ]
  64698. // }
  64699. }
  64700. // method id "compute.instances.setMetadata":
  64701. type InstancesSetMetadataCall struct {
  64702. s *Service
  64703. project string
  64704. zone string
  64705. instance string
  64706. metadata *Metadata
  64707. urlParams_ gensupport.URLParams
  64708. ctx_ context.Context
  64709. header_ http.Header
  64710. }
  64711. // SetMetadata: Sets metadata for the specified instance to the data
  64712. // included in the request.
  64713. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/setMetadata
  64714. func (r *InstancesService) SetMetadata(project string, zone string, instance string, metadata *Metadata) *InstancesSetMetadataCall {
  64715. c := &InstancesSetMetadataCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  64716. c.project = project
  64717. c.zone = zone
  64718. c.instance = instance
  64719. c.metadata = metadata
  64720. return c
  64721. }
  64722. // RequestId sets the optional parameter "requestId": An optional
  64723. // request ID to identify requests. Specify a unique request ID so that
  64724. // if you must retry your request, the server will know to ignore the
  64725. // request if it has already been completed.
  64726. //
  64727. // For example, consider a situation where you make an initial request
  64728. // and the request times out. If you make the request again with the
  64729. // same request ID, the server can check if original operation with the
  64730. // same request ID was received, and if so, will ignore the second
  64731. // request. This prevents clients from accidentally creating duplicate
  64732. // commitments.
  64733. //
  64734. // The request ID must be a valid UUID with the exception that zero UUID
  64735. // is not supported (00000000-0000-0000-0000-000000000000).
  64736. func (c *InstancesSetMetadataCall) RequestId(requestId string) *InstancesSetMetadataCall {
  64737. c.urlParams_.Set("requestId", requestId)
  64738. return c
  64739. }
  64740. // Fields allows partial responses to be retrieved. See
  64741. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  64742. // for more information.
  64743. func (c *InstancesSetMetadataCall) Fields(s ...googleapi.Field) *InstancesSetMetadataCall {
  64744. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  64745. return c
  64746. }
  64747. // Context sets the context to be used in this call's Do method. Any
  64748. // pending HTTP request will be aborted if the provided context is
  64749. // canceled.
  64750. func (c *InstancesSetMetadataCall) Context(ctx context.Context) *InstancesSetMetadataCall {
  64751. c.ctx_ = ctx
  64752. return c
  64753. }
  64754. // Header returns an http.Header that can be modified by the caller to
  64755. // add HTTP headers to the request.
  64756. func (c *InstancesSetMetadataCall) Header() http.Header {
  64757. if c.header_ == nil {
  64758. c.header_ = make(http.Header)
  64759. }
  64760. return c.header_
  64761. }
  64762. func (c *InstancesSetMetadataCall) doRequest(alt string) (*http.Response, error) {
  64763. reqHeaders := make(http.Header)
  64764. for k, v := range c.header_ {
  64765. reqHeaders[k] = v
  64766. }
  64767. reqHeaders.Set("User-Agent", c.s.userAgent())
  64768. var body io.Reader = nil
  64769. body, err := googleapi.WithoutDataWrapper.JSONReader(c.metadata)
  64770. if err != nil {
  64771. return nil, err
  64772. }
  64773. reqHeaders.Set("Content-Type", "application/json")
  64774. c.urlParams_.Set("alt", alt)
  64775. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setMetadata")
  64776. urls += "?" + c.urlParams_.Encode()
  64777. req, _ := http.NewRequest("POST", urls, body)
  64778. req.Header = reqHeaders
  64779. googleapi.Expand(req.URL, map[string]string{
  64780. "project": c.project,
  64781. "zone": c.zone,
  64782. "instance": c.instance,
  64783. })
  64784. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  64785. }
  64786. // Do executes the "compute.instances.setMetadata" call.
  64787. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  64788. // status code is an error. Response headers are in either
  64789. // *Operation.ServerResponse.Header or (if a response was returned at
  64790. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  64791. // to check whether the returned error was because
  64792. // http.StatusNotModified was returned.
  64793. func (c *InstancesSetMetadataCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  64794. gensupport.SetOptions(c.urlParams_, opts...)
  64795. res, err := c.doRequest("json")
  64796. if res != nil && res.StatusCode == http.StatusNotModified {
  64797. if res.Body != nil {
  64798. res.Body.Close()
  64799. }
  64800. return nil, &googleapi.Error{
  64801. Code: res.StatusCode,
  64802. Header: res.Header,
  64803. }
  64804. }
  64805. if err != nil {
  64806. return nil, err
  64807. }
  64808. defer googleapi.CloseBody(res)
  64809. if err := googleapi.CheckResponse(res); err != nil {
  64810. return nil, err
  64811. }
  64812. ret := &Operation{
  64813. ServerResponse: googleapi.ServerResponse{
  64814. Header: res.Header,
  64815. HTTPStatusCode: res.StatusCode,
  64816. },
  64817. }
  64818. target := &ret
  64819. if err := gensupport.DecodeResponse(target, res); err != nil {
  64820. return nil, err
  64821. }
  64822. return ret, nil
  64823. // {
  64824. // "description": "Sets metadata for the specified instance to the data included in the request.",
  64825. // "httpMethod": "POST",
  64826. // "id": "compute.instances.setMetadata",
  64827. // "parameterOrder": [
  64828. // "project",
  64829. // "zone",
  64830. // "instance"
  64831. // ],
  64832. // "parameters": {
  64833. // "instance": {
  64834. // "description": "Name of the instance scoping this request.",
  64835. // "location": "path",
  64836. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  64837. // "required": true,
  64838. // "type": "string"
  64839. // },
  64840. // "project": {
  64841. // "description": "Project ID for this request.",
  64842. // "location": "path",
  64843. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  64844. // "required": true,
  64845. // "type": "string"
  64846. // },
  64847. // "requestId": {
  64848. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  64849. // "location": "query",
  64850. // "type": "string"
  64851. // },
  64852. // "zone": {
  64853. // "description": "The name of the zone for this request.",
  64854. // "location": "path",
  64855. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  64856. // "required": true,
  64857. // "type": "string"
  64858. // }
  64859. // },
  64860. // "path": "{project}/zones/{zone}/instances/{instance}/setMetadata",
  64861. // "request": {
  64862. // "$ref": "Metadata"
  64863. // },
  64864. // "response": {
  64865. // "$ref": "Operation"
  64866. // },
  64867. // "scopes": [
  64868. // "https://www.googleapis.com/auth/cloud-platform",
  64869. // "https://www.googleapis.com/auth/compute"
  64870. // ]
  64871. // }
  64872. }
  64873. // method id "compute.instances.setMinCpuPlatform":
  64874. type InstancesSetMinCpuPlatformCall struct {
  64875. s *Service
  64876. project string
  64877. zone string
  64878. instance string
  64879. instancessetmincpuplatformrequest *InstancesSetMinCpuPlatformRequest
  64880. urlParams_ gensupport.URLParams
  64881. ctx_ context.Context
  64882. header_ http.Header
  64883. }
  64884. // SetMinCpuPlatform: Changes the minimum CPU platform that this
  64885. // instance should use. This method can only be called on a stopped
  64886. // instance. For more information, read Specifying a Minimum CPU
  64887. // Platform.
  64888. func (r *InstancesService) SetMinCpuPlatform(project string, zone string, instance string, instancessetmincpuplatformrequest *InstancesSetMinCpuPlatformRequest) *InstancesSetMinCpuPlatformCall {
  64889. c := &InstancesSetMinCpuPlatformCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  64890. c.project = project
  64891. c.zone = zone
  64892. c.instance = instance
  64893. c.instancessetmincpuplatformrequest = instancessetmincpuplatformrequest
  64894. return c
  64895. }
  64896. // RequestId sets the optional parameter "requestId": An optional
  64897. // request ID to identify requests. Specify a unique request ID so that
  64898. // if you must retry your request, the server will know to ignore the
  64899. // request if it has already been completed.
  64900. //
  64901. // For example, consider a situation where you make an initial request
  64902. // and the request times out. If you make the request again with the
  64903. // same request ID, the server can check if original operation with the
  64904. // same request ID was received, and if so, will ignore the second
  64905. // request. This prevents clients from accidentally creating duplicate
  64906. // commitments.
  64907. //
  64908. // The request ID must be a valid UUID with the exception that zero UUID
  64909. // is not supported (00000000-0000-0000-0000-000000000000).
  64910. func (c *InstancesSetMinCpuPlatformCall) RequestId(requestId string) *InstancesSetMinCpuPlatformCall {
  64911. c.urlParams_.Set("requestId", requestId)
  64912. return c
  64913. }
  64914. // Fields allows partial responses to be retrieved. See
  64915. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  64916. // for more information.
  64917. func (c *InstancesSetMinCpuPlatformCall) Fields(s ...googleapi.Field) *InstancesSetMinCpuPlatformCall {
  64918. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  64919. return c
  64920. }
  64921. // Context sets the context to be used in this call's Do method. Any
  64922. // pending HTTP request will be aborted if the provided context is
  64923. // canceled.
  64924. func (c *InstancesSetMinCpuPlatformCall) Context(ctx context.Context) *InstancesSetMinCpuPlatformCall {
  64925. c.ctx_ = ctx
  64926. return c
  64927. }
  64928. // Header returns an http.Header that can be modified by the caller to
  64929. // add HTTP headers to the request.
  64930. func (c *InstancesSetMinCpuPlatformCall) Header() http.Header {
  64931. if c.header_ == nil {
  64932. c.header_ = make(http.Header)
  64933. }
  64934. return c.header_
  64935. }
  64936. func (c *InstancesSetMinCpuPlatformCall) doRequest(alt string) (*http.Response, error) {
  64937. reqHeaders := make(http.Header)
  64938. for k, v := range c.header_ {
  64939. reqHeaders[k] = v
  64940. }
  64941. reqHeaders.Set("User-Agent", c.s.userAgent())
  64942. var body io.Reader = nil
  64943. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetmincpuplatformrequest)
  64944. if err != nil {
  64945. return nil, err
  64946. }
  64947. reqHeaders.Set("Content-Type", "application/json")
  64948. c.urlParams_.Set("alt", alt)
  64949. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setMinCpuPlatform")
  64950. urls += "?" + c.urlParams_.Encode()
  64951. req, _ := http.NewRequest("POST", urls, body)
  64952. req.Header = reqHeaders
  64953. googleapi.Expand(req.URL, map[string]string{
  64954. "project": c.project,
  64955. "zone": c.zone,
  64956. "instance": c.instance,
  64957. })
  64958. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  64959. }
  64960. // Do executes the "compute.instances.setMinCpuPlatform" call.
  64961. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  64962. // status code is an error. Response headers are in either
  64963. // *Operation.ServerResponse.Header or (if a response was returned at
  64964. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  64965. // to check whether the returned error was because
  64966. // http.StatusNotModified was returned.
  64967. func (c *InstancesSetMinCpuPlatformCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  64968. gensupport.SetOptions(c.urlParams_, opts...)
  64969. res, err := c.doRequest("json")
  64970. if res != nil && res.StatusCode == http.StatusNotModified {
  64971. if res.Body != nil {
  64972. res.Body.Close()
  64973. }
  64974. return nil, &googleapi.Error{
  64975. Code: res.StatusCode,
  64976. Header: res.Header,
  64977. }
  64978. }
  64979. if err != nil {
  64980. return nil, err
  64981. }
  64982. defer googleapi.CloseBody(res)
  64983. if err := googleapi.CheckResponse(res); err != nil {
  64984. return nil, err
  64985. }
  64986. ret := &Operation{
  64987. ServerResponse: googleapi.ServerResponse{
  64988. Header: res.Header,
  64989. HTTPStatusCode: res.StatusCode,
  64990. },
  64991. }
  64992. target := &ret
  64993. if err := gensupport.DecodeResponse(target, res); err != nil {
  64994. return nil, err
  64995. }
  64996. return ret, nil
  64997. // {
  64998. // "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.",
  64999. // "httpMethod": "POST",
  65000. // "id": "compute.instances.setMinCpuPlatform",
  65001. // "parameterOrder": [
  65002. // "project",
  65003. // "zone",
  65004. // "instance"
  65005. // ],
  65006. // "parameters": {
  65007. // "instance": {
  65008. // "description": "Name of the instance scoping this request.",
  65009. // "location": "path",
  65010. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  65011. // "required": true,
  65012. // "type": "string"
  65013. // },
  65014. // "project": {
  65015. // "description": "Project ID for this request.",
  65016. // "location": "path",
  65017. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  65018. // "required": true,
  65019. // "type": "string"
  65020. // },
  65021. // "requestId": {
  65022. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  65023. // "location": "query",
  65024. // "type": "string"
  65025. // },
  65026. // "zone": {
  65027. // "description": "The name of the zone for this request.",
  65028. // "location": "path",
  65029. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  65030. // "required": true,
  65031. // "type": "string"
  65032. // }
  65033. // },
  65034. // "path": "{project}/zones/{zone}/instances/{instance}/setMinCpuPlatform",
  65035. // "request": {
  65036. // "$ref": "InstancesSetMinCpuPlatformRequest"
  65037. // },
  65038. // "response": {
  65039. // "$ref": "Operation"
  65040. // },
  65041. // "scopes": [
  65042. // "https://www.googleapis.com/auth/cloud-platform",
  65043. // "https://www.googleapis.com/auth/compute"
  65044. // ]
  65045. // }
  65046. }
  65047. // method id "compute.instances.setScheduling":
  65048. type InstancesSetSchedulingCall struct {
  65049. s *Service
  65050. project string
  65051. zone string
  65052. instance string
  65053. scheduling *Scheduling
  65054. urlParams_ gensupport.URLParams
  65055. ctx_ context.Context
  65056. header_ http.Header
  65057. }
  65058. // SetScheduling: Sets an instance's scheduling options.
  65059. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/setScheduling
  65060. func (r *InstancesService) SetScheduling(project string, zone string, instance string, scheduling *Scheduling) *InstancesSetSchedulingCall {
  65061. c := &InstancesSetSchedulingCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  65062. c.project = project
  65063. c.zone = zone
  65064. c.instance = instance
  65065. c.scheduling = scheduling
  65066. return c
  65067. }
  65068. // RequestId sets the optional parameter "requestId": An optional
  65069. // request ID to identify requests. Specify a unique request ID so that
  65070. // if you must retry your request, the server will know to ignore the
  65071. // request if it has already been completed.
  65072. //
  65073. // For example, consider a situation where you make an initial request
  65074. // and the request times out. If you make the request again with the
  65075. // same request ID, the server can check if original operation with the
  65076. // same request ID was received, and if so, will ignore the second
  65077. // request. This prevents clients from accidentally creating duplicate
  65078. // commitments.
  65079. //
  65080. // The request ID must be a valid UUID with the exception that zero UUID
  65081. // is not supported (00000000-0000-0000-0000-000000000000).
  65082. func (c *InstancesSetSchedulingCall) RequestId(requestId string) *InstancesSetSchedulingCall {
  65083. c.urlParams_.Set("requestId", requestId)
  65084. return c
  65085. }
  65086. // Fields allows partial responses to be retrieved. See
  65087. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  65088. // for more information.
  65089. func (c *InstancesSetSchedulingCall) Fields(s ...googleapi.Field) *InstancesSetSchedulingCall {
  65090. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  65091. return c
  65092. }
  65093. // Context sets the context to be used in this call's Do method. Any
  65094. // pending HTTP request will be aborted if the provided context is
  65095. // canceled.
  65096. func (c *InstancesSetSchedulingCall) Context(ctx context.Context) *InstancesSetSchedulingCall {
  65097. c.ctx_ = ctx
  65098. return c
  65099. }
  65100. // Header returns an http.Header that can be modified by the caller to
  65101. // add HTTP headers to the request.
  65102. func (c *InstancesSetSchedulingCall) Header() http.Header {
  65103. if c.header_ == nil {
  65104. c.header_ = make(http.Header)
  65105. }
  65106. return c.header_
  65107. }
  65108. func (c *InstancesSetSchedulingCall) doRequest(alt string) (*http.Response, error) {
  65109. reqHeaders := make(http.Header)
  65110. for k, v := range c.header_ {
  65111. reqHeaders[k] = v
  65112. }
  65113. reqHeaders.Set("User-Agent", c.s.userAgent())
  65114. var body io.Reader = nil
  65115. body, err := googleapi.WithoutDataWrapper.JSONReader(c.scheduling)
  65116. if err != nil {
  65117. return nil, err
  65118. }
  65119. reqHeaders.Set("Content-Type", "application/json")
  65120. c.urlParams_.Set("alt", alt)
  65121. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setScheduling")
  65122. urls += "?" + c.urlParams_.Encode()
  65123. req, _ := http.NewRequest("POST", urls, body)
  65124. req.Header = reqHeaders
  65125. googleapi.Expand(req.URL, map[string]string{
  65126. "project": c.project,
  65127. "zone": c.zone,
  65128. "instance": c.instance,
  65129. })
  65130. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  65131. }
  65132. // Do executes the "compute.instances.setScheduling" call.
  65133. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  65134. // status code is an error. Response headers are in either
  65135. // *Operation.ServerResponse.Header or (if a response was returned at
  65136. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  65137. // to check whether the returned error was because
  65138. // http.StatusNotModified was returned.
  65139. func (c *InstancesSetSchedulingCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  65140. gensupport.SetOptions(c.urlParams_, opts...)
  65141. res, err := c.doRequest("json")
  65142. if res != nil && res.StatusCode == http.StatusNotModified {
  65143. if res.Body != nil {
  65144. res.Body.Close()
  65145. }
  65146. return nil, &googleapi.Error{
  65147. Code: res.StatusCode,
  65148. Header: res.Header,
  65149. }
  65150. }
  65151. if err != nil {
  65152. return nil, err
  65153. }
  65154. defer googleapi.CloseBody(res)
  65155. if err := googleapi.CheckResponse(res); err != nil {
  65156. return nil, err
  65157. }
  65158. ret := &Operation{
  65159. ServerResponse: googleapi.ServerResponse{
  65160. Header: res.Header,
  65161. HTTPStatusCode: res.StatusCode,
  65162. },
  65163. }
  65164. target := &ret
  65165. if err := gensupport.DecodeResponse(target, res); err != nil {
  65166. return nil, err
  65167. }
  65168. return ret, nil
  65169. // {
  65170. // "description": "Sets an instance's scheduling options.",
  65171. // "httpMethod": "POST",
  65172. // "id": "compute.instances.setScheduling",
  65173. // "parameterOrder": [
  65174. // "project",
  65175. // "zone",
  65176. // "instance"
  65177. // ],
  65178. // "parameters": {
  65179. // "instance": {
  65180. // "description": "Instance name.",
  65181. // "location": "path",
  65182. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  65183. // "required": true,
  65184. // "type": "string"
  65185. // },
  65186. // "project": {
  65187. // "description": "Project ID for this request.",
  65188. // "location": "path",
  65189. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  65190. // "required": true,
  65191. // "type": "string"
  65192. // },
  65193. // "requestId": {
  65194. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  65195. // "location": "query",
  65196. // "type": "string"
  65197. // },
  65198. // "zone": {
  65199. // "description": "The name of the zone for this request.",
  65200. // "location": "path",
  65201. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  65202. // "required": true,
  65203. // "type": "string"
  65204. // }
  65205. // },
  65206. // "path": "{project}/zones/{zone}/instances/{instance}/setScheduling",
  65207. // "request": {
  65208. // "$ref": "Scheduling"
  65209. // },
  65210. // "response": {
  65211. // "$ref": "Operation"
  65212. // },
  65213. // "scopes": [
  65214. // "https://www.googleapis.com/auth/cloud-platform",
  65215. // "https://www.googleapis.com/auth/compute"
  65216. // ]
  65217. // }
  65218. }
  65219. // method id "compute.instances.setServiceAccount":
  65220. type InstancesSetServiceAccountCall struct {
  65221. s *Service
  65222. project string
  65223. zone string
  65224. instance string
  65225. instancessetserviceaccountrequest *InstancesSetServiceAccountRequest
  65226. urlParams_ gensupport.URLParams
  65227. ctx_ context.Context
  65228. header_ http.Header
  65229. }
  65230. // SetServiceAccount: Sets the service account on the instance. For more
  65231. // information, read Changing the service account and access scopes for
  65232. // an instance.
  65233. func (r *InstancesService) SetServiceAccount(project string, zone string, instance string, instancessetserviceaccountrequest *InstancesSetServiceAccountRequest) *InstancesSetServiceAccountCall {
  65234. c := &InstancesSetServiceAccountCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  65235. c.project = project
  65236. c.zone = zone
  65237. c.instance = instance
  65238. c.instancessetserviceaccountrequest = instancessetserviceaccountrequest
  65239. return c
  65240. }
  65241. // RequestId sets the optional parameter "requestId": An optional
  65242. // request ID to identify requests. Specify a unique request ID so that
  65243. // if you must retry your request, the server will know to ignore the
  65244. // request if it has already been completed.
  65245. //
  65246. // For example, consider a situation where you make an initial request
  65247. // and the request times out. If you make the request again with the
  65248. // same request ID, the server can check if original operation with the
  65249. // same request ID was received, and if so, will ignore the second
  65250. // request. This prevents clients from accidentally creating duplicate
  65251. // commitments.
  65252. //
  65253. // The request ID must be a valid UUID with the exception that zero UUID
  65254. // is not supported (00000000-0000-0000-0000-000000000000).
  65255. func (c *InstancesSetServiceAccountCall) RequestId(requestId string) *InstancesSetServiceAccountCall {
  65256. c.urlParams_.Set("requestId", requestId)
  65257. return c
  65258. }
  65259. // Fields allows partial responses to be retrieved. See
  65260. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  65261. // for more information.
  65262. func (c *InstancesSetServiceAccountCall) Fields(s ...googleapi.Field) *InstancesSetServiceAccountCall {
  65263. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  65264. return c
  65265. }
  65266. // Context sets the context to be used in this call's Do method. Any
  65267. // pending HTTP request will be aborted if the provided context is
  65268. // canceled.
  65269. func (c *InstancesSetServiceAccountCall) Context(ctx context.Context) *InstancesSetServiceAccountCall {
  65270. c.ctx_ = ctx
  65271. return c
  65272. }
  65273. // Header returns an http.Header that can be modified by the caller to
  65274. // add HTTP headers to the request.
  65275. func (c *InstancesSetServiceAccountCall) Header() http.Header {
  65276. if c.header_ == nil {
  65277. c.header_ = make(http.Header)
  65278. }
  65279. return c.header_
  65280. }
  65281. func (c *InstancesSetServiceAccountCall) doRequest(alt string) (*http.Response, error) {
  65282. reqHeaders := make(http.Header)
  65283. for k, v := range c.header_ {
  65284. reqHeaders[k] = v
  65285. }
  65286. reqHeaders.Set("User-Agent", c.s.userAgent())
  65287. var body io.Reader = nil
  65288. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetserviceaccountrequest)
  65289. if err != nil {
  65290. return nil, err
  65291. }
  65292. reqHeaders.Set("Content-Type", "application/json")
  65293. c.urlParams_.Set("alt", alt)
  65294. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setServiceAccount")
  65295. urls += "?" + c.urlParams_.Encode()
  65296. req, _ := http.NewRequest("POST", urls, body)
  65297. req.Header = reqHeaders
  65298. googleapi.Expand(req.URL, map[string]string{
  65299. "project": c.project,
  65300. "zone": c.zone,
  65301. "instance": c.instance,
  65302. })
  65303. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  65304. }
  65305. // Do executes the "compute.instances.setServiceAccount" call.
  65306. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  65307. // status code is an error. Response headers are in either
  65308. // *Operation.ServerResponse.Header or (if a response was returned at
  65309. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  65310. // to check whether the returned error was because
  65311. // http.StatusNotModified was returned.
  65312. func (c *InstancesSetServiceAccountCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  65313. gensupport.SetOptions(c.urlParams_, opts...)
  65314. res, err := c.doRequest("json")
  65315. if res != nil && res.StatusCode == http.StatusNotModified {
  65316. if res.Body != nil {
  65317. res.Body.Close()
  65318. }
  65319. return nil, &googleapi.Error{
  65320. Code: res.StatusCode,
  65321. Header: res.Header,
  65322. }
  65323. }
  65324. if err != nil {
  65325. return nil, err
  65326. }
  65327. defer googleapi.CloseBody(res)
  65328. if err := googleapi.CheckResponse(res); err != nil {
  65329. return nil, err
  65330. }
  65331. ret := &Operation{
  65332. ServerResponse: googleapi.ServerResponse{
  65333. Header: res.Header,
  65334. HTTPStatusCode: res.StatusCode,
  65335. },
  65336. }
  65337. target := &ret
  65338. if err := gensupport.DecodeResponse(target, res); err != nil {
  65339. return nil, err
  65340. }
  65341. return ret, nil
  65342. // {
  65343. // "description": "Sets the service account on the instance. For more information, read Changing the service account and access scopes for an instance.",
  65344. // "httpMethod": "POST",
  65345. // "id": "compute.instances.setServiceAccount",
  65346. // "parameterOrder": [
  65347. // "project",
  65348. // "zone",
  65349. // "instance"
  65350. // ],
  65351. // "parameters": {
  65352. // "instance": {
  65353. // "description": "Name of the instance resource to start.",
  65354. // "location": "path",
  65355. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  65356. // "required": true,
  65357. // "type": "string"
  65358. // },
  65359. // "project": {
  65360. // "description": "Project ID for this request.",
  65361. // "location": "path",
  65362. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  65363. // "required": true,
  65364. // "type": "string"
  65365. // },
  65366. // "requestId": {
  65367. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  65368. // "location": "query",
  65369. // "type": "string"
  65370. // },
  65371. // "zone": {
  65372. // "description": "The name of the zone for this request.",
  65373. // "location": "path",
  65374. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  65375. // "required": true,
  65376. // "type": "string"
  65377. // }
  65378. // },
  65379. // "path": "{project}/zones/{zone}/instances/{instance}/setServiceAccount",
  65380. // "request": {
  65381. // "$ref": "InstancesSetServiceAccountRequest"
  65382. // },
  65383. // "response": {
  65384. // "$ref": "Operation"
  65385. // },
  65386. // "scopes": [
  65387. // "https://www.googleapis.com/auth/cloud-platform",
  65388. // "https://www.googleapis.com/auth/compute"
  65389. // ]
  65390. // }
  65391. }
  65392. // method id "compute.instances.setShieldedVmIntegrityPolicy":
  65393. type InstancesSetShieldedVmIntegrityPolicyCall struct {
  65394. s *Service
  65395. project string
  65396. zone string
  65397. instance string
  65398. shieldedvmintegritypolicy *ShieldedVmIntegrityPolicy
  65399. urlParams_ gensupport.URLParams
  65400. ctx_ context.Context
  65401. header_ http.Header
  65402. }
  65403. // SetShieldedVmIntegrityPolicy: Sets the Shielded VM integrity policy
  65404. // for an instance. This method supports PATCH semantics and uses the
  65405. // JSON merge patch format and processing rules.
  65406. func (r *InstancesService) SetShieldedVmIntegrityPolicy(project string, zone string, instance string, shieldedvmintegritypolicy *ShieldedVmIntegrityPolicy) *InstancesSetShieldedVmIntegrityPolicyCall {
  65407. c := &InstancesSetShieldedVmIntegrityPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  65408. c.project = project
  65409. c.zone = zone
  65410. c.instance = instance
  65411. c.shieldedvmintegritypolicy = shieldedvmintegritypolicy
  65412. return c
  65413. }
  65414. // RequestId sets the optional parameter "requestId": An optional
  65415. // request ID to identify requests. Specify a unique request ID so that
  65416. // if you must retry your request, the server will know to ignore the
  65417. // request if it has already been completed.
  65418. //
  65419. // For example, consider a situation where you make an initial request
  65420. // and the request times out. If you make the request again with the
  65421. // same request ID, the server can check if original operation with the
  65422. // same request ID was received, and if so, will ignore the second
  65423. // request. This prevents clients from accidentally creating duplicate
  65424. // commitments.
  65425. //
  65426. // The request ID must be a valid UUID with the exception that zero UUID
  65427. // is not supported (00000000-0000-0000-0000-000000000000).
  65428. func (c *InstancesSetShieldedVmIntegrityPolicyCall) RequestId(requestId string) *InstancesSetShieldedVmIntegrityPolicyCall {
  65429. c.urlParams_.Set("requestId", requestId)
  65430. return c
  65431. }
  65432. // Fields allows partial responses to be retrieved. See
  65433. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  65434. // for more information.
  65435. func (c *InstancesSetShieldedVmIntegrityPolicyCall) Fields(s ...googleapi.Field) *InstancesSetShieldedVmIntegrityPolicyCall {
  65436. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  65437. return c
  65438. }
  65439. // Context sets the context to be used in this call's Do method. Any
  65440. // pending HTTP request will be aborted if the provided context is
  65441. // canceled.
  65442. func (c *InstancesSetShieldedVmIntegrityPolicyCall) Context(ctx context.Context) *InstancesSetShieldedVmIntegrityPolicyCall {
  65443. c.ctx_ = ctx
  65444. return c
  65445. }
  65446. // Header returns an http.Header that can be modified by the caller to
  65447. // add HTTP headers to the request.
  65448. func (c *InstancesSetShieldedVmIntegrityPolicyCall) Header() http.Header {
  65449. if c.header_ == nil {
  65450. c.header_ = make(http.Header)
  65451. }
  65452. return c.header_
  65453. }
  65454. func (c *InstancesSetShieldedVmIntegrityPolicyCall) doRequest(alt string) (*http.Response, error) {
  65455. reqHeaders := make(http.Header)
  65456. for k, v := range c.header_ {
  65457. reqHeaders[k] = v
  65458. }
  65459. reqHeaders.Set("User-Agent", c.s.userAgent())
  65460. var body io.Reader = nil
  65461. body, err := googleapi.WithoutDataWrapper.JSONReader(c.shieldedvmintegritypolicy)
  65462. if err != nil {
  65463. return nil, err
  65464. }
  65465. reqHeaders.Set("Content-Type", "application/json")
  65466. c.urlParams_.Set("alt", alt)
  65467. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setShieldedVmIntegrityPolicy")
  65468. urls += "?" + c.urlParams_.Encode()
  65469. req, _ := http.NewRequest("PATCH", urls, body)
  65470. req.Header = reqHeaders
  65471. googleapi.Expand(req.URL, map[string]string{
  65472. "project": c.project,
  65473. "zone": c.zone,
  65474. "instance": c.instance,
  65475. })
  65476. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  65477. }
  65478. // Do executes the "compute.instances.setShieldedVmIntegrityPolicy" call.
  65479. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  65480. // status code is an error. Response headers are in either
  65481. // *Operation.ServerResponse.Header or (if a response was returned at
  65482. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  65483. // to check whether the returned error was because
  65484. // http.StatusNotModified was returned.
  65485. func (c *InstancesSetShieldedVmIntegrityPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  65486. gensupport.SetOptions(c.urlParams_, opts...)
  65487. res, err := c.doRequest("json")
  65488. if res != nil && res.StatusCode == http.StatusNotModified {
  65489. if res.Body != nil {
  65490. res.Body.Close()
  65491. }
  65492. return nil, &googleapi.Error{
  65493. Code: res.StatusCode,
  65494. Header: res.Header,
  65495. }
  65496. }
  65497. if err != nil {
  65498. return nil, err
  65499. }
  65500. defer googleapi.CloseBody(res)
  65501. if err := googleapi.CheckResponse(res); err != nil {
  65502. return nil, err
  65503. }
  65504. ret := &Operation{
  65505. ServerResponse: googleapi.ServerResponse{
  65506. Header: res.Header,
  65507. HTTPStatusCode: res.StatusCode,
  65508. },
  65509. }
  65510. target := &ret
  65511. if err := gensupport.DecodeResponse(target, res); err != nil {
  65512. return nil, err
  65513. }
  65514. return ret, nil
  65515. // {
  65516. // "description": "Sets the Shielded VM integrity policy for an instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
  65517. // "httpMethod": "PATCH",
  65518. // "id": "compute.instances.setShieldedVmIntegrityPolicy",
  65519. // "parameterOrder": [
  65520. // "project",
  65521. // "zone",
  65522. // "instance"
  65523. // ],
  65524. // "parameters": {
  65525. // "instance": {
  65526. // "description": "Name of the instance scoping this request.",
  65527. // "location": "path",
  65528. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  65529. // "required": true,
  65530. // "type": "string"
  65531. // },
  65532. // "project": {
  65533. // "description": "Project ID for this request.",
  65534. // "location": "path",
  65535. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  65536. // "required": true,
  65537. // "type": "string"
  65538. // },
  65539. // "requestId": {
  65540. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  65541. // "location": "query",
  65542. // "type": "string"
  65543. // },
  65544. // "zone": {
  65545. // "description": "The name of the zone for this request.",
  65546. // "location": "path",
  65547. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  65548. // "required": true,
  65549. // "type": "string"
  65550. // }
  65551. // },
  65552. // "path": "{project}/zones/{zone}/instances/{instance}/setShieldedVmIntegrityPolicy",
  65553. // "request": {
  65554. // "$ref": "ShieldedVmIntegrityPolicy"
  65555. // },
  65556. // "response": {
  65557. // "$ref": "Operation"
  65558. // },
  65559. // "scopes": [
  65560. // "https://www.googleapis.com/auth/cloud-platform",
  65561. // "https://www.googleapis.com/auth/compute"
  65562. // ]
  65563. // }
  65564. }
  65565. // method id "compute.instances.setTags":
  65566. type InstancesSetTagsCall struct {
  65567. s *Service
  65568. project string
  65569. zone string
  65570. instance string
  65571. tags *Tags
  65572. urlParams_ gensupport.URLParams
  65573. ctx_ context.Context
  65574. header_ http.Header
  65575. }
  65576. // SetTags: Sets tags for the specified instance to the data included in
  65577. // the request.
  65578. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/setTags
  65579. func (r *InstancesService) SetTags(project string, zone string, instance string, tags *Tags) *InstancesSetTagsCall {
  65580. c := &InstancesSetTagsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  65581. c.project = project
  65582. c.zone = zone
  65583. c.instance = instance
  65584. c.tags = tags
  65585. return c
  65586. }
  65587. // RequestId sets the optional parameter "requestId": An optional
  65588. // request ID to identify requests. Specify a unique request ID so that
  65589. // if you must retry your request, the server will know to ignore the
  65590. // request if it has already been completed.
  65591. //
  65592. // For example, consider a situation where you make an initial request
  65593. // and the request times out. If you make the request again with the
  65594. // same request ID, the server can check if original operation with the
  65595. // same request ID was received, and if so, will ignore the second
  65596. // request. This prevents clients from accidentally creating duplicate
  65597. // commitments.
  65598. //
  65599. // The request ID must be a valid UUID with the exception that zero UUID
  65600. // is not supported (00000000-0000-0000-0000-000000000000).
  65601. func (c *InstancesSetTagsCall) RequestId(requestId string) *InstancesSetTagsCall {
  65602. c.urlParams_.Set("requestId", requestId)
  65603. return c
  65604. }
  65605. // Fields allows partial responses to be retrieved. See
  65606. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  65607. // for more information.
  65608. func (c *InstancesSetTagsCall) Fields(s ...googleapi.Field) *InstancesSetTagsCall {
  65609. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  65610. return c
  65611. }
  65612. // Context sets the context to be used in this call's Do method. Any
  65613. // pending HTTP request will be aborted if the provided context is
  65614. // canceled.
  65615. func (c *InstancesSetTagsCall) Context(ctx context.Context) *InstancesSetTagsCall {
  65616. c.ctx_ = ctx
  65617. return c
  65618. }
  65619. // Header returns an http.Header that can be modified by the caller to
  65620. // add HTTP headers to the request.
  65621. func (c *InstancesSetTagsCall) Header() http.Header {
  65622. if c.header_ == nil {
  65623. c.header_ = make(http.Header)
  65624. }
  65625. return c.header_
  65626. }
  65627. func (c *InstancesSetTagsCall) doRequest(alt string) (*http.Response, error) {
  65628. reqHeaders := make(http.Header)
  65629. for k, v := range c.header_ {
  65630. reqHeaders[k] = v
  65631. }
  65632. reqHeaders.Set("User-Agent", c.s.userAgent())
  65633. var body io.Reader = nil
  65634. body, err := googleapi.WithoutDataWrapper.JSONReader(c.tags)
  65635. if err != nil {
  65636. return nil, err
  65637. }
  65638. reqHeaders.Set("Content-Type", "application/json")
  65639. c.urlParams_.Set("alt", alt)
  65640. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setTags")
  65641. urls += "?" + c.urlParams_.Encode()
  65642. req, _ := http.NewRequest("POST", urls, body)
  65643. req.Header = reqHeaders
  65644. googleapi.Expand(req.URL, map[string]string{
  65645. "project": c.project,
  65646. "zone": c.zone,
  65647. "instance": c.instance,
  65648. })
  65649. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  65650. }
  65651. // Do executes the "compute.instances.setTags" call.
  65652. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  65653. // status code is an error. Response headers are in either
  65654. // *Operation.ServerResponse.Header or (if a response was returned at
  65655. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  65656. // to check whether the returned error was because
  65657. // http.StatusNotModified was returned.
  65658. func (c *InstancesSetTagsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  65659. gensupport.SetOptions(c.urlParams_, opts...)
  65660. res, err := c.doRequest("json")
  65661. if res != nil && res.StatusCode == http.StatusNotModified {
  65662. if res.Body != nil {
  65663. res.Body.Close()
  65664. }
  65665. return nil, &googleapi.Error{
  65666. Code: res.StatusCode,
  65667. Header: res.Header,
  65668. }
  65669. }
  65670. if err != nil {
  65671. return nil, err
  65672. }
  65673. defer googleapi.CloseBody(res)
  65674. if err := googleapi.CheckResponse(res); err != nil {
  65675. return nil, err
  65676. }
  65677. ret := &Operation{
  65678. ServerResponse: googleapi.ServerResponse{
  65679. Header: res.Header,
  65680. HTTPStatusCode: res.StatusCode,
  65681. },
  65682. }
  65683. target := &ret
  65684. if err := gensupport.DecodeResponse(target, res); err != nil {
  65685. return nil, err
  65686. }
  65687. return ret, nil
  65688. // {
  65689. // "description": "Sets tags for the specified instance to the data included in the request.",
  65690. // "httpMethod": "POST",
  65691. // "id": "compute.instances.setTags",
  65692. // "parameterOrder": [
  65693. // "project",
  65694. // "zone",
  65695. // "instance"
  65696. // ],
  65697. // "parameters": {
  65698. // "instance": {
  65699. // "description": "Name of the instance scoping this request.",
  65700. // "location": "path",
  65701. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  65702. // "required": true,
  65703. // "type": "string"
  65704. // },
  65705. // "project": {
  65706. // "description": "Project ID for this request.",
  65707. // "location": "path",
  65708. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  65709. // "required": true,
  65710. // "type": "string"
  65711. // },
  65712. // "requestId": {
  65713. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  65714. // "location": "query",
  65715. // "type": "string"
  65716. // },
  65717. // "zone": {
  65718. // "description": "The name of the zone for this request.",
  65719. // "location": "path",
  65720. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  65721. // "required": true,
  65722. // "type": "string"
  65723. // }
  65724. // },
  65725. // "path": "{project}/zones/{zone}/instances/{instance}/setTags",
  65726. // "request": {
  65727. // "$ref": "Tags"
  65728. // },
  65729. // "response": {
  65730. // "$ref": "Operation"
  65731. // },
  65732. // "scopes": [
  65733. // "https://www.googleapis.com/auth/cloud-platform",
  65734. // "https://www.googleapis.com/auth/compute"
  65735. // ]
  65736. // }
  65737. }
  65738. // method id "compute.instances.simulateMaintenanceEvent":
  65739. type InstancesSimulateMaintenanceEventCall struct {
  65740. s *Service
  65741. project string
  65742. zone string
  65743. instance string
  65744. urlParams_ gensupport.URLParams
  65745. ctx_ context.Context
  65746. header_ http.Header
  65747. }
  65748. // SimulateMaintenanceEvent: Simulates a maintenance event on the
  65749. // instance.
  65750. func (r *InstancesService) SimulateMaintenanceEvent(project string, zone string, instance string) *InstancesSimulateMaintenanceEventCall {
  65751. c := &InstancesSimulateMaintenanceEventCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  65752. c.project = project
  65753. c.zone = zone
  65754. c.instance = instance
  65755. return c
  65756. }
  65757. // Fields allows partial responses to be retrieved. See
  65758. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  65759. // for more information.
  65760. func (c *InstancesSimulateMaintenanceEventCall) Fields(s ...googleapi.Field) *InstancesSimulateMaintenanceEventCall {
  65761. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  65762. return c
  65763. }
  65764. // Context sets the context to be used in this call's Do method. Any
  65765. // pending HTTP request will be aborted if the provided context is
  65766. // canceled.
  65767. func (c *InstancesSimulateMaintenanceEventCall) Context(ctx context.Context) *InstancesSimulateMaintenanceEventCall {
  65768. c.ctx_ = ctx
  65769. return c
  65770. }
  65771. // Header returns an http.Header that can be modified by the caller to
  65772. // add HTTP headers to the request.
  65773. func (c *InstancesSimulateMaintenanceEventCall) Header() http.Header {
  65774. if c.header_ == nil {
  65775. c.header_ = make(http.Header)
  65776. }
  65777. return c.header_
  65778. }
  65779. func (c *InstancesSimulateMaintenanceEventCall) doRequest(alt string) (*http.Response, error) {
  65780. reqHeaders := make(http.Header)
  65781. for k, v := range c.header_ {
  65782. reqHeaders[k] = v
  65783. }
  65784. reqHeaders.Set("User-Agent", c.s.userAgent())
  65785. var body io.Reader = nil
  65786. c.urlParams_.Set("alt", alt)
  65787. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/simulateMaintenanceEvent")
  65788. urls += "?" + c.urlParams_.Encode()
  65789. req, _ := http.NewRequest("POST", urls, body)
  65790. req.Header = reqHeaders
  65791. googleapi.Expand(req.URL, map[string]string{
  65792. "project": c.project,
  65793. "zone": c.zone,
  65794. "instance": c.instance,
  65795. })
  65796. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  65797. }
  65798. // Do executes the "compute.instances.simulateMaintenanceEvent" call.
  65799. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  65800. // status code is an error. Response headers are in either
  65801. // *Operation.ServerResponse.Header or (if a response was returned at
  65802. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  65803. // to check whether the returned error was because
  65804. // http.StatusNotModified was returned.
  65805. func (c *InstancesSimulateMaintenanceEventCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  65806. gensupport.SetOptions(c.urlParams_, opts...)
  65807. res, err := c.doRequest("json")
  65808. if res != nil && res.StatusCode == http.StatusNotModified {
  65809. if res.Body != nil {
  65810. res.Body.Close()
  65811. }
  65812. return nil, &googleapi.Error{
  65813. Code: res.StatusCode,
  65814. Header: res.Header,
  65815. }
  65816. }
  65817. if err != nil {
  65818. return nil, err
  65819. }
  65820. defer googleapi.CloseBody(res)
  65821. if err := googleapi.CheckResponse(res); err != nil {
  65822. return nil, err
  65823. }
  65824. ret := &Operation{
  65825. ServerResponse: googleapi.ServerResponse{
  65826. Header: res.Header,
  65827. HTTPStatusCode: res.StatusCode,
  65828. },
  65829. }
  65830. target := &ret
  65831. if err := gensupport.DecodeResponse(target, res); err != nil {
  65832. return nil, err
  65833. }
  65834. return ret, nil
  65835. // {
  65836. // "description": "Simulates a maintenance event on the instance.",
  65837. // "httpMethod": "POST",
  65838. // "id": "compute.instances.simulateMaintenanceEvent",
  65839. // "parameterOrder": [
  65840. // "project",
  65841. // "zone",
  65842. // "instance"
  65843. // ],
  65844. // "parameters": {
  65845. // "instance": {
  65846. // "description": "Name of the instance scoping this request.",
  65847. // "location": "path",
  65848. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  65849. // "required": true,
  65850. // "type": "string"
  65851. // },
  65852. // "project": {
  65853. // "description": "Project ID for this request.",
  65854. // "location": "path",
  65855. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  65856. // "required": true,
  65857. // "type": "string"
  65858. // },
  65859. // "zone": {
  65860. // "description": "The name of the zone for this request.",
  65861. // "location": "path",
  65862. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  65863. // "required": true,
  65864. // "type": "string"
  65865. // }
  65866. // },
  65867. // "path": "{project}/zones/{zone}/instances/{instance}/simulateMaintenanceEvent",
  65868. // "response": {
  65869. // "$ref": "Operation"
  65870. // },
  65871. // "scopes": [
  65872. // "https://www.googleapis.com/auth/cloud-platform",
  65873. // "https://www.googleapis.com/auth/compute"
  65874. // ]
  65875. // }
  65876. }
  65877. // method id "compute.instances.start":
  65878. type InstancesStartCall struct {
  65879. s *Service
  65880. project string
  65881. zone string
  65882. instance string
  65883. urlParams_ gensupport.URLParams
  65884. ctx_ context.Context
  65885. header_ http.Header
  65886. }
  65887. // Start: Starts an instance that was stopped using the instances().stop
  65888. // method. For more information, see Restart an instance.
  65889. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/start
  65890. func (r *InstancesService) Start(project string, zone string, instance string) *InstancesStartCall {
  65891. c := &InstancesStartCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  65892. c.project = project
  65893. c.zone = zone
  65894. c.instance = instance
  65895. return c
  65896. }
  65897. // RequestId sets the optional parameter "requestId": An optional
  65898. // request ID to identify requests. Specify a unique request ID so that
  65899. // if you must retry your request, the server will know to ignore the
  65900. // request if it has already been completed.
  65901. //
  65902. // For example, consider a situation where you make an initial request
  65903. // and the request times out. If you make the request again with the
  65904. // same request ID, the server can check if original operation with the
  65905. // same request ID was received, and if so, will ignore the second
  65906. // request. This prevents clients from accidentally creating duplicate
  65907. // commitments.
  65908. //
  65909. // The request ID must be a valid UUID with the exception that zero UUID
  65910. // is not supported (00000000-0000-0000-0000-000000000000).
  65911. func (c *InstancesStartCall) RequestId(requestId string) *InstancesStartCall {
  65912. c.urlParams_.Set("requestId", requestId)
  65913. return c
  65914. }
  65915. // Fields allows partial responses to be retrieved. See
  65916. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  65917. // for more information.
  65918. func (c *InstancesStartCall) Fields(s ...googleapi.Field) *InstancesStartCall {
  65919. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  65920. return c
  65921. }
  65922. // Context sets the context to be used in this call's Do method. Any
  65923. // pending HTTP request will be aborted if the provided context is
  65924. // canceled.
  65925. func (c *InstancesStartCall) Context(ctx context.Context) *InstancesStartCall {
  65926. c.ctx_ = ctx
  65927. return c
  65928. }
  65929. // Header returns an http.Header that can be modified by the caller to
  65930. // add HTTP headers to the request.
  65931. func (c *InstancesStartCall) Header() http.Header {
  65932. if c.header_ == nil {
  65933. c.header_ = make(http.Header)
  65934. }
  65935. return c.header_
  65936. }
  65937. func (c *InstancesStartCall) doRequest(alt string) (*http.Response, error) {
  65938. reqHeaders := make(http.Header)
  65939. for k, v := range c.header_ {
  65940. reqHeaders[k] = v
  65941. }
  65942. reqHeaders.Set("User-Agent", c.s.userAgent())
  65943. var body io.Reader = nil
  65944. c.urlParams_.Set("alt", alt)
  65945. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/start")
  65946. urls += "?" + c.urlParams_.Encode()
  65947. req, _ := http.NewRequest("POST", urls, body)
  65948. req.Header = reqHeaders
  65949. googleapi.Expand(req.URL, map[string]string{
  65950. "project": c.project,
  65951. "zone": c.zone,
  65952. "instance": c.instance,
  65953. })
  65954. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  65955. }
  65956. // Do executes the "compute.instances.start" call.
  65957. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  65958. // status code is an error. Response headers are in either
  65959. // *Operation.ServerResponse.Header or (if a response was returned at
  65960. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  65961. // to check whether the returned error was because
  65962. // http.StatusNotModified was returned.
  65963. func (c *InstancesStartCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  65964. gensupport.SetOptions(c.urlParams_, opts...)
  65965. res, err := c.doRequest("json")
  65966. if res != nil && res.StatusCode == http.StatusNotModified {
  65967. if res.Body != nil {
  65968. res.Body.Close()
  65969. }
  65970. return nil, &googleapi.Error{
  65971. Code: res.StatusCode,
  65972. Header: res.Header,
  65973. }
  65974. }
  65975. if err != nil {
  65976. return nil, err
  65977. }
  65978. defer googleapi.CloseBody(res)
  65979. if err := googleapi.CheckResponse(res); err != nil {
  65980. return nil, err
  65981. }
  65982. ret := &Operation{
  65983. ServerResponse: googleapi.ServerResponse{
  65984. Header: res.Header,
  65985. HTTPStatusCode: res.StatusCode,
  65986. },
  65987. }
  65988. target := &ret
  65989. if err := gensupport.DecodeResponse(target, res); err != nil {
  65990. return nil, err
  65991. }
  65992. return ret, nil
  65993. // {
  65994. // "description": "Starts an instance that was stopped using the instances().stop method. For more information, see Restart an instance.",
  65995. // "httpMethod": "POST",
  65996. // "id": "compute.instances.start",
  65997. // "parameterOrder": [
  65998. // "project",
  65999. // "zone",
  66000. // "instance"
  66001. // ],
  66002. // "parameters": {
  66003. // "instance": {
  66004. // "description": "Name of the instance resource to start.",
  66005. // "location": "path",
  66006. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  66007. // "required": true,
  66008. // "type": "string"
  66009. // },
  66010. // "project": {
  66011. // "description": "Project ID for this request.",
  66012. // "location": "path",
  66013. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  66014. // "required": true,
  66015. // "type": "string"
  66016. // },
  66017. // "requestId": {
  66018. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  66019. // "location": "query",
  66020. // "type": "string"
  66021. // },
  66022. // "zone": {
  66023. // "description": "The name of the zone for this request.",
  66024. // "location": "path",
  66025. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  66026. // "required": true,
  66027. // "type": "string"
  66028. // }
  66029. // },
  66030. // "path": "{project}/zones/{zone}/instances/{instance}/start",
  66031. // "response": {
  66032. // "$ref": "Operation"
  66033. // },
  66034. // "scopes": [
  66035. // "https://www.googleapis.com/auth/cloud-platform",
  66036. // "https://www.googleapis.com/auth/compute"
  66037. // ]
  66038. // }
  66039. }
  66040. // method id "compute.instances.startWithEncryptionKey":
  66041. type InstancesStartWithEncryptionKeyCall struct {
  66042. s *Service
  66043. project string
  66044. zone string
  66045. instance string
  66046. instancesstartwithencryptionkeyrequest *InstancesStartWithEncryptionKeyRequest
  66047. urlParams_ gensupport.URLParams
  66048. ctx_ context.Context
  66049. header_ http.Header
  66050. }
  66051. // StartWithEncryptionKey: Starts an instance that was stopped using the
  66052. // instances().stop method. For more information, see Restart an
  66053. // instance.
  66054. func (r *InstancesService) StartWithEncryptionKey(project string, zone string, instance string, instancesstartwithencryptionkeyrequest *InstancesStartWithEncryptionKeyRequest) *InstancesStartWithEncryptionKeyCall {
  66055. c := &InstancesStartWithEncryptionKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  66056. c.project = project
  66057. c.zone = zone
  66058. c.instance = instance
  66059. c.instancesstartwithencryptionkeyrequest = instancesstartwithencryptionkeyrequest
  66060. return c
  66061. }
  66062. // RequestId sets the optional parameter "requestId": An optional
  66063. // request ID to identify requests. Specify a unique request ID so that
  66064. // if you must retry your request, the server will know to ignore the
  66065. // request if it has already been completed.
  66066. //
  66067. // For example, consider a situation where you make an initial request
  66068. // and the request times out. If you make the request again with the
  66069. // same request ID, the server can check if original operation with the
  66070. // same request ID was received, and if so, will ignore the second
  66071. // request. This prevents clients from accidentally creating duplicate
  66072. // commitments.
  66073. //
  66074. // The request ID must be a valid UUID with the exception that zero UUID
  66075. // is not supported (00000000-0000-0000-0000-000000000000).
  66076. func (c *InstancesStartWithEncryptionKeyCall) RequestId(requestId string) *InstancesStartWithEncryptionKeyCall {
  66077. c.urlParams_.Set("requestId", requestId)
  66078. return c
  66079. }
  66080. // Fields allows partial responses to be retrieved. See
  66081. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  66082. // for more information.
  66083. func (c *InstancesStartWithEncryptionKeyCall) Fields(s ...googleapi.Field) *InstancesStartWithEncryptionKeyCall {
  66084. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  66085. return c
  66086. }
  66087. // Context sets the context to be used in this call's Do method. Any
  66088. // pending HTTP request will be aborted if the provided context is
  66089. // canceled.
  66090. func (c *InstancesStartWithEncryptionKeyCall) Context(ctx context.Context) *InstancesStartWithEncryptionKeyCall {
  66091. c.ctx_ = ctx
  66092. return c
  66093. }
  66094. // Header returns an http.Header that can be modified by the caller to
  66095. // add HTTP headers to the request.
  66096. func (c *InstancesStartWithEncryptionKeyCall) Header() http.Header {
  66097. if c.header_ == nil {
  66098. c.header_ = make(http.Header)
  66099. }
  66100. return c.header_
  66101. }
  66102. func (c *InstancesStartWithEncryptionKeyCall) doRequest(alt string) (*http.Response, error) {
  66103. reqHeaders := make(http.Header)
  66104. for k, v := range c.header_ {
  66105. reqHeaders[k] = v
  66106. }
  66107. reqHeaders.Set("User-Agent", c.s.userAgent())
  66108. var body io.Reader = nil
  66109. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesstartwithencryptionkeyrequest)
  66110. if err != nil {
  66111. return nil, err
  66112. }
  66113. reqHeaders.Set("Content-Type", "application/json")
  66114. c.urlParams_.Set("alt", alt)
  66115. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/startWithEncryptionKey")
  66116. urls += "?" + c.urlParams_.Encode()
  66117. req, _ := http.NewRequest("POST", urls, body)
  66118. req.Header = reqHeaders
  66119. googleapi.Expand(req.URL, map[string]string{
  66120. "project": c.project,
  66121. "zone": c.zone,
  66122. "instance": c.instance,
  66123. })
  66124. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  66125. }
  66126. // Do executes the "compute.instances.startWithEncryptionKey" call.
  66127. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  66128. // status code is an error. Response headers are in either
  66129. // *Operation.ServerResponse.Header or (if a response was returned at
  66130. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  66131. // to check whether the returned error was because
  66132. // http.StatusNotModified was returned.
  66133. func (c *InstancesStartWithEncryptionKeyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  66134. gensupport.SetOptions(c.urlParams_, opts...)
  66135. res, err := c.doRequest("json")
  66136. if res != nil && res.StatusCode == http.StatusNotModified {
  66137. if res.Body != nil {
  66138. res.Body.Close()
  66139. }
  66140. return nil, &googleapi.Error{
  66141. Code: res.StatusCode,
  66142. Header: res.Header,
  66143. }
  66144. }
  66145. if err != nil {
  66146. return nil, err
  66147. }
  66148. defer googleapi.CloseBody(res)
  66149. if err := googleapi.CheckResponse(res); err != nil {
  66150. return nil, err
  66151. }
  66152. ret := &Operation{
  66153. ServerResponse: googleapi.ServerResponse{
  66154. Header: res.Header,
  66155. HTTPStatusCode: res.StatusCode,
  66156. },
  66157. }
  66158. target := &ret
  66159. if err := gensupport.DecodeResponse(target, res); err != nil {
  66160. return nil, err
  66161. }
  66162. return ret, nil
  66163. // {
  66164. // "description": "Starts an instance that was stopped using the instances().stop method. For more information, see Restart an instance.",
  66165. // "httpMethod": "POST",
  66166. // "id": "compute.instances.startWithEncryptionKey",
  66167. // "parameterOrder": [
  66168. // "project",
  66169. // "zone",
  66170. // "instance"
  66171. // ],
  66172. // "parameters": {
  66173. // "instance": {
  66174. // "description": "Name of the instance resource to start.",
  66175. // "location": "path",
  66176. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  66177. // "required": true,
  66178. // "type": "string"
  66179. // },
  66180. // "project": {
  66181. // "description": "Project ID for this request.",
  66182. // "location": "path",
  66183. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  66184. // "required": true,
  66185. // "type": "string"
  66186. // },
  66187. // "requestId": {
  66188. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  66189. // "location": "query",
  66190. // "type": "string"
  66191. // },
  66192. // "zone": {
  66193. // "description": "The name of the zone for this request.",
  66194. // "location": "path",
  66195. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  66196. // "required": true,
  66197. // "type": "string"
  66198. // }
  66199. // },
  66200. // "path": "{project}/zones/{zone}/instances/{instance}/startWithEncryptionKey",
  66201. // "request": {
  66202. // "$ref": "InstancesStartWithEncryptionKeyRequest"
  66203. // },
  66204. // "response": {
  66205. // "$ref": "Operation"
  66206. // },
  66207. // "scopes": [
  66208. // "https://www.googleapis.com/auth/cloud-platform",
  66209. // "https://www.googleapis.com/auth/compute"
  66210. // ]
  66211. // }
  66212. }
  66213. // method id "compute.instances.stop":
  66214. type InstancesStopCall struct {
  66215. s *Service
  66216. project string
  66217. zone string
  66218. instance string
  66219. urlParams_ gensupport.URLParams
  66220. ctx_ context.Context
  66221. header_ http.Header
  66222. }
  66223. // Stop: Stops a running instance, shutting it down cleanly, and allows
  66224. // you to restart the instance at a later time. Stopped instances do not
  66225. // incur VM usage charges while they are stopped. However, resources
  66226. // that the VM is using, such as persistent disks and static IP
  66227. // addresses, will continue to be charged until they are deleted. For
  66228. // more information, see Stopping an instance.
  66229. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/stop
  66230. func (r *InstancesService) Stop(project string, zone string, instance string) *InstancesStopCall {
  66231. c := &InstancesStopCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  66232. c.project = project
  66233. c.zone = zone
  66234. c.instance = instance
  66235. return c
  66236. }
  66237. // DiscardLocalSsd sets the optional parameter "discardLocalSsd": If
  66238. // true, discard the contents of any attached localSSD partitions.
  66239. // Default value is false (== preserve localSSD data).
  66240. func (c *InstancesStopCall) DiscardLocalSsd(discardLocalSsd bool) *InstancesStopCall {
  66241. c.urlParams_.Set("discardLocalSsd", fmt.Sprint(discardLocalSsd))
  66242. return c
  66243. }
  66244. // RequestId sets the optional parameter "requestId": An optional
  66245. // request ID to identify requests. Specify a unique request ID so that
  66246. // if you must retry your request, the server will know to ignore the
  66247. // request if it has already been completed.
  66248. //
  66249. // For example, consider a situation where you make an initial request
  66250. // and the request times out. If you make the request again with the
  66251. // same request ID, the server can check if original operation with the
  66252. // same request ID was received, and if so, will ignore the second
  66253. // request. This prevents clients from accidentally creating duplicate
  66254. // commitments.
  66255. //
  66256. // The request ID must be a valid UUID with the exception that zero UUID
  66257. // is not supported (00000000-0000-0000-0000-000000000000).
  66258. func (c *InstancesStopCall) RequestId(requestId string) *InstancesStopCall {
  66259. c.urlParams_.Set("requestId", requestId)
  66260. return c
  66261. }
  66262. // Fields allows partial responses to be retrieved. See
  66263. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  66264. // for more information.
  66265. func (c *InstancesStopCall) Fields(s ...googleapi.Field) *InstancesStopCall {
  66266. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  66267. return c
  66268. }
  66269. // Context sets the context to be used in this call's Do method. Any
  66270. // pending HTTP request will be aborted if the provided context is
  66271. // canceled.
  66272. func (c *InstancesStopCall) Context(ctx context.Context) *InstancesStopCall {
  66273. c.ctx_ = ctx
  66274. return c
  66275. }
  66276. // Header returns an http.Header that can be modified by the caller to
  66277. // add HTTP headers to the request.
  66278. func (c *InstancesStopCall) Header() http.Header {
  66279. if c.header_ == nil {
  66280. c.header_ = make(http.Header)
  66281. }
  66282. return c.header_
  66283. }
  66284. func (c *InstancesStopCall) doRequest(alt string) (*http.Response, error) {
  66285. reqHeaders := make(http.Header)
  66286. for k, v := range c.header_ {
  66287. reqHeaders[k] = v
  66288. }
  66289. reqHeaders.Set("User-Agent", c.s.userAgent())
  66290. var body io.Reader = nil
  66291. c.urlParams_.Set("alt", alt)
  66292. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/stop")
  66293. urls += "?" + c.urlParams_.Encode()
  66294. req, _ := http.NewRequest("POST", urls, body)
  66295. req.Header = reqHeaders
  66296. googleapi.Expand(req.URL, map[string]string{
  66297. "project": c.project,
  66298. "zone": c.zone,
  66299. "instance": c.instance,
  66300. })
  66301. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  66302. }
  66303. // Do executes the "compute.instances.stop" call.
  66304. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  66305. // status code is an error. Response headers are in either
  66306. // *Operation.ServerResponse.Header or (if a response was returned at
  66307. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  66308. // to check whether the returned error was because
  66309. // http.StatusNotModified was returned.
  66310. func (c *InstancesStopCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  66311. gensupport.SetOptions(c.urlParams_, opts...)
  66312. res, err := c.doRequest("json")
  66313. if res != nil && res.StatusCode == http.StatusNotModified {
  66314. if res.Body != nil {
  66315. res.Body.Close()
  66316. }
  66317. return nil, &googleapi.Error{
  66318. Code: res.StatusCode,
  66319. Header: res.Header,
  66320. }
  66321. }
  66322. if err != nil {
  66323. return nil, err
  66324. }
  66325. defer googleapi.CloseBody(res)
  66326. if err := googleapi.CheckResponse(res); err != nil {
  66327. return nil, err
  66328. }
  66329. ret := &Operation{
  66330. ServerResponse: googleapi.ServerResponse{
  66331. Header: res.Header,
  66332. HTTPStatusCode: res.StatusCode,
  66333. },
  66334. }
  66335. target := &ret
  66336. if err := gensupport.DecodeResponse(target, res); err != nil {
  66337. return nil, err
  66338. }
  66339. return ret, nil
  66340. // {
  66341. // "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.",
  66342. // "httpMethod": "POST",
  66343. // "id": "compute.instances.stop",
  66344. // "parameterOrder": [
  66345. // "project",
  66346. // "zone",
  66347. // "instance"
  66348. // ],
  66349. // "parameters": {
  66350. // "discardLocalSsd": {
  66351. // "description": "If true, discard the contents of any attached localSSD partitions. Default value is false (== preserve localSSD data).",
  66352. // "location": "query",
  66353. // "type": "boolean"
  66354. // },
  66355. // "instance": {
  66356. // "description": "Name of the instance resource to stop.",
  66357. // "location": "path",
  66358. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  66359. // "required": true,
  66360. // "type": "string"
  66361. // },
  66362. // "project": {
  66363. // "description": "Project ID for this request.",
  66364. // "location": "path",
  66365. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  66366. // "required": true,
  66367. // "type": "string"
  66368. // },
  66369. // "requestId": {
  66370. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  66371. // "location": "query",
  66372. // "type": "string"
  66373. // },
  66374. // "zone": {
  66375. // "description": "The name of the zone for this request.",
  66376. // "location": "path",
  66377. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  66378. // "required": true,
  66379. // "type": "string"
  66380. // }
  66381. // },
  66382. // "path": "{project}/zones/{zone}/instances/{instance}/stop",
  66383. // "response": {
  66384. // "$ref": "Operation"
  66385. // },
  66386. // "scopes": [
  66387. // "https://www.googleapis.com/auth/cloud-platform",
  66388. // "https://www.googleapis.com/auth/compute"
  66389. // ]
  66390. // }
  66391. }
  66392. // method id "compute.instances.suspend":
  66393. type InstancesSuspendCall struct {
  66394. s *Service
  66395. project string
  66396. zone string
  66397. instance string
  66398. urlParams_ gensupport.URLParams
  66399. ctx_ context.Context
  66400. header_ http.Header
  66401. }
  66402. // Suspend: This method suspends a running instance, saving its state to
  66403. // persistent storage, and allows you to resume the instance at a later
  66404. // time. Suspended instances incur reduced per-minute, virtual machine
  66405. // usage charges while they are suspended. Any resources the virtual
  66406. // machine is using, such as persistent disks and static IP addresses,
  66407. // will continue to be charged until they are deleted.
  66408. func (r *InstancesService) Suspend(project string, zone string, instance string) *InstancesSuspendCall {
  66409. c := &InstancesSuspendCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  66410. c.project = project
  66411. c.zone = zone
  66412. c.instance = instance
  66413. return c
  66414. }
  66415. // DiscardLocalSsd sets the optional parameter "discardLocalSsd": If
  66416. // true, discard the contents of any attached localSSD partitions.
  66417. // Default value is false (== preserve localSSD data).
  66418. func (c *InstancesSuspendCall) DiscardLocalSsd(discardLocalSsd bool) *InstancesSuspendCall {
  66419. c.urlParams_.Set("discardLocalSsd", fmt.Sprint(discardLocalSsd))
  66420. return c
  66421. }
  66422. // RequestId sets the optional parameter "requestId": An optional
  66423. // request ID to identify requests. Specify a unique request ID so that
  66424. // if you must retry your request, the server will know to ignore the
  66425. // request if it has already been completed.
  66426. //
  66427. // For example, consider a situation where you make an initial request
  66428. // and the request times out. If you make the request again with the
  66429. // same request ID, the server can check if original operation with the
  66430. // same request ID was received, and if so, will ignore the second
  66431. // request. This prevents clients from accidentally creating duplicate
  66432. // commitments.
  66433. //
  66434. // The request ID must be a valid UUID with the exception that zero UUID
  66435. // is not supported (00000000-0000-0000-0000-000000000000).
  66436. func (c *InstancesSuspendCall) RequestId(requestId string) *InstancesSuspendCall {
  66437. c.urlParams_.Set("requestId", requestId)
  66438. return c
  66439. }
  66440. // Fields allows partial responses to be retrieved. See
  66441. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  66442. // for more information.
  66443. func (c *InstancesSuspendCall) Fields(s ...googleapi.Field) *InstancesSuspendCall {
  66444. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  66445. return c
  66446. }
  66447. // Context sets the context to be used in this call's Do method. Any
  66448. // pending HTTP request will be aborted if the provided context is
  66449. // canceled.
  66450. func (c *InstancesSuspendCall) Context(ctx context.Context) *InstancesSuspendCall {
  66451. c.ctx_ = ctx
  66452. return c
  66453. }
  66454. // Header returns an http.Header that can be modified by the caller to
  66455. // add HTTP headers to the request.
  66456. func (c *InstancesSuspendCall) Header() http.Header {
  66457. if c.header_ == nil {
  66458. c.header_ = make(http.Header)
  66459. }
  66460. return c.header_
  66461. }
  66462. func (c *InstancesSuspendCall) doRequest(alt string) (*http.Response, error) {
  66463. reqHeaders := make(http.Header)
  66464. for k, v := range c.header_ {
  66465. reqHeaders[k] = v
  66466. }
  66467. reqHeaders.Set("User-Agent", c.s.userAgent())
  66468. var body io.Reader = nil
  66469. c.urlParams_.Set("alt", alt)
  66470. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/suspend")
  66471. urls += "?" + c.urlParams_.Encode()
  66472. req, _ := http.NewRequest("POST", urls, body)
  66473. req.Header = reqHeaders
  66474. googleapi.Expand(req.URL, map[string]string{
  66475. "project": c.project,
  66476. "zone": c.zone,
  66477. "instance": c.instance,
  66478. })
  66479. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  66480. }
  66481. // Do executes the "compute.instances.suspend" call.
  66482. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  66483. // status code is an error. Response headers are in either
  66484. // *Operation.ServerResponse.Header or (if a response was returned at
  66485. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  66486. // to check whether the returned error was because
  66487. // http.StatusNotModified was returned.
  66488. func (c *InstancesSuspendCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  66489. gensupport.SetOptions(c.urlParams_, opts...)
  66490. res, err := c.doRequest("json")
  66491. if res != nil && res.StatusCode == http.StatusNotModified {
  66492. if res.Body != nil {
  66493. res.Body.Close()
  66494. }
  66495. return nil, &googleapi.Error{
  66496. Code: res.StatusCode,
  66497. Header: res.Header,
  66498. }
  66499. }
  66500. if err != nil {
  66501. return nil, err
  66502. }
  66503. defer googleapi.CloseBody(res)
  66504. if err := googleapi.CheckResponse(res); err != nil {
  66505. return nil, err
  66506. }
  66507. ret := &Operation{
  66508. ServerResponse: googleapi.ServerResponse{
  66509. Header: res.Header,
  66510. HTTPStatusCode: res.StatusCode,
  66511. },
  66512. }
  66513. target := &ret
  66514. if err := gensupport.DecodeResponse(target, res); err != nil {
  66515. return nil, err
  66516. }
  66517. return ret, nil
  66518. // {
  66519. // "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.",
  66520. // "httpMethod": "POST",
  66521. // "id": "compute.instances.suspend",
  66522. // "parameterOrder": [
  66523. // "project",
  66524. // "zone",
  66525. // "instance"
  66526. // ],
  66527. // "parameters": {
  66528. // "discardLocalSsd": {
  66529. // "description": "If true, discard the contents of any attached localSSD partitions. Default value is false (== preserve localSSD data).",
  66530. // "location": "query",
  66531. // "type": "boolean"
  66532. // },
  66533. // "instance": {
  66534. // "description": "Name of the instance resource to suspend.",
  66535. // "location": "path",
  66536. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  66537. // "required": true,
  66538. // "type": "string"
  66539. // },
  66540. // "project": {
  66541. // "description": "Project ID for this request.",
  66542. // "location": "path",
  66543. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  66544. // "required": true,
  66545. // "type": "string"
  66546. // },
  66547. // "requestId": {
  66548. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  66549. // "location": "query",
  66550. // "type": "string"
  66551. // },
  66552. // "zone": {
  66553. // "description": "The name of the zone for this request.",
  66554. // "location": "path",
  66555. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  66556. // "required": true,
  66557. // "type": "string"
  66558. // }
  66559. // },
  66560. // "path": "{project}/zones/{zone}/instances/{instance}/suspend",
  66561. // "response": {
  66562. // "$ref": "Operation"
  66563. // },
  66564. // "scopes": [
  66565. // "https://www.googleapis.com/auth/cloud-platform",
  66566. // "https://www.googleapis.com/auth/compute"
  66567. // ]
  66568. // }
  66569. }
  66570. // method id "compute.instances.testIamPermissions":
  66571. type InstancesTestIamPermissionsCall struct {
  66572. s *Service
  66573. project string
  66574. zone string
  66575. resource string
  66576. testpermissionsrequest *TestPermissionsRequest
  66577. urlParams_ gensupport.URLParams
  66578. ctx_ context.Context
  66579. header_ http.Header
  66580. }
  66581. // TestIamPermissions: Returns permissions that a caller has on the
  66582. // specified resource.
  66583. func (r *InstancesService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *InstancesTestIamPermissionsCall {
  66584. c := &InstancesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  66585. c.project = project
  66586. c.zone = zone
  66587. c.resource = resource
  66588. c.testpermissionsrequest = testpermissionsrequest
  66589. return c
  66590. }
  66591. // Fields allows partial responses to be retrieved. See
  66592. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  66593. // for more information.
  66594. func (c *InstancesTestIamPermissionsCall) Fields(s ...googleapi.Field) *InstancesTestIamPermissionsCall {
  66595. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  66596. return c
  66597. }
  66598. // Context sets the context to be used in this call's Do method. Any
  66599. // pending HTTP request will be aborted if the provided context is
  66600. // canceled.
  66601. func (c *InstancesTestIamPermissionsCall) Context(ctx context.Context) *InstancesTestIamPermissionsCall {
  66602. c.ctx_ = ctx
  66603. return c
  66604. }
  66605. // Header returns an http.Header that can be modified by the caller to
  66606. // add HTTP headers to the request.
  66607. func (c *InstancesTestIamPermissionsCall) Header() http.Header {
  66608. if c.header_ == nil {
  66609. c.header_ = make(http.Header)
  66610. }
  66611. return c.header_
  66612. }
  66613. func (c *InstancesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  66614. reqHeaders := make(http.Header)
  66615. for k, v := range c.header_ {
  66616. reqHeaders[k] = v
  66617. }
  66618. reqHeaders.Set("User-Agent", c.s.userAgent())
  66619. var body io.Reader = nil
  66620. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  66621. if err != nil {
  66622. return nil, err
  66623. }
  66624. reqHeaders.Set("Content-Type", "application/json")
  66625. c.urlParams_.Set("alt", alt)
  66626. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{resource}/testIamPermissions")
  66627. urls += "?" + c.urlParams_.Encode()
  66628. req, _ := http.NewRequest("POST", urls, body)
  66629. req.Header = reqHeaders
  66630. googleapi.Expand(req.URL, map[string]string{
  66631. "project": c.project,
  66632. "zone": c.zone,
  66633. "resource": c.resource,
  66634. })
  66635. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  66636. }
  66637. // Do executes the "compute.instances.testIamPermissions" call.
  66638. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  66639. // non-2xx status code is an error. Response headers are in either
  66640. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  66641. // returned at all) in error.(*googleapi.Error).Header. Use
  66642. // googleapi.IsNotModified to check whether the returned error was
  66643. // because http.StatusNotModified was returned.
  66644. func (c *InstancesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  66645. gensupport.SetOptions(c.urlParams_, opts...)
  66646. res, err := c.doRequest("json")
  66647. if res != nil && res.StatusCode == http.StatusNotModified {
  66648. if res.Body != nil {
  66649. res.Body.Close()
  66650. }
  66651. return nil, &googleapi.Error{
  66652. Code: res.StatusCode,
  66653. Header: res.Header,
  66654. }
  66655. }
  66656. if err != nil {
  66657. return nil, err
  66658. }
  66659. defer googleapi.CloseBody(res)
  66660. if err := googleapi.CheckResponse(res); err != nil {
  66661. return nil, err
  66662. }
  66663. ret := &TestPermissionsResponse{
  66664. ServerResponse: googleapi.ServerResponse{
  66665. Header: res.Header,
  66666. HTTPStatusCode: res.StatusCode,
  66667. },
  66668. }
  66669. target := &ret
  66670. if err := gensupport.DecodeResponse(target, res); err != nil {
  66671. return nil, err
  66672. }
  66673. return ret, nil
  66674. // {
  66675. // "description": "Returns permissions that a caller has on the specified resource.",
  66676. // "httpMethod": "POST",
  66677. // "id": "compute.instances.testIamPermissions",
  66678. // "parameterOrder": [
  66679. // "project",
  66680. // "zone",
  66681. // "resource"
  66682. // ],
  66683. // "parameters": {
  66684. // "project": {
  66685. // "description": "Project ID for this request.",
  66686. // "location": "path",
  66687. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  66688. // "required": true,
  66689. // "type": "string"
  66690. // },
  66691. // "resource": {
  66692. // "description": "Name of the resource for this request.",
  66693. // "location": "path",
  66694. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  66695. // "required": true,
  66696. // "type": "string"
  66697. // },
  66698. // "zone": {
  66699. // "description": "The name of the zone for this request.",
  66700. // "location": "path",
  66701. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  66702. // "required": true,
  66703. // "type": "string"
  66704. // }
  66705. // },
  66706. // "path": "{project}/zones/{zone}/instances/{resource}/testIamPermissions",
  66707. // "request": {
  66708. // "$ref": "TestPermissionsRequest"
  66709. // },
  66710. // "response": {
  66711. // "$ref": "TestPermissionsResponse"
  66712. // },
  66713. // "scopes": [
  66714. // "https://www.googleapis.com/auth/cloud-platform",
  66715. // "https://www.googleapis.com/auth/compute",
  66716. // "https://www.googleapis.com/auth/compute.readonly"
  66717. // ]
  66718. // }
  66719. }
  66720. // method id "compute.instances.updateAccessConfig":
  66721. type InstancesUpdateAccessConfigCall struct {
  66722. s *Service
  66723. project string
  66724. zone string
  66725. instance string
  66726. accessconfig *AccessConfig
  66727. urlParams_ gensupport.URLParams
  66728. ctx_ context.Context
  66729. header_ http.Header
  66730. }
  66731. // UpdateAccessConfig: Updates the specified access config from an
  66732. // instance's network interface with the data included in the request.
  66733. // This method supports PATCH semantics and uses the JSON merge patch
  66734. // format and processing rules.
  66735. func (r *InstancesService) UpdateAccessConfig(project string, zone string, instance string, networkInterface string, accessconfig *AccessConfig) *InstancesUpdateAccessConfigCall {
  66736. c := &InstancesUpdateAccessConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  66737. c.project = project
  66738. c.zone = zone
  66739. c.instance = instance
  66740. c.urlParams_.Set("networkInterface", networkInterface)
  66741. c.accessconfig = accessconfig
  66742. return c
  66743. }
  66744. // RequestId sets the optional parameter "requestId": An optional
  66745. // request ID to identify requests. Specify a unique request ID so that
  66746. // if you must retry your request, the server will know to ignore the
  66747. // request if it has already been completed.
  66748. //
  66749. // For example, consider a situation where you make an initial request
  66750. // and the request times out. If you make the request again with the
  66751. // same request ID, the server can check if original operation with the
  66752. // same request ID was received, and if so, will ignore the second
  66753. // request. This prevents clients from accidentally creating duplicate
  66754. // commitments.
  66755. //
  66756. // The request ID must be a valid UUID with the exception that zero UUID
  66757. // is not supported (00000000-0000-0000-0000-000000000000).
  66758. func (c *InstancesUpdateAccessConfigCall) RequestId(requestId string) *InstancesUpdateAccessConfigCall {
  66759. c.urlParams_.Set("requestId", requestId)
  66760. return c
  66761. }
  66762. // Fields allows partial responses to be retrieved. See
  66763. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  66764. // for more information.
  66765. func (c *InstancesUpdateAccessConfigCall) Fields(s ...googleapi.Field) *InstancesUpdateAccessConfigCall {
  66766. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  66767. return c
  66768. }
  66769. // Context sets the context to be used in this call's Do method. Any
  66770. // pending HTTP request will be aborted if the provided context is
  66771. // canceled.
  66772. func (c *InstancesUpdateAccessConfigCall) Context(ctx context.Context) *InstancesUpdateAccessConfigCall {
  66773. c.ctx_ = ctx
  66774. return c
  66775. }
  66776. // Header returns an http.Header that can be modified by the caller to
  66777. // add HTTP headers to the request.
  66778. func (c *InstancesUpdateAccessConfigCall) Header() http.Header {
  66779. if c.header_ == nil {
  66780. c.header_ = make(http.Header)
  66781. }
  66782. return c.header_
  66783. }
  66784. func (c *InstancesUpdateAccessConfigCall) doRequest(alt string) (*http.Response, error) {
  66785. reqHeaders := make(http.Header)
  66786. for k, v := range c.header_ {
  66787. reqHeaders[k] = v
  66788. }
  66789. reqHeaders.Set("User-Agent", c.s.userAgent())
  66790. var body io.Reader = nil
  66791. body, err := googleapi.WithoutDataWrapper.JSONReader(c.accessconfig)
  66792. if err != nil {
  66793. return nil, err
  66794. }
  66795. reqHeaders.Set("Content-Type", "application/json")
  66796. c.urlParams_.Set("alt", alt)
  66797. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/updateAccessConfig")
  66798. urls += "?" + c.urlParams_.Encode()
  66799. req, _ := http.NewRequest("POST", urls, body)
  66800. req.Header = reqHeaders
  66801. googleapi.Expand(req.URL, map[string]string{
  66802. "project": c.project,
  66803. "zone": c.zone,
  66804. "instance": c.instance,
  66805. })
  66806. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  66807. }
  66808. // Do executes the "compute.instances.updateAccessConfig" call.
  66809. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  66810. // status code is an error. Response headers are in either
  66811. // *Operation.ServerResponse.Header or (if a response was returned at
  66812. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  66813. // to check whether the returned error was because
  66814. // http.StatusNotModified was returned.
  66815. func (c *InstancesUpdateAccessConfigCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  66816. gensupport.SetOptions(c.urlParams_, opts...)
  66817. res, err := c.doRequest("json")
  66818. if res != nil && res.StatusCode == http.StatusNotModified {
  66819. if res.Body != nil {
  66820. res.Body.Close()
  66821. }
  66822. return nil, &googleapi.Error{
  66823. Code: res.StatusCode,
  66824. Header: res.Header,
  66825. }
  66826. }
  66827. if err != nil {
  66828. return nil, err
  66829. }
  66830. defer googleapi.CloseBody(res)
  66831. if err := googleapi.CheckResponse(res); err != nil {
  66832. return nil, err
  66833. }
  66834. ret := &Operation{
  66835. ServerResponse: googleapi.ServerResponse{
  66836. Header: res.Header,
  66837. HTTPStatusCode: res.StatusCode,
  66838. },
  66839. }
  66840. target := &ret
  66841. if err := gensupport.DecodeResponse(target, res); err != nil {
  66842. return nil, err
  66843. }
  66844. return ret, nil
  66845. // {
  66846. // "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.",
  66847. // "httpMethod": "POST",
  66848. // "id": "compute.instances.updateAccessConfig",
  66849. // "parameterOrder": [
  66850. // "project",
  66851. // "zone",
  66852. // "instance",
  66853. // "networkInterface"
  66854. // ],
  66855. // "parameters": {
  66856. // "instance": {
  66857. // "description": "The instance name for this request.",
  66858. // "location": "path",
  66859. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  66860. // "required": true,
  66861. // "type": "string"
  66862. // },
  66863. // "networkInterface": {
  66864. // "description": "The name of the network interface where the access config is attached.",
  66865. // "location": "query",
  66866. // "required": true,
  66867. // "type": "string"
  66868. // },
  66869. // "project": {
  66870. // "description": "Project ID for this request.",
  66871. // "location": "path",
  66872. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  66873. // "required": true,
  66874. // "type": "string"
  66875. // },
  66876. // "requestId": {
  66877. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  66878. // "location": "query",
  66879. // "type": "string"
  66880. // },
  66881. // "zone": {
  66882. // "description": "The name of the zone for this request.",
  66883. // "location": "path",
  66884. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  66885. // "required": true,
  66886. // "type": "string"
  66887. // }
  66888. // },
  66889. // "path": "{project}/zones/{zone}/instances/{instance}/updateAccessConfig",
  66890. // "request": {
  66891. // "$ref": "AccessConfig"
  66892. // },
  66893. // "response": {
  66894. // "$ref": "Operation"
  66895. // },
  66896. // "scopes": [
  66897. // "https://www.googleapis.com/auth/cloud-platform",
  66898. // "https://www.googleapis.com/auth/compute"
  66899. // ]
  66900. // }
  66901. }
  66902. // method id "compute.instances.updateNetworkInterface":
  66903. type InstancesUpdateNetworkInterfaceCall struct {
  66904. s *Service
  66905. project string
  66906. zone string
  66907. instance string
  66908. networkinterface *NetworkInterface
  66909. urlParams_ gensupport.URLParams
  66910. ctx_ context.Context
  66911. header_ http.Header
  66912. }
  66913. // UpdateNetworkInterface: Updates an instance's network interface. This
  66914. // method follows PATCH semantics.
  66915. func (r *InstancesService) UpdateNetworkInterface(project string, zone string, instance string, networkInterface string, networkinterface *NetworkInterface) *InstancesUpdateNetworkInterfaceCall {
  66916. c := &InstancesUpdateNetworkInterfaceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  66917. c.project = project
  66918. c.zone = zone
  66919. c.instance = instance
  66920. c.urlParams_.Set("networkInterface", networkInterface)
  66921. c.networkinterface = networkinterface
  66922. return c
  66923. }
  66924. // RequestId sets the optional parameter "requestId": An optional
  66925. // request ID to identify requests. Specify a unique request ID so that
  66926. // if you must retry your request, the server will know to ignore the
  66927. // request if it has already been completed.
  66928. //
  66929. // For example, consider a situation where you make an initial request
  66930. // and the request times out. If you make the request again with the
  66931. // same request ID, the server can check if original operation with the
  66932. // same request ID was received, and if so, will ignore the second
  66933. // request. This prevents clients from accidentally creating duplicate
  66934. // commitments.
  66935. //
  66936. // The request ID must be a valid UUID with the exception that zero UUID
  66937. // is not supported (00000000-0000-0000-0000-000000000000).
  66938. func (c *InstancesUpdateNetworkInterfaceCall) RequestId(requestId string) *InstancesUpdateNetworkInterfaceCall {
  66939. c.urlParams_.Set("requestId", requestId)
  66940. return c
  66941. }
  66942. // Fields allows partial responses to be retrieved. See
  66943. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  66944. // for more information.
  66945. func (c *InstancesUpdateNetworkInterfaceCall) Fields(s ...googleapi.Field) *InstancesUpdateNetworkInterfaceCall {
  66946. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  66947. return c
  66948. }
  66949. // Context sets the context to be used in this call's Do method. Any
  66950. // pending HTTP request will be aborted if the provided context is
  66951. // canceled.
  66952. func (c *InstancesUpdateNetworkInterfaceCall) Context(ctx context.Context) *InstancesUpdateNetworkInterfaceCall {
  66953. c.ctx_ = ctx
  66954. return c
  66955. }
  66956. // Header returns an http.Header that can be modified by the caller to
  66957. // add HTTP headers to the request.
  66958. func (c *InstancesUpdateNetworkInterfaceCall) Header() http.Header {
  66959. if c.header_ == nil {
  66960. c.header_ = make(http.Header)
  66961. }
  66962. return c.header_
  66963. }
  66964. func (c *InstancesUpdateNetworkInterfaceCall) doRequest(alt string) (*http.Response, error) {
  66965. reqHeaders := make(http.Header)
  66966. for k, v := range c.header_ {
  66967. reqHeaders[k] = v
  66968. }
  66969. reqHeaders.Set("User-Agent", c.s.userAgent())
  66970. var body io.Reader = nil
  66971. body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkinterface)
  66972. if err != nil {
  66973. return nil, err
  66974. }
  66975. reqHeaders.Set("Content-Type", "application/json")
  66976. c.urlParams_.Set("alt", alt)
  66977. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/updateNetworkInterface")
  66978. urls += "?" + c.urlParams_.Encode()
  66979. req, _ := http.NewRequest("PATCH", urls, body)
  66980. req.Header = reqHeaders
  66981. googleapi.Expand(req.URL, map[string]string{
  66982. "project": c.project,
  66983. "zone": c.zone,
  66984. "instance": c.instance,
  66985. })
  66986. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  66987. }
  66988. // Do executes the "compute.instances.updateNetworkInterface" call.
  66989. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  66990. // status code is an error. Response headers are in either
  66991. // *Operation.ServerResponse.Header or (if a response was returned at
  66992. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  66993. // to check whether the returned error was because
  66994. // http.StatusNotModified was returned.
  66995. func (c *InstancesUpdateNetworkInterfaceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  66996. gensupport.SetOptions(c.urlParams_, opts...)
  66997. res, err := c.doRequest("json")
  66998. if res != nil && res.StatusCode == http.StatusNotModified {
  66999. if res.Body != nil {
  67000. res.Body.Close()
  67001. }
  67002. return nil, &googleapi.Error{
  67003. Code: res.StatusCode,
  67004. Header: res.Header,
  67005. }
  67006. }
  67007. if err != nil {
  67008. return nil, err
  67009. }
  67010. defer googleapi.CloseBody(res)
  67011. if err := googleapi.CheckResponse(res); err != nil {
  67012. return nil, err
  67013. }
  67014. ret := &Operation{
  67015. ServerResponse: googleapi.ServerResponse{
  67016. Header: res.Header,
  67017. HTTPStatusCode: res.StatusCode,
  67018. },
  67019. }
  67020. target := &ret
  67021. if err := gensupport.DecodeResponse(target, res); err != nil {
  67022. return nil, err
  67023. }
  67024. return ret, nil
  67025. // {
  67026. // "description": "Updates an instance's network interface. This method follows PATCH semantics.",
  67027. // "httpMethod": "PATCH",
  67028. // "id": "compute.instances.updateNetworkInterface",
  67029. // "parameterOrder": [
  67030. // "project",
  67031. // "zone",
  67032. // "instance",
  67033. // "networkInterface"
  67034. // ],
  67035. // "parameters": {
  67036. // "instance": {
  67037. // "description": "The instance name for this request.",
  67038. // "location": "path",
  67039. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  67040. // "required": true,
  67041. // "type": "string"
  67042. // },
  67043. // "networkInterface": {
  67044. // "description": "The name of the network interface to update.",
  67045. // "location": "query",
  67046. // "required": true,
  67047. // "type": "string"
  67048. // },
  67049. // "project": {
  67050. // "description": "Project ID for this request.",
  67051. // "location": "path",
  67052. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  67053. // "required": true,
  67054. // "type": "string"
  67055. // },
  67056. // "requestId": {
  67057. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  67058. // "location": "query",
  67059. // "type": "string"
  67060. // },
  67061. // "zone": {
  67062. // "description": "The name of the zone for this request.",
  67063. // "location": "path",
  67064. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  67065. // "required": true,
  67066. // "type": "string"
  67067. // }
  67068. // },
  67069. // "path": "{project}/zones/{zone}/instances/{instance}/updateNetworkInterface",
  67070. // "request": {
  67071. // "$ref": "NetworkInterface"
  67072. // },
  67073. // "response": {
  67074. // "$ref": "Operation"
  67075. // },
  67076. // "scopes": [
  67077. // "https://www.googleapis.com/auth/cloud-platform",
  67078. // "https://www.googleapis.com/auth/compute"
  67079. // ]
  67080. // }
  67081. }
  67082. // method id "compute.instances.updateShieldedVmConfig":
  67083. type InstancesUpdateShieldedVmConfigCall struct {
  67084. s *Service
  67085. project string
  67086. zone string
  67087. instance string
  67088. shieldedvmconfig *ShieldedVmConfig
  67089. urlParams_ gensupport.URLParams
  67090. ctx_ context.Context
  67091. header_ http.Header
  67092. }
  67093. // UpdateShieldedVmConfig: Updates the Shielded VM config for an
  67094. // instance. This method supports PATCH semantics and uses the JSON
  67095. // merge patch format and processing rules.
  67096. func (r *InstancesService) UpdateShieldedVmConfig(project string, zone string, instance string, shieldedvmconfig *ShieldedVmConfig) *InstancesUpdateShieldedVmConfigCall {
  67097. c := &InstancesUpdateShieldedVmConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  67098. c.project = project
  67099. c.zone = zone
  67100. c.instance = instance
  67101. c.shieldedvmconfig = shieldedvmconfig
  67102. return c
  67103. }
  67104. // RequestId sets the optional parameter "requestId": An optional
  67105. // request ID to identify requests. Specify a unique request ID so that
  67106. // if you must retry your request, the server will know to ignore the
  67107. // request if it has already been completed.
  67108. //
  67109. // For example, consider a situation where you make an initial request
  67110. // and the request times out. If you make the request again with the
  67111. // same request ID, the server can check if original operation with the
  67112. // same request ID was received, and if so, will ignore the second
  67113. // request. This prevents clients from accidentally creating duplicate
  67114. // commitments.
  67115. //
  67116. // The request ID must be a valid UUID with the exception that zero UUID
  67117. // is not supported (00000000-0000-0000-0000-000000000000).
  67118. func (c *InstancesUpdateShieldedVmConfigCall) RequestId(requestId string) *InstancesUpdateShieldedVmConfigCall {
  67119. c.urlParams_.Set("requestId", requestId)
  67120. return c
  67121. }
  67122. // Fields allows partial responses to be retrieved. See
  67123. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  67124. // for more information.
  67125. func (c *InstancesUpdateShieldedVmConfigCall) Fields(s ...googleapi.Field) *InstancesUpdateShieldedVmConfigCall {
  67126. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  67127. return c
  67128. }
  67129. // Context sets the context to be used in this call's Do method. Any
  67130. // pending HTTP request will be aborted if the provided context is
  67131. // canceled.
  67132. func (c *InstancesUpdateShieldedVmConfigCall) Context(ctx context.Context) *InstancesUpdateShieldedVmConfigCall {
  67133. c.ctx_ = ctx
  67134. return c
  67135. }
  67136. // Header returns an http.Header that can be modified by the caller to
  67137. // add HTTP headers to the request.
  67138. func (c *InstancesUpdateShieldedVmConfigCall) Header() http.Header {
  67139. if c.header_ == nil {
  67140. c.header_ = make(http.Header)
  67141. }
  67142. return c.header_
  67143. }
  67144. func (c *InstancesUpdateShieldedVmConfigCall) doRequest(alt string) (*http.Response, error) {
  67145. reqHeaders := make(http.Header)
  67146. for k, v := range c.header_ {
  67147. reqHeaders[k] = v
  67148. }
  67149. reqHeaders.Set("User-Agent", c.s.userAgent())
  67150. var body io.Reader = nil
  67151. body, err := googleapi.WithoutDataWrapper.JSONReader(c.shieldedvmconfig)
  67152. if err != nil {
  67153. return nil, err
  67154. }
  67155. reqHeaders.Set("Content-Type", "application/json")
  67156. c.urlParams_.Set("alt", alt)
  67157. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/updateShieldedVmConfig")
  67158. urls += "?" + c.urlParams_.Encode()
  67159. req, _ := http.NewRequest("PATCH", urls, body)
  67160. req.Header = reqHeaders
  67161. googleapi.Expand(req.URL, map[string]string{
  67162. "project": c.project,
  67163. "zone": c.zone,
  67164. "instance": c.instance,
  67165. })
  67166. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  67167. }
  67168. // Do executes the "compute.instances.updateShieldedVmConfig" call.
  67169. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  67170. // status code is an error. Response headers are in either
  67171. // *Operation.ServerResponse.Header or (if a response was returned at
  67172. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  67173. // to check whether the returned error was because
  67174. // http.StatusNotModified was returned.
  67175. func (c *InstancesUpdateShieldedVmConfigCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  67176. gensupport.SetOptions(c.urlParams_, opts...)
  67177. res, err := c.doRequest("json")
  67178. if res != nil && res.StatusCode == http.StatusNotModified {
  67179. if res.Body != nil {
  67180. res.Body.Close()
  67181. }
  67182. return nil, &googleapi.Error{
  67183. Code: res.StatusCode,
  67184. Header: res.Header,
  67185. }
  67186. }
  67187. if err != nil {
  67188. return nil, err
  67189. }
  67190. defer googleapi.CloseBody(res)
  67191. if err := googleapi.CheckResponse(res); err != nil {
  67192. return nil, err
  67193. }
  67194. ret := &Operation{
  67195. ServerResponse: googleapi.ServerResponse{
  67196. Header: res.Header,
  67197. HTTPStatusCode: res.StatusCode,
  67198. },
  67199. }
  67200. target := &ret
  67201. if err := gensupport.DecodeResponse(target, res); err != nil {
  67202. return nil, err
  67203. }
  67204. return ret, nil
  67205. // {
  67206. // "description": "Updates the Shielded VM config for an instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
  67207. // "httpMethod": "PATCH",
  67208. // "id": "compute.instances.updateShieldedVmConfig",
  67209. // "parameterOrder": [
  67210. // "project",
  67211. // "zone",
  67212. // "instance"
  67213. // ],
  67214. // "parameters": {
  67215. // "instance": {
  67216. // "description": "Name of the instance scoping this request.",
  67217. // "location": "path",
  67218. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  67219. // "required": true,
  67220. // "type": "string"
  67221. // },
  67222. // "project": {
  67223. // "description": "Project ID for this request.",
  67224. // "location": "path",
  67225. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  67226. // "required": true,
  67227. // "type": "string"
  67228. // },
  67229. // "requestId": {
  67230. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  67231. // "location": "query",
  67232. // "type": "string"
  67233. // },
  67234. // "zone": {
  67235. // "description": "The name of the zone for this request.",
  67236. // "location": "path",
  67237. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  67238. // "required": true,
  67239. // "type": "string"
  67240. // }
  67241. // },
  67242. // "path": "{project}/zones/{zone}/instances/{instance}/updateShieldedVmConfig",
  67243. // "request": {
  67244. // "$ref": "ShieldedVmConfig"
  67245. // },
  67246. // "response": {
  67247. // "$ref": "Operation"
  67248. // },
  67249. // "scopes": [
  67250. // "https://www.googleapis.com/auth/cloud-platform",
  67251. // "https://www.googleapis.com/auth/compute"
  67252. // ]
  67253. // }
  67254. }
  67255. // method id "compute.interconnectAttachments.aggregatedList":
  67256. type InterconnectAttachmentsAggregatedListCall struct {
  67257. s *Service
  67258. project string
  67259. urlParams_ gensupport.URLParams
  67260. ifNoneMatch_ string
  67261. ctx_ context.Context
  67262. header_ http.Header
  67263. }
  67264. // AggregatedList: Retrieves an aggregated list of interconnect
  67265. // attachments.
  67266. func (r *InterconnectAttachmentsService) AggregatedList(project string) *InterconnectAttachmentsAggregatedListCall {
  67267. c := &InterconnectAttachmentsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  67268. c.project = project
  67269. return c
  67270. }
  67271. // Filter sets the optional parameter "filter": A filter expression that
  67272. // filters resources listed in the response. The expression must specify
  67273. // the field name, a comparison operator, and the value that you want to
  67274. // use for filtering. The value must be a string, a number, or a
  67275. // boolean. The comparison operator must be either =, !=, >, or <.
  67276. //
  67277. // For example, if you are filtering Compute Engine instances, you can
  67278. // exclude instances named example-instance by specifying name !=
  67279. // example-instance.
  67280. //
  67281. // You can also filter nested fields. For example, you could specify
  67282. // scheduling.automaticRestart = false to include instances only if they
  67283. // are not scheduled for automatic restarts. You can use filtering on
  67284. // nested fields to filter based on resource labels.
  67285. //
  67286. // To filter on multiple expressions, provide each separate expression
  67287. // within parentheses. For example, (scheduling.automaticRestart = true)
  67288. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  67289. // AND expression. However, you can include AND and OR expressions
  67290. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  67291. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  67292. // true).
  67293. func (c *InterconnectAttachmentsAggregatedListCall) Filter(filter string) *InterconnectAttachmentsAggregatedListCall {
  67294. c.urlParams_.Set("filter", filter)
  67295. return c
  67296. }
  67297. // MaxResults sets the optional parameter "maxResults": The maximum
  67298. // number of results per page that should be returned. If the number of
  67299. // available results is larger than maxResults, Compute Engine returns a
  67300. // nextPageToken that can be used to get the next page of results in
  67301. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  67302. // (Default: 500)
  67303. func (c *InterconnectAttachmentsAggregatedListCall) MaxResults(maxResults int64) *InterconnectAttachmentsAggregatedListCall {
  67304. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  67305. return c
  67306. }
  67307. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  67308. // a certain order. By default, results are returned in alphanumerical
  67309. // order based on the resource name.
  67310. //
  67311. // You can also sort results in descending order based on the creation
  67312. // timestamp using orderBy="creationTimestamp desc". This sorts results
  67313. // based on the creationTimestamp field in reverse chronological order
  67314. // (newest result first). Use this to sort resources like operations so
  67315. // that the newest operation is returned first.
  67316. //
  67317. // Currently, only sorting by name or creationTimestamp desc is
  67318. // supported.
  67319. func (c *InterconnectAttachmentsAggregatedListCall) OrderBy(orderBy string) *InterconnectAttachmentsAggregatedListCall {
  67320. c.urlParams_.Set("orderBy", orderBy)
  67321. return c
  67322. }
  67323. // PageToken sets the optional parameter "pageToken": Specifies a page
  67324. // token to use. Set pageToken to the nextPageToken returned by a
  67325. // previous list request to get the next page of results.
  67326. func (c *InterconnectAttachmentsAggregatedListCall) PageToken(pageToken string) *InterconnectAttachmentsAggregatedListCall {
  67327. c.urlParams_.Set("pageToken", pageToken)
  67328. return c
  67329. }
  67330. // Fields allows partial responses to be retrieved. See
  67331. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  67332. // for more information.
  67333. func (c *InterconnectAttachmentsAggregatedListCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsAggregatedListCall {
  67334. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  67335. return c
  67336. }
  67337. // IfNoneMatch sets the optional parameter which makes the operation
  67338. // fail if the object's ETag matches the given value. This is useful for
  67339. // getting updates only after the object has changed since the last
  67340. // request. Use googleapi.IsNotModified to check whether the response
  67341. // error from Do is the result of In-None-Match.
  67342. func (c *InterconnectAttachmentsAggregatedListCall) IfNoneMatch(entityTag string) *InterconnectAttachmentsAggregatedListCall {
  67343. c.ifNoneMatch_ = entityTag
  67344. return c
  67345. }
  67346. // Context sets the context to be used in this call's Do method. Any
  67347. // pending HTTP request will be aborted if the provided context is
  67348. // canceled.
  67349. func (c *InterconnectAttachmentsAggregatedListCall) Context(ctx context.Context) *InterconnectAttachmentsAggregatedListCall {
  67350. c.ctx_ = ctx
  67351. return c
  67352. }
  67353. // Header returns an http.Header that can be modified by the caller to
  67354. // add HTTP headers to the request.
  67355. func (c *InterconnectAttachmentsAggregatedListCall) Header() http.Header {
  67356. if c.header_ == nil {
  67357. c.header_ = make(http.Header)
  67358. }
  67359. return c.header_
  67360. }
  67361. func (c *InterconnectAttachmentsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  67362. reqHeaders := make(http.Header)
  67363. for k, v := range c.header_ {
  67364. reqHeaders[k] = v
  67365. }
  67366. reqHeaders.Set("User-Agent", c.s.userAgent())
  67367. if c.ifNoneMatch_ != "" {
  67368. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  67369. }
  67370. var body io.Reader = nil
  67371. c.urlParams_.Set("alt", alt)
  67372. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/interconnectAttachments")
  67373. urls += "?" + c.urlParams_.Encode()
  67374. req, _ := http.NewRequest("GET", urls, body)
  67375. req.Header = reqHeaders
  67376. googleapi.Expand(req.URL, map[string]string{
  67377. "project": c.project,
  67378. })
  67379. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  67380. }
  67381. // Do executes the "compute.interconnectAttachments.aggregatedList" call.
  67382. // Exactly one of *InterconnectAttachmentAggregatedList or error will be
  67383. // non-nil. Any non-2xx status code is an error. Response headers are in
  67384. // either *InterconnectAttachmentAggregatedList.ServerResponse.Header or
  67385. // (if a response was returned at all) in
  67386. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  67387. // whether the returned error was because http.StatusNotModified was
  67388. // returned.
  67389. func (c *InterconnectAttachmentsAggregatedListCall) Do(opts ...googleapi.CallOption) (*InterconnectAttachmentAggregatedList, error) {
  67390. gensupport.SetOptions(c.urlParams_, opts...)
  67391. res, err := c.doRequest("json")
  67392. if res != nil && res.StatusCode == http.StatusNotModified {
  67393. if res.Body != nil {
  67394. res.Body.Close()
  67395. }
  67396. return nil, &googleapi.Error{
  67397. Code: res.StatusCode,
  67398. Header: res.Header,
  67399. }
  67400. }
  67401. if err != nil {
  67402. return nil, err
  67403. }
  67404. defer googleapi.CloseBody(res)
  67405. if err := googleapi.CheckResponse(res); err != nil {
  67406. return nil, err
  67407. }
  67408. ret := &InterconnectAttachmentAggregatedList{
  67409. ServerResponse: googleapi.ServerResponse{
  67410. Header: res.Header,
  67411. HTTPStatusCode: res.StatusCode,
  67412. },
  67413. }
  67414. target := &ret
  67415. if err := gensupport.DecodeResponse(target, res); err != nil {
  67416. return nil, err
  67417. }
  67418. return ret, nil
  67419. // {
  67420. // "description": "Retrieves an aggregated list of interconnect attachments.",
  67421. // "httpMethod": "GET",
  67422. // "id": "compute.interconnectAttachments.aggregatedList",
  67423. // "parameterOrder": [
  67424. // "project"
  67425. // ],
  67426. // "parameters": {
  67427. // "filter": {
  67428. // "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).",
  67429. // "location": "query",
  67430. // "type": "string"
  67431. // },
  67432. // "maxResults": {
  67433. // "default": "500",
  67434. // "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)",
  67435. // "format": "uint32",
  67436. // "location": "query",
  67437. // "minimum": "0",
  67438. // "type": "integer"
  67439. // },
  67440. // "orderBy": {
  67441. // "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.",
  67442. // "location": "query",
  67443. // "type": "string"
  67444. // },
  67445. // "pageToken": {
  67446. // "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.",
  67447. // "location": "query",
  67448. // "type": "string"
  67449. // },
  67450. // "project": {
  67451. // "description": "Project ID for this request.",
  67452. // "location": "path",
  67453. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  67454. // "required": true,
  67455. // "type": "string"
  67456. // }
  67457. // },
  67458. // "path": "{project}/aggregated/interconnectAttachments",
  67459. // "response": {
  67460. // "$ref": "InterconnectAttachmentAggregatedList"
  67461. // },
  67462. // "scopes": [
  67463. // "https://www.googleapis.com/auth/cloud-platform",
  67464. // "https://www.googleapis.com/auth/compute",
  67465. // "https://www.googleapis.com/auth/compute.readonly"
  67466. // ]
  67467. // }
  67468. }
  67469. // Pages invokes f for each page of results.
  67470. // A non-nil error returned from f will halt the iteration.
  67471. // The provided context supersedes any context provided to the Context method.
  67472. func (c *InterconnectAttachmentsAggregatedListCall) Pages(ctx context.Context, f func(*InterconnectAttachmentAggregatedList) error) error {
  67473. c.ctx_ = ctx
  67474. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  67475. for {
  67476. x, err := c.Do()
  67477. if err != nil {
  67478. return err
  67479. }
  67480. if err := f(x); err != nil {
  67481. return err
  67482. }
  67483. if x.NextPageToken == "" {
  67484. return nil
  67485. }
  67486. c.PageToken(x.NextPageToken)
  67487. }
  67488. }
  67489. // method id "compute.interconnectAttachments.delete":
  67490. type InterconnectAttachmentsDeleteCall struct {
  67491. s *Service
  67492. project string
  67493. region string
  67494. interconnectAttachment string
  67495. urlParams_ gensupport.URLParams
  67496. ctx_ context.Context
  67497. header_ http.Header
  67498. }
  67499. // Delete: Deletes the specified interconnect attachment.
  67500. func (r *InterconnectAttachmentsService) Delete(project string, region string, interconnectAttachment string) *InterconnectAttachmentsDeleteCall {
  67501. c := &InterconnectAttachmentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  67502. c.project = project
  67503. c.region = region
  67504. c.interconnectAttachment = interconnectAttachment
  67505. return c
  67506. }
  67507. // RequestId sets the optional parameter "requestId": An optional
  67508. // request ID to identify requests. Specify a unique request ID so that
  67509. // if you must retry your request, the server will know to ignore the
  67510. // request if it has already been completed.
  67511. //
  67512. // For example, consider a situation where you make an initial request
  67513. // and the request times out. If you make the request again with the
  67514. // same request ID, the server can check if original operation with the
  67515. // same request ID was received, and if so, will ignore the second
  67516. // request. This prevents clients from accidentally creating duplicate
  67517. // commitments.
  67518. //
  67519. // The request ID must be a valid UUID with the exception that zero UUID
  67520. // is not supported (00000000-0000-0000-0000-000000000000).
  67521. func (c *InterconnectAttachmentsDeleteCall) RequestId(requestId string) *InterconnectAttachmentsDeleteCall {
  67522. c.urlParams_.Set("requestId", requestId)
  67523. return c
  67524. }
  67525. // Fields allows partial responses to be retrieved. See
  67526. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  67527. // for more information.
  67528. func (c *InterconnectAttachmentsDeleteCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsDeleteCall {
  67529. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  67530. return c
  67531. }
  67532. // Context sets the context to be used in this call's Do method. Any
  67533. // pending HTTP request will be aborted if the provided context is
  67534. // canceled.
  67535. func (c *InterconnectAttachmentsDeleteCall) Context(ctx context.Context) *InterconnectAttachmentsDeleteCall {
  67536. c.ctx_ = ctx
  67537. return c
  67538. }
  67539. // Header returns an http.Header that can be modified by the caller to
  67540. // add HTTP headers to the request.
  67541. func (c *InterconnectAttachmentsDeleteCall) Header() http.Header {
  67542. if c.header_ == nil {
  67543. c.header_ = make(http.Header)
  67544. }
  67545. return c.header_
  67546. }
  67547. func (c *InterconnectAttachmentsDeleteCall) doRequest(alt string) (*http.Response, error) {
  67548. reqHeaders := make(http.Header)
  67549. for k, v := range c.header_ {
  67550. reqHeaders[k] = v
  67551. }
  67552. reqHeaders.Set("User-Agent", c.s.userAgent())
  67553. var body io.Reader = nil
  67554. c.urlParams_.Set("alt", alt)
  67555. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}")
  67556. urls += "?" + c.urlParams_.Encode()
  67557. req, _ := http.NewRequest("DELETE", urls, body)
  67558. req.Header = reqHeaders
  67559. googleapi.Expand(req.URL, map[string]string{
  67560. "project": c.project,
  67561. "region": c.region,
  67562. "interconnectAttachment": c.interconnectAttachment,
  67563. })
  67564. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  67565. }
  67566. // Do executes the "compute.interconnectAttachments.delete" call.
  67567. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  67568. // status code is an error. Response headers are in either
  67569. // *Operation.ServerResponse.Header or (if a response was returned at
  67570. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  67571. // to check whether the returned error was because
  67572. // http.StatusNotModified was returned.
  67573. func (c *InterconnectAttachmentsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  67574. gensupport.SetOptions(c.urlParams_, opts...)
  67575. res, err := c.doRequest("json")
  67576. if res != nil && res.StatusCode == http.StatusNotModified {
  67577. if res.Body != nil {
  67578. res.Body.Close()
  67579. }
  67580. return nil, &googleapi.Error{
  67581. Code: res.StatusCode,
  67582. Header: res.Header,
  67583. }
  67584. }
  67585. if err != nil {
  67586. return nil, err
  67587. }
  67588. defer googleapi.CloseBody(res)
  67589. if err := googleapi.CheckResponse(res); err != nil {
  67590. return nil, err
  67591. }
  67592. ret := &Operation{
  67593. ServerResponse: googleapi.ServerResponse{
  67594. Header: res.Header,
  67595. HTTPStatusCode: res.StatusCode,
  67596. },
  67597. }
  67598. target := &ret
  67599. if err := gensupport.DecodeResponse(target, res); err != nil {
  67600. return nil, err
  67601. }
  67602. return ret, nil
  67603. // {
  67604. // "description": "Deletes the specified interconnect attachment.",
  67605. // "httpMethod": "DELETE",
  67606. // "id": "compute.interconnectAttachments.delete",
  67607. // "parameterOrder": [
  67608. // "project",
  67609. // "region",
  67610. // "interconnectAttachment"
  67611. // ],
  67612. // "parameters": {
  67613. // "interconnectAttachment": {
  67614. // "description": "Name of the interconnect attachment to delete.",
  67615. // "location": "path",
  67616. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  67617. // "required": true,
  67618. // "type": "string"
  67619. // },
  67620. // "project": {
  67621. // "description": "Project ID for this request.",
  67622. // "location": "path",
  67623. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  67624. // "required": true,
  67625. // "type": "string"
  67626. // },
  67627. // "region": {
  67628. // "description": "Name of the region for this request.",
  67629. // "location": "path",
  67630. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  67631. // "required": true,
  67632. // "type": "string"
  67633. // },
  67634. // "requestId": {
  67635. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  67636. // "location": "query",
  67637. // "type": "string"
  67638. // }
  67639. // },
  67640. // "path": "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}",
  67641. // "response": {
  67642. // "$ref": "Operation"
  67643. // },
  67644. // "scopes": [
  67645. // "https://www.googleapis.com/auth/cloud-platform",
  67646. // "https://www.googleapis.com/auth/compute"
  67647. // ]
  67648. // }
  67649. }
  67650. // method id "compute.interconnectAttachments.get":
  67651. type InterconnectAttachmentsGetCall struct {
  67652. s *Service
  67653. project string
  67654. region string
  67655. interconnectAttachment string
  67656. urlParams_ gensupport.URLParams
  67657. ifNoneMatch_ string
  67658. ctx_ context.Context
  67659. header_ http.Header
  67660. }
  67661. // Get: Returns the specified interconnect attachment.
  67662. func (r *InterconnectAttachmentsService) Get(project string, region string, interconnectAttachment string) *InterconnectAttachmentsGetCall {
  67663. c := &InterconnectAttachmentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  67664. c.project = project
  67665. c.region = region
  67666. c.interconnectAttachment = interconnectAttachment
  67667. return c
  67668. }
  67669. // Fields allows partial responses to be retrieved. See
  67670. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  67671. // for more information.
  67672. func (c *InterconnectAttachmentsGetCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsGetCall {
  67673. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  67674. return c
  67675. }
  67676. // IfNoneMatch sets the optional parameter which makes the operation
  67677. // fail if the object's ETag matches the given value. This is useful for
  67678. // getting updates only after the object has changed since the last
  67679. // request. Use googleapi.IsNotModified to check whether the response
  67680. // error from Do is the result of In-None-Match.
  67681. func (c *InterconnectAttachmentsGetCall) IfNoneMatch(entityTag string) *InterconnectAttachmentsGetCall {
  67682. c.ifNoneMatch_ = entityTag
  67683. return c
  67684. }
  67685. // Context sets the context to be used in this call's Do method. Any
  67686. // pending HTTP request will be aborted if the provided context is
  67687. // canceled.
  67688. func (c *InterconnectAttachmentsGetCall) Context(ctx context.Context) *InterconnectAttachmentsGetCall {
  67689. c.ctx_ = ctx
  67690. return c
  67691. }
  67692. // Header returns an http.Header that can be modified by the caller to
  67693. // add HTTP headers to the request.
  67694. func (c *InterconnectAttachmentsGetCall) Header() http.Header {
  67695. if c.header_ == nil {
  67696. c.header_ = make(http.Header)
  67697. }
  67698. return c.header_
  67699. }
  67700. func (c *InterconnectAttachmentsGetCall) doRequest(alt string) (*http.Response, error) {
  67701. reqHeaders := make(http.Header)
  67702. for k, v := range c.header_ {
  67703. reqHeaders[k] = v
  67704. }
  67705. reqHeaders.Set("User-Agent", c.s.userAgent())
  67706. if c.ifNoneMatch_ != "" {
  67707. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  67708. }
  67709. var body io.Reader = nil
  67710. c.urlParams_.Set("alt", alt)
  67711. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}")
  67712. urls += "?" + c.urlParams_.Encode()
  67713. req, _ := http.NewRequest("GET", urls, body)
  67714. req.Header = reqHeaders
  67715. googleapi.Expand(req.URL, map[string]string{
  67716. "project": c.project,
  67717. "region": c.region,
  67718. "interconnectAttachment": c.interconnectAttachment,
  67719. })
  67720. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  67721. }
  67722. // Do executes the "compute.interconnectAttachments.get" call.
  67723. // Exactly one of *InterconnectAttachment or error will be non-nil. Any
  67724. // non-2xx status code is an error. Response headers are in either
  67725. // *InterconnectAttachment.ServerResponse.Header or (if a response was
  67726. // returned at all) in error.(*googleapi.Error).Header. Use
  67727. // googleapi.IsNotModified to check whether the returned error was
  67728. // because http.StatusNotModified was returned.
  67729. func (c *InterconnectAttachmentsGetCall) Do(opts ...googleapi.CallOption) (*InterconnectAttachment, error) {
  67730. gensupport.SetOptions(c.urlParams_, opts...)
  67731. res, err := c.doRequest("json")
  67732. if res != nil && res.StatusCode == http.StatusNotModified {
  67733. if res.Body != nil {
  67734. res.Body.Close()
  67735. }
  67736. return nil, &googleapi.Error{
  67737. Code: res.StatusCode,
  67738. Header: res.Header,
  67739. }
  67740. }
  67741. if err != nil {
  67742. return nil, err
  67743. }
  67744. defer googleapi.CloseBody(res)
  67745. if err := googleapi.CheckResponse(res); err != nil {
  67746. return nil, err
  67747. }
  67748. ret := &InterconnectAttachment{
  67749. ServerResponse: googleapi.ServerResponse{
  67750. Header: res.Header,
  67751. HTTPStatusCode: res.StatusCode,
  67752. },
  67753. }
  67754. target := &ret
  67755. if err := gensupport.DecodeResponse(target, res); err != nil {
  67756. return nil, err
  67757. }
  67758. return ret, nil
  67759. // {
  67760. // "description": "Returns the specified interconnect attachment.",
  67761. // "httpMethod": "GET",
  67762. // "id": "compute.interconnectAttachments.get",
  67763. // "parameterOrder": [
  67764. // "project",
  67765. // "region",
  67766. // "interconnectAttachment"
  67767. // ],
  67768. // "parameters": {
  67769. // "interconnectAttachment": {
  67770. // "description": "Name of the interconnect attachment to return.",
  67771. // "location": "path",
  67772. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  67773. // "required": true,
  67774. // "type": "string"
  67775. // },
  67776. // "project": {
  67777. // "description": "Project ID for this request.",
  67778. // "location": "path",
  67779. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  67780. // "required": true,
  67781. // "type": "string"
  67782. // },
  67783. // "region": {
  67784. // "description": "Name of the region for this request.",
  67785. // "location": "path",
  67786. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  67787. // "required": true,
  67788. // "type": "string"
  67789. // }
  67790. // },
  67791. // "path": "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}",
  67792. // "response": {
  67793. // "$ref": "InterconnectAttachment"
  67794. // },
  67795. // "scopes": [
  67796. // "https://www.googleapis.com/auth/cloud-platform",
  67797. // "https://www.googleapis.com/auth/compute",
  67798. // "https://www.googleapis.com/auth/compute.readonly"
  67799. // ]
  67800. // }
  67801. }
  67802. // method id "compute.interconnectAttachments.getIamPolicy":
  67803. type InterconnectAttachmentsGetIamPolicyCall struct {
  67804. s *Service
  67805. project string
  67806. region string
  67807. resource string
  67808. urlParams_ gensupport.URLParams
  67809. ifNoneMatch_ string
  67810. ctx_ context.Context
  67811. header_ http.Header
  67812. }
  67813. // GetIamPolicy: Gets the access control policy for a resource. May be
  67814. // empty if no such policy or resource exists.
  67815. func (r *InterconnectAttachmentsService) GetIamPolicy(project string, region string, resource string) *InterconnectAttachmentsGetIamPolicyCall {
  67816. c := &InterconnectAttachmentsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  67817. c.project = project
  67818. c.region = region
  67819. c.resource = resource
  67820. return c
  67821. }
  67822. // Fields allows partial responses to be retrieved. See
  67823. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  67824. // for more information.
  67825. func (c *InterconnectAttachmentsGetIamPolicyCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsGetIamPolicyCall {
  67826. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  67827. return c
  67828. }
  67829. // IfNoneMatch sets the optional parameter which makes the operation
  67830. // fail if the object's ETag matches the given value. This is useful for
  67831. // getting updates only after the object has changed since the last
  67832. // request. Use googleapi.IsNotModified to check whether the response
  67833. // error from Do is the result of In-None-Match.
  67834. func (c *InterconnectAttachmentsGetIamPolicyCall) IfNoneMatch(entityTag string) *InterconnectAttachmentsGetIamPolicyCall {
  67835. c.ifNoneMatch_ = entityTag
  67836. return c
  67837. }
  67838. // Context sets the context to be used in this call's Do method. Any
  67839. // pending HTTP request will be aborted if the provided context is
  67840. // canceled.
  67841. func (c *InterconnectAttachmentsGetIamPolicyCall) Context(ctx context.Context) *InterconnectAttachmentsGetIamPolicyCall {
  67842. c.ctx_ = ctx
  67843. return c
  67844. }
  67845. // Header returns an http.Header that can be modified by the caller to
  67846. // add HTTP headers to the request.
  67847. func (c *InterconnectAttachmentsGetIamPolicyCall) Header() http.Header {
  67848. if c.header_ == nil {
  67849. c.header_ = make(http.Header)
  67850. }
  67851. return c.header_
  67852. }
  67853. func (c *InterconnectAttachmentsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  67854. reqHeaders := make(http.Header)
  67855. for k, v := range c.header_ {
  67856. reqHeaders[k] = v
  67857. }
  67858. reqHeaders.Set("User-Agent", c.s.userAgent())
  67859. if c.ifNoneMatch_ != "" {
  67860. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  67861. }
  67862. var body io.Reader = nil
  67863. c.urlParams_.Set("alt", alt)
  67864. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments/{resource}/getIamPolicy")
  67865. urls += "?" + c.urlParams_.Encode()
  67866. req, _ := http.NewRequest("GET", urls, body)
  67867. req.Header = reqHeaders
  67868. googleapi.Expand(req.URL, map[string]string{
  67869. "project": c.project,
  67870. "region": c.region,
  67871. "resource": c.resource,
  67872. })
  67873. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  67874. }
  67875. // Do executes the "compute.interconnectAttachments.getIamPolicy" call.
  67876. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  67877. // code is an error. Response headers are in either
  67878. // *Policy.ServerResponse.Header or (if a response was returned at all)
  67879. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  67880. // check whether the returned error was because http.StatusNotModified
  67881. // was returned.
  67882. func (c *InterconnectAttachmentsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  67883. gensupport.SetOptions(c.urlParams_, opts...)
  67884. res, err := c.doRequest("json")
  67885. if res != nil && res.StatusCode == http.StatusNotModified {
  67886. if res.Body != nil {
  67887. res.Body.Close()
  67888. }
  67889. return nil, &googleapi.Error{
  67890. Code: res.StatusCode,
  67891. Header: res.Header,
  67892. }
  67893. }
  67894. if err != nil {
  67895. return nil, err
  67896. }
  67897. defer googleapi.CloseBody(res)
  67898. if err := googleapi.CheckResponse(res); err != nil {
  67899. return nil, err
  67900. }
  67901. ret := &Policy{
  67902. ServerResponse: googleapi.ServerResponse{
  67903. Header: res.Header,
  67904. HTTPStatusCode: res.StatusCode,
  67905. },
  67906. }
  67907. target := &ret
  67908. if err := gensupport.DecodeResponse(target, res); err != nil {
  67909. return nil, err
  67910. }
  67911. return ret, nil
  67912. // {
  67913. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  67914. // "httpMethod": "GET",
  67915. // "id": "compute.interconnectAttachments.getIamPolicy",
  67916. // "parameterOrder": [
  67917. // "project",
  67918. // "region",
  67919. // "resource"
  67920. // ],
  67921. // "parameters": {
  67922. // "project": {
  67923. // "description": "Project ID for this request.",
  67924. // "location": "path",
  67925. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  67926. // "required": true,
  67927. // "type": "string"
  67928. // },
  67929. // "region": {
  67930. // "description": "The name of the region for this request.",
  67931. // "location": "path",
  67932. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  67933. // "required": true,
  67934. // "type": "string"
  67935. // },
  67936. // "resource": {
  67937. // "description": "Name of the resource for this request.",
  67938. // "location": "path",
  67939. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  67940. // "required": true,
  67941. // "type": "string"
  67942. // }
  67943. // },
  67944. // "path": "{project}/regions/{region}/interconnectAttachments/{resource}/getIamPolicy",
  67945. // "response": {
  67946. // "$ref": "Policy"
  67947. // },
  67948. // "scopes": [
  67949. // "https://www.googleapis.com/auth/cloud-platform",
  67950. // "https://www.googleapis.com/auth/compute",
  67951. // "https://www.googleapis.com/auth/compute.readonly"
  67952. // ]
  67953. // }
  67954. }
  67955. // method id "compute.interconnectAttachments.insert":
  67956. type InterconnectAttachmentsInsertCall struct {
  67957. s *Service
  67958. project string
  67959. region string
  67960. interconnectattachment *InterconnectAttachment
  67961. urlParams_ gensupport.URLParams
  67962. ctx_ context.Context
  67963. header_ http.Header
  67964. }
  67965. // Insert: Creates an InterconnectAttachment in the specified project
  67966. // using the data included in the request.
  67967. func (r *InterconnectAttachmentsService) Insert(project string, region string, interconnectattachment *InterconnectAttachment) *InterconnectAttachmentsInsertCall {
  67968. c := &InterconnectAttachmentsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  67969. c.project = project
  67970. c.region = region
  67971. c.interconnectattachment = interconnectattachment
  67972. return c
  67973. }
  67974. // RequestId sets the optional parameter "requestId": An optional
  67975. // request ID to identify requests. Specify a unique request ID so that
  67976. // if you must retry your request, the server will know to ignore the
  67977. // request if it has already been completed.
  67978. //
  67979. // For example, consider a situation where you make an initial request
  67980. // and the request times out. If you make the request again with the
  67981. // same request ID, the server can check if original operation with the
  67982. // same request ID was received, and if so, will ignore the second
  67983. // request. This prevents clients from accidentally creating duplicate
  67984. // commitments.
  67985. //
  67986. // The request ID must be a valid UUID with the exception that zero UUID
  67987. // is not supported (00000000-0000-0000-0000-000000000000).
  67988. func (c *InterconnectAttachmentsInsertCall) RequestId(requestId string) *InterconnectAttachmentsInsertCall {
  67989. c.urlParams_.Set("requestId", requestId)
  67990. return c
  67991. }
  67992. // Fields allows partial responses to be retrieved. See
  67993. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  67994. // for more information.
  67995. func (c *InterconnectAttachmentsInsertCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsInsertCall {
  67996. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  67997. return c
  67998. }
  67999. // Context sets the context to be used in this call's Do method. Any
  68000. // pending HTTP request will be aborted if the provided context is
  68001. // canceled.
  68002. func (c *InterconnectAttachmentsInsertCall) Context(ctx context.Context) *InterconnectAttachmentsInsertCall {
  68003. c.ctx_ = ctx
  68004. return c
  68005. }
  68006. // Header returns an http.Header that can be modified by the caller to
  68007. // add HTTP headers to the request.
  68008. func (c *InterconnectAttachmentsInsertCall) Header() http.Header {
  68009. if c.header_ == nil {
  68010. c.header_ = make(http.Header)
  68011. }
  68012. return c.header_
  68013. }
  68014. func (c *InterconnectAttachmentsInsertCall) doRequest(alt string) (*http.Response, error) {
  68015. reqHeaders := make(http.Header)
  68016. for k, v := range c.header_ {
  68017. reqHeaders[k] = v
  68018. }
  68019. reqHeaders.Set("User-Agent", c.s.userAgent())
  68020. var body io.Reader = nil
  68021. body, err := googleapi.WithoutDataWrapper.JSONReader(c.interconnectattachment)
  68022. if err != nil {
  68023. return nil, err
  68024. }
  68025. reqHeaders.Set("Content-Type", "application/json")
  68026. c.urlParams_.Set("alt", alt)
  68027. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments")
  68028. urls += "?" + c.urlParams_.Encode()
  68029. req, _ := http.NewRequest("POST", urls, body)
  68030. req.Header = reqHeaders
  68031. googleapi.Expand(req.URL, map[string]string{
  68032. "project": c.project,
  68033. "region": c.region,
  68034. })
  68035. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  68036. }
  68037. // Do executes the "compute.interconnectAttachments.insert" call.
  68038. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  68039. // status code is an error. Response headers are in either
  68040. // *Operation.ServerResponse.Header or (if a response was returned at
  68041. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  68042. // to check whether the returned error was because
  68043. // http.StatusNotModified was returned.
  68044. func (c *InterconnectAttachmentsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  68045. gensupport.SetOptions(c.urlParams_, opts...)
  68046. res, err := c.doRequest("json")
  68047. if res != nil && res.StatusCode == http.StatusNotModified {
  68048. if res.Body != nil {
  68049. res.Body.Close()
  68050. }
  68051. return nil, &googleapi.Error{
  68052. Code: res.StatusCode,
  68053. Header: res.Header,
  68054. }
  68055. }
  68056. if err != nil {
  68057. return nil, err
  68058. }
  68059. defer googleapi.CloseBody(res)
  68060. if err := googleapi.CheckResponse(res); err != nil {
  68061. return nil, err
  68062. }
  68063. ret := &Operation{
  68064. ServerResponse: googleapi.ServerResponse{
  68065. Header: res.Header,
  68066. HTTPStatusCode: res.StatusCode,
  68067. },
  68068. }
  68069. target := &ret
  68070. if err := gensupport.DecodeResponse(target, res); err != nil {
  68071. return nil, err
  68072. }
  68073. return ret, nil
  68074. // {
  68075. // "description": "Creates an InterconnectAttachment in the specified project using the data included in the request.",
  68076. // "httpMethod": "POST",
  68077. // "id": "compute.interconnectAttachments.insert",
  68078. // "parameterOrder": [
  68079. // "project",
  68080. // "region"
  68081. // ],
  68082. // "parameters": {
  68083. // "project": {
  68084. // "description": "Project ID for this request.",
  68085. // "location": "path",
  68086. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  68087. // "required": true,
  68088. // "type": "string"
  68089. // },
  68090. // "region": {
  68091. // "description": "Name of the region for this request.",
  68092. // "location": "path",
  68093. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  68094. // "required": true,
  68095. // "type": "string"
  68096. // },
  68097. // "requestId": {
  68098. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  68099. // "location": "query",
  68100. // "type": "string"
  68101. // }
  68102. // },
  68103. // "path": "{project}/regions/{region}/interconnectAttachments",
  68104. // "request": {
  68105. // "$ref": "InterconnectAttachment"
  68106. // },
  68107. // "response": {
  68108. // "$ref": "Operation"
  68109. // },
  68110. // "scopes": [
  68111. // "https://www.googleapis.com/auth/cloud-platform",
  68112. // "https://www.googleapis.com/auth/compute"
  68113. // ]
  68114. // }
  68115. }
  68116. // method id "compute.interconnectAttachments.list":
  68117. type InterconnectAttachmentsListCall struct {
  68118. s *Service
  68119. project string
  68120. region string
  68121. urlParams_ gensupport.URLParams
  68122. ifNoneMatch_ string
  68123. ctx_ context.Context
  68124. header_ http.Header
  68125. }
  68126. // List: Retrieves the list of interconnect attachments contained within
  68127. // the specified region.
  68128. func (r *InterconnectAttachmentsService) List(project string, region string) *InterconnectAttachmentsListCall {
  68129. c := &InterconnectAttachmentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  68130. c.project = project
  68131. c.region = region
  68132. return c
  68133. }
  68134. // Filter sets the optional parameter "filter": A filter expression that
  68135. // filters resources listed in the response. The expression must specify
  68136. // the field name, a comparison operator, and the value that you want to
  68137. // use for filtering. The value must be a string, a number, or a
  68138. // boolean. The comparison operator must be either =, !=, >, or <.
  68139. //
  68140. // For example, if you are filtering Compute Engine instances, you can
  68141. // exclude instances named example-instance by specifying name !=
  68142. // example-instance.
  68143. //
  68144. // You can also filter nested fields. For example, you could specify
  68145. // scheduling.automaticRestart = false to include instances only if they
  68146. // are not scheduled for automatic restarts. You can use filtering on
  68147. // nested fields to filter based on resource labels.
  68148. //
  68149. // To filter on multiple expressions, provide each separate expression
  68150. // within parentheses. For example, (scheduling.automaticRestart = true)
  68151. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  68152. // AND expression. However, you can include AND and OR expressions
  68153. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  68154. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  68155. // true).
  68156. func (c *InterconnectAttachmentsListCall) Filter(filter string) *InterconnectAttachmentsListCall {
  68157. c.urlParams_.Set("filter", filter)
  68158. return c
  68159. }
  68160. // MaxResults sets the optional parameter "maxResults": The maximum
  68161. // number of results per page that should be returned. If the number of
  68162. // available results is larger than maxResults, Compute Engine returns a
  68163. // nextPageToken that can be used to get the next page of results in
  68164. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  68165. // (Default: 500)
  68166. func (c *InterconnectAttachmentsListCall) MaxResults(maxResults int64) *InterconnectAttachmentsListCall {
  68167. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  68168. return c
  68169. }
  68170. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  68171. // a certain order. By default, results are returned in alphanumerical
  68172. // order based on the resource name.
  68173. //
  68174. // You can also sort results in descending order based on the creation
  68175. // timestamp using orderBy="creationTimestamp desc". This sorts results
  68176. // based on the creationTimestamp field in reverse chronological order
  68177. // (newest result first). Use this to sort resources like operations so
  68178. // that the newest operation is returned first.
  68179. //
  68180. // Currently, only sorting by name or creationTimestamp desc is
  68181. // supported.
  68182. func (c *InterconnectAttachmentsListCall) OrderBy(orderBy string) *InterconnectAttachmentsListCall {
  68183. c.urlParams_.Set("orderBy", orderBy)
  68184. return c
  68185. }
  68186. // PageToken sets the optional parameter "pageToken": Specifies a page
  68187. // token to use. Set pageToken to the nextPageToken returned by a
  68188. // previous list request to get the next page of results.
  68189. func (c *InterconnectAttachmentsListCall) PageToken(pageToken string) *InterconnectAttachmentsListCall {
  68190. c.urlParams_.Set("pageToken", pageToken)
  68191. return c
  68192. }
  68193. // Fields allows partial responses to be retrieved. See
  68194. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  68195. // for more information.
  68196. func (c *InterconnectAttachmentsListCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsListCall {
  68197. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  68198. return c
  68199. }
  68200. // IfNoneMatch sets the optional parameter which makes the operation
  68201. // fail if the object's ETag matches the given value. This is useful for
  68202. // getting updates only after the object has changed since the last
  68203. // request. Use googleapi.IsNotModified to check whether the response
  68204. // error from Do is the result of In-None-Match.
  68205. func (c *InterconnectAttachmentsListCall) IfNoneMatch(entityTag string) *InterconnectAttachmentsListCall {
  68206. c.ifNoneMatch_ = entityTag
  68207. return c
  68208. }
  68209. // Context sets the context to be used in this call's Do method. Any
  68210. // pending HTTP request will be aborted if the provided context is
  68211. // canceled.
  68212. func (c *InterconnectAttachmentsListCall) Context(ctx context.Context) *InterconnectAttachmentsListCall {
  68213. c.ctx_ = ctx
  68214. return c
  68215. }
  68216. // Header returns an http.Header that can be modified by the caller to
  68217. // add HTTP headers to the request.
  68218. func (c *InterconnectAttachmentsListCall) Header() http.Header {
  68219. if c.header_ == nil {
  68220. c.header_ = make(http.Header)
  68221. }
  68222. return c.header_
  68223. }
  68224. func (c *InterconnectAttachmentsListCall) doRequest(alt string) (*http.Response, error) {
  68225. reqHeaders := make(http.Header)
  68226. for k, v := range c.header_ {
  68227. reqHeaders[k] = v
  68228. }
  68229. reqHeaders.Set("User-Agent", c.s.userAgent())
  68230. if c.ifNoneMatch_ != "" {
  68231. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  68232. }
  68233. var body io.Reader = nil
  68234. c.urlParams_.Set("alt", alt)
  68235. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments")
  68236. urls += "?" + c.urlParams_.Encode()
  68237. req, _ := http.NewRequest("GET", urls, body)
  68238. req.Header = reqHeaders
  68239. googleapi.Expand(req.URL, map[string]string{
  68240. "project": c.project,
  68241. "region": c.region,
  68242. })
  68243. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  68244. }
  68245. // Do executes the "compute.interconnectAttachments.list" call.
  68246. // Exactly one of *InterconnectAttachmentList or error will be non-nil.
  68247. // Any non-2xx status code is an error. Response headers are in either
  68248. // *InterconnectAttachmentList.ServerResponse.Header or (if a response
  68249. // was returned at all) in error.(*googleapi.Error).Header. Use
  68250. // googleapi.IsNotModified to check whether the returned error was
  68251. // because http.StatusNotModified was returned.
  68252. func (c *InterconnectAttachmentsListCall) Do(opts ...googleapi.CallOption) (*InterconnectAttachmentList, error) {
  68253. gensupport.SetOptions(c.urlParams_, opts...)
  68254. res, err := c.doRequest("json")
  68255. if res != nil && res.StatusCode == http.StatusNotModified {
  68256. if res.Body != nil {
  68257. res.Body.Close()
  68258. }
  68259. return nil, &googleapi.Error{
  68260. Code: res.StatusCode,
  68261. Header: res.Header,
  68262. }
  68263. }
  68264. if err != nil {
  68265. return nil, err
  68266. }
  68267. defer googleapi.CloseBody(res)
  68268. if err := googleapi.CheckResponse(res); err != nil {
  68269. return nil, err
  68270. }
  68271. ret := &InterconnectAttachmentList{
  68272. ServerResponse: googleapi.ServerResponse{
  68273. Header: res.Header,
  68274. HTTPStatusCode: res.StatusCode,
  68275. },
  68276. }
  68277. target := &ret
  68278. if err := gensupport.DecodeResponse(target, res); err != nil {
  68279. return nil, err
  68280. }
  68281. return ret, nil
  68282. // {
  68283. // "description": "Retrieves the list of interconnect attachments contained within the specified region.",
  68284. // "httpMethod": "GET",
  68285. // "id": "compute.interconnectAttachments.list",
  68286. // "parameterOrder": [
  68287. // "project",
  68288. // "region"
  68289. // ],
  68290. // "parameters": {
  68291. // "filter": {
  68292. // "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).",
  68293. // "location": "query",
  68294. // "type": "string"
  68295. // },
  68296. // "maxResults": {
  68297. // "default": "500",
  68298. // "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)",
  68299. // "format": "uint32",
  68300. // "location": "query",
  68301. // "minimum": "0",
  68302. // "type": "integer"
  68303. // },
  68304. // "orderBy": {
  68305. // "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.",
  68306. // "location": "query",
  68307. // "type": "string"
  68308. // },
  68309. // "pageToken": {
  68310. // "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.",
  68311. // "location": "query",
  68312. // "type": "string"
  68313. // },
  68314. // "project": {
  68315. // "description": "Project ID for this request.",
  68316. // "location": "path",
  68317. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  68318. // "required": true,
  68319. // "type": "string"
  68320. // },
  68321. // "region": {
  68322. // "description": "Name of the region for this request.",
  68323. // "location": "path",
  68324. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  68325. // "required": true,
  68326. // "type": "string"
  68327. // }
  68328. // },
  68329. // "path": "{project}/regions/{region}/interconnectAttachments",
  68330. // "response": {
  68331. // "$ref": "InterconnectAttachmentList"
  68332. // },
  68333. // "scopes": [
  68334. // "https://www.googleapis.com/auth/cloud-platform",
  68335. // "https://www.googleapis.com/auth/compute",
  68336. // "https://www.googleapis.com/auth/compute.readonly"
  68337. // ]
  68338. // }
  68339. }
  68340. // Pages invokes f for each page of results.
  68341. // A non-nil error returned from f will halt the iteration.
  68342. // The provided context supersedes any context provided to the Context method.
  68343. func (c *InterconnectAttachmentsListCall) Pages(ctx context.Context, f func(*InterconnectAttachmentList) error) error {
  68344. c.ctx_ = ctx
  68345. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  68346. for {
  68347. x, err := c.Do()
  68348. if err != nil {
  68349. return err
  68350. }
  68351. if err := f(x); err != nil {
  68352. return err
  68353. }
  68354. if x.NextPageToken == "" {
  68355. return nil
  68356. }
  68357. c.PageToken(x.NextPageToken)
  68358. }
  68359. }
  68360. // method id "compute.interconnectAttachments.patch":
  68361. type InterconnectAttachmentsPatchCall struct {
  68362. s *Service
  68363. project string
  68364. region string
  68365. interconnectAttachment string
  68366. interconnectattachment *InterconnectAttachment
  68367. urlParams_ gensupport.URLParams
  68368. ctx_ context.Context
  68369. header_ http.Header
  68370. }
  68371. // Patch: Updates the specified interconnect attachment with the data
  68372. // included in the request. This method supports PATCH semantics and
  68373. // uses the JSON merge patch format and processing rules.
  68374. func (r *InterconnectAttachmentsService) Patch(project string, region string, interconnectAttachment string, interconnectattachment *InterconnectAttachment) *InterconnectAttachmentsPatchCall {
  68375. c := &InterconnectAttachmentsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  68376. c.project = project
  68377. c.region = region
  68378. c.interconnectAttachment = interconnectAttachment
  68379. c.interconnectattachment = interconnectattachment
  68380. return c
  68381. }
  68382. // RequestId sets the optional parameter "requestId": An optional
  68383. // request ID to identify requests. Specify a unique request ID so that
  68384. // if you must retry your request, the server will know to ignore the
  68385. // request if it has already been completed.
  68386. //
  68387. // For example, consider a situation where you make an initial request
  68388. // and the request times out. If you make the request again with the
  68389. // same request ID, the server can check if original operation with the
  68390. // same request ID was received, and if so, will ignore the second
  68391. // request. This prevents clients from accidentally creating duplicate
  68392. // commitments.
  68393. //
  68394. // The request ID must be a valid UUID with the exception that zero UUID
  68395. // is not supported (00000000-0000-0000-0000-000000000000).
  68396. func (c *InterconnectAttachmentsPatchCall) RequestId(requestId string) *InterconnectAttachmentsPatchCall {
  68397. c.urlParams_.Set("requestId", requestId)
  68398. return c
  68399. }
  68400. // Fields allows partial responses to be retrieved. See
  68401. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  68402. // for more information.
  68403. func (c *InterconnectAttachmentsPatchCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsPatchCall {
  68404. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  68405. return c
  68406. }
  68407. // Context sets the context to be used in this call's Do method. Any
  68408. // pending HTTP request will be aborted if the provided context is
  68409. // canceled.
  68410. func (c *InterconnectAttachmentsPatchCall) Context(ctx context.Context) *InterconnectAttachmentsPatchCall {
  68411. c.ctx_ = ctx
  68412. return c
  68413. }
  68414. // Header returns an http.Header that can be modified by the caller to
  68415. // add HTTP headers to the request.
  68416. func (c *InterconnectAttachmentsPatchCall) Header() http.Header {
  68417. if c.header_ == nil {
  68418. c.header_ = make(http.Header)
  68419. }
  68420. return c.header_
  68421. }
  68422. func (c *InterconnectAttachmentsPatchCall) doRequest(alt string) (*http.Response, error) {
  68423. reqHeaders := make(http.Header)
  68424. for k, v := range c.header_ {
  68425. reqHeaders[k] = v
  68426. }
  68427. reqHeaders.Set("User-Agent", c.s.userAgent())
  68428. var body io.Reader = nil
  68429. body, err := googleapi.WithoutDataWrapper.JSONReader(c.interconnectattachment)
  68430. if err != nil {
  68431. return nil, err
  68432. }
  68433. reqHeaders.Set("Content-Type", "application/json")
  68434. c.urlParams_.Set("alt", alt)
  68435. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}")
  68436. urls += "?" + c.urlParams_.Encode()
  68437. req, _ := http.NewRequest("PATCH", urls, body)
  68438. req.Header = reqHeaders
  68439. googleapi.Expand(req.URL, map[string]string{
  68440. "project": c.project,
  68441. "region": c.region,
  68442. "interconnectAttachment": c.interconnectAttachment,
  68443. })
  68444. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  68445. }
  68446. // Do executes the "compute.interconnectAttachments.patch" call.
  68447. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  68448. // status code is an error. Response headers are in either
  68449. // *Operation.ServerResponse.Header or (if a response was returned at
  68450. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  68451. // to check whether the returned error was because
  68452. // http.StatusNotModified was returned.
  68453. func (c *InterconnectAttachmentsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  68454. gensupport.SetOptions(c.urlParams_, opts...)
  68455. res, err := c.doRequest("json")
  68456. if res != nil && res.StatusCode == http.StatusNotModified {
  68457. if res.Body != nil {
  68458. res.Body.Close()
  68459. }
  68460. return nil, &googleapi.Error{
  68461. Code: res.StatusCode,
  68462. Header: res.Header,
  68463. }
  68464. }
  68465. if err != nil {
  68466. return nil, err
  68467. }
  68468. defer googleapi.CloseBody(res)
  68469. if err := googleapi.CheckResponse(res); err != nil {
  68470. return nil, err
  68471. }
  68472. ret := &Operation{
  68473. ServerResponse: googleapi.ServerResponse{
  68474. Header: res.Header,
  68475. HTTPStatusCode: res.StatusCode,
  68476. },
  68477. }
  68478. target := &ret
  68479. if err := gensupport.DecodeResponse(target, res); err != nil {
  68480. return nil, err
  68481. }
  68482. return ret, nil
  68483. // {
  68484. // "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.",
  68485. // "httpMethod": "PATCH",
  68486. // "id": "compute.interconnectAttachments.patch",
  68487. // "parameterOrder": [
  68488. // "project",
  68489. // "region",
  68490. // "interconnectAttachment"
  68491. // ],
  68492. // "parameters": {
  68493. // "interconnectAttachment": {
  68494. // "description": "Name of the interconnect attachment to patch.",
  68495. // "location": "path",
  68496. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  68497. // "required": true,
  68498. // "type": "string"
  68499. // },
  68500. // "project": {
  68501. // "description": "Project ID for this request.",
  68502. // "location": "path",
  68503. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  68504. // "required": true,
  68505. // "type": "string"
  68506. // },
  68507. // "region": {
  68508. // "description": "Name of the region scoping this request.",
  68509. // "location": "path",
  68510. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  68511. // "required": true,
  68512. // "type": "string"
  68513. // },
  68514. // "requestId": {
  68515. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  68516. // "location": "query",
  68517. // "type": "string"
  68518. // }
  68519. // },
  68520. // "path": "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}",
  68521. // "request": {
  68522. // "$ref": "InterconnectAttachment"
  68523. // },
  68524. // "response": {
  68525. // "$ref": "Operation"
  68526. // },
  68527. // "scopes": [
  68528. // "https://www.googleapis.com/auth/cloud-platform",
  68529. // "https://www.googleapis.com/auth/compute"
  68530. // ]
  68531. // }
  68532. }
  68533. // method id "compute.interconnectAttachments.setIamPolicy":
  68534. type InterconnectAttachmentsSetIamPolicyCall struct {
  68535. s *Service
  68536. project string
  68537. region string
  68538. resource string
  68539. regionsetpolicyrequest *RegionSetPolicyRequest
  68540. urlParams_ gensupport.URLParams
  68541. ctx_ context.Context
  68542. header_ http.Header
  68543. }
  68544. // SetIamPolicy: Sets the access control policy on the specified
  68545. // resource. Replaces any existing policy.
  68546. func (r *InterconnectAttachmentsService) SetIamPolicy(project string, region string, resource string, regionsetpolicyrequest *RegionSetPolicyRequest) *InterconnectAttachmentsSetIamPolicyCall {
  68547. c := &InterconnectAttachmentsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  68548. c.project = project
  68549. c.region = region
  68550. c.resource = resource
  68551. c.regionsetpolicyrequest = regionsetpolicyrequest
  68552. return c
  68553. }
  68554. // Fields allows partial responses to be retrieved. See
  68555. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  68556. // for more information.
  68557. func (c *InterconnectAttachmentsSetIamPolicyCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsSetIamPolicyCall {
  68558. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  68559. return c
  68560. }
  68561. // Context sets the context to be used in this call's Do method. Any
  68562. // pending HTTP request will be aborted if the provided context is
  68563. // canceled.
  68564. func (c *InterconnectAttachmentsSetIamPolicyCall) Context(ctx context.Context) *InterconnectAttachmentsSetIamPolicyCall {
  68565. c.ctx_ = ctx
  68566. return c
  68567. }
  68568. // Header returns an http.Header that can be modified by the caller to
  68569. // add HTTP headers to the request.
  68570. func (c *InterconnectAttachmentsSetIamPolicyCall) Header() http.Header {
  68571. if c.header_ == nil {
  68572. c.header_ = make(http.Header)
  68573. }
  68574. return c.header_
  68575. }
  68576. func (c *InterconnectAttachmentsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  68577. reqHeaders := make(http.Header)
  68578. for k, v := range c.header_ {
  68579. reqHeaders[k] = v
  68580. }
  68581. reqHeaders.Set("User-Agent", c.s.userAgent())
  68582. var body io.Reader = nil
  68583. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest)
  68584. if err != nil {
  68585. return nil, err
  68586. }
  68587. reqHeaders.Set("Content-Type", "application/json")
  68588. c.urlParams_.Set("alt", alt)
  68589. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments/{resource}/setIamPolicy")
  68590. urls += "?" + c.urlParams_.Encode()
  68591. req, _ := http.NewRequest("POST", urls, body)
  68592. req.Header = reqHeaders
  68593. googleapi.Expand(req.URL, map[string]string{
  68594. "project": c.project,
  68595. "region": c.region,
  68596. "resource": c.resource,
  68597. })
  68598. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  68599. }
  68600. // Do executes the "compute.interconnectAttachments.setIamPolicy" call.
  68601. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  68602. // code is an error. Response headers are in either
  68603. // *Policy.ServerResponse.Header or (if a response was returned at all)
  68604. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  68605. // check whether the returned error was because http.StatusNotModified
  68606. // was returned.
  68607. func (c *InterconnectAttachmentsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  68608. gensupport.SetOptions(c.urlParams_, opts...)
  68609. res, err := c.doRequest("json")
  68610. if res != nil && res.StatusCode == http.StatusNotModified {
  68611. if res.Body != nil {
  68612. res.Body.Close()
  68613. }
  68614. return nil, &googleapi.Error{
  68615. Code: res.StatusCode,
  68616. Header: res.Header,
  68617. }
  68618. }
  68619. if err != nil {
  68620. return nil, err
  68621. }
  68622. defer googleapi.CloseBody(res)
  68623. if err := googleapi.CheckResponse(res); err != nil {
  68624. return nil, err
  68625. }
  68626. ret := &Policy{
  68627. ServerResponse: googleapi.ServerResponse{
  68628. Header: res.Header,
  68629. HTTPStatusCode: res.StatusCode,
  68630. },
  68631. }
  68632. target := &ret
  68633. if err := gensupport.DecodeResponse(target, res); err != nil {
  68634. return nil, err
  68635. }
  68636. return ret, nil
  68637. // {
  68638. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  68639. // "httpMethod": "POST",
  68640. // "id": "compute.interconnectAttachments.setIamPolicy",
  68641. // "parameterOrder": [
  68642. // "project",
  68643. // "region",
  68644. // "resource"
  68645. // ],
  68646. // "parameters": {
  68647. // "project": {
  68648. // "description": "Project ID for this request.",
  68649. // "location": "path",
  68650. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  68651. // "required": true,
  68652. // "type": "string"
  68653. // },
  68654. // "region": {
  68655. // "description": "The name of the region for this request.",
  68656. // "location": "path",
  68657. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  68658. // "required": true,
  68659. // "type": "string"
  68660. // },
  68661. // "resource": {
  68662. // "description": "Name of the resource for this request.",
  68663. // "location": "path",
  68664. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  68665. // "required": true,
  68666. // "type": "string"
  68667. // }
  68668. // },
  68669. // "path": "{project}/regions/{region}/interconnectAttachments/{resource}/setIamPolicy",
  68670. // "request": {
  68671. // "$ref": "RegionSetPolicyRequest"
  68672. // },
  68673. // "response": {
  68674. // "$ref": "Policy"
  68675. // },
  68676. // "scopes": [
  68677. // "https://www.googleapis.com/auth/cloud-platform",
  68678. // "https://www.googleapis.com/auth/compute"
  68679. // ]
  68680. // }
  68681. }
  68682. // method id "compute.interconnectAttachments.setLabels":
  68683. type InterconnectAttachmentsSetLabelsCall struct {
  68684. s *Service
  68685. project string
  68686. region string
  68687. resource string
  68688. regionsetlabelsrequest *RegionSetLabelsRequest
  68689. urlParams_ gensupport.URLParams
  68690. ctx_ context.Context
  68691. header_ http.Header
  68692. }
  68693. // SetLabels: Sets the labels on an InterconnectAttachment. To learn
  68694. // more about labels, read the Labeling Resources documentation.
  68695. func (r *InterconnectAttachmentsService) SetLabels(project string, region string, resource string, regionsetlabelsrequest *RegionSetLabelsRequest) *InterconnectAttachmentsSetLabelsCall {
  68696. c := &InterconnectAttachmentsSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  68697. c.project = project
  68698. c.region = region
  68699. c.resource = resource
  68700. c.regionsetlabelsrequest = regionsetlabelsrequest
  68701. return c
  68702. }
  68703. // RequestId sets the optional parameter "requestId": An optional
  68704. // request ID to identify requests. Specify a unique request ID so that
  68705. // if you must retry your request, the server will know to ignore the
  68706. // request if it has already been completed.
  68707. //
  68708. // For example, consider a situation where you make an initial request
  68709. // and the request times out. If you make the request again with the
  68710. // same request ID, the server can check if original operation with the
  68711. // same request ID was received, and if so, will ignore the second
  68712. // request. This prevents clients from accidentally creating duplicate
  68713. // commitments.
  68714. //
  68715. // The request ID must be a valid UUID with the exception that zero UUID
  68716. // is not supported (00000000-0000-0000-0000-000000000000).
  68717. func (c *InterconnectAttachmentsSetLabelsCall) RequestId(requestId string) *InterconnectAttachmentsSetLabelsCall {
  68718. c.urlParams_.Set("requestId", requestId)
  68719. return c
  68720. }
  68721. // Fields allows partial responses to be retrieved. See
  68722. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  68723. // for more information.
  68724. func (c *InterconnectAttachmentsSetLabelsCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsSetLabelsCall {
  68725. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  68726. return c
  68727. }
  68728. // Context sets the context to be used in this call's Do method. Any
  68729. // pending HTTP request will be aborted if the provided context is
  68730. // canceled.
  68731. func (c *InterconnectAttachmentsSetLabelsCall) Context(ctx context.Context) *InterconnectAttachmentsSetLabelsCall {
  68732. c.ctx_ = ctx
  68733. return c
  68734. }
  68735. // Header returns an http.Header that can be modified by the caller to
  68736. // add HTTP headers to the request.
  68737. func (c *InterconnectAttachmentsSetLabelsCall) Header() http.Header {
  68738. if c.header_ == nil {
  68739. c.header_ = make(http.Header)
  68740. }
  68741. return c.header_
  68742. }
  68743. func (c *InterconnectAttachmentsSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  68744. reqHeaders := make(http.Header)
  68745. for k, v := range c.header_ {
  68746. reqHeaders[k] = v
  68747. }
  68748. reqHeaders.Set("User-Agent", c.s.userAgent())
  68749. var body io.Reader = nil
  68750. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest)
  68751. if err != nil {
  68752. return nil, err
  68753. }
  68754. reqHeaders.Set("Content-Type", "application/json")
  68755. c.urlParams_.Set("alt", alt)
  68756. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments/{resource}/setLabels")
  68757. urls += "?" + c.urlParams_.Encode()
  68758. req, _ := http.NewRequest("POST", urls, body)
  68759. req.Header = reqHeaders
  68760. googleapi.Expand(req.URL, map[string]string{
  68761. "project": c.project,
  68762. "region": c.region,
  68763. "resource": c.resource,
  68764. })
  68765. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  68766. }
  68767. // Do executes the "compute.interconnectAttachments.setLabels" call.
  68768. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  68769. // status code is an error. Response headers are in either
  68770. // *Operation.ServerResponse.Header or (if a response was returned at
  68771. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  68772. // to check whether the returned error was because
  68773. // http.StatusNotModified was returned.
  68774. func (c *InterconnectAttachmentsSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  68775. gensupport.SetOptions(c.urlParams_, opts...)
  68776. res, err := c.doRequest("json")
  68777. if res != nil && res.StatusCode == http.StatusNotModified {
  68778. if res.Body != nil {
  68779. res.Body.Close()
  68780. }
  68781. return nil, &googleapi.Error{
  68782. Code: res.StatusCode,
  68783. Header: res.Header,
  68784. }
  68785. }
  68786. if err != nil {
  68787. return nil, err
  68788. }
  68789. defer googleapi.CloseBody(res)
  68790. if err := googleapi.CheckResponse(res); err != nil {
  68791. return nil, err
  68792. }
  68793. ret := &Operation{
  68794. ServerResponse: googleapi.ServerResponse{
  68795. Header: res.Header,
  68796. HTTPStatusCode: res.StatusCode,
  68797. },
  68798. }
  68799. target := &ret
  68800. if err := gensupport.DecodeResponse(target, res); err != nil {
  68801. return nil, err
  68802. }
  68803. return ret, nil
  68804. // {
  68805. // "description": "Sets the labels on an InterconnectAttachment. To learn more about labels, read the Labeling Resources documentation.",
  68806. // "httpMethod": "POST",
  68807. // "id": "compute.interconnectAttachments.setLabels",
  68808. // "parameterOrder": [
  68809. // "project",
  68810. // "region",
  68811. // "resource"
  68812. // ],
  68813. // "parameters": {
  68814. // "project": {
  68815. // "description": "Project ID for this request.",
  68816. // "location": "path",
  68817. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  68818. // "required": true,
  68819. // "type": "string"
  68820. // },
  68821. // "region": {
  68822. // "description": "The region for this request.",
  68823. // "location": "path",
  68824. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  68825. // "required": true,
  68826. // "type": "string"
  68827. // },
  68828. // "requestId": {
  68829. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  68830. // "location": "query",
  68831. // "type": "string"
  68832. // },
  68833. // "resource": {
  68834. // "description": "Name of the resource for this request.",
  68835. // "location": "path",
  68836. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  68837. // "required": true,
  68838. // "type": "string"
  68839. // }
  68840. // },
  68841. // "path": "{project}/regions/{region}/interconnectAttachments/{resource}/setLabels",
  68842. // "request": {
  68843. // "$ref": "RegionSetLabelsRequest"
  68844. // },
  68845. // "response": {
  68846. // "$ref": "Operation"
  68847. // },
  68848. // "scopes": [
  68849. // "https://www.googleapis.com/auth/cloud-platform",
  68850. // "https://www.googleapis.com/auth/compute"
  68851. // ]
  68852. // }
  68853. }
  68854. // method id "compute.interconnectAttachments.testIamPermissions":
  68855. type InterconnectAttachmentsTestIamPermissionsCall struct {
  68856. s *Service
  68857. project string
  68858. region string
  68859. resource string
  68860. testpermissionsrequest *TestPermissionsRequest
  68861. urlParams_ gensupport.URLParams
  68862. ctx_ context.Context
  68863. header_ http.Header
  68864. }
  68865. // TestIamPermissions: Returns permissions that a caller has on the
  68866. // specified resource.
  68867. func (r *InterconnectAttachmentsService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *InterconnectAttachmentsTestIamPermissionsCall {
  68868. c := &InterconnectAttachmentsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  68869. c.project = project
  68870. c.region = region
  68871. c.resource = resource
  68872. c.testpermissionsrequest = testpermissionsrequest
  68873. return c
  68874. }
  68875. // Fields allows partial responses to be retrieved. See
  68876. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  68877. // for more information.
  68878. func (c *InterconnectAttachmentsTestIamPermissionsCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsTestIamPermissionsCall {
  68879. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  68880. return c
  68881. }
  68882. // Context sets the context to be used in this call's Do method. Any
  68883. // pending HTTP request will be aborted if the provided context is
  68884. // canceled.
  68885. func (c *InterconnectAttachmentsTestIamPermissionsCall) Context(ctx context.Context) *InterconnectAttachmentsTestIamPermissionsCall {
  68886. c.ctx_ = ctx
  68887. return c
  68888. }
  68889. // Header returns an http.Header that can be modified by the caller to
  68890. // add HTTP headers to the request.
  68891. func (c *InterconnectAttachmentsTestIamPermissionsCall) Header() http.Header {
  68892. if c.header_ == nil {
  68893. c.header_ = make(http.Header)
  68894. }
  68895. return c.header_
  68896. }
  68897. func (c *InterconnectAttachmentsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  68898. reqHeaders := make(http.Header)
  68899. for k, v := range c.header_ {
  68900. reqHeaders[k] = v
  68901. }
  68902. reqHeaders.Set("User-Agent", c.s.userAgent())
  68903. var body io.Reader = nil
  68904. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  68905. if err != nil {
  68906. return nil, err
  68907. }
  68908. reqHeaders.Set("Content-Type", "application/json")
  68909. c.urlParams_.Set("alt", alt)
  68910. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments/{resource}/testIamPermissions")
  68911. urls += "?" + c.urlParams_.Encode()
  68912. req, _ := http.NewRequest("POST", urls, body)
  68913. req.Header = reqHeaders
  68914. googleapi.Expand(req.URL, map[string]string{
  68915. "project": c.project,
  68916. "region": c.region,
  68917. "resource": c.resource,
  68918. })
  68919. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  68920. }
  68921. // Do executes the "compute.interconnectAttachments.testIamPermissions" call.
  68922. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  68923. // non-2xx status code is an error. Response headers are in either
  68924. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  68925. // returned at all) in error.(*googleapi.Error).Header. Use
  68926. // googleapi.IsNotModified to check whether the returned error was
  68927. // because http.StatusNotModified was returned.
  68928. func (c *InterconnectAttachmentsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  68929. gensupport.SetOptions(c.urlParams_, opts...)
  68930. res, err := c.doRequest("json")
  68931. if res != nil && res.StatusCode == http.StatusNotModified {
  68932. if res.Body != nil {
  68933. res.Body.Close()
  68934. }
  68935. return nil, &googleapi.Error{
  68936. Code: res.StatusCode,
  68937. Header: res.Header,
  68938. }
  68939. }
  68940. if err != nil {
  68941. return nil, err
  68942. }
  68943. defer googleapi.CloseBody(res)
  68944. if err := googleapi.CheckResponse(res); err != nil {
  68945. return nil, err
  68946. }
  68947. ret := &TestPermissionsResponse{
  68948. ServerResponse: googleapi.ServerResponse{
  68949. Header: res.Header,
  68950. HTTPStatusCode: res.StatusCode,
  68951. },
  68952. }
  68953. target := &ret
  68954. if err := gensupport.DecodeResponse(target, res); err != nil {
  68955. return nil, err
  68956. }
  68957. return ret, nil
  68958. // {
  68959. // "description": "Returns permissions that a caller has on the specified resource.",
  68960. // "httpMethod": "POST",
  68961. // "id": "compute.interconnectAttachments.testIamPermissions",
  68962. // "parameterOrder": [
  68963. // "project",
  68964. // "region",
  68965. // "resource"
  68966. // ],
  68967. // "parameters": {
  68968. // "project": {
  68969. // "description": "Project ID for this request.",
  68970. // "location": "path",
  68971. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  68972. // "required": true,
  68973. // "type": "string"
  68974. // },
  68975. // "region": {
  68976. // "description": "The name of the region for this request.",
  68977. // "location": "path",
  68978. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  68979. // "required": true,
  68980. // "type": "string"
  68981. // },
  68982. // "resource": {
  68983. // "description": "Name of the resource for this request.",
  68984. // "location": "path",
  68985. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  68986. // "required": true,
  68987. // "type": "string"
  68988. // }
  68989. // },
  68990. // "path": "{project}/regions/{region}/interconnectAttachments/{resource}/testIamPermissions",
  68991. // "request": {
  68992. // "$ref": "TestPermissionsRequest"
  68993. // },
  68994. // "response": {
  68995. // "$ref": "TestPermissionsResponse"
  68996. // },
  68997. // "scopes": [
  68998. // "https://www.googleapis.com/auth/cloud-platform",
  68999. // "https://www.googleapis.com/auth/compute",
  69000. // "https://www.googleapis.com/auth/compute.readonly"
  69001. // ]
  69002. // }
  69003. }
  69004. // method id "compute.interconnectLocations.get":
  69005. type InterconnectLocationsGetCall struct {
  69006. s *Service
  69007. project string
  69008. interconnectLocation string
  69009. urlParams_ gensupport.URLParams
  69010. ifNoneMatch_ string
  69011. ctx_ context.Context
  69012. header_ http.Header
  69013. }
  69014. // Get: Returns the details for the specified interconnect location.
  69015. // Gets a list of available interconnect locations by making a list()
  69016. // request.
  69017. func (r *InterconnectLocationsService) Get(project string, interconnectLocation string) *InterconnectLocationsGetCall {
  69018. c := &InterconnectLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  69019. c.project = project
  69020. c.interconnectLocation = interconnectLocation
  69021. return c
  69022. }
  69023. // Fields allows partial responses to be retrieved. See
  69024. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  69025. // for more information.
  69026. func (c *InterconnectLocationsGetCall) Fields(s ...googleapi.Field) *InterconnectLocationsGetCall {
  69027. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  69028. return c
  69029. }
  69030. // IfNoneMatch sets the optional parameter which makes the operation
  69031. // fail if the object's ETag matches the given value. This is useful for
  69032. // getting updates only after the object has changed since the last
  69033. // request. Use googleapi.IsNotModified to check whether the response
  69034. // error from Do is the result of In-None-Match.
  69035. func (c *InterconnectLocationsGetCall) IfNoneMatch(entityTag string) *InterconnectLocationsGetCall {
  69036. c.ifNoneMatch_ = entityTag
  69037. return c
  69038. }
  69039. // Context sets the context to be used in this call's Do method. Any
  69040. // pending HTTP request will be aborted if the provided context is
  69041. // canceled.
  69042. func (c *InterconnectLocationsGetCall) Context(ctx context.Context) *InterconnectLocationsGetCall {
  69043. c.ctx_ = ctx
  69044. return c
  69045. }
  69046. // Header returns an http.Header that can be modified by the caller to
  69047. // add HTTP headers to the request.
  69048. func (c *InterconnectLocationsGetCall) Header() http.Header {
  69049. if c.header_ == nil {
  69050. c.header_ = make(http.Header)
  69051. }
  69052. return c.header_
  69053. }
  69054. func (c *InterconnectLocationsGetCall) doRequest(alt string) (*http.Response, error) {
  69055. reqHeaders := make(http.Header)
  69056. for k, v := range c.header_ {
  69057. reqHeaders[k] = v
  69058. }
  69059. reqHeaders.Set("User-Agent", c.s.userAgent())
  69060. if c.ifNoneMatch_ != "" {
  69061. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  69062. }
  69063. var body io.Reader = nil
  69064. c.urlParams_.Set("alt", alt)
  69065. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnectLocations/{interconnectLocation}")
  69066. urls += "?" + c.urlParams_.Encode()
  69067. req, _ := http.NewRequest("GET", urls, body)
  69068. req.Header = reqHeaders
  69069. googleapi.Expand(req.URL, map[string]string{
  69070. "project": c.project,
  69071. "interconnectLocation": c.interconnectLocation,
  69072. })
  69073. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  69074. }
  69075. // Do executes the "compute.interconnectLocations.get" call.
  69076. // Exactly one of *InterconnectLocation or error will be non-nil. Any
  69077. // non-2xx status code is an error. Response headers are in either
  69078. // *InterconnectLocation.ServerResponse.Header or (if a response was
  69079. // returned at all) in error.(*googleapi.Error).Header. Use
  69080. // googleapi.IsNotModified to check whether the returned error was
  69081. // because http.StatusNotModified was returned.
  69082. func (c *InterconnectLocationsGetCall) Do(opts ...googleapi.CallOption) (*InterconnectLocation, error) {
  69083. gensupport.SetOptions(c.urlParams_, opts...)
  69084. res, err := c.doRequest("json")
  69085. if res != nil && res.StatusCode == http.StatusNotModified {
  69086. if res.Body != nil {
  69087. res.Body.Close()
  69088. }
  69089. return nil, &googleapi.Error{
  69090. Code: res.StatusCode,
  69091. Header: res.Header,
  69092. }
  69093. }
  69094. if err != nil {
  69095. return nil, err
  69096. }
  69097. defer googleapi.CloseBody(res)
  69098. if err := googleapi.CheckResponse(res); err != nil {
  69099. return nil, err
  69100. }
  69101. ret := &InterconnectLocation{
  69102. ServerResponse: googleapi.ServerResponse{
  69103. Header: res.Header,
  69104. HTTPStatusCode: res.StatusCode,
  69105. },
  69106. }
  69107. target := &ret
  69108. if err := gensupport.DecodeResponse(target, res); err != nil {
  69109. return nil, err
  69110. }
  69111. return ret, nil
  69112. // {
  69113. // "description": "Returns the details for the specified interconnect location. Gets a list of available interconnect locations by making a list() request.",
  69114. // "httpMethod": "GET",
  69115. // "id": "compute.interconnectLocations.get",
  69116. // "parameterOrder": [
  69117. // "project",
  69118. // "interconnectLocation"
  69119. // ],
  69120. // "parameters": {
  69121. // "interconnectLocation": {
  69122. // "description": "Name of the interconnect location to return.",
  69123. // "location": "path",
  69124. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  69125. // "required": true,
  69126. // "type": "string"
  69127. // },
  69128. // "project": {
  69129. // "description": "Project ID for this request.",
  69130. // "location": "path",
  69131. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  69132. // "required": true,
  69133. // "type": "string"
  69134. // }
  69135. // },
  69136. // "path": "{project}/global/interconnectLocations/{interconnectLocation}",
  69137. // "response": {
  69138. // "$ref": "InterconnectLocation"
  69139. // },
  69140. // "scopes": [
  69141. // "https://www.googleapis.com/auth/cloud-platform",
  69142. // "https://www.googleapis.com/auth/compute",
  69143. // "https://www.googleapis.com/auth/compute.readonly"
  69144. // ]
  69145. // }
  69146. }
  69147. // method id "compute.interconnectLocations.list":
  69148. type InterconnectLocationsListCall struct {
  69149. s *Service
  69150. project string
  69151. urlParams_ gensupport.URLParams
  69152. ifNoneMatch_ string
  69153. ctx_ context.Context
  69154. header_ http.Header
  69155. }
  69156. // List: Retrieves the list of interconnect locations available to the
  69157. // specified project.
  69158. func (r *InterconnectLocationsService) List(project string) *InterconnectLocationsListCall {
  69159. c := &InterconnectLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  69160. c.project = project
  69161. return c
  69162. }
  69163. // Filter sets the optional parameter "filter": A filter expression that
  69164. // filters resources listed in the response. The expression must specify
  69165. // the field name, a comparison operator, and the value that you want to
  69166. // use for filtering. The value must be a string, a number, or a
  69167. // boolean. The comparison operator must be either =, !=, >, or <.
  69168. //
  69169. // For example, if you are filtering Compute Engine instances, you can
  69170. // exclude instances named example-instance by specifying name !=
  69171. // example-instance.
  69172. //
  69173. // You can also filter nested fields. For example, you could specify
  69174. // scheduling.automaticRestart = false to include instances only if they
  69175. // are not scheduled for automatic restarts. You can use filtering on
  69176. // nested fields to filter based on resource labels.
  69177. //
  69178. // To filter on multiple expressions, provide each separate expression
  69179. // within parentheses. For example, (scheduling.automaticRestart = true)
  69180. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  69181. // AND expression. However, you can include AND and OR expressions
  69182. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  69183. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  69184. // true).
  69185. func (c *InterconnectLocationsListCall) Filter(filter string) *InterconnectLocationsListCall {
  69186. c.urlParams_.Set("filter", filter)
  69187. return c
  69188. }
  69189. // MaxResults sets the optional parameter "maxResults": The maximum
  69190. // number of results per page that should be returned. If the number of
  69191. // available results is larger than maxResults, Compute Engine returns a
  69192. // nextPageToken that can be used to get the next page of results in
  69193. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  69194. // (Default: 500)
  69195. func (c *InterconnectLocationsListCall) MaxResults(maxResults int64) *InterconnectLocationsListCall {
  69196. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  69197. return c
  69198. }
  69199. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  69200. // a certain order. By default, results are returned in alphanumerical
  69201. // order based on the resource name.
  69202. //
  69203. // You can also sort results in descending order based on the creation
  69204. // timestamp using orderBy="creationTimestamp desc". This sorts results
  69205. // based on the creationTimestamp field in reverse chronological order
  69206. // (newest result first). Use this to sort resources like operations so
  69207. // that the newest operation is returned first.
  69208. //
  69209. // Currently, only sorting by name or creationTimestamp desc is
  69210. // supported.
  69211. func (c *InterconnectLocationsListCall) OrderBy(orderBy string) *InterconnectLocationsListCall {
  69212. c.urlParams_.Set("orderBy", orderBy)
  69213. return c
  69214. }
  69215. // PageToken sets the optional parameter "pageToken": Specifies a page
  69216. // token to use. Set pageToken to the nextPageToken returned by a
  69217. // previous list request to get the next page of results.
  69218. func (c *InterconnectLocationsListCall) PageToken(pageToken string) *InterconnectLocationsListCall {
  69219. c.urlParams_.Set("pageToken", pageToken)
  69220. return c
  69221. }
  69222. // Fields allows partial responses to be retrieved. See
  69223. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  69224. // for more information.
  69225. func (c *InterconnectLocationsListCall) Fields(s ...googleapi.Field) *InterconnectLocationsListCall {
  69226. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  69227. return c
  69228. }
  69229. // IfNoneMatch sets the optional parameter which makes the operation
  69230. // fail if the object's ETag matches the given value. This is useful for
  69231. // getting updates only after the object has changed since the last
  69232. // request. Use googleapi.IsNotModified to check whether the response
  69233. // error from Do is the result of In-None-Match.
  69234. func (c *InterconnectLocationsListCall) IfNoneMatch(entityTag string) *InterconnectLocationsListCall {
  69235. c.ifNoneMatch_ = entityTag
  69236. return c
  69237. }
  69238. // Context sets the context to be used in this call's Do method. Any
  69239. // pending HTTP request will be aborted if the provided context is
  69240. // canceled.
  69241. func (c *InterconnectLocationsListCall) Context(ctx context.Context) *InterconnectLocationsListCall {
  69242. c.ctx_ = ctx
  69243. return c
  69244. }
  69245. // Header returns an http.Header that can be modified by the caller to
  69246. // add HTTP headers to the request.
  69247. func (c *InterconnectLocationsListCall) Header() http.Header {
  69248. if c.header_ == nil {
  69249. c.header_ = make(http.Header)
  69250. }
  69251. return c.header_
  69252. }
  69253. func (c *InterconnectLocationsListCall) doRequest(alt string) (*http.Response, error) {
  69254. reqHeaders := make(http.Header)
  69255. for k, v := range c.header_ {
  69256. reqHeaders[k] = v
  69257. }
  69258. reqHeaders.Set("User-Agent", c.s.userAgent())
  69259. if c.ifNoneMatch_ != "" {
  69260. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  69261. }
  69262. var body io.Reader = nil
  69263. c.urlParams_.Set("alt", alt)
  69264. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnectLocations")
  69265. urls += "?" + c.urlParams_.Encode()
  69266. req, _ := http.NewRequest("GET", urls, body)
  69267. req.Header = reqHeaders
  69268. googleapi.Expand(req.URL, map[string]string{
  69269. "project": c.project,
  69270. })
  69271. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  69272. }
  69273. // Do executes the "compute.interconnectLocations.list" call.
  69274. // Exactly one of *InterconnectLocationList or error will be non-nil.
  69275. // Any non-2xx status code is an error. Response headers are in either
  69276. // *InterconnectLocationList.ServerResponse.Header or (if a response was
  69277. // returned at all) in error.(*googleapi.Error).Header. Use
  69278. // googleapi.IsNotModified to check whether the returned error was
  69279. // because http.StatusNotModified was returned.
  69280. func (c *InterconnectLocationsListCall) Do(opts ...googleapi.CallOption) (*InterconnectLocationList, error) {
  69281. gensupport.SetOptions(c.urlParams_, opts...)
  69282. res, err := c.doRequest("json")
  69283. if res != nil && res.StatusCode == http.StatusNotModified {
  69284. if res.Body != nil {
  69285. res.Body.Close()
  69286. }
  69287. return nil, &googleapi.Error{
  69288. Code: res.StatusCode,
  69289. Header: res.Header,
  69290. }
  69291. }
  69292. if err != nil {
  69293. return nil, err
  69294. }
  69295. defer googleapi.CloseBody(res)
  69296. if err := googleapi.CheckResponse(res); err != nil {
  69297. return nil, err
  69298. }
  69299. ret := &InterconnectLocationList{
  69300. ServerResponse: googleapi.ServerResponse{
  69301. Header: res.Header,
  69302. HTTPStatusCode: res.StatusCode,
  69303. },
  69304. }
  69305. target := &ret
  69306. if err := gensupport.DecodeResponse(target, res); err != nil {
  69307. return nil, err
  69308. }
  69309. return ret, nil
  69310. // {
  69311. // "description": "Retrieves the list of interconnect locations available to the specified project.",
  69312. // "httpMethod": "GET",
  69313. // "id": "compute.interconnectLocations.list",
  69314. // "parameterOrder": [
  69315. // "project"
  69316. // ],
  69317. // "parameters": {
  69318. // "filter": {
  69319. // "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).",
  69320. // "location": "query",
  69321. // "type": "string"
  69322. // },
  69323. // "maxResults": {
  69324. // "default": "500",
  69325. // "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)",
  69326. // "format": "uint32",
  69327. // "location": "query",
  69328. // "minimum": "0",
  69329. // "type": "integer"
  69330. // },
  69331. // "orderBy": {
  69332. // "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.",
  69333. // "location": "query",
  69334. // "type": "string"
  69335. // },
  69336. // "pageToken": {
  69337. // "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.",
  69338. // "location": "query",
  69339. // "type": "string"
  69340. // },
  69341. // "project": {
  69342. // "description": "Project ID for this request.",
  69343. // "location": "path",
  69344. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  69345. // "required": true,
  69346. // "type": "string"
  69347. // }
  69348. // },
  69349. // "path": "{project}/global/interconnectLocations",
  69350. // "response": {
  69351. // "$ref": "InterconnectLocationList"
  69352. // },
  69353. // "scopes": [
  69354. // "https://www.googleapis.com/auth/cloud-platform",
  69355. // "https://www.googleapis.com/auth/compute",
  69356. // "https://www.googleapis.com/auth/compute.readonly"
  69357. // ]
  69358. // }
  69359. }
  69360. // Pages invokes f for each page of results.
  69361. // A non-nil error returned from f will halt the iteration.
  69362. // The provided context supersedes any context provided to the Context method.
  69363. func (c *InterconnectLocationsListCall) Pages(ctx context.Context, f func(*InterconnectLocationList) error) error {
  69364. c.ctx_ = ctx
  69365. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  69366. for {
  69367. x, err := c.Do()
  69368. if err != nil {
  69369. return err
  69370. }
  69371. if err := f(x); err != nil {
  69372. return err
  69373. }
  69374. if x.NextPageToken == "" {
  69375. return nil
  69376. }
  69377. c.PageToken(x.NextPageToken)
  69378. }
  69379. }
  69380. // method id "compute.interconnectLocations.testIamPermissions":
  69381. type InterconnectLocationsTestIamPermissionsCall struct {
  69382. s *Service
  69383. project string
  69384. resource string
  69385. testpermissionsrequest *TestPermissionsRequest
  69386. urlParams_ gensupport.URLParams
  69387. ctx_ context.Context
  69388. header_ http.Header
  69389. }
  69390. // TestIamPermissions: Returns permissions that a caller has on the
  69391. // specified resource.
  69392. func (r *InterconnectLocationsService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *InterconnectLocationsTestIamPermissionsCall {
  69393. c := &InterconnectLocationsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  69394. c.project = project
  69395. c.resource = resource
  69396. c.testpermissionsrequest = testpermissionsrequest
  69397. return c
  69398. }
  69399. // Fields allows partial responses to be retrieved. See
  69400. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  69401. // for more information.
  69402. func (c *InterconnectLocationsTestIamPermissionsCall) Fields(s ...googleapi.Field) *InterconnectLocationsTestIamPermissionsCall {
  69403. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  69404. return c
  69405. }
  69406. // Context sets the context to be used in this call's Do method. Any
  69407. // pending HTTP request will be aborted if the provided context is
  69408. // canceled.
  69409. func (c *InterconnectLocationsTestIamPermissionsCall) Context(ctx context.Context) *InterconnectLocationsTestIamPermissionsCall {
  69410. c.ctx_ = ctx
  69411. return c
  69412. }
  69413. // Header returns an http.Header that can be modified by the caller to
  69414. // add HTTP headers to the request.
  69415. func (c *InterconnectLocationsTestIamPermissionsCall) Header() http.Header {
  69416. if c.header_ == nil {
  69417. c.header_ = make(http.Header)
  69418. }
  69419. return c.header_
  69420. }
  69421. func (c *InterconnectLocationsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  69422. reqHeaders := make(http.Header)
  69423. for k, v := range c.header_ {
  69424. reqHeaders[k] = v
  69425. }
  69426. reqHeaders.Set("User-Agent", c.s.userAgent())
  69427. var body io.Reader = nil
  69428. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  69429. if err != nil {
  69430. return nil, err
  69431. }
  69432. reqHeaders.Set("Content-Type", "application/json")
  69433. c.urlParams_.Set("alt", alt)
  69434. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnectLocations/{resource}/testIamPermissions")
  69435. urls += "?" + c.urlParams_.Encode()
  69436. req, _ := http.NewRequest("POST", urls, body)
  69437. req.Header = reqHeaders
  69438. googleapi.Expand(req.URL, map[string]string{
  69439. "project": c.project,
  69440. "resource": c.resource,
  69441. })
  69442. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  69443. }
  69444. // Do executes the "compute.interconnectLocations.testIamPermissions" call.
  69445. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  69446. // non-2xx status code is an error. Response headers are in either
  69447. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  69448. // returned at all) in error.(*googleapi.Error).Header. Use
  69449. // googleapi.IsNotModified to check whether the returned error was
  69450. // because http.StatusNotModified was returned.
  69451. func (c *InterconnectLocationsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  69452. gensupport.SetOptions(c.urlParams_, opts...)
  69453. res, err := c.doRequest("json")
  69454. if res != nil && res.StatusCode == http.StatusNotModified {
  69455. if res.Body != nil {
  69456. res.Body.Close()
  69457. }
  69458. return nil, &googleapi.Error{
  69459. Code: res.StatusCode,
  69460. Header: res.Header,
  69461. }
  69462. }
  69463. if err != nil {
  69464. return nil, err
  69465. }
  69466. defer googleapi.CloseBody(res)
  69467. if err := googleapi.CheckResponse(res); err != nil {
  69468. return nil, err
  69469. }
  69470. ret := &TestPermissionsResponse{
  69471. ServerResponse: googleapi.ServerResponse{
  69472. Header: res.Header,
  69473. HTTPStatusCode: res.StatusCode,
  69474. },
  69475. }
  69476. target := &ret
  69477. if err := gensupport.DecodeResponse(target, res); err != nil {
  69478. return nil, err
  69479. }
  69480. return ret, nil
  69481. // {
  69482. // "description": "Returns permissions that a caller has on the specified resource.",
  69483. // "httpMethod": "POST",
  69484. // "id": "compute.interconnectLocations.testIamPermissions",
  69485. // "parameterOrder": [
  69486. // "project",
  69487. // "resource"
  69488. // ],
  69489. // "parameters": {
  69490. // "project": {
  69491. // "description": "Project ID for this request.",
  69492. // "location": "path",
  69493. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  69494. // "required": true,
  69495. // "type": "string"
  69496. // },
  69497. // "resource": {
  69498. // "description": "Name of the resource for this request.",
  69499. // "location": "path",
  69500. // "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?",
  69501. // "required": true,
  69502. // "type": "string"
  69503. // }
  69504. // },
  69505. // "path": "{project}/global/interconnectLocations/{resource}/testIamPermissions",
  69506. // "request": {
  69507. // "$ref": "TestPermissionsRequest"
  69508. // },
  69509. // "response": {
  69510. // "$ref": "TestPermissionsResponse"
  69511. // },
  69512. // "scopes": [
  69513. // "https://www.googleapis.com/auth/cloud-platform",
  69514. // "https://www.googleapis.com/auth/compute",
  69515. // "https://www.googleapis.com/auth/compute.readonly"
  69516. // ]
  69517. // }
  69518. }
  69519. // method id "compute.interconnects.delete":
  69520. type InterconnectsDeleteCall struct {
  69521. s *Service
  69522. project string
  69523. interconnect string
  69524. urlParams_ gensupport.URLParams
  69525. ctx_ context.Context
  69526. header_ http.Header
  69527. }
  69528. // Delete: Deletes the specified interconnect.
  69529. func (r *InterconnectsService) Delete(project string, interconnect string) *InterconnectsDeleteCall {
  69530. c := &InterconnectsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  69531. c.project = project
  69532. c.interconnect = interconnect
  69533. return c
  69534. }
  69535. // RequestId sets the optional parameter "requestId": An optional
  69536. // request ID to identify requests. Specify a unique request ID so that
  69537. // if you must retry your request, the server will know to ignore the
  69538. // request if it has already been completed.
  69539. //
  69540. // For example, consider a situation where you make an initial request
  69541. // and the request times out. If you make the request again with the
  69542. // same request ID, the server can check if original operation with the
  69543. // same request ID was received, and if so, will ignore the second
  69544. // request. This prevents clients from accidentally creating duplicate
  69545. // commitments.
  69546. //
  69547. // The request ID must be a valid UUID with the exception that zero UUID
  69548. // is not supported (00000000-0000-0000-0000-000000000000).
  69549. func (c *InterconnectsDeleteCall) RequestId(requestId string) *InterconnectsDeleteCall {
  69550. c.urlParams_.Set("requestId", requestId)
  69551. return c
  69552. }
  69553. // Fields allows partial responses to be retrieved. See
  69554. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  69555. // for more information.
  69556. func (c *InterconnectsDeleteCall) Fields(s ...googleapi.Field) *InterconnectsDeleteCall {
  69557. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  69558. return c
  69559. }
  69560. // Context sets the context to be used in this call's Do method. Any
  69561. // pending HTTP request will be aborted if the provided context is
  69562. // canceled.
  69563. func (c *InterconnectsDeleteCall) Context(ctx context.Context) *InterconnectsDeleteCall {
  69564. c.ctx_ = ctx
  69565. return c
  69566. }
  69567. // Header returns an http.Header that can be modified by the caller to
  69568. // add HTTP headers to the request.
  69569. func (c *InterconnectsDeleteCall) Header() http.Header {
  69570. if c.header_ == nil {
  69571. c.header_ = make(http.Header)
  69572. }
  69573. return c.header_
  69574. }
  69575. func (c *InterconnectsDeleteCall) doRequest(alt string) (*http.Response, error) {
  69576. reqHeaders := make(http.Header)
  69577. for k, v := range c.header_ {
  69578. reqHeaders[k] = v
  69579. }
  69580. reqHeaders.Set("User-Agent", c.s.userAgent())
  69581. var body io.Reader = nil
  69582. c.urlParams_.Set("alt", alt)
  69583. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects/{interconnect}")
  69584. urls += "?" + c.urlParams_.Encode()
  69585. req, _ := http.NewRequest("DELETE", urls, body)
  69586. req.Header = reqHeaders
  69587. googleapi.Expand(req.URL, map[string]string{
  69588. "project": c.project,
  69589. "interconnect": c.interconnect,
  69590. })
  69591. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  69592. }
  69593. // Do executes the "compute.interconnects.delete" call.
  69594. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  69595. // status code is an error. Response headers are in either
  69596. // *Operation.ServerResponse.Header or (if a response was returned at
  69597. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  69598. // to check whether the returned error was because
  69599. // http.StatusNotModified was returned.
  69600. func (c *InterconnectsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  69601. gensupport.SetOptions(c.urlParams_, opts...)
  69602. res, err := c.doRequest("json")
  69603. if res != nil && res.StatusCode == http.StatusNotModified {
  69604. if res.Body != nil {
  69605. res.Body.Close()
  69606. }
  69607. return nil, &googleapi.Error{
  69608. Code: res.StatusCode,
  69609. Header: res.Header,
  69610. }
  69611. }
  69612. if err != nil {
  69613. return nil, err
  69614. }
  69615. defer googleapi.CloseBody(res)
  69616. if err := googleapi.CheckResponse(res); err != nil {
  69617. return nil, err
  69618. }
  69619. ret := &Operation{
  69620. ServerResponse: googleapi.ServerResponse{
  69621. Header: res.Header,
  69622. HTTPStatusCode: res.StatusCode,
  69623. },
  69624. }
  69625. target := &ret
  69626. if err := gensupport.DecodeResponse(target, res); err != nil {
  69627. return nil, err
  69628. }
  69629. return ret, nil
  69630. // {
  69631. // "description": "Deletes the specified interconnect.",
  69632. // "httpMethod": "DELETE",
  69633. // "id": "compute.interconnects.delete",
  69634. // "parameterOrder": [
  69635. // "project",
  69636. // "interconnect"
  69637. // ],
  69638. // "parameters": {
  69639. // "interconnect": {
  69640. // "description": "Name of the interconnect to delete.",
  69641. // "location": "path",
  69642. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  69643. // "required": true,
  69644. // "type": "string"
  69645. // },
  69646. // "project": {
  69647. // "description": "Project ID for this request.",
  69648. // "location": "path",
  69649. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  69650. // "required": true,
  69651. // "type": "string"
  69652. // },
  69653. // "requestId": {
  69654. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  69655. // "location": "query",
  69656. // "type": "string"
  69657. // }
  69658. // },
  69659. // "path": "{project}/global/interconnects/{interconnect}",
  69660. // "response": {
  69661. // "$ref": "Operation"
  69662. // },
  69663. // "scopes": [
  69664. // "https://www.googleapis.com/auth/cloud-platform",
  69665. // "https://www.googleapis.com/auth/compute"
  69666. // ]
  69667. // }
  69668. }
  69669. // method id "compute.interconnects.get":
  69670. type InterconnectsGetCall struct {
  69671. s *Service
  69672. project string
  69673. interconnect string
  69674. urlParams_ gensupport.URLParams
  69675. ifNoneMatch_ string
  69676. ctx_ context.Context
  69677. header_ http.Header
  69678. }
  69679. // Get: Returns the specified interconnect. Get a list of available
  69680. // interconnects by making a list() request.
  69681. func (r *InterconnectsService) Get(project string, interconnect string) *InterconnectsGetCall {
  69682. c := &InterconnectsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  69683. c.project = project
  69684. c.interconnect = interconnect
  69685. return c
  69686. }
  69687. // Fields allows partial responses to be retrieved. See
  69688. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  69689. // for more information.
  69690. func (c *InterconnectsGetCall) Fields(s ...googleapi.Field) *InterconnectsGetCall {
  69691. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  69692. return c
  69693. }
  69694. // IfNoneMatch sets the optional parameter which makes the operation
  69695. // fail if the object's ETag matches the given value. This is useful for
  69696. // getting updates only after the object has changed since the last
  69697. // request. Use googleapi.IsNotModified to check whether the response
  69698. // error from Do is the result of In-None-Match.
  69699. func (c *InterconnectsGetCall) IfNoneMatch(entityTag string) *InterconnectsGetCall {
  69700. c.ifNoneMatch_ = entityTag
  69701. return c
  69702. }
  69703. // Context sets the context to be used in this call's Do method. Any
  69704. // pending HTTP request will be aborted if the provided context is
  69705. // canceled.
  69706. func (c *InterconnectsGetCall) Context(ctx context.Context) *InterconnectsGetCall {
  69707. c.ctx_ = ctx
  69708. return c
  69709. }
  69710. // Header returns an http.Header that can be modified by the caller to
  69711. // add HTTP headers to the request.
  69712. func (c *InterconnectsGetCall) Header() http.Header {
  69713. if c.header_ == nil {
  69714. c.header_ = make(http.Header)
  69715. }
  69716. return c.header_
  69717. }
  69718. func (c *InterconnectsGetCall) doRequest(alt string) (*http.Response, error) {
  69719. reqHeaders := make(http.Header)
  69720. for k, v := range c.header_ {
  69721. reqHeaders[k] = v
  69722. }
  69723. reqHeaders.Set("User-Agent", c.s.userAgent())
  69724. if c.ifNoneMatch_ != "" {
  69725. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  69726. }
  69727. var body io.Reader = nil
  69728. c.urlParams_.Set("alt", alt)
  69729. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects/{interconnect}")
  69730. urls += "?" + c.urlParams_.Encode()
  69731. req, _ := http.NewRequest("GET", urls, body)
  69732. req.Header = reqHeaders
  69733. googleapi.Expand(req.URL, map[string]string{
  69734. "project": c.project,
  69735. "interconnect": c.interconnect,
  69736. })
  69737. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  69738. }
  69739. // Do executes the "compute.interconnects.get" call.
  69740. // Exactly one of *Interconnect or error will be non-nil. Any non-2xx
  69741. // status code is an error. Response headers are in either
  69742. // *Interconnect.ServerResponse.Header or (if a response was returned at
  69743. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  69744. // to check whether the returned error was because
  69745. // http.StatusNotModified was returned.
  69746. func (c *InterconnectsGetCall) Do(opts ...googleapi.CallOption) (*Interconnect, error) {
  69747. gensupport.SetOptions(c.urlParams_, opts...)
  69748. res, err := c.doRequest("json")
  69749. if res != nil && res.StatusCode == http.StatusNotModified {
  69750. if res.Body != nil {
  69751. res.Body.Close()
  69752. }
  69753. return nil, &googleapi.Error{
  69754. Code: res.StatusCode,
  69755. Header: res.Header,
  69756. }
  69757. }
  69758. if err != nil {
  69759. return nil, err
  69760. }
  69761. defer googleapi.CloseBody(res)
  69762. if err := googleapi.CheckResponse(res); err != nil {
  69763. return nil, err
  69764. }
  69765. ret := &Interconnect{
  69766. ServerResponse: googleapi.ServerResponse{
  69767. Header: res.Header,
  69768. HTTPStatusCode: res.StatusCode,
  69769. },
  69770. }
  69771. target := &ret
  69772. if err := gensupport.DecodeResponse(target, res); err != nil {
  69773. return nil, err
  69774. }
  69775. return ret, nil
  69776. // {
  69777. // "description": "Returns the specified interconnect. Get a list of available interconnects by making a list() request.",
  69778. // "httpMethod": "GET",
  69779. // "id": "compute.interconnects.get",
  69780. // "parameterOrder": [
  69781. // "project",
  69782. // "interconnect"
  69783. // ],
  69784. // "parameters": {
  69785. // "interconnect": {
  69786. // "description": "Name of the interconnect to return.",
  69787. // "location": "path",
  69788. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  69789. // "required": true,
  69790. // "type": "string"
  69791. // },
  69792. // "project": {
  69793. // "description": "Project ID for this request.",
  69794. // "location": "path",
  69795. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  69796. // "required": true,
  69797. // "type": "string"
  69798. // }
  69799. // },
  69800. // "path": "{project}/global/interconnects/{interconnect}",
  69801. // "response": {
  69802. // "$ref": "Interconnect"
  69803. // },
  69804. // "scopes": [
  69805. // "https://www.googleapis.com/auth/cloud-platform",
  69806. // "https://www.googleapis.com/auth/compute",
  69807. // "https://www.googleapis.com/auth/compute.readonly"
  69808. // ]
  69809. // }
  69810. }
  69811. // method id "compute.interconnects.getIamPolicy":
  69812. type InterconnectsGetIamPolicyCall struct {
  69813. s *Service
  69814. project string
  69815. resource string
  69816. urlParams_ gensupport.URLParams
  69817. ifNoneMatch_ string
  69818. ctx_ context.Context
  69819. header_ http.Header
  69820. }
  69821. // GetIamPolicy: Gets the access control policy for a resource. May be
  69822. // empty if no such policy or resource exists.
  69823. func (r *InterconnectsService) GetIamPolicy(project string, resource string) *InterconnectsGetIamPolicyCall {
  69824. c := &InterconnectsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  69825. c.project = project
  69826. c.resource = resource
  69827. return c
  69828. }
  69829. // Fields allows partial responses to be retrieved. See
  69830. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  69831. // for more information.
  69832. func (c *InterconnectsGetIamPolicyCall) Fields(s ...googleapi.Field) *InterconnectsGetIamPolicyCall {
  69833. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  69834. return c
  69835. }
  69836. // IfNoneMatch sets the optional parameter which makes the operation
  69837. // fail if the object's ETag matches the given value. This is useful for
  69838. // getting updates only after the object has changed since the last
  69839. // request. Use googleapi.IsNotModified to check whether the response
  69840. // error from Do is the result of In-None-Match.
  69841. func (c *InterconnectsGetIamPolicyCall) IfNoneMatch(entityTag string) *InterconnectsGetIamPolicyCall {
  69842. c.ifNoneMatch_ = entityTag
  69843. return c
  69844. }
  69845. // Context sets the context to be used in this call's Do method. Any
  69846. // pending HTTP request will be aborted if the provided context is
  69847. // canceled.
  69848. func (c *InterconnectsGetIamPolicyCall) Context(ctx context.Context) *InterconnectsGetIamPolicyCall {
  69849. c.ctx_ = ctx
  69850. return c
  69851. }
  69852. // Header returns an http.Header that can be modified by the caller to
  69853. // add HTTP headers to the request.
  69854. func (c *InterconnectsGetIamPolicyCall) Header() http.Header {
  69855. if c.header_ == nil {
  69856. c.header_ = make(http.Header)
  69857. }
  69858. return c.header_
  69859. }
  69860. func (c *InterconnectsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  69861. reqHeaders := make(http.Header)
  69862. for k, v := range c.header_ {
  69863. reqHeaders[k] = v
  69864. }
  69865. reqHeaders.Set("User-Agent", c.s.userAgent())
  69866. if c.ifNoneMatch_ != "" {
  69867. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  69868. }
  69869. var body io.Reader = nil
  69870. c.urlParams_.Set("alt", alt)
  69871. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects/{resource}/getIamPolicy")
  69872. urls += "?" + c.urlParams_.Encode()
  69873. req, _ := http.NewRequest("GET", urls, body)
  69874. req.Header = reqHeaders
  69875. googleapi.Expand(req.URL, map[string]string{
  69876. "project": c.project,
  69877. "resource": c.resource,
  69878. })
  69879. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  69880. }
  69881. // Do executes the "compute.interconnects.getIamPolicy" call.
  69882. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  69883. // code is an error. Response headers are in either
  69884. // *Policy.ServerResponse.Header or (if a response was returned at all)
  69885. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  69886. // check whether the returned error was because http.StatusNotModified
  69887. // was returned.
  69888. func (c *InterconnectsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  69889. gensupport.SetOptions(c.urlParams_, opts...)
  69890. res, err := c.doRequest("json")
  69891. if res != nil && res.StatusCode == http.StatusNotModified {
  69892. if res.Body != nil {
  69893. res.Body.Close()
  69894. }
  69895. return nil, &googleapi.Error{
  69896. Code: res.StatusCode,
  69897. Header: res.Header,
  69898. }
  69899. }
  69900. if err != nil {
  69901. return nil, err
  69902. }
  69903. defer googleapi.CloseBody(res)
  69904. if err := googleapi.CheckResponse(res); err != nil {
  69905. return nil, err
  69906. }
  69907. ret := &Policy{
  69908. ServerResponse: googleapi.ServerResponse{
  69909. Header: res.Header,
  69910. HTTPStatusCode: res.StatusCode,
  69911. },
  69912. }
  69913. target := &ret
  69914. if err := gensupport.DecodeResponse(target, res); err != nil {
  69915. return nil, err
  69916. }
  69917. return ret, nil
  69918. // {
  69919. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  69920. // "httpMethod": "GET",
  69921. // "id": "compute.interconnects.getIamPolicy",
  69922. // "parameterOrder": [
  69923. // "project",
  69924. // "resource"
  69925. // ],
  69926. // "parameters": {
  69927. // "project": {
  69928. // "description": "Project ID for this request.",
  69929. // "location": "path",
  69930. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  69931. // "required": true,
  69932. // "type": "string"
  69933. // },
  69934. // "resource": {
  69935. // "description": "Name of the resource for this request.",
  69936. // "location": "path",
  69937. // "pattern": "[a-z0-9](?:[-a-z0-9_]{0,61}[a-z0-9])?",
  69938. // "required": true,
  69939. // "type": "string"
  69940. // }
  69941. // },
  69942. // "path": "{project}/global/interconnects/{resource}/getIamPolicy",
  69943. // "response": {
  69944. // "$ref": "Policy"
  69945. // },
  69946. // "scopes": [
  69947. // "https://www.googleapis.com/auth/cloud-platform",
  69948. // "https://www.googleapis.com/auth/compute",
  69949. // "https://www.googleapis.com/auth/compute.readonly"
  69950. // ]
  69951. // }
  69952. }
  69953. // method id "compute.interconnects.insert":
  69954. type InterconnectsInsertCall struct {
  69955. s *Service
  69956. project string
  69957. interconnect *Interconnect
  69958. urlParams_ gensupport.URLParams
  69959. ctx_ context.Context
  69960. header_ http.Header
  69961. }
  69962. // Insert: Creates a Interconnect in the specified project using the
  69963. // data included in the request.
  69964. func (r *InterconnectsService) Insert(project string, interconnect *Interconnect) *InterconnectsInsertCall {
  69965. c := &InterconnectsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  69966. c.project = project
  69967. c.interconnect = interconnect
  69968. return c
  69969. }
  69970. // RequestId sets the optional parameter "requestId": An optional
  69971. // request ID to identify requests. Specify a unique request ID so that
  69972. // if you must retry your request, the server will know to ignore the
  69973. // request if it has already been completed.
  69974. //
  69975. // For example, consider a situation where you make an initial request
  69976. // and the request times out. If you make the request again with the
  69977. // same request ID, the server can check if original operation with the
  69978. // same request ID was received, and if so, will ignore the second
  69979. // request. This prevents clients from accidentally creating duplicate
  69980. // commitments.
  69981. //
  69982. // The request ID must be a valid UUID with the exception that zero UUID
  69983. // is not supported (00000000-0000-0000-0000-000000000000).
  69984. func (c *InterconnectsInsertCall) RequestId(requestId string) *InterconnectsInsertCall {
  69985. c.urlParams_.Set("requestId", requestId)
  69986. return c
  69987. }
  69988. // Fields allows partial responses to be retrieved. See
  69989. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  69990. // for more information.
  69991. func (c *InterconnectsInsertCall) Fields(s ...googleapi.Field) *InterconnectsInsertCall {
  69992. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  69993. return c
  69994. }
  69995. // Context sets the context to be used in this call's Do method. Any
  69996. // pending HTTP request will be aborted if the provided context is
  69997. // canceled.
  69998. func (c *InterconnectsInsertCall) Context(ctx context.Context) *InterconnectsInsertCall {
  69999. c.ctx_ = ctx
  70000. return c
  70001. }
  70002. // Header returns an http.Header that can be modified by the caller to
  70003. // add HTTP headers to the request.
  70004. func (c *InterconnectsInsertCall) Header() http.Header {
  70005. if c.header_ == nil {
  70006. c.header_ = make(http.Header)
  70007. }
  70008. return c.header_
  70009. }
  70010. func (c *InterconnectsInsertCall) doRequest(alt string) (*http.Response, error) {
  70011. reqHeaders := make(http.Header)
  70012. for k, v := range c.header_ {
  70013. reqHeaders[k] = v
  70014. }
  70015. reqHeaders.Set("User-Agent", c.s.userAgent())
  70016. var body io.Reader = nil
  70017. body, err := googleapi.WithoutDataWrapper.JSONReader(c.interconnect)
  70018. if err != nil {
  70019. return nil, err
  70020. }
  70021. reqHeaders.Set("Content-Type", "application/json")
  70022. c.urlParams_.Set("alt", alt)
  70023. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects")
  70024. urls += "?" + c.urlParams_.Encode()
  70025. req, _ := http.NewRequest("POST", urls, body)
  70026. req.Header = reqHeaders
  70027. googleapi.Expand(req.URL, map[string]string{
  70028. "project": c.project,
  70029. })
  70030. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  70031. }
  70032. // Do executes the "compute.interconnects.insert" call.
  70033. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  70034. // status code is an error. Response headers are in either
  70035. // *Operation.ServerResponse.Header or (if a response was returned at
  70036. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  70037. // to check whether the returned error was because
  70038. // http.StatusNotModified was returned.
  70039. func (c *InterconnectsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  70040. gensupport.SetOptions(c.urlParams_, opts...)
  70041. res, err := c.doRequest("json")
  70042. if res != nil && res.StatusCode == http.StatusNotModified {
  70043. if res.Body != nil {
  70044. res.Body.Close()
  70045. }
  70046. return nil, &googleapi.Error{
  70047. Code: res.StatusCode,
  70048. Header: res.Header,
  70049. }
  70050. }
  70051. if err != nil {
  70052. return nil, err
  70053. }
  70054. defer googleapi.CloseBody(res)
  70055. if err := googleapi.CheckResponse(res); err != nil {
  70056. return nil, err
  70057. }
  70058. ret := &Operation{
  70059. ServerResponse: googleapi.ServerResponse{
  70060. Header: res.Header,
  70061. HTTPStatusCode: res.StatusCode,
  70062. },
  70063. }
  70064. target := &ret
  70065. if err := gensupport.DecodeResponse(target, res); err != nil {
  70066. return nil, err
  70067. }
  70068. return ret, nil
  70069. // {
  70070. // "description": "Creates a Interconnect in the specified project using the data included in the request.",
  70071. // "httpMethod": "POST",
  70072. // "id": "compute.interconnects.insert",
  70073. // "parameterOrder": [
  70074. // "project"
  70075. // ],
  70076. // "parameters": {
  70077. // "project": {
  70078. // "description": "Project ID for this request.",
  70079. // "location": "path",
  70080. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  70081. // "required": true,
  70082. // "type": "string"
  70083. // },
  70084. // "requestId": {
  70085. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  70086. // "location": "query",
  70087. // "type": "string"
  70088. // }
  70089. // },
  70090. // "path": "{project}/global/interconnects",
  70091. // "request": {
  70092. // "$ref": "Interconnect"
  70093. // },
  70094. // "response": {
  70095. // "$ref": "Operation"
  70096. // },
  70097. // "scopes": [
  70098. // "https://www.googleapis.com/auth/cloud-platform",
  70099. // "https://www.googleapis.com/auth/compute"
  70100. // ]
  70101. // }
  70102. }
  70103. // method id "compute.interconnects.list":
  70104. type InterconnectsListCall struct {
  70105. s *Service
  70106. project string
  70107. urlParams_ gensupport.URLParams
  70108. ifNoneMatch_ string
  70109. ctx_ context.Context
  70110. header_ http.Header
  70111. }
  70112. // List: Retrieves the list of interconnect available to the specified
  70113. // project.
  70114. func (r *InterconnectsService) List(project string) *InterconnectsListCall {
  70115. c := &InterconnectsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  70116. c.project = project
  70117. return c
  70118. }
  70119. // Filter sets the optional parameter "filter": A filter expression that
  70120. // filters resources listed in the response. The expression must specify
  70121. // the field name, a comparison operator, and the value that you want to
  70122. // use for filtering. The value must be a string, a number, or a
  70123. // boolean. The comparison operator must be either =, !=, >, or <.
  70124. //
  70125. // For example, if you are filtering Compute Engine instances, you can
  70126. // exclude instances named example-instance by specifying name !=
  70127. // example-instance.
  70128. //
  70129. // You can also filter nested fields. For example, you could specify
  70130. // scheduling.automaticRestart = false to include instances only if they
  70131. // are not scheduled for automatic restarts. You can use filtering on
  70132. // nested fields to filter based on resource labels.
  70133. //
  70134. // To filter on multiple expressions, provide each separate expression
  70135. // within parentheses. For example, (scheduling.automaticRestart = true)
  70136. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  70137. // AND expression. However, you can include AND and OR expressions
  70138. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  70139. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  70140. // true).
  70141. func (c *InterconnectsListCall) Filter(filter string) *InterconnectsListCall {
  70142. c.urlParams_.Set("filter", filter)
  70143. return c
  70144. }
  70145. // MaxResults sets the optional parameter "maxResults": The maximum
  70146. // number of results per page that should be returned. If the number of
  70147. // available results is larger than maxResults, Compute Engine returns a
  70148. // nextPageToken that can be used to get the next page of results in
  70149. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  70150. // (Default: 500)
  70151. func (c *InterconnectsListCall) MaxResults(maxResults int64) *InterconnectsListCall {
  70152. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  70153. return c
  70154. }
  70155. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  70156. // a certain order. By default, results are returned in alphanumerical
  70157. // order based on the resource name.
  70158. //
  70159. // You can also sort results in descending order based on the creation
  70160. // timestamp using orderBy="creationTimestamp desc". This sorts results
  70161. // based on the creationTimestamp field in reverse chronological order
  70162. // (newest result first). Use this to sort resources like operations so
  70163. // that the newest operation is returned first.
  70164. //
  70165. // Currently, only sorting by name or creationTimestamp desc is
  70166. // supported.
  70167. func (c *InterconnectsListCall) OrderBy(orderBy string) *InterconnectsListCall {
  70168. c.urlParams_.Set("orderBy", orderBy)
  70169. return c
  70170. }
  70171. // PageToken sets the optional parameter "pageToken": Specifies a page
  70172. // token to use. Set pageToken to the nextPageToken returned by a
  70173. // previous list request to get the next page of results.
  70174. func (c *InterconnectsListCall) PageToken(pageToken string) *InterconnectsListCall {
  70175. c.urlParams_.Set("pageToken", pageToken)
  70176. return c
  70177. }
  70178. // Fields allows partial responses to be retrieved. See
  70179. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  70180. // for more information.
  70181. func (c *InterconnectsListCall) Fields(s ...googleapi.Field) *InterconnectsListCall {
  70182. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  70183. return c
  70184. }
  70185. // IfNoneMatch sets the optional parameter which makes the operation
  70186. // fail if the object's ETag matches the given value. This is useful for
  70187. // getting updates only after the object has changed since the last
  70188. // request. Use googleapi.IsNotModified to check whether the response
  70189. // error from Do is the result of In-None-Match.
  70190. func (c *InterconnectsListCall) IfNoneMatch(entityTag string) *InterconnectsListCall {
  70191. c.ifNoneMatch_ = entityTag
  70192. return c
  70193. }
  70194. // Context sets the context to be used in this call's Do method. Any
  70195. // pending HTTP request will be aborted if the provided context is
  70196. // canceled.
  70197. func (c *InterconnectsListCall) Context(ctx context.Context) *InterconnectsListCall {
  70198. c.ctx_ = ctx
  70199. return c
  70200. }
  70201. // Header returns an http.Header that can be modified by the caller to
  70202. // add HTTP headers to the request.
  70203. func (c *InterconnectsListCall) Header() http.Header {
  70204. if c.header_ == nil {
  70205. c.header_ = make(http.Header)
  70206. }
  70207. return c.header_
  70208. }
  70209. func (c *InterconnectsListCall) doRequest(alt string) (*http.Response, error) {
  70210. reqHeaders := make(http.Header)
  70211. for k, v := range c.header_ {
  70212. reqHeaders[k] = v
  70213. }
  70214. reqHeaders.Set("User-Agent", c.s.userAgent())
  70215. if c.ifNoneMatch_ != "" {
  70216. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  70217. }
  70218. var body io.Reader = nil
  70219. c.urlParams_.Set("alt", alt)
  70220. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects")
  70221. urls += "?" + c.urlParams_.Encode()
  70222. req, _ := http.NewRequest("GET", urls, body)
  70223. req.Header = reqHeaders
  70224. googleapi.Expand(req.URL, map[string]string{
  70225. "project": c.project,
  70226. })
  70227. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  70228. }
  70229. // Do executes the "compute.interconnects.list" call.
  70230. // Exactly one of *InterconnectList or error will be non-nil. Any
  70231. // non-2xx status code is an error. Response headers are in either
  70232. // *InterconnectList.ServerResponse.Header or (if a response was
  70233. // returned at all) in error.(*googleapi.Error).Header. Use
  70234. // googleapi.IsNotModified to check whether the returned error was
  70235. // because http.StatusNotModified was returned.
  70236. func (c *InterconnectsListCall) Do(opts ...googleapi.CallOption) (*InterconnectList, error) {
  70237. gensupport.SetOptions(c.urlParams_, opts...)
  70238. res, err := c.doRequest("json")
  70239. if res != nil && res.StatusCode == http.StatusNotModified {
  70240. if res.Body != nil {
  70241. res.Body.Close()
  70242. }
  70243. return nil, &googleapi.Error{
  70244. Code: res.StatusCode,
  70245. Header: res.Header,
  70246. }
  70247. }
  70248. if err != nil {
  70249. return nil, err
  70250. }
  70251. defer googleapi.CloseBody(res)
  70252. if err := googleapi.CheckResponse(res); err != nil {
  70253. return nil, err
  70254. }
  70255. ret := &InterconnectList{
  70256. ServerResponse: googleapi.ServerResponse{
  70257. Header: res.Header,
  70258. HTTPStatusCode: res.StatusCode,
  70259. },
  70260. }
  70261. target := &ret
  70262. if err := gensupport.DecodeResponse(target, res); err != nil {
  70263. return nil, err
  70264. }
  70265. return ret, nil
  70266. // {
  70267. // "description": "Retrieves the list of interconnect available to the specified project.",
  70268. // "httpMethod": "GET",
  70269. // "id": "compute.interconnects.list",
  70270. // "parameterOrder": [
  70271. // "project"
  70272. // ],
  70273. // "parameters": {
  70274. // "filter": {
  70275. // "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).",
  70276. // "location": "query",
  70277. // "type": "string"
  70278. // },
  70279. // "maxResults": {
  70280. // "default": "500",
  70281. // "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)",
  70282. // "format": "uint32",
  70283. // "location": "query",
  70284. // "minimum": "0",
  70285. // "type": "integer"
  70286. // },
  70287. // "orderBy": {
  70288. // "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.",
  70289. // "location": "query",
  70290. // "type": "string"
  70291. // },
  70292. // "pageToken": {
  70293. // "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.",
  70294. // "location": "query",
  70295. // "type": "string"
  70296. // },
  70297. // "project": {
  70298. // "description": "Project ID for this request.",
  70299. // "location": "path",
  70300. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  70301. // "required": true,
  70302. // "type": "string"
  70303. // }
  70304. // },
  70305. // "path": "{project}/global/interconnects",
  70306. // "response": {
  70307. // "$ref": "InterconnectList"
  70308. // },
  70309. // "scopes": [
  70310. // "https://www.googleapis.com/auth/cloud-platform",
  70311. // "https://www.googleapis.com/auth/compute",
  70312. // "https://www.googleapis.com/auth/compute.readonly"
  70313. // ]
  70314. // }
  70315. }
  70316. // Pages invokes f for each page of results.
  70317. // A non-nil error returned from f will halt the iteration.
  70318. // The provided context supersedes any context provided to the Context method.
  70319. func (c *InterconnectsListCall) Pages(ctx context.Context, f func(*InterconnectList) error) error {
  70320. c.ctx_ = ctx
  70321. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  70322. for {
  70323. x, err := c.Do()
  70324. if err != nil {
  70325. return err
  70326. }
  70327. if err := f(x); err != nil {
  70328. return err
  70329. }
  70330. if x.NextPageToken == "" {
  70331. return nil
  70332. }
  70333. c.PageToken(x.NextPageToken)
  70334. }
  70335. }
  70336. // method id "compute.interconnects.patch":
  70337. type InterconnectsPatchCall struct {
  70338. s *Service
  70339. project string
  70340. interconnect string
  70341. interconnect2 *Interconnect
  70342. urlParams_ gensupport.URLParams
  70343. ctx_ context.Context
  70344. header_ http.Header
  70345. }
  70346. // Patch: Updates the specified interconnect with the data included in
  70347. // the request. This method supports PATCH semantics and uses the JSON
  70348. // merge patch format and processing rules.
  70349. func (r *InterconnectsService) Patch(project string, interconnect string, interconnect2 *Interconnect) *InterconnectsPatchCall {
  70350. c := &InterconnectsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  70351. c.project = project
  70352. c.interconnect = interconnect
  70353. c.interconnect2 = interconnect2
  70354. return c
  70355. }
  70356. // RequestId sets the optional parameter "requestId": An optional
  70357. // request ID to identify requests. Specify a unique request ID so that
  70358. // if you must retry your request, the server will know to ignore the
  70359. // request if it has already been completed.
  70360. //
  70361. // For example, consider a situation where you make an initial request
  70362. // and the request times out. If you make the request again with the
  70363. // same request ID, the server can check if original operation with the
  70364. // same request ID was received, and if so, will ignore the second
  70365. // request. This prevents clients from accidentally creating duplicate
  70366. // commitments.
  70367. //
  70368. // The request ID must be a valid UUID with the exception that zero UUID
  70369. // is not supported (00000000-0000-0000-0000-000000000000).
  70370. func (c *InterconnectsPatchCall) RequestId(requestId string) *InterconnectsPatchCall {
  70371. c.urlParams_.Set("requestId", requestId)
  70372. return c
  70373. }
  70374. // Fields allows partial responses to be retrieved. See
  70375. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  70376. // for more information.
  70377. func (c *InterconnectsPatchCall) Fields(s ...googleapi.Field) *InterconnectsPatchCall {
  70378. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  70379. return c
  70380. }
  70381. // Context sets the context to be used in this call's Do method. Any
  70382. // pending HTTP request will be aborted if the provided context is
  70383. // canceled.
  70384. func (c *InterconnectsPatchCall) Context(ctx context.Context) *InterconnectsPatchCall {
  70385. c.ctx_ = ctx
  70386. return c
  70387. }
  70388. // Header returns an http.Header that can be modified by the caller to
  70389. // add HTTP headers to the request.
  70390. func (c *InterconnectsPatchCall) Header() http.Header {
  70391. if c.header_ == nil {
  70392. c.header_ = make(http.Header)
  70393. }
  70394. return c.header_
  70395. }
  70396. func (c *InterconnectsPatchCall) doRequest(alt string) (*http.Response, error) {
  70397. reqHeaders := make(http.Header)
  70398. for k, v := range c.header_ {
  70399. reqHeaders[k] = v
  70400. }
  70401. reqHeaders.Set("User-Agent", c.s.userAgent())
  70402. var body io.Reader = nil
  70403. body, err := googleapi.WithoutDataWrapper.JSONReader(c.interconnect2)
  70404. if err != nil {
  70405. return nil, err
  70406. }
  70407. reqHeaders.Set("Content-Type", "application/json")
  70408. c.urlParams_.Set("alt", alt)
  70409. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects/{interconnect}")
  70410. urls += "?" + c.urlParams_.Encode()
  70411. req, _ := http.NewRequest("PATCH", urls, body)
  70412. req.Header = reqHeaders
  70413. googleapi.Expand(req.URL, map[string]string{
  70414. "project": c.project,
  70415. "interconnect": c.interconnect,
  70416. })
  70417. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  70418. }
  70419. // Do executes the "compute.interconnects.patch" call.
  70420. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  70421. // status code is an error. Response headers are in either
  70422. // *Operation.ServerResponse.Header or (if a response was returned at
  70423. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  70424. // to check whether the returned error was because
  70425. // http.StatusNotModified was returned.
  70426. func (c *InterconnectsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  70427. gensupport.SetOptions(c.urlParams_, opts...)
  70428. res, err := c.doRequest("json")
  70429. if res != nil && res.StatusCode == http.StatusNotModified {
  70430. if res.Body != nil {
  70431. res.Body.Close()
  70432. }
  70433. return nil, &googleapi.Error{
  70434. Code: res.StatusCode,
  70435. Header: res.Header,
  70436. }
  70437. }
  70438. if err != nil {
  70439. return nil, err
  70440. }
  70441. defer googleapi.CloseBody(res)
  70442. if err := googleapi.CheckResponse(res); err != nil {
  70443. return nil, err
  70444. }
  70445. ret := &Operation{
  70446. ServerResponse: googleapi.ServerResponse{
  70447. Header: res.Header,
  70448. HTTPStatusCode: res.StatusCode,
  70449. },
  70450. }
  70451. target := &ret
  70452. if err := gensupport.DecodeResponse(target, res); err != nil {
  70453. return nil, err
  70454. }
  70455. return ret, nil
  70456. // {
  70457. // "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.",
  70458. // "httpMethod": "PATCH",
  70459. // "id": "compute.interconnects.patch",
  70460. // "parameterOrder": [
  70461. // "project",
  70462. // "interconnect"
  70463. // ],
  70464. // "parameters": {
  70465. // "interconnect": {
  70466. // "description": "Name of the interconnect to update.",
  70467. // "location": "path",
  70468. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  70469. // "required": true,
  70470. // "type": "string"
  70471. // },
  70472. // "project": {
  70473. // "description": "Project ID for this request.",
  70474. // "location": "path",
  70475. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  70476. // "required": true,
  70477. // "type": "string"
  70478. // },
  70479. // "requestId": {
  70480. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  70481. // "location": "query",
  70482. // "type": "string"
  70483. // }
  70484. // },
  70485. // "path": "{project}/global/interconnects/{interconnect}",
  70486. // "request": {
  70487. // "$ref": "Interconnect"
  70488. // },
  70489. // "response": {
  70490. // "$ref": "Operation"
  70491. // },
  70492. // "scopes": [
  70493. // "https://www.googleapis.com/auth/cloud-platform",
  70494. // "https://www.googleapis.com/auth/compute"
  70495. // ]
  70496. // }
  70497. }
  70498. // method id "compute.interconnects.setIamPolicy":
  70499. type InterconnectsSetIamPolicyCall struct {
  70500. s *Service
  70501. project string
  70502. resource string
  70503. globalsetpolicyrequest *GlobalSetPolicyRequest
  70504. urlParams_ gensupport.URLParams
  70505. ctx_ context.Context
  70506. header_ http.Header
  70507. }
  70508. // SetIamPolicy: Sets the access control policy on the specified
  70509. // resource. Replaces any existing policy.
  70510. func (r *InterconnectsService) SetIamPolicy(project string, resource string, globalsetpolicyrequest *GlobalSetPolicyRequest) *InterconnectsSetIamPolicyCall {
  70511. c := &InterconnectsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  70512. c.project = project
  70513. c.resource = resource
  70514. c.globalsetpolicyrequest = globalsetpolicyrequest
  70515. return c
  70516. }
  70517. // Fields allows partial responses to be retrieved. See
  70518. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  70519. // for more information.
  70520. func (c *InterconnectsSetIamPolicyCall) Fields(s ...googleapi.Field) *InterconnectsSetIamPolicyCall {
  70521. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  70522. return c
  70523. }
  70524. // Context sets the context to be used in this call's Do method. Any
  70525. // pending HTTP request will be aborted if the provided context is
  70526. // canceled.
  70527. func (c *InterconnectsSetIamPolicyCall) Context(ctx context.Context) *InterconnectsSetIamPolicyCall {
  70528. c.ctx_ = ctx
  70529. return c
  70530. }
  70531. // Header returns an http.Header that can be modified by the caller to
  70532. // add HTTP headers to the request.
  70533. func (c *InterconnectsSetIamPolicyCall) Header() http.Header {
  70534. if c.header_ == nil {
  70535. c.header_ = make(http.Header)
  70536. }
  70537. return c.header_
  70538. }
  70539. func (c *InterconnectsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  70540. reqHeaders := make(http.Header)
  70541. for k, v := range c.header_ {
  70542. reqHeaders[k] = v
  70543. }
  70544. reqHeaders.Set("User-Agent", c.s.userAgent())
  70545. var body io.Reader = nil
  70546. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest)
  70547. if err != nil {
  70548. return nil, err
  70549. }
  70550. reqHeaders.Set("Content-Type", "application/json")
  70551. c.urlParams_.Set("alt", alt)
  70552. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects/{resource}/setIamPolicy")
  70553. urls += "?" + c.urlParams_.Encode()
  70554. req, _ := http.NewRequest("POST", urls, body)
  70555. req.Header = reqHeaders
  70556. googleapi.Expand(req.URL, map[string]string{
  70557. "project": c.project,
  70558. "resource": c.resource,
  70559. })
  70560. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  70561. }
  70562. // Do executes the "compute.interconnects.setIamPolicy" call.
  70563. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  70564. // code is an error. Response headers are in either
  70565. // *Policy.ServerResponse.Header or (if a response was returned at all)
  70566. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  70567. // check whether the returned error was because http.StatusNotModified
  70568. // was returned.
  70569. func (c *InterconnectsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  70570. gensupport.SetOptions(c.urlParams_, opts...)
  70571. res, err := c.doRequest("json")
  70572. if res != nil && res.StatusCode == http.StatusNotModified {
  70573. if res.Body != nil {
  70574. res.Body.Close()
  70575. }
  70576. return nil, &googleapi.Error{
  70577. Code: res.StatusCode,
  70578. Header: res.Header,
  70579. }
  70580. }
  70581. if err != nil {
  70582. return nil, err
  70583. }
  70584. defer googleapi.CloseBody(res)
  70585. if err := googleapi.CheckResponse(res); err != nil {
  70586. return nil, err
  70587. }
  70588. ret := &Policy{
  70589. ServerResponse: googleapi.ServerResponse{
  70590. Header: res.Header,
  70591. HTTPStatusCode: res.StatusCode,
  70592. },
  70593. }
  70594. target := &ret
  70595. if err := gensupport.DecodeResponse(target, res); err != nil {
  70596. return nil, err
  70597. }
  70598. return ret, nil
  70599. // {
  70600. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  70601. // "httpMethod": "POST",
  70602. // "id": "compute.interconnects.setIamPolicy",
  70603. // "parameterOrder": [
  70604. // "project",
  70605. // "resource"
  70606. // ],
  70607. // "parameters": {
  70608. // "project": {
  70609. // "description": "Project ID for this request.",
  70610. // "location": "path",
  70611. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  70612. // "required": true,
  70613. // "type": "string"
  70614. // },
  70615. // "resource": {
  70616. // "description": "Name of the resource for this request.",
  70617. // "location": "path",
  70618. // "pattern": "[a-z0-9](?:[-a-z0-9_]{0,61}[a-z0-9])?",
  70619. // "required": true,
  70620. // "type": "string"
  70621. // }
  70622. // },
  70623. // "path": "{project}/global/interconnects/{resource}/setIamPolicy",
  70624. // "request": {
  70625. // "$ref": "GlobalSetPolicyRequest"
  70626. // },
  70627. // "response": {
  70628. // "$ref": "Policy"
  70629. // },
  70630. // "scopes": [
  70631. // "https://www.googleapis.com/auth/cloud-platform",
  70632. // "https://www.googleapis.com/auth/compute"
  70633. // ]
  70634. // }
  70635. }
  70636. // method id "compute.interconnects.setLabels":
  70637. type InterconnectsSetLabelsCall struct {
  70638. s *Service
  70639. project string
  70640. resource string
  70641. globalsetlabelsrequest *GlobalSetLabelsRequest
  70642. urlParams_ gensupport.URLParams
  70643. ctx_ context.Context
  70644. header_ http.Header
  70645. }
  70646. // SetLabels: Sets the labels on an Interconnect. To learn more about
  70647. // labels, read the Labeling Resources documentation.
  70648. func (r *InterconnectsService) SetLabels(project string, resource string, globalsetlabelsrequest *GlobalSetLabelsRequest) *InterconnectsSetLabelsCall {
  70649. c := &InterconnectsSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  70650. c.project = project
  70651. c.resource = resource
  70652. c.globalsetlabelsrequest = globalsetlabelsrequest
  70653. return c
  70654. }
  70655. // Fields allows partial responses to be retrieved. See
  70656. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  70657. // for more information.
  70658. func (c *InterconnectsSetLabelsCall) Fields(s ...googleapi.Field) *InterconnectsSetLabelsCall {
  70659. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  70660. return c
  70661. }
  70662. // Context sets the context to be used in this call's Do method. Any
  70663. // pending HTTP request will be aborted if the provided context is
  70664. // canceled.
  70665. func (c *InterconnectsSetLabelsCall) Context(ctx context.Context) *InterconnectsSetLabelsCall {
  70666. c.ctx_ = ctx
  70667. return c
  70668. }
  70669. // Header returns an http.Header that can be modified by the caller to
  70670. // add HTTP headers to the request.
  70671. func (c *InterconnectsSetLabelsCall) Header() http.Header {
  70672. if c.header_ == nil {
  70673. c.header_ = make(http.Header)
  70674. }
  70675. return c.header_
  70676. }
  70677. func (c *InterconnectsSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  70678. reqHeaders := make(http.Header)
  70679. for k, v := range c.header_ {
  70680. reqHeaders[k] = v
  70681. }
  70682. reqHeaders.Set("User-Agent", c.s.userAgent())
  70683. var body io.Reader = nil
  70684. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest)
  70685. if err != nil {
  70686. return nil, err
  70687. }
  70688. reqHeaders.Set("Content-Type", "application/json")
  70689. c.urlParams_.Set("alt", alt)
  70690. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects/{resource}/setLabels")
  70691. urls += "?" + c.urlParams_.Encode()
  70692. req, _ := http.NewRequest("POST", urls, body)
  70693. req.Header = reqHeaders
  70694. googleapi.Expand(req.URL, map[string]string{
  70695. "project": c.project,
  70696. "resource": c.resource,
  70697. })
  70698. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  70699. }
  70700. // Do executes the "compute.interconnects.setLabels" call.
  70701. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  70702. // status code is an error. Response headers are in either
  70703. // *Operation.ServerResponse.Header or (if a response was returned at
  70704. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  70705. // to check whether the returned error was because
  70706. // http.StatusNotModified was returned.
  70707. func (c *InterconnectsSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  70708. gensupport.SetOptions(c.urlParams_, opts...)
  70709. res, err := c.doRequest("json")
  70710. if res != nil && res.StatusCode == http.StatusNotModified {
  70711. if res.Body != nil {
  70712. res.Body.Close()
  70713. }
  70714. return nil, &googleapi.Error{
  70715. Code: res.StatusCode,
  70716. Header: res.Header,
  70717. }
  70718. }
  70719. if err != nil {
  70720. return nil, err
  70721. }
  70722. defer googleapi.CloseBody(res)
  70723. if err := googleapi.CheckResponse(res); err != nil {
  70724. return nil, err
  70725. }
  70726. ret := &Operation{
  70727. ServerResponse: googleapi.ServerResponse{
  70728. Header: res.Header,
  70729. HTTPStatusCode: res.StatusCode,
  70730. },
  70731. }
  70732. target := &ret
  70733. if err := gensupport.DecodeResponse(target, res); err != nil {
  70734. return nil, err
  70735. }
  70736. return ret, nil
  70737. // {
  70738. // "description": "Sets the labels on an Interconnect. To learn more about labels, read the Labeling Resources documentation.",
  70739. // "httpMethod": "POST",
  70740. // "id": "compute.interconnects.setLabels",
  70741. // "parameterOrder": [
  70742. // "project",
  70743. // "resource"
  70744. // ],
  70745. // "parameters": {
  70746. // "project": {
  70747. // "description": "Project ID for this request.",
  70748. // "location": "path",
  70749. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  70750. // "required": true,
  70751. // "type": "string"
  70752. // },
  70753. // "resource": {
  70754. // "description": "Name of the resource for this request.",
  70755. // "location": "path",
  70756. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?",
  70757. // "required": true,
  70758. // "type": "string"
  70759. // }
  70760. // },
  70761. // "path": "{project}/global/interconnects/{resource}/setLabels",
  70762. // "request": {
  70763. // "$ref": "GlobalSetLabelsRequest"
  70764. // },
  70765. // "response": {
  70766. // "$ref": "Operation"
  70767. // },
  70768. // "scopes": [
  70769. // "https://www.googleapis.com/auth/cloud-platform",
  70770. // "https://www.googleapis.com/auth/compute"
  70771. // ]
  70772. // }
  70773. }
  70774. // method id "compute.interconnects.testIamPermissions":
  70775. type InterconnectsTestIamPermissionsCall struct {
  70776. s *Service
  70777. project string
  70778. resource string
  70779. testpermissionsrequest *TestPermissionsRequest
  70780. urlParams_ gensupport.URLParams
  70781. ctx_ context.Context
  70782. header_ http.Header
  70783. }
  70784. // TestIamPermissions: Returns permissions that a caller has on the
  70785. // specified resource.
  70786. func (r *InterconnectsService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *InterconnectsTestIamPermissionsCall {
  70787. c := &InterconnectsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  70788. c.project = project
  70789. c.resource = resource
  70790. c.testpermissionsrequest = testpermissionsrequest
  70791. return c
  70792. }
  70793. // Fields allows partial responses to be retrieved. See
  70794. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  70795. // for more information.
  70796. func (c *InterconnectsTestIamPermissionsCall) Fields(s ...googleapi.Field) *InterconnectsTestIamPermissionsCall {
  70797. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  70798. return c
  70799. }
  70800. // Context sets the context to be used in this call's Do method. Any
  70801. // pending HTTP request will be aborted if the provided context is
  70802. // canceled.
  70803. func (c *InterconnectsTestIamPermissionsCall) Context(ctx context.Context) *InterconnectsTestIamPermissionsCall {
  70804. c.ctx_ = ctx
  70805. return c
  70806. }
  70807. // Header returns an http.Header that can be modified by the caller to
  70808. // add HTTP headers to the request.
  70809. func (c *InterconnectsTestIamPermissionsCall) Header() http.Header {
  70810. if c.header_ == nil {
  70811. c.header_ = make(http.Header)
  70812. }
  70813. return c.header_
  70814. }
  70815. func (c *InterconnectsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  70816. reqHeaders := make(http.Header)
  70817. for k, v := range c.header_ {
  70818. reqHeaders[k] = v
  70819. }
  70820. reqHeaders.Set("User-Agent", c.s.userAgent())
  70821. var body io.Reader = nil
  70822. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  70823. if err != nil {
  70824. return nil, err
  70825. }
  70826. reqHeaders.Set("Content-Type", "application/json")
  70827. c.urlParams_.Set("alt", alt)
  70828. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects/{resource}/testIamPermissions")
  70829. urls += "?" + c.urlParams_.Encode()
  70830. req, _ := http.NewRequest("POST", urls, body)
  70831. req.Header = reqHeaders
  70832. googleapi.Expand(req.URL, map[string]string{
  70833. "project": c.project,
  70834. "resource": c.resource,
  70835. })
  70836. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  70837. }
  70838. // Do executes the "compute.interconnects.testIamPermissions" call.
  70839. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  70840. // non-2xx status code is an error. Response headers are in either
  70841. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  70842. // returned at all) in error.(*googleapi.Error).Header. Use
  70843. // googleapi.IsNotModified to check whether the returned error was
  70844. // because http.StatusNotModified was returned.
  70845. func (c *InterconnectsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  70846. gensupport.SetOptions(c.urlParams_, opts...)
  70847. res, err := c.doRequest("json")
  70848. if res != nil && res.StatusCode == http.StatusNotModified {
  70849. if res.Body != nil {
  70850. res.Body.Close()
  70851. }
  70852. return nil, &googleapi.Error{
  70853. Code: res.StatusCode,
  70854. Header: res.Header,
  70855. }
  70856. }
  70857. if err != nil {
  70858. return nil, err
  70859. }
  70860. defer googleapi.CloseBody(res)
  70861. if err := googleapi.CheckResponse(res); err != nil {
  70862. return nil, err
  70863. }
  70864. ret := &TestPermissionsResponse{
  70865. ServerResponse: googleapi.ServerResponse{
  70866. Header: res.Header,
  70867. HTTPStatusCode: res.StatusCode,
  70868. },
  70869. }
  70870. target := &ret
  70871. if err := gensupport.DecodeResponse(target, res); err != nil {
  70872. return nil, err
  70873. }
  70874. return ret, nil
  70875. // {
  70876. // "description": "Returns permissions that a caller has on the specified resource.",
  70877. // "httpMethod": "POST",
  70878. // "id": "compute.interconnects.testIamPermissions",
  70879. // "parameterOrder": [
  70880. // "project",
  70881. // "resource"
  70882. // ],
  70883. // "parameters": {
  70884. // "project": {
  70885. // "description": "Project ID for this request.",
  70886. // "location": "path",
  70887. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  70888. // "required": true,
  70889. // "type": "string"
  70890. // },
  70891. // "resource": {
  70892. // "description": "Name of the resource for this request.",
  70893. // "location": "path",
  70894. // "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?",
  70895. // "required": true,
  70896. // "type": "string"
  70897. // }
  70898. // },
  70899. // "path": "{project}/global/interconnects/{resource}/testIamPermissions",
  70900. // "request": {
  70901. // "$ref": "TestPermissionsRequest"
  70902. // },
  70903. // "response": {
  70904. // "$ref": "TestPermissionsResponse"
  70905. // },
  70906. // "scopes": [
  70907. // "https://www.googleapis.com/auth/cloud-platform",
  70908. // "https://www.googleapis.com/auth/compute",
  70909. // "https://www.googleapis.com/auth/compute.readonly"
  70910. // ]
  70911. // }
  70912. }
  70913. // method id "compute.licenseCodes.get":
  70914. type LicenseCodesGetCall struct {
  70915. s *Service
  70916. project string
  70917. licenseCode string
  70918. urlParams_ gensupport.URLParams
  70919. ifNoneMatch_ string
  70920. ctx_ context.Context
  70921. header_ http.Header
  70922. }
  70923. // Get: Return a specified license code. License codes are mirrored
  70924. // across all projects that have permissions to read the License Code.
  70925. func (r *LicenseCodesService) Get(project string, licenseCode string) *LicenseCodesGetCall {
  70926. c := &LicenseCodesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  70927. c.project = project
  70928. c.licenseCode = licenseCode
  70929. return c
  70930. }
  70931. // Fields allows partial responses to be retrieved. See
  70932. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  70933. // for more information.
  70934. func (c *LicenseCodesGetCall) Fields(s ...googleapi.Field) *LicenseCodesGetCall {
  70935. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  70936. return c
  70937. }
  70938. // IfNoneMatch sets the optional parameter which makes the operation
  70939. // fail if the object's ETag matches the given value. This is useful for
  70940. // getting updates only after the object has changed since the last
  70941. // request. Use googleapi.IsNotModified to check whether the response
  70942. // error from Do is the result of In-None-Match.
  70943. func (c *LicenseCodesGetCall) IfNoneMatch(entityTag string) *LicenseCodesGetCall {
  70944. c.ifNoneMatch_ = entityTag
  70945. return c
  70946. }
  70947. // Context sets the context to be used in this call's Do method. Any
  70948. // pending HTTP request will be aborted if the provided context is
  70949. // canceled.
  70950. func (c *LicenseCodesGetCall) Context(ctx context.Context) *LicenseCodesGetCall {
  70951. c.ctx_ = ctx
  70952. return c
  70953. }
  70954. // Header returns an http.Header that can be modified by the caller to
  70955. // add HTTP headers to the request.
  70956. func (c *LicenseCodesGetCall) Header() http.Header {
  70957. if c.header_ == nil {
  70958. c.header_ = make(http.Header)
  70959. }
  70960. return c.header_
  70961. }
  70962. func (c *LicenseCodesGetCall) doRequest(alt string) (*http.Response, error) {
  70963. reqHeaders := make(http.Header)
  70964. for k, v := range c.header_ {
  70965. reqHeaders[k] = v
  70966. }
  70967. reqHeaders.Set("User-Agent", c.s.userAgent())
  70968. if c.ifNoneMatch_ != "" {
  70969. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  70970. }
  70971. var body io.Reader = nil
  70972. c.urlParams_.Set("alt", alt)
  70973. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenseCodes/{licenseCode}")
  70974. urls += "?" + c.urlParams_.Encode()
  70975. req, _ := http.NewRequest("GET", urls, body)
  70976. req.Header = reqHeaders
  70977. googleapi.Expand(req.URL, map[string]string{
  70978. "project": c.project,
  70979. "licenseCode": c.licenseCode,
  70980. })
  70981. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  70982. }
  70983. // Do executes the "compute.licenseCodes.get" call.
  70984. // Exactly one of *LicenseCode or error will be non-nil. Any non-2xx
  70985. // status code is an error. Response headers are in either
  70986. // *LicenseCode.ServerResponse.Header or (if a response was returned at
  70987. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  70988. // to check whether the returned error was because
  70989. // http.StatusNotModified was returned.
  70990. func (c *LicenseCodesGetCall) Do(opts ...googleapi.CallOption) (*LicenseCode, error) {
  70991. gensupport.SetOptions(c.urlParams_, opts...)
  70992. res, err := c.doRequest("json")
  70993. if res != nil && res.StatusCode == http.StatusNotModified {
  70994. if res.Body != nil {
  70995. res.Body.Close()
  70996. }
  70997. return nil, &googleapi.Error{
  70998. Code: res.StatusCode,
  70999. Header: res.Header,
  71000. }
  71001. }
  71002. if err != nil {
  71003. return nil, err
  71004. }
  71005. defer googleapi.CloseBody(res)
  71006. if err := googleapi.CheckResponse(res); err != nil {
  71007. return nil, err
  71008. }
  71009. ret := &LicenseCode{
  71010. ServerResponse: googleapi.ServerResponse{
  71011. Header: res.Header,
  71012. HTTPStatusCode: res.StatusCode,
  71013. },
  71014. }
  71015. target := &ret
  71016. if err := gensupport.DecodeResponse(target, res); err != nil {
  71017. return nil, err
  71018. }
  71019. return ret, nil
  71020. // {
  71021. // "description": "Return a specified license code. License codes are mirrored across all projects that have permissions to read the License Code.",
  71022. // "httpMethod": "GET",
  71023. // "id": "compute.licenseCodes.get",
  71024. // "parameterOrder": [
  71025. // "project",
  71026. // "licenseCode"
  71027. // ],
  71028. // "parameters": {
  71029. // "licenseCode": {
  71030. // "description": "Number corresponding to the License code resource to return.",
  71031. // "location": "path",
  71032. // "pattern": "[0-9]{0,61}?",
  71033. // "required": true,
  71034. // "type": "string"
  71035. // },
  71036. // "project": {
  71037. // "description": "Project ID for this request.",
  71038. // "location": "path",
  71039. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  71040. // "required": true,
  71041. // "type": "string"
  71042. // }
  71043. // },
  71044. // "path": "{project}/global/licenseCodes/{licenseCode}",
  71045. // "response": {
  71046. // "$ref": "LicenseCode"
  71047. // },
  71048. // "scopes": [
  71049. // "https://www.googleapis.com/auth/cloud-platform",
  71050. // "https://www.googleapis.com/auth/compute",
  71051. // "https://www.googleapis.com/auth/compute.readonly"
  71052. // ]
  71053. // }
  71054. }
  71055. // method id "compute.licenseCodes.getIamPolicy":
  71056. type LicenseCodesGetIamPolicyCall struct {
  71057. s *Service
  71058. project string
  71059. resource string
  71060. urlParams_ gensupport.URLParams
  71061. ifNoneMatch_ string
  71062. ctx_ context.Context
  71063. header_ http.Header
  71064. }
  71065. // GetIamPolicy: Gets the access control policy for a resource. May be
  71066. // empty if no such policy or resource exists.
  71067. func (r *LicenseCodesService) GetIamPolicy(project string, resource string) *LicenseCodesGetIamPolicyCall {
  71068. c := &LicenseCodesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  71069. c.project = project
  71070. c.resource = resource
  71071. return c
  71072. }
  71073. // Fields allows partial responses to be retrieved. See
  71074. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  71075. // for more information.
  71076. func (c *LicenseCodesGetIamPolicyCall) Fields(s ...googleapi.Field) *LicenseCodesGetIamPolicyCall {
  71077. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  71078. return c
  71079. }
  71080. // IfNoneMatch sets the optional parameter which makes the operation
  71081. // fail if the object's ETag matches the given value. This is useful for
  71082. // getting updates only after the object has changed since the last
  71083. // request. Use googleapi.IsNotModified to check whether the response
  71084. // error from Do is the result of In-None-Match.
  71085. func (c *LicenseCodesGetIamPolicyCall) IfNoneMatch(entityTag string) *LicenseCodesGetIamPolicyCall {
  71086. c.ifNoneMatch_ = entityTag
  71087. return c
  71088. }
  71089. // Context sets the context to be used in this call's Do method. Any
  71090. // pending HTTP request will be aborted if the provided context is
  71091. // canceled.
  71092. func (c *LicenseCodesGetIamPolicyCall) Context(ctx context.Context) *LicenseCodesGetIamPolicyCall {
  71093. c.ctx_ = ctx
  71094. return c
  71095. }
  71096. // Header returns an http.Header that can be modified by the caller to
  71097. // add HTTP headers to the request.
  71098. func (c *LicenseCodesGetIamPolicyCall) Header() http.Header {
  71099. if c.header_ == nil {
  71100. c.header_ = make(http.Header)
  71101. }
  71102. return c.header_
  71103. }
  71104. func (c *LicenseCodesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  71105. reqHeaders := make(http.Header)
  71106. for k, v := range c.header_ {
  71107. reqHeaders[k] = v
  71108. }
  71109. reqHeaders.Set("User-Agent", c.s.userAgent())
  71110. if c.ifNoneMatch_ != "" {
  71111. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  71112. }
  71113. var body io.Reader = nil
  71114. c.urlParams_.Set("alt", alt)
  71115. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenseCodes/{resource}/getIamPolicy")
  71116. urls += "?" + c.urlParams_.Encode()
  71117. req, _ := http.NewRequest("GET", urls, body)
  71118. req.Header = reqHeaders
  71119. googleapi.Expand(req.URL, map[string]string{
  71120. "project": c.project,
  71121. "resource": c.resource,
  71122. })
  71123. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  71124. }
  71125. // Do executes the "compute.licenseCodes.getIamPolicy" call.
  71126. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  71127. // code is an error. Response headers are in either
  71128. // *Policy.ServerResponse.Header or (if a response was returned at all)
  71129. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  71130. // check whether the returned error was because http.StatusNotModified
  71131. // was returned.
  71132. func (c *LicenseCodesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  71133. gensupport.SetOptions(c.urlParams_, opts...)
  71134. res, err := c.doRequest("json")
  71135. if res != nil && res.StatusCode == http.StatusNotModified {
  71136. if res.Body != nil {
  71137. res.Body.Close()
  71138. }
  71139. return nil, &googleapi.Error{
  71140. Code: res.StatusCode,
  71141. Header: res.Header,
  71142. }
  71143. }
  71144. if err != nil {
  71145. return nil, err
  71146. }
  71147. defer googleapi.CloseBody(res)
  71148. if err := googleapi.CheckResponse(res); err != nil {
  71149. return nil, err
  71150. }
  71151. ret := &Policy{
  71152. ServerResponse: googleapi.ServerResponse{
  71153. Header: res.Header,
  71154. HTTPStatusCode: res.StatusCode,
  71155. },
  71156. }
  71157. target := &ret
  71158. if err := gensupport.DecodeResponse(target, res); err != nil {
  71159. return nil, err
  71160. }
  71161. return ret, nil
  71162. // {
  71163. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  71164. // "httpMethod": "GET",
  71165. // "id": "compute.licenseCodes.getIamPolicy",
  71166. // "parameterOrder": [
  71167. // "project",
  71168. // "resource"
  71169. // ],
  71170. // "parameters": {
  71171. // "project": {
  71172. // "description": "Project ID for this request.",
  71173. // "location": "path",
  71174. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  71175. // "required": true,
  71176. // "type": "string"
  71177. // },
  71178. // "resource": {
  71179. // "description": "Name of the resource for this request.",
  71180. // "location": "path",
  71181. // "pattern": "[a-z0-9](?:[-a-z0-9_]{0,61}[a-z0-9])?",
  71182. // "required": true,
  71183. // "type": "string"
  71184. // }
  71185. // },
  71186. // "path": "{project}/global/licenseCodes/{resource}/getIamPolicy",
  71187. // "response": {
  71188. // "$ref": "Policy"
  71189. // },
  71190. // "scopes": [
  71191. // "https://www.googleapis.com/auth/cloud-platform",
  71192. // "https://www.googleapis.com/auth/compute",
  71193. // "https://www.googleapis.com/auth/compute.readonly"
  71194. // ]
  71195. // }
  71196. }
  71197. // method id "compute.licenseCodes.setIamPolicy":
  71198. type LicenseCodesSetIamPolicyCall struct {
  71199. s *Service
  71200. project string
  71201. resource string
  71202. globalsetpolicyrequest *GlobalSetPolicyRequest
  71203. urlParams_ gensupport.URLParams
  71204. ctx_ context.Context
  71205. header_ http.Header
  71206. }
  71207. // SetIamPolicy: Sets the access control policy on the specified
  71208. // resource. Replaces any existing policy.
  71209. func (r *LicenseCodesService) SetIamPolicy(project string, resource string, globalsetpolicyrequest *GlobalSetPolicyRequest) *LicenseCodesSetIamPolicyCall {
  71210. c := &LicenseCodesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  71211. c.project = project
  71212. c.resource = resource
  71213. c.globalsetpolicyrequest = globalsetpolicyrequest
  71214. return c
  71215. }
  71216. // Fields allows partial responses to be retrieved. See
  71217. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  71218. // for more information.
  71219. func (c *LicenseCodesSetIamPolicyCall) Fields(s ...googleapi.Field) *LicenseCodesSetIamPolicyCall {
  71220. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  71221. return c
  71222. }
  71223. // Context sets the context to be used in this call's Do method. Any
  71224. // pending HTTP request will be aborted if the provided context is
  71225. // canceled.
  71226. func (c *LicenseCodesSetIamPolicyCall) Context(ctx context.Context) *LicenseCodesSetIamPolicyCall {
  71227. c.ctx_ = ctx
  71228. return c
  71229. }
  71230. // Header returns an http.Header that can be modified by the caller to
  71231. // add HTTP headers to the request.
  71232. func (c *LicenseCodesSetIamPolicyCall) Header() http.Header {
  71233. if c.header_ == nil {
  71234. c.header_ = make(http.Header)
  71235. }
  71236. return c.header_
  71237. }
  71238. func (c *LicenseCodesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  71239. reqHeaders := make(http.Header)
  71240. for k, v := range c.header_ {
  71241. reqHeaders[k] = v
  71242. }
  71243. reqHeaders.Set("User-Agent", c.s.userAgent())
  71244. var body io.Reader = nil
  71245. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest)
  71246. if err != nil {
  71247. return nil, err
  71248. }
  71249. reqHeaders.Set("Content-Type", "application/json")
  71250. c.urlParams_.Set("alt", alt)
  71251. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenseCodes/{resource}/setIamPolicy")
  71252. urls += "?" + c.urlParams_.Encode()
  71253. req, _ := http.NewRequest("POST", urls, body)
  71254. req.Header = reqHeaders
  71255. googleapi.Expand(req.URL, map[string]string{
  71256. "project": c.project,
  71257. "resource": c.resource,
  71258. })
  71259. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  71260. }
  71261. // Do executes the "compute.licenseCodes.setIamPolicy" call.
  71262. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  71263. // code is an error. Response headers are in either
  71264. // *Policy.ServerResponse.Header or (if a response was returned at all)
  71265. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  71266. // check whether the returned error was because http.StatusNotModified
  71267. // was returned.
  71268. func (c *LicenseCodesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  71269. gensupport.SetOptions(c.urlParams_, opts...)
  71270. res, err := c.doRequest("json")
  71271. if res != nil && res.StatusCode == http.StatusNotModified {
  71272. if res.Body != nil {
  71273. res.Body.Close()
  71274. }
  71275. return nil, &googleapi.Error{
  71276. Code: res.StatusCode,
  71277. Header: res.Header,
  71278. }
  71279. }
  71280. if err != nil {
  71281. return nil, err
  71282. }
  71283. defer googleapi.CloseBody(res)
  71284. if err := googleapi.CheckResponse(res); err != nil {
  71285. return nil, err
  71286. }
  71287. ret := &Policy{
  71288. ServerResponse: googleapi.ServerResponse{
  71289. Header: res.Header,
  71290. HTTPStatusCode: res.StatusCode,
  71291. },
  71292. }
  71293. target := &ret
  71294. if err := gensupport.DecodeResponse(target, res); err != nil {
  71295. return nil, err
  71296. }
  71297. return ret, nil
  71298. // {
  71299. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  71300. // "httpMethod": "POST",
  71301. // "id": "compute.licenseCodes.setIamPolicy",
  71302. // "parameterOrder": [
  71303. // "project",
  71304. // "resource"
  71305. // ],
  71306. // "parameters": {
  71307. // "project": {
  71308. // "description": "Project ID for this request.",
  71309. // "location": "path",
  71310. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  71311. // "required": true,
  71312. // "type": "string"
  71313. // },
  71314. // "resource": {
  71315. // "description": "Name of the resource for this request.",
  71316. // "location": "path",
  71317. // "pattern": "[a-z0-9](?:[-a-z0-9_]{0,61}[a-z0-9])?",
  71318. // "required": true,
  71319. // "type": "string"
  71320. // }
  71321. // },
  71322. // "path": "{project}/global/licenseCodes/{resource}/setIamPolicy",
  71323. // "request": {
  71324. // "$ref": "GlobalSetPolicyRequest"
  71325. // },
  71326. // "response": {
  71327. // "$ref": "Policy"
  71328. // },
  71329. // "scopes": [
  71330. // "https://www.googleapis.com/auth/cloud-platform",
  71331. // "https://www.googleapis.com/auth/compute"
  71332. // ]
  71333. // }
  71334. }
  71335. // method id "compute.licenseCodes.testIamPermissions":
  71336. type LicenseCodesTestIamPermissionsCall struct {
  71337. s *Service
  71338. project string
  71339. resource string
  71340. testpermissionsrequest *TestPermissionsRequest
  71341. urlParams_ gensupport.URLParams
  71342. ctx_ context.Context
  71343. header_ http.Header
  71344. }
  71345. // TestIamPermissions: Returns permissions that a caller has on the
  71346. // specified resource.
  71347. func (r *LicenseCodesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *LicenseCodesTestIamPermissionsCall {
  71348. c := &LicenseCodesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  71349. c.project = project
  71350. c.resource = resource
  71351. c.testpermissionsrequest = testpermissionsrequest
  71352. return c
  71353. }
  71354. // Fields allows partial responses to be retrieved. See
  71355. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  71356. // for more information.
  71357. func (c *LicenseCodesTestIamPermissionsCall) Fields(s ...googleapi.Field) *LicenseCodesTestIamPermissionsCall {
  71358. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  71359. return c
  71360. }
  71361. // Context sets the context to be used in this call's Do method. Any
  71362. // pending HTTP request will be aborted if the provided context is
  71363. // canceled.
  71364. func (c *LicenseCodesTestIamPermissionsCall) Context(ctx context.Context) *LicenseCodesTestIamPermissionsCall {
  71365. c.ctx_ = ctx
  71366. return c
  71367. }
  71368. // Header returns an http.Header that can be modified by the caller to
  71369. // add HTTP headers to the request.
  71370. func (c *LicenseCodesTestIamPermissionsCall) Header() http.Header {
  71371. if c.header_ == nil {
  71372. c.header_ = make(http.Header)
  71373. }
  71374. return c.header_
  71375. }
  71376. func (c *LicenseCodesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  71377. reqHeaders := make(http.Header)
  71378. for k, v := range c.header_ {
  71379. reqHeaders[k] = v
  71380. }
  71381. reqHeaders.Set("User-Agent", c.s.userAgent())
  71382. var body io.Reader = nil
  71383. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  71384. if err != nil {
  71385. return nil, err
  71386. }
  71387. reqHeaders.Set("Content-Type", "application/json")
  71388. c.urlParams_.Set("alt", alt)
  71389. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenseCodes/{resource}/testIamPermissions")
  71390. urls += "?" + c.urlParams_.Encode()
  71391. req, _ := http.NewRequest("POST", urls, body)
  71392. req.Header = reqHeaders
  71393. googleapi.Expand(req.URL, map[string]string{
  71394. "project": c.project,
  71395. "resource": c.resource,
  71396. })
  71397. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  71398. }
  71399. // Do executes the "compute.licenseCodes.testIamPermissions" call.
  71400. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  71401. // non-2xx status code is an error. Response headers are in either
  71402. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  71403. // returned at all) in error.(*googleapi.Error).Header. Use
  71404. // googleapi.IsNotModified to check whether the returned error was
  71405. // because http.StatusNotModified was returned.
  71406. func (c *LicenseCodesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  71407. gensupport.SetOptions(c.urlParams_, opts...)
  71408. res, err := c.doRequest("json")
  71409. if res != nil && res.StatusCode == http.StatusNotModified {
  71410. if res.Body != nil {
  71411. res.Body.Close()
  71412. }
  71413. return nil, &googleapi.Error{
  71414. Code: res.StatusCode,
  71415. Header: res.Header,
  71416. }
  71417. }
  71418. if err != nil {
  71419. return nil, err
  71420. }
  71421. defer googleapi.CloseBody(res)
  71422. if err := googleapi.CheckResponse(res); err != nil {
  71423. return nil, err
  71424. }
  71425. ret := &TestPermissionsResponse{
  71426. ServerResponse: googleapi.ServerResponse{
  71427. Header: res.Header,
  71428. HTTPStatusCode: res.StatusCode,
  71429. },
  71430. }
  71431. target := &ret
  71432. if err := gensupport.DecodeResponse(target, res); err != nil {
  71433. return nil, err
  71434. }
  71435. return ret, nil
  71436. // {
  71437. // "description": "Returns permissions that a caller has on the specified resource.",
  71438. // "httpMethod": "POST",
  71439. // "id": "compute.licenseCodes.testIamPermissions",
  71440. // "parameterOrder": [
  71441. // "project",
  71442. // "resource"
  71443. // ],
  71444. // "parameters": {
  71445. // "project": {
  71446. // "description": "Project ID for this request.",
  71447. // "location": "path",
  71448. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  71449. // "required": true,
  71450. // "type": "string"
  71451. // },
  71452. // "resource": {
  71453. // "description": "Name of the resource for this request.",
  71454. // "location": "path",
  71455. // "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?",
  71456. // "required": true,
  71457. // "type": "string"
  71458. // }
  71459. // },
  71460. // "path": "{project}/global/licenseCodes/{resource}/testIamPermissions",
  71461. // "request": {
  71462. // "$ref": "TestPermissionsRequest"
  71463. // },
  71464. // "response": {
  71465. // "$ref": "TestPermissionsResponse"
  71466. // },
  71467. // "scopes": [
  71468. // "https://www.googleapis.com/auth/cloud-platform",
  71469. // "https://www.googleapis.com/auth/compute",
  71470. // "https://www.googleapis.com/auth/compute.readonly"
  71471. // ]
  71472. // }
  71473. }
  71474. // method id "compute.licenses.delete":
  71475. type LicensesDeleteCall struct {
  71476. s *Service
  71477. project string
  71478. license string
  71479. urlParams_ gensupport.URLParams
  71480. ctx_ context.Context
  71481. header_ http.Header
  71482. }
  71483. // Delete: Deletes the specified license.
  71484. func (r *LicensesService) Delete(project string, license string) *LicensesDeleteCall {
  71485. c := &LicensesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  71486. c.project = project
  71487. c.license = license
  71488. return c
  71489. }
  71490. // RequestId sets the optional parameter "requestId": An optional
  71491. // request ID to identify requests. Specify a unique request ID so that
  71492. // if you must retry your request, the server will know to ignore the
  71493. // request if it has already been completed.
  71494. //
  71495. // For example, consider a situation where you make an initial request
  71496. // and the request times out. If you make the request again with the
  71497. // same request ID, the server can check if original operation with the
  71498. // same request ID was received, and if so, will ignore the second
  71499. // request. This prevents clients from accidentally creating duplicate
  71500. // commitments.
  71501. //
  71502. // The request ID must be a valid UUID with the exception that zero UUID
  71503. // is not supported (00000000-0000-0000-0000-000000000000).
  71504. func (c *LicensesDeleteCall) RequestId(requestId string) *LicensesDeleteCall {
  71505. c.urlParams_.Set("requestId", requestId)
  71506. return c
  71507. }
  71508. // Fields allows partial responses to be retrieved. See
  71509. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  71510. // for more information.
  71511. func (c *LicensesDeleteCall) Fields(s ...googleapi.Field) *LicensesDeleteCall {
  71512. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  71513. return c
  71514. }
  71515. // Context sets the context to be used in this call's Do method. Any
  71516. // pending HTTP request will be aborted if the provided context is
  71517. // canceled.
  71518. func (c *LicensesDeleteCall) Context(ctx context.Context) *LicensesDeleteCall {
  71519. c.ctx_ = ctx
  71520. return c
  71521. }
  71522. // Header returns an http.Header that can be modified by the caller to
  71523. // add HTTP headers to the request.
  71524. func (c *LicensesDeleteCall) Header() http.Header {
  71525. if c.header_ == nil {
  71526. c.header_ = make(http.Header)
  71527. }
  71528. return c.header_
  71529. }
  71530. func (c *LicensesDeleteCall) doRequest(alt string) (*http.Response, error) {
  71531. reqHeaders := make(http.Header)
  71532. for k, v := range c.header_ {
  71533. reqHeaders[k] = v
  71534. }
  71535. reqHeaders.Set("User-Agent", c.s.userAgent())
  71536. var body io.Reader = nil
  71537. c.urlParams_.Set("alt", alt)
  71538. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses/{license}")
  71539. urls += "?" + c.urlParams_.Encode()
  71540. req, _ := http.NewRequest("DELETE", urls, body)
  71541. req.Header = reqHeaders
  71542. googleapi.Expand(req.URL, map[string]string{
  71543. "project": c.project,
  71544. "license": c.license,
  71545. })
  71546. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  71547. }
  71548. // Do executes the "compute.licenses.delete" call.
  71549. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  71550. // status code is an error. Response headers are in either
  71551. // *Operation.ServerResponse.Header or (if a response was returned at
  71552. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  71553. // to check whether the returned error was because
  71554. // http.StatusNotModified was returned.
  71555. func (c *LicensesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  71556. gensupport.SetOptions(c.urlParams_, opts...)
  71557. res, err := c.doRequest("json")
  71558. if res != nil && res.StatusCode == http.StatusNotModified {
  71559. if res.Body != nil {
  71560. res.Body.Close()
  71561. }
  71562. return nil, &googleapi.Error{
  71563. Code: res.StatusCode,
  71564. Header: res.Header,
  71565. }
  71566. }
  71567. if err != nil {
  71568. return nil, err
  71569. }
  71570. defer googleapi.CloseBody(res)
  71571. if err := googleapi.CheckResponse(res); err != nil {
  71572. return nil, err
  71573. }
  71574. ret := &Operation{
  71575. ServerResponse: googleapi.ServerResponse{
  71576. Header: res.Header,
  71577. HTTPStatusCode: res.StatusCode,
  71578. },
  71579. }
  71580. target := &ret
  71581. if err := gensupport.DecodeResponse(target, res); err != nil {
  71582. return nil, err
  71583. }
  71584. return ret, nil
  71585. // {
  71586. // "description": "Deletes the specified license.",
  71587. // "httpMethod": "DELETE",
  71588. // "id": "compute.licenses.delete",
  71589. // "parameterOrder": [
  71590. // "project",
  71591. // "license"
  71592. // ],
  71593. // "parameters": {
  71594. // "license": {
  71595. // "description": "Name of the license resource to delete.",
  71596. // "location": "path",
  71597. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  71598. // "required": true,
  71599. // "type": "string"
  71600. // },
  71601. // "project": {
  71602. // "description": "Project ID for this request.",
  71603. // "location": "path",
  71604. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  71605. // "required": true,
  71606. // "type": "string"
  71607. // },
  71608. // "requestId": {
  71609. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  71610. // "location": "query",
  71611. // "type": "string"
  71612. // }
  71613. // },
  71614. // "path": "{project}/global/licenses/{license}",
  71615. // "response": {
  71616. // "$ref": "Operation"
  71617. // },
  71618. // "scopes": [
  71619. // "https://www.googleapis.com/auth/cloud-platform",
  71620. // "https://www.googleapis.com/auth/compute"
  71621. // ]
  71622. // }
  71623. }
  71624. // method id "compute.licenses.get":
  71625. type LicensesGetCall struct {
  71626. s *Service
  71627. project string
  71628. license string
  71629. urlParams_ gensupport.URLParams
  71630. ifNoneMatch_ string
  71631. ctx_ context.Context
  71632. header_ http.Header
  71633. }
  71634. // Get: Returns the specified License resource.
  71635. // For details, see https://cloud.google.com/compute/docs/reference/latest/licenses/get
  71636. func (r *LicensesService) Get(project string, license string) *LicensesGetCall {
  71637. c := &LicensesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  71638. c.project = project
  71639. c.license = license
  71640. return c
  71641. }
  71642. // Fields allows partial responses to be retrieved. See
  71643. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  71644. // for more information.
  71645. func (c *LicensesGetCall) Fields(s ...googleapi.Field) *LicensesGetCall {
  71646. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  71647. return c
  71648. }
  71649. // IfNoneMatch sets the optional parameter which makes the operation
  71650. // fail if the object's ETag matches the given value. This is useful for
  71651. // getting updates only after the object has changed since the last
  71652. // request. Use googleapi.IsNotModified to check whether the response
  71653. // error from Do is the result of In-None-Match.
  71654. func (c *LicensesGetCall) IfNoneMatch(entityTag string) *LicensesGetCall {
  71655. c.ifNoneMatch_ = entityTag
  71656. return c
  71657. }
  71658. // Context sets the context to be used in this call's Do method. Any
  71659. // pending HTTP request will be aborted if the provided context is
  71660. // canceled.
  71661. func (c *LicensesGetCall) Context(ctx context.Context) *LicensesGetCall {
  71662. c.ctx_ = ctx
  71663. return c
  71664. }
  71665. // Header returns an http.Header that can be modified by the caller to
  71666. // add HTTP headers to the request.
  71667. func (c *LicensesGetCall) Header() http.Header {
  71668. if c.header_ == nil {
  71669. c.header_ = make(http.Header)
  71670. }
  71671. return c.header_
  71672. }
  71673. func (c *LicensesGetCall) doRequest(alt string) (*http.Response, error) {
  71674. reqHeaders := make(http.Header)
  71675. for k, v := range c.header_ {
  71676. reqHeaders[k] = v
  71677. }
  71678. reqHeaders.Set("User-Agent", c.s.userAgent())
  71679. if c.ifNoneMatch_ != "" {
  71680. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  71681. }
  71682. var body io.Reader = nil
  71683. c.urlParams_.Set("alt", alt)
  71684. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses/{license}")
  71685. urls += "?" + c.urlParams_.Encode()
  71686. req, _ := http.NewRequest("GET", urls, body)
  71687. req.Header = reqHeaders
  71688. googleapi.Expand(req.URL, map[string]string{
  71689. "project": c.project,
  71690. "license": c.license,
  71691. })
  71692. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  71693. }
  71694. // Do executes the "compute.licenses.get" call.
  71695. // Exactly one of *License or error will be non-nil. Any non-2xx status
  71696. // code is an error. Response headers are in either
  71697. // *License.ServerResponse.Header or (if a response was returned at all)
  71698. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  71699. // check whether the returned error was because http.StatusNotModified
  71700. // was returned.
  71701. func (c *LicensesGetCall) Do(opts ...googleapi.CallOption) (*License, error) {
  71702. gensupport.SetOptions(c.urlParams_, opts...)
  71703. res, err := c.doRequest("json")
  71704. if res != nil && res.StatusCode == http.StatusNotModified {
  71705. if res.Body != nil {
  71706. res.Body.Close()
  71707. }
  71708. return nil, &googleapi.Error{
  71709. Code: res.StatusCode,
  71710. Header: res.Header,
  71711. }
  71712. }
  71713. if err != nil {
  71714. return nil, err
  71715. }
  71716. defer googleapi.CloseBody(res)
  71717. if err := googleapi.CheckResponse(res); err != nil {
  71718. return nil, err
  71719. }
  71720. ret := &License{
  71721. ServerResponse: googleapi.ServerResponse{
  71722. Header: res.Header,
  71723. HTTPStatusCode: res.StatusCode,
  71724. },
  71725. }
  71726. target := &ret
  71727. if err := gensupport.DecodeResponse(target, res); err != nil {
  71728. return nil, err
  71729. }
  71730. return ret, nil
  71731. // {
  71732. // "description": "Returns the specified License resource.",
  71733. // "httpMethod": "GET",
  71734. // "id": "compute.licenses.get",
  71735. // "parameterOrder": [
  71736. // "project",
  71737. // "license"
  71738. // ],
  71739. // "parameters": {
  71740. // "license": {
  71741. // "description": "Name of the License resource to return.",
  71742. // "location": "path",
  71743. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  71744. // "required": true,
  71745. // "type": "string"
  71746. // },
  71747. // "project": {
  71748. // "description": "Project ID for this request.",
  71749. // "location": "path",
  71750. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  71751. // "required": true,
  71752. // "type": "string"
  71753. // }
  71754. // },
  71755. // "path": "{project}/global/licenses/{license}",
  71756. // "response": {
  71757. // "$ref": "License"
  71758. // },
  71759. // "scopes": [
  71760. // "https://www.googleapis.com/auth/cloud-platform",
  71761. // "https://www.googleapis.com/auth/compute",
  71762. // "https://www.googleapis.com/auth/compute.readonly"
  71763. // ]
  71764. // }
  71765. }
  71766. // method id "compute.licenses.getIamPolicy":
  71767. type LicensesGetIamPolicyCall struct {
  71768. s *Service
  71769. project string
  71770. resource string
  71771. urlParams_ gensupport.URLParams
  71772. ifNoneMatch_ string
  71773. ctx_ context.Context
  71774. header_ http.Header
  71775. }
  71776. // GetIamPolicy: Gets the access control policy for a resource. May be
  71777. // empty if no such policy or resource exists.
  71778. func (r *LicensesService) GetIamPolicy(project string, resource string) *LicensesGetIamPolicyCall {
  71779. c := &LicensesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  71780. c.project = project
  71781. c.resource = resource
  71782. return c
  71783. }
  71784. // Fields allows partial responses to be retrieved. See
  71785. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  71786. // for more information.
  71787. func (c *LicensesGetIamPolicyCall) Fields(s ...googleapi.Field) *LicensesGetIamPolicyCall {
  71788. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  71789. return c
  71790. }
  71791. // IfNoneMatch sets the optional parameter which makes the operation
  71792. // fail if the object's ETag matches the given value. This is useful for
  71793. // getting updates only after the object has changed since the last
  71794. // request. Use googleapi.IsNotModified to check whether the response
  71795. // error from Do is the result of In-None-Match.
  71796. func (c *LicensesGetIamPolicyCall) IfNoneMatch(entityTag string) *LicensesGetIamPolicyCall {
  71797. c.ifNoneMatch_ = entityTag
  71798. return c
  71799. }
  71800. // Context sets the context to be used in this call's Do method. Any
  71801. // pending HTTP request will be aborted if the provided context is
  71802. // canceled.
  71803. func (c *LicensesGetIamPolicyCall) Context(ctx context.Context) *LicensesGetIamPolicyCall {
  71804. c.ctx_ = ctx
  71805. return c
  71806. }
  71807. // Header returns an http.Header that can be modified by the caller to
  71808. // add HTTP headers to the request.
  71809. func (c *LicensesGetIamPolicyCall) Header() http.Header {
  71810. if c.header_ == nil {
  71811. c.header_ = make(http.Header)
  71812. }
  71813. return c.header_
  71814. }
  71815. func (c *LicensesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  71816. reqHeaders := make(http.Header)
  71817. for k, v := range c.header_ {
  71818. reqHeaders[k] = v
  71819. }
  71820. reqHeaders.Set("User-Agent", c.s.userAgent())
  71821. if c.ifNoneMatch_ != "" {
  71822. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  71823. }
  71824. var body io.Reader = nil
  71825. c.urlParams_.Set("alt", alt)
  71826. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses/{resource}/getIamPolicy")
  71827. urls += "?" + c.urlParams_.Encode()
  71828. req, _ := http.NewRequest("GET", urls, body)
  71829. req.Header = reqHeaders
  71830. googleapi.Expand(req.URL, map[string]string{
  71831. "project": c.project,
  71832. "resource": c.resource,
  71833. })
  71834. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  71835. }
  71836. // Do executes the "compute.licenses.getIamPolicy" call.
  71837. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  71838. // code is an error. Response headers are in either
  71839. // *Policy.ServerResponse.Header or (if a response was returned at all)
  71840. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  71841. // check whether the returned error was because http.StatusNotModified
  71842. // was returned.
  71843. func (c *LicensesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  71844. gensupport.SetOptions(c.urlParams_, opts...)
  71845. res, err := c.doRequest("json")
  71846. if res != nil && res.StatusCode == http.StatusNotModified {
  71847. if res.Body != nil {
  71848. res.Body.Close()
  71849. }
  71850. return nil, &googleapi.Error{
  71851. Code: res.StatusCode,
  71852. Header: res.Header,
  71853. }
  71854. }
  71855. if err != nil {
  71856. return nil, err
  71857. }
  71858. defer googleapi.CloseBody(res)
  71859. if err := googleapi.CheckResponse(res); err != nil {
  71860. return nil, err
  71861. }
  71862. ret := &Policy{
  71863. ServerResponse: googleapi.ServerResponse{
  71864. Header: res.Header,
  71865. HTTPStatusCode: res.StatusCode,
  71866. },
  71867. }
  71868. target := &ret
  71869. if err := gensupport.DecodeResponse(target, res); err != nil {
  71870. return nil, err
  71871. }
  71872. return ret, nil
  71873. // {
  71874. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  71875. // "httpMethod": "GET",
  71876. // "id": "compute.licenses.getIamPolicy",
  71877. // "parameterOrder": [
  71878. // "project",
  71879. // "resource"
  71880. // ],
  71881. // "parameters": {
  71882. // "project": {
  71883. // "description": "Project ID for this request.",
  71884. // "location": "path",
  71885. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  71886. // "required": true,
  71887. // "type": "string"
  71888. // },
  71889. // "resource": {
  71890. // "description": "Name of the resource for this request.",
  71891. // "location": "path",
  71892. // "pattern": "[a-z0-9](?:[-a-z0-9_]{0,61}[a-z0-9])?",
  71893. // "required": true,
  71894. // "type": "string"
  71895. // }
  71896. // },
  71897. // "path": "{project}/global/licenses/{resource}/getIamPolicy",
  71898. // "response": {
  71899. // "$ref": "Policy"
  71900. // },
  71901. // "scopes": [
  71902. // "https://www.googleapis.com/auth/cloud-platform",
  71903. // "https://www.googleapis.com/auth/compute",
  71904. // "https://www.googleapis.com/auth/compute.readonly"
  71905. // ]
  71906. // }
  71907. }
  71908. // method id "compute.licenses.insert":
  71909. type LicensesInsertCall struct {
  71910. s *Service
  71911. project string
  71912. license *License
  71913. urlParams_ gensupport.URLParams
  71914. ctx_ context.Context
  71915. header_ http.Header
  71916. }
  71917. // Insert: Create a License resource in the specified project.
  71918. func (r *LicensesService) Insert(project string, license *License) *LicensesInsertCall {
  71919. c := &LicensesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  71920. c.project = project
  71921. c.license = license
  71922. return c
  71923. }
  71924. // RequestId sets the optional parameter "requestId": An optional
  71925. // request ID to identify requests. Specify a unique request ID so that
  71926. // if you must retry your request, the server will know to ignore the
  71927. // request if it has already been completed.
  71928. //
  71929. // For example, consider a situation where you make an initial request
  71930. // and the request times out. If you make the request again with the
  71931. // same request ID, the server can check if original operation with the
  71932. // same request ID was received, and if so, will ignore the second
  71933. // request. This prevents clients from accidentally creating duplicate
  71934. // commitments.
  71935. //
  71936. // The request ID must be a valid UUID with the exception that zero UUID
  71937. // is not supported (00000000-0000-0000-0000-000000000000).
  71938. func (c *LicensesInsertCall) RequestId(requestId string) *LicensesInsertCall {
  71939. c.urlParams_.Set("requestId", requestId)
  71940. return c
  71941. }
  71942. // Fields allows partial responses to be retrieved. See
  71943. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  71944. // for more information.
  71945. func (c *LicensesInsertCall) Fields(s ...googleapi.Field) *LicensesInsertCall {
  71946. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  71947. return c
  71948. }
  71949. // Context sets the context to be used in this call's Do method. Any
  71950. // pending HTTP request will be aborted if the provided context is
  71951. // canceled.
  71952. func (c *LicensesInsertCall) Context(ctx context.Context) *LicensesInsertCall {
  71953. c.ctx_ = ctx
  71954. return c
  71955. }
  71956. // Header returns an http.Header that can be modified by the caller to
  71957. // add HTTP headers to the request.
  71958. func (c *LicensesInsertCall) Header() http.Header {
  71959. if c.header_ == nil {
  71960. c.header_ = make(http.Header)
  71961. }
  71962. return c.header_
  71963. }
  71964. func (c *LicensesInsertCall) doRequest(alt string) (*http.Response, error) {
  71965. reqHeaders := make(http.Header)
  71966. for k, v := range c.header_ {
  71967. reqHeaders[k] = v
  71968. }
  71969. reqHeaders.Set("User-Agent", c.s.userAgent())
  71970. var body io.Reader = nil
  71971. body, err := googleapi.WithoutDataWrapper.JSONReader(c.license)
  71972. if err != nil {
  71973. return nil, err
  71974. }
  71975. reqHeaders.Set("Content-Type", "application/json")
  71976. c.urlParams_.Set("alt", alt)
  71977. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses")
  71978. urls += "?" + c.urlParams_.Encode()
  71979. req, _ := http.NewRequest("POST", urls, body)
  71980. req.Header = reqHeaders
  71981. googleapi.Expand(req.URL, map[string]string{
  71982. "project": c.project,
  71983. })
  71984. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  71985. }
  71986. // Do executes the "compute.licenses.insert" call.
  71987. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  71988. // status code is an error. Response headers are in either
  71989. // *Operation.ServerResponse.Header or (if a response was returned at
  71990. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  71991. // to check whether the returned error was because
  71992. // http.StatusNotModified was returned.
  71993. func (c *LicensesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  71994. gensupport.SetOptions(c.urlParams_, opts...)
  71995. res, err := c.doRequest("json")
  71996. if res != nil && res.StatusCode == http.StatusNotModified {
  71997. if res.Body != nil {
  71998. res.Body.Close()
  71999. }
  72000. return nil, &googleapi.Error{
  72001. Code: res.StatusCode,
  72002. Header: res.Header,
  72003. }
  72004. }
  72005. if err != nil {
  72006. return nil, err
  72007. }
  72008. defer googleapi.CloseBody(res)
  72009. if err := googleapi.CheckResponse(res); err != nil {
  72010. return nil, err
  72011. }
  72012. ret := &Operation{
  72013. ServerResponse: googleapi.ServerResponse{
  72014. Header: res.Header,
  72015. HTTPStatusCode: res.StatusCode,
  72016. },
  72017. }
  72018. target := &ret
  72019. if err := gensupport.DecodeResponse(target, res); err != nil {
  72020. return nil, err
  72021. }
  72022. return ret, nil
  72023. // {
  72024. // "description": "Create a License resource in the specified project.",
  72025. // "httpMethod": "POST",
  72026. // "id": "compute.licenses.insert",
  72027. // "parameterOrder": [
  72028. // "project"
  72029. // ],
  72030. // "parameters": {
  72031. // "project": {
  72032. // "description": "Project ID for this request.",
  72033. // "location": "path",
  72034. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  72035. // "required": true,
  72036. // "type": "string"
  72037. // },
  72038. // "requestId": {
  72039. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  72040. // "location": "query",
  72041. // "type": "string"
  72042. // }
  72043. // },
  72044. // "path": "{project}/global/licenses",
  72045. // "request": {
  72046. // "$ref": "License"
  72047. // },
  72048. // "response": {
  72049. // "$ref": "Operation"
  72050. // },
  72051. // "scopes": [
  72052. // "https://www.googleapis.com/auth/cloud-platform",
  72053. // "https://www.googleapis.com/auth/compute",
  72054. // "https://www.googleapis.com/auth/devstorage.full_control",
  72055. // "https://www.googleapis.com/auth/devstorage.read_only",
  72056. // "https://www.googleapis.com/auth/devstorage.read_write"
  72057. // ]
  72058. // }
  72059. }
  72060. // method id "compute.licenses.list":
  72061. type LicensesListCall struct {
  72062. s *Service
  72063. project string
  72064. urlParams_ gensupport.URLParams
  72065. ifNoneMatch_ string
  72066. ctx_ context.Context
  72067. header_ http.Header
  72068. }
  72069. // List: Retrieves the list of licenses available in the specified
  72070. // project. This method does not get any licenses that belong to other
  72071. // projects, including licenses attached to publicly-available images,
  72072. // like Debian 9. If you want to get a list of publicly-available
  72073. // licenses, use this method to make a request to the respective image
  72074. // project, such as debian-cloud or windows-cloud.
  72075. func (r *LicensesService) List(project string) *LicensesListCall {
  72076. c := &LicensesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  72077. c.project = project
  72078. return c
  72079. }
  72080. // Filter sets the optional parameter "filter": A filter expression that
  72081. // filters resources listed in the response. The expression must specify
  72082. // the field name, a comparison operator, and the value that you want to
  72083. // use for filtering. The value must be a string, a number, or a
  72084. // boolean. The comparison operator must be either =, !=, >, or <.
  72085. //
  72086. // For example, if you are filtering Compute Engine instances, you can
  72087. // exclude instances named example-instance by specifying name !=
  72088. // example-instance.
  72089. //
  72090. // You can also filter nested fields. For example, you could specify
  72091. // scheduling.automaticRestart = false to include instances only if they
  72092. // are not scheduled for automatic restarts. You can use filtering on
  72093. // nested fields to filter based on resource labels.
  72094. //
  72095. // To filter on multiple expressions, provide each separate expression
  72096. // within parentheses. For example, (scheduling.automaticRestart = true)
  72097. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  72098. // AND expression. However, you can include AND and OR expressions
  72099. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  72100. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  72101. // true).
  72102. func (c *LicensesListCall) Filter(filter string) *LicensesListCall {
  72103. c.urlParams_.Set("filter", filter)
  72104. return c
  72105. }
  72106. // MaxResults sets the optional parameter "maxResults": The maximum
  72107. // number of results per page that should be returned. If the number of
  72108. // available results is larger than maxResults, Compute Engine returns a
  72109. // nextPageToken that can be used to get the next page of results in
  72110. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  72111. // (Default: 500)
  72112. func (c *LicensesListCall) MaxResults(maxResults int64) *LicensesListCall {
  72113. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  72114. return c
  72115. }
  72116. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  72117. // a certain order. By default, results are returned in alphanumerical
  72118. // order based on the resource name.
  72119. //
  72120. // You can also sort results in descending order based on the creation
  72121. // timestamp using orderBy="creationTimestamp desc". This sorts results
  72122. // based on the creationTimestamp field in reverse chronological order
  72123. // (newest result first). Use this to sort resources like operations so
  72124. // that the newest operation is returned first.
  72125. //
  72126. // Currently, only sorting by name or creationTimestamp desc is
  72127. // supported.
  72128. func (c *LicensesListCall) OrderBy(orderBy string) *LicensesListCall {
  72129. c.urlParams_.Set("orderBy", orderBy)
  72130. return c
  72131. }
  72132. // PageToken sets the optional parameter "pageToken": Specifies a page
  72133. // token to use. Set pageToken to the nextPageToken returned by a
  72134. // previous list request to get the next page of results.
  72135. func (c *LicensesListCall) PageToken(pageToken string) *LicensesListCall {
  72136. c.urlParams_.Set("pageToken", pageToken)
  72137. return c
  72138. }
  72139. // Fields allows partial responses to be retrieved. See
  72140. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  72141. // for more information.
  72142. func (c *LicensesListCall) Fields(s ...googleapi.Field) *LicensesListCall {
  72143. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  72144. return c
  72145. }
  72146. // IfNoneMatch sets the optional parameter which makes the operation
  72147. // fail if the object's ETag matches the given value. This is useful for
  72148. // getting updates only after the object has changed since the last
  72149. // request. Use googleapi.IsNotModified to check whether the response
  72150. // error from Do is the result of In-None-Match.
  72151. func (c *LicensesListCall) IfNoneMatch(entityTag string) *LicensesListCall {
  72152. c.ifNoneMatch_ = entityTag
  72153. return c
  72154. }
  72155. // Context sets the context to be used in this call's Do method. Any
  72156. // pending HTTP request will be aborted if the provided context is
  72157. // canceled.
  72158. func (c *LicensesListCall) Context(ctx context.Context) *LicensesListCall {
  72159. c.ctx_ = ctx
  72160. return c
  72161. }
  72162. // Header returns an http.Header that can be modified by the caller to
  72163. // add HTTP headers to the request.
  72164. func (c *LicensesListCall) Header() http.Header {
  72165. if c.header_ == nil {
  72166. c.header_ = make(http.Header)
  72167. }
  72168. return c.header_
  72169. }
  72170. func (c *LicensesListCall) doRequest(alt string) (*http.Response, error) {
  72171. reqHeaders := make(http.Header)
  72172. for k, v := range c.header_ {
  72173. reqHeaders[k] = v
  72174. }
  72175. reqHeaders.Set("User-Agent", c.s.userAgent())
  72176. if c.ifNoneMatch_ != "" {
  72177. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  72178. }
  72179. var body io.Reader = nil
  72180. c.urlParams_.Set("alt", alt)
  72181. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses")
  72182. urls += "?" + c.urlParams_.Encode()
  72183. req, _ := http.NewRequest("GET", urls, body)
  72184. req.Header = reqHeaders
  72185. googleapi.Expand(req.URL, map[string]string{
  72186. "project": c.project,
  72187. })
  72188. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  72189. }
  72190. // Do executes the "compute.licenses.list" call.
  72191. // Exactly one of *LicensesListResponse or error will be non-nil. Any
  72192. // non-2xx status code is an error. Response headers are in either
  72193. // *LicensesListResponse.ServerResponse.Header or (if a response was
  72194. // returned at all) in error.(*googleapi.Error).Header. Use
  72195. // googleapi.IsNotModified to check whether the returned error was
  72196. // because http.StatusNotModified was returned.
  72197. func (c *LicensesListCall) Do(opts ...googleapi.CallOption) (*LicensesListResponse, error) {
  72198. gensupport.SetOptions(c.urlParams_, opts...)
  72199. res, err := c.doRequest("json")
  72200. if res != nil && res.StatusCode == http.StatusNotModified {
  72201. if res.Body != nil {
  72202. res.Body.Close()
  72203. }
  72204. return nil, &googleapi.Error{
  72205. Code: res.StatusCode,
  72206. Header: res.Header,
  72207. }
  72208. }
  72209. if err != nil {
  72210. return nil, err
  72211. }
  72212. defer googleapi.CloseBody(res)
  72213. if err := googleapi.CheckResponse(res); err != nil {
  72214. return nil, err
  72215. }
  72216. ret := &LicensesListResponse{
  72217. ServerResponse: googleapi.ServerResponse{
  72218. Header: res.Header,
  72219. HTTPStatusCode: res.StatusCode,
  72220. },
  72221. }
  72222. target := &ret
  72223. if err := gensupport.DecodeResponse(target, res); err != nil {
  72224. return nil, err
  72225. }
  72226. return ret, nil
  72227. // {
  72228. // "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.",
  72229. // "httpMethod": "GET",
  72230. // "id": "compute.licenses.list",
  72231. // "parameterOrder": [
  72232. // "project"
  72233. // ],
  72234. // "parameters": {
  72235. // "filter": {
  72236. // "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).",
  72237. // "location": "query",
  72238. // "type": "string"
  72239. // },
  72240. // "maxResults": {
  72241. // "default": "500",
  72242. // "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)",
  72243. // "format": "uint32",
  72244. // "location": "query",
  72245. // "minimum": "0",
  72246. // "type": "integer"
  72247. // },
  72248. // "orderBy": {
  72249. // "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.",
  72250. // "location": "query",
  72251. // "type": "string"
  72252. // },
  72253. // "pageToken": {
  72254. // "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.",
  72255. // "location": "query",
  72256. // "type": "string"
  72257. // },
  72258. // "project": {
  72259. // "description": "Project ID for this request.",
  72260. // "location": "path",
  72261. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  72262. // "required": true,
  72263. // "type": "string"
  72264. // }
  72265. // },
  72266. // "path": "{project}/global/licenses",
  72267. // "response": {
  72268. // "$ref": "LicensesListResponse"
  72269. // },
  72270. // "scopes": [
  72271. // "https://www.googleapis.com/auth/cloud-platform",
  72272. // "https://www.googleapis.com/auth/compute",
  72273. // "https://www.googleapis.com/auth/compute.readonly"
  72274. // ]
  72275. // }
  72276. }
  72277. // Pages invokes f for each page of results.
  72278. // A non-nil error returned from f will halt the iteration.
  72279. // The provided context supersedes any context provided to the Context method.
  72280. func (c *LicensesListCall) Pages(ctx context.Context, f func(*LicensesListResponse) error) error {
  72281. c.ctx_ = ctx
  72282. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  72283. for {
  72284. x, err := c.Do()
  72285. if err != nil {
  72286. return err
  72287. }
  72288. if err := f(x); err != nil {
  72289. return err
  72290. }
  72291. if x.NextPageToken == "" {
  72292. return nil
  72293. }
  72294. c.PageToken(x.NextPageToken)
  72295. }
  72296. }
  72297. // method id "compute.licenses.setIamPolicy":
  72298. type LicensesSetIamPolicyCall struct {
  72299. s *Service
  72300. project string
  72301. resource string
  72302. globalsetpolicyrequest *GlobalSetPolicyRequest
  72303. urlParams_ gensupport.URLParams
  72304. ctx_ context.Context
  72305. header_ http.Header
  72306. }
  72307. // SetIamPolicy: Sets the access control policy on the specified
  72308. // resource. Replaces any existing policy.
  72309. func (r *LicensesService) SetIamPolicy(project string, resource string, globalsetpolicyrequest *GlobalSetPolicyRequest) *LicensesSetIamPolicyCall {
  72310. c := &LicensesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  72311. c.project = project
  72312. c.resource = resource
  72313. c.globalsetpolicyrequest = globalsetpolicyrequest
  72314. return c
  72315. }
  72316. // Fields allows partial responses to be retrieved. See
  72317. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  72318. // for more information.
  72319. func (c *LicensesSetIamPolicyCall) Fields(s ...googleapi.Field) *LicensesSetIamPolicyCall {
  72320. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  72321. return c
  72322. }
  72323. // Context sets the context to be used in this call's Do method. Any
  72324. // pending HTTP request will be aborted if the provided context is
  72325. // canceled.
  72326. func (c *LicensesSetIamPolicyCall) Context(ctx context.Context) *LicensesSetIamPolicyCall {
  72327. c.ctx_ = ctx
  72328. return c
  72329. }
  72330. // Header returns an http.Header that can be modified by the caller to
  72331. // add HTTP headers to the request.
  72332. func (c *LicensesSetIamPolicyCall) Header() http.Header {
  72333. if c.header_ == nil {
  72334. c.header_ = make(http.Header)
  72335. }
  72336. return c.header_
  72337. }
  72338. func (c *LicensesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  72339. reqHeaders := make(http.Header)
  72340. for k, v := range c.header_ {
  72341. reqHeaders[k] = v
  72342. }
  72343. reqHeaders.Set("User-Agent", c.s.userAgent())
  72344. var body io.Reader = nil
  72345. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest)
  72346. if err != nil {
  72347. return nil, err
  72348. }
  72349. reqHeaders.Set("Content-Type", "application/json")
  72350. c.urlParams_.Set("alt", alt)
  72351. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses/{resource}/setIamPolicy")
  72352. urls += "?" + c.urlParams_.Encode()
  72353. req, _ := http.NewRequest("POST", urls, body)
  72354. req.Header = reqHeaders
  72355. googleapi.Expand(req.URL, map[string]string{
  72356. "project": c.project,
  72357. "resource": c.resource,
  72358. })
  72359. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  72360. }
  72361. // Do executes the "compute.licenses.setIamPolicy" call.
  72362. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  72363. // code is an error. Response headers are in either
  72364. // *Policy.ServerResponse.Header or (if a response was returned at all)
  72365. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  72366. // check whether the returned error was because http.StatusNotModified
  72367. // was returned.
  72368. func (c *LicensesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  72369. gensupport.SetOptions(c.urlParams_, opts...)
  72370. res, err := c.doRequest("json")
  72371. if res != nil && res.StatusCode == http.StatusNotModified {
  72372. if res.Body != nil {
  72373. res.Body.Close()
  72374. }
  72375. return nil, &googleapi.Error{
  72376. Code: res.StatusCode,
  72377. Header: res.Header,
  72378. }
  72379. }
  72380. if err != nil {
  72381. return nil, err
  72382. }
  72383. defer googleapi.CloseBody(res)
  72384. if err := googleapi.CheckResponse(res); err != nil {
  72385. return nil, err
  72386. }
  72387. ret := &Policy{
  72388. ServerResponse: googleapi.ServerResponse{
  72389. Header: res.Header,
  72390. HTTPStatusCode: res.StatusCode,
  72391. },
  72392. }
  72393. target := &ret
  72394. if err := gensupport.DecodeResponse(target, res); err != nil {
  72395. return nil, err
  72396. }
  72397. return ret, nil
  72398. // {
  72399. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  72400. // "httpMethod": "POST",
  72401. // "id": "compute.licenses.setIamPolicy",
  72402. // "parameterOrder": [
  72403. // "project",
  72404. // "resource"
  72405. // ],
  72406. // "parameters": {
  72407. // "project": {
  72408. // "description": "Project ID for this request.",
  72409. // "location": "path",
  72410. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  72411. // "required": true,
  72412. // "type": "string"
  72413. // },
  72414. // "resource": {
  72415. // "description": "Name of the resource for this request.",
  72416. // "location": "path",
  72417. // "pattern": "[a-z0-9](?:[-a-z0-9_]{0,61}[a-z0-9])?",
  72418. // "required": true,
  72419. // "type": "string"
  72420. // }
  72421. // },
  72422. // "path": "{project}/global/licenses/{resource}/setIamPolicy",
  72423. // "request": {
  72424. // "$ref": "GlobalSetPolicyRequest"
  72425. // },
  72426. // "response": {
  72427. // "$ref": "Policy"
  72428. // },
  72429. // "scopes": [
  72430. // "https://www.googleapis.com/auth/cloud-platform",
  72431. // "https://www.googleapis.com/auth/compute"
  72432. // ]
  72433. // }
  72434. }
  72435. // method id "compute.licenses.testIamPermissions":
  72436. type LicensesTestIamPermissionsCall struct {
  72437. s *Service
  72438. project string
  72439. resource string
  72440. testpermissionsrequest *TestPermissionsRequest
  72441. urlParams_ gensupport.URLParams
  72442. ctx_ context.Context
  72443. header_ http.Header
  72444. }
  72445. // TestIamPermissions: Returns permissions that a caller has on the
  72446. // specified resource.
  72447. func (r *LicensesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *LicensesTestIamPermissionsCall {
  72448. c := &LicensesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  72449. c.project = project
  72450. c.resource = resource
  72451. c.testpermissionsrequest = testpermissionsrequest
  72452. return c
  72453. }
  72454. // Fields allows partial responses to be retrieved. See
  72455. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  72456. // for more information.
  72457. func (c *LicensesTestIamPermissionsCall) Fields(s ...googleapi.Field) *LicensesTestIamPermissionsCall {
  72458. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  72459. return c
  72460. }
  72461. // Context sets the context to be used in this call's Do method. Any
  72462. // pending HTTP request will be aborted if the provided context is
  72463. // canceled.
  72464. func (c *LicensesTestIamPermissionsCall) Context(ctx context.Context) *LicensesTestIamPermissionsCall {
  72465. c.ctx_ = ctx
  72466. return c
  72467. }
  72468. // Header returns an http.Header that can be modified by the caller to
  72469. // add HTTP headers to the request.
  72470. func (c *LicensesTestIamPermissionsCall) Header() http.Header {
  72471. if c.header_ == nil {
  72472. c.header_ = make(http.Header)
  72473. }
  72474. return c.header_
  72475. }
  72476. func (c *LicensesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  72477. reqHeaders := make(http.Header)
  72478. for k, v := range c.header_ {
  72479. reqHeaders[k] = v
  72480. }
  72481. reqHeaders.Set("User-Agent", c.s.userAgent())
  72482. var body io.Reader = nil
  72483. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  72484. if err != nil {
  72485. return nil, err
  72486. }
  72487. reqHeaders.Set("Content-Type", "application/json")
  72488. c.urlParams_.Set("alt", alt)
  72489. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses/{resource}/testIamPermissions")
  72490. urls += "?" + c.urlParams_.Encode()
  72491. req, _ := http.NewRequest("POST", urls, body)
  72492. req.Header = reqHeaders
  72493. googleapi.Expand(req.URL, map[string]string{
  72494. "project": c.project,
  72495. "resource": c.resource,
  72496. })
  72497. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  72498. }
  72499. // Do executes the "compute.licenses.testIamPermissions" call.
  72500. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  72501. // non-2xx status code is an error. Response headers are in either
  72502. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  72503. // returned at all) in error.(*googleapi.Error).Header. Use
  72504. // googleapi.IsNotModified to check whether the returned error was
  72505. // because http.StatusNotModified was returned.
  72506. func (c *LicensesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  72507. gensupport.SetOptions(c.urlParams_, opts...)
  72508. res, err := c.doRequest("json")
  72509. if res != nil && res.StatusCode == http.StatusNotModified {
  72510. if res.Body != nil {
  72511. res.Body.Close()
  72512. }
  72513. return nil, &googleapi.Error{
  72514. Code: res.StatusCode,
  72515. Header: res.Header,
  72516. }
  72517. }
  72518. if err != nil {
  72519. return nil, err
  72520. }
  72521. defer googleapi.CloseBody(res)
  72522. if err := googleapi.CheckResponse(res); err != nil {
  72523. return nil, err
  72524. }
  72525. ret := &TestPermissionsResponse{
  72526. ServerResponse: googleapi.ServerResponse{
  72527. Header: res.Header,
  72528. HTTPStatusCode: res.StatusCode,
  72529. },
  72530. }
  72531. target := &ret
  72532. if err := gensupport.DecodeResponse(target, res); err != nil {
  72533. return nil, err
  72534. }
  72535. return ret, nil
  72536. // {
  72537. // "description": "Returns permissions that a caller has on the specified resource.",
  72538. // "httpMethod": "POST",
  72539. // "id": "compute.licenses.testIamPermissions",
  72540. // "parameterOrder": [
  72541. // "project",
  72542. // "resource"
  72543. // ],
  72544. // "parameters": {
  72545. // "project": {
  72546. // "description": "Project ID for this request.",
  72547. // "location": "path",
  72548. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  72549. // "required": true,
  72550. // "type": "string"
  72551. // },
  72552. // "resource": {
  72553. // "description": "Name of the resource for this request.",
  72554. // "location": "path",
  72555. // "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?",
  72556. // "required": true,
  72557. // "type": "string"
  72558. // }
  72559. // },
  72560. // "path": "{project}/global/licenses/{resource}/testIamPermissions",
  72561. // "request": {
  72562. // "$ref": "TestPermissionsRequest"
  72563. // },
  72564. // "response": {
  72565. // "$ref": "TestPermissionsResponse"
  72566. // },
  72567. // "scopes": [
  72568. // "https://www.googleapis.com/auth/cloud-platform",
  72569. // "https://www.googleapis.com/auth/compute",
  72570. // "https://www.googleapis.com/auth/compute.readonly"
  72571. // ]
  72572. // }
  72573. }
  72574. // method id "compute.machineTypes.aggregatedList":
  72575. type MachineTypesAggregatedListCall struct {
  72576. s *Service
  72577. project string
  72578. urlParams_ gensupport.URLParams
  72579. ifNoneMatch_ string
  72580. ctx_ context.Context
  72581. header_ http.Header
  72582. }
  72583. // AggregatedList: Retrieves an aggregated list of machine types.
  72584. // For details, see https://cloud.google.com/compute/docs/reference/latest/machineTypes/aggregatedList
  72585. func (r *MachineTypesService) AggregatedList(project string) *MachineTypesAggregatedListCall {
  72586. c := &MachineTypesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  72587. c.project = project
  72588. return c
  72589. }
  72590. // Filter sets the optional parameter "filter": A filter expression that
  72591. // filters resources listed in the response. The expression must specify
  72592. // the field name, a comparison operator, and the value that you want to
  72593. // use for filtering. The value must be a string, a number, or a
  72594. // boolean. The comparison operator must be either =, !=, >, or <.
  72595. //
  72596. // For example, if you are filtering Compute Engine instances, you can
  72597. // exclude instances named example-instance by specifying name !=
  72598. // example-instance.
  72599. //
  72600. // You can also filter nested fields. For example, you could specify
  72601. // scheduling.automaticRestart = false to include instances only if they
  72602. // are not scheduled for automatic restarts. You can use filtering on
  72603. // nested fields to filter based on resource labels.
  72604. //
  72605. // To filter on multiple expressions, provide each separate expression
  72606. // within parentheses. For example, (scheduling.automaticRestart = true)
  72607. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  72608. // AND expression. However, you can include AND and OR expressions
  72609. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  72610. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  72611. // true).
  72612. func (c *MachineTypesAggregatedListCall) Filter(filter string) *MachineTypesAggregatedListCall {
  72613. c.urlParams_.Set("filter", filter)
  72614. return c
  72615. }
  72616. // MaxResults sets the optional parameter "maxResults": The maximum
  72617. // number of results per page that should be returned. If the number of
  72618. // available results is larger than maxResults, Compute Engine returns a
  72619. // nextPageToken that can be used to get the next page of results in
  72620. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  72621. // (Default: 500)
  72622. func (c *MachineTypesAggregatedListCall) MaxResults(maxResults int64) *MachineTypesAggregatedListCall {
  72623. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  72624. return c
  72625. }
  72626. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  72627. // a certain order. By default, results are returned in alphanumerical
  72628. // order based on the resource name.
  72629. //
  72630. // You can also sort results in descending order based on the creation
  72631. // timestamp using orderBy="creationTimestamp desc". This sorts results
  72632. // based on the creationTimestamp field in reverse chronological order
  72633. // (newest result first). Use this to sort resources like operations so
  72634. // that the newest operation is returned first.
  72635. //
  72636. // Currently, only sorting by name or creationTimestamp desc is
  72637. // supported.
  72638. func (c *MachineTypesAggregatedListCall) OrderBy(orderBy string) *MachineTypesAggregatedListCall {
  72639. c.urlParams_.Set("orderBy", orderBy)
  72640. return c
  72641. }
  72642. // PageToken sets the optional parameter "pageToken": Specifies a page
  72643. // token to use. Set pageToken to the nextPageToken returned by a
  72644. // previous list request to get the next page of results.
  72645. func (c *MachineTypesAggregatedListCall) PageToken(pageToken string) *MachineTypesAggregatedListCall {
  72646. c.urlParams_.Set("pageToken", pageToken)
  72647. return c
  72648. }
  72649. // Fields allows partial responses to be retrieved. See
  72650. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  72651. // for more information.
  72652. func (c *MachineTypesAggregatedListCall) Fields(s ...googleapi.Field) *MachineTypesAggregatedListCall {
  72653. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  72654. return c
  72655. }
  72656. // IfNoneMatch sets the optional parameter which makes the operation
  72657. // fail if the object's ETag matches the given value. This is useful for
  72658. // getting updates only after the object has changed since the last
  72659. // request. Use googleapi.IsNotModified to check whether the response
  72660. // error from Do is the result of In-None-Match.
  72661. func (c *MachineTypesAggregatedListCall) IfNoneMatch(entityTag string) *MachineTypesAggregatedListCall {
  72662. c.ifNoneMatch_ = entityTag
  72663. return c
  72664. }
  72665. // Context sets the context to be used in this call's Do method. Any
  72666. // pending HTTP request will be aborted if the provided context is
  72667. // canceled.
  72668. func (c *MachineTypesAggregatedListCall) Context(ctx context.Context) *MachineTypesAggregatedListCall {
  72669. c.ctx_ = ctx
  72670. return c
  72671. }
  72672. // Header returns an http.Header that can be modified by the caller to
  72673. // add HTTP headers to the request.
  72674. func (c *MachineTypesAggregatedListCall) Header() http.Header {
  72675. if c.header_ == nil {
  72676. c.header_ = make(http.Header)
  72677. }
  72678. return c.header_
  72679. }
  72680. func (c *MachineTypesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  72681. reqHeaders := make(http.Header)
  72682. for k, v := range c.header_ {
  72683. reqHeaders[k] = v
  72684. }
  72685. reqHeaders.Set("User-Agent", c.s.userAgent())
  72686. if c.ifNoneMatch_ != "" {
  72687. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  72688. }
  72689. var body io.Reader = nil
  72690. c.urlParams_.Set("alt", alt)
  72691. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/machineTypes")
  72692. urls += "?" + c.urlParams_.Encode()
  72693. req, _ := http.NewRequest("GET", urls, body)
  72694. req.Header = reqHeaders
  72695. googleapi.Expand(req.URL, map[string]string{
  72696. "project": c.project,
  72697. })
  72698. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  72699. }
  72700. // Do executes the "compute.machineTypes.aggregatedList" call.
  72701. // Exactly one of *MachineTypeAggregatedList or error will be non-nil.
  72702. // Any non-2xx status code is an error. Response headers are in either
  72703. // *MachineTypeAggregatedList.ServerResponse.Header or (if a response
  72704. // was returned at all) in error.(*googleapi.Error).Header. Use
  72705. // googleapi.IsNotModified to check whether the returned error was
  72706. // because http.StatusNotModified was returned.
  72707. func (c *MachineTypesAggregatedListCall) Do(opts ...googleapi.CallOption) (*MachineTypeAggregatedList, error) {
  72708. gensupport.SetOptions(c.urlParams_, opts...)
  72709. res, err := c.doRequest("json")
  72710. if res != nil && res.StatusCode == http.StatusNotModified {
  72711. if res.Body != nil {
  72712. res.Body.Close()
  72713. }
  72714. return nil, &googleapi.Error{
  72715. Code: res.StatusCode,
  72716. Header: res.Header,
  72717. }
  72718. }
  72719. if err != nil {
  72720. return nil, err
  72721. }
  72722. defer googleapi.CloseBody(res)
  72723. if err := googleapi.CheckResponse(res); err != nil {
  72724. return nil, err
  72725. }
  72726. ret := &MachineTypeAggregatedList{
  72727. ServerResponse: googleapi.ServerResponse{
  72728. Header: res.Header,
  72729. HTTPStatusCode: res.StatusCode,
  72730. },
  72731. }
  72732. target := &ret
  72733. if err := gensupport.DecodeResponse(target, res); err != nil {
  72734. return nil, err
  72735. }
  72736. return ret, nil
  72737. // {
  72738. // "description": "Retrieves an aggregated list of machine types.",
  72739. // "httpMethod": "GET",
  72740. // "id": "compute.machineTypes.aggregatedList",
  72741. // "parameterOrder": [
  72742. // "project"
  72743. // ],
  72744. // "parameters": {
  72745. // "filter": {
  72746. // "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).",
  72747. // "location": "query",
  72748. // "type": "string"
  72749. // },
  72750. // "maxResults": {
  72751. // "default": "500",
  72752. // "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)",
  72753. // "format": "uint32",
  72754. // "location": "query",
  72755. // "minimum": "0",
  72756. // "type": "integer"
  72757. // },
  72758. // "orderBy": {
  72759. // "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.",
  72760. // "location": "query",
  72761. // "type": "string"
  72762. // },
  72763. // "pageToken": {
  72764. // "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.",
  72765. // "location": "query",
  72766. // "type": "string"
  72767. // },
  72768. // "project": {
  72769. // "description": "Project ID for this request.",
  72770. // "location": "path",
  72771. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  72772. // "required": true,
  72773. // "type": "string"
  72774. // }
  72775. // },
  72776. // "path": "{project}/aggregated/machineTypes",
  72777. // "response": {
  72778. // "$ref": "MachineTypeAggregatedList"
  72779. // },
  72780. // "scopes": [
  72781. // "https://www.googleapis.com/auth/cloud-platform",
  72782. // "https://www.googleapis.com/auth/compute",
  72783. // "https://www.googleapis.com/auth/compute.readonly"
  72784. // ]
  72785. // }
  72786. }
  72787. // Pages invokes f for each page of results.
  72788. // A non-nil error returned from f will halt the iteration.
  72789. // The provided context supersedes any context provided to the Context method.
  72790. func (c *MachineTypesAggregatedListCall) Pages(ctx context.Context, f func(*MachineTypeAggregatedList) error) error {
  72791. c.ctx_ = ctx
  72792. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  72793. for {
  72794. x, err := c.Do()
  72795. if err != nil {
  72796. return err
  72797. }
  72798. if err := f(x); err != nil {
  72799. return err
  72800. }
  72801. if x.NextPageToken == "" {
  72802. return nil
  72803. }
  72804. c.PageToken(x.NextPageToken)
  72805. }
  72806. }
  72807. // method id "compute.machineTypes.get":
  72808. type MachineTypesGetCall struct {
  72809. s *Service
  72810. project string
  72811. zone string
  72812. machineType string
  72813. urlParams_ gensupport.URLParams
  72814. ifNoneMatch_ string
  72815. ctx_ context.Context
  72816. header_ http.Header
  72817. }
  72818. // Get: Returns the specified machine type. Gets a list of available
  72819. // machine types by making a list() request.
  72820. // For details, see https://cloud.google.com/compute/docs/reference/latest/machineTypes/get
  72821. func (r *MachineTypesService) Get(project string, zone string, machineType string) *MachineTypesGetCall {
  72822. c := &MachineTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  72823. c.project = project
  72824. c.zone = zone
  72825. c.machineType = machineType
  72826. return c
  72827. }
  72828. // Fields allows partial responses to be retrieved. See
  72829. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  72830. // for more information.
  72831. func (c *MachineTypesGetCall) Fields(s ...googleapi.Field) *MachineTypesGetCall {
  72832. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  72833. return c
  72834. }
  72835. // IfNoneMatch sets the optional parameter which makes the operation
  72836. // fail if the object's ETag matches the given value. This is useful for
  72837. // getting updates only after the object has changed since the last
  72838. // request. Use googleapi.IsNotModified to check whether the response
  72839. // error from Do is the result of In-None-Match.
  72840. func (c *MachineTypesGetCall) IfNoneMatch(entityTag string) *MachineTypesGetCall {
  72841. c.ifNoneMatch_ = entityTag
  72842. return c
  72843. }
  72844. // Context sets the context to be used in this call's Do method. Any
  72845. // pending HTTP request will be aborted if the provided context is
  72846. // canceled.
  72847. func (c *MachineTypesGetCall) Context(ctx context.Context) *MachineTypesGetCall {
  72848. c.ctx_ = ctx
  72849. return c
  72850. }
  72851. // Header returns an http.Header that can be modified by the caller to
  72852. // add HTTP headers to the request.
  72853. func (c *MachineTypesGetCall) Header() http.Header {
  72854. if c.header_ == nil {
  72855. c.header_ = make(http.Header)
  72856. }
  72857. return c.header_
  72858. }
  72859. func (c *MachineTypesGetCall) doRequest(alt string) (*http.Response, error) {
  72860. reqHeaders := make(http.Header)
  72861. for k, v := range c.header_ {
  72862. reqHeaders[k] = v
  72863. }
  72864. reqHeaders.Set("User-Agent", c.s.userAgent())
  72865. if c.ifNoneMatch_ != "" {
  72866. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  72867. }
  72868. var body io.Reader = nil
  72869. c.urlParams_.Set("alt", alt)
  72870. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/machineTypes/{machineType}")
  72871. urls += "?" + c.urlParams_.Encode()
  72872. req, _ := http.NewRequest("GET", urls, body)
  72873. req.Header = reqHeaders
  72874. googleapi.Expand(req.URL, map[string]string{
  72875. "project": c.project,
  72876. "zone": c.zone,
  72877. "machineType": c.machineType,
  72878. })
  72879. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  72880. }
  72881. // Do executes the "compute.machineTypes.get" call.
  72882. // Exactly one of *MachineType or error will be non-nil. Any non-2xx
  72883. // status code is an error. Response headers are in either
  72884. // *MachineType.ServerResponse.Header or (if a response was returned at
  72885. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  72886. // to check whether the returned error was because
  72887. // http.StatusNotModified was returned.
  72888. func (c *MachineTypesGetCall) Do(opts ...googleapi.CallOption) (*MachineType, error) {
  72889. gensupport.SetOptions(c.urlParams_, opts...)
  72890. res, err := c.doRequest("json")
  72891. if res != nil && res.StatusCode == http.StatusNotModified {
  72892. if res.Body != nil {
  72893. res.Body.Close()
  72894. }
  72895. return nil, &googleapi.Error{
  72896. Code: res.StatusCode,
  72897. Header: res.Header,
  72898. }
  72899. }
  72900. if err != nil {
  72901. return nil, err
  72902. }
  72903. defer googleapi.CloseBody(res)
  72904. if err := googleapi.CheckResponse(res); err != nil {
  72905. return nil, err
  72906. }
  72907. ret := &MachineType{
  72908. ServerResponse: googleapi.ServerResponse{
  72909. Header: res.Header,
  72910. HTTPStatusCode: res.StatusCode,
  72911. },
  72912. }
  72913. target := &ret
  72914. if err := gensupport.DecodeResponse(target, res); err != nil {
  72915. return nil, err
  72916. }
  72917. return ret, nil
  72918. // {
  72919. // "description": "Returns the specified machine type. Gets a list of available machine types by making a list() request.",
  72920. // "httpMethod": "GET",
  72921. // "id": "compute.machineTypes.get",
  72922. // "parameterOrder": [
  72923. // "project",
  72924. // "zone",
  72925. // "machineType"
  72926. // ],
  72927. // "parameters": {
  72928. // "machineType": {
  72929. // "description": "Name of the machine type to return.",
  72930. // "location": "path",
  72931. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  72932. // "required": true,
  72933. // "type": "string"
  72934. // },
  72935. // "project": {
  72936. // "description": "Project ID for this request.",
  72937. // "location": "path",
  72938. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  72939. // "required": true,
  72940. // "type": "string"
  72941. // },
  72942. // "zone": {
  72943. // "description": "The name of the zone for this request.",
  72944. // "location": "path",
  72945. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  72946. // "required": true,
  72947. // "type": "string"
  72948. // }
  72949. // },
  72950. // "path": "{project}/zones/{zone}/machineTypes/{machineType}",
  72951. // "response": {
  72952. // "$ref": "MachineType"
  72953. // },
  72954. // "scopes": [
  72955. // "https://www.googleapis.com/auth/cloud-platform",
  72956. // "https://www.googleapis.com/auth/compute",
  72957. // "https://www.googleapis.com/auth/compute.readonly"
  72958. // ]
  72959. // }
  72960. }
  72961. // method id "compute.machineTypes.list":
  72962. type MachineTypesListCall struct {
  72963. s *Service
  72964. project string
  72965. zone string
  72966. urlParams_ gensupport.URLParams
  72967. ifNoneMatch_ string
  72968. ctx_ context.Context
  72969. header_ http.Header
  72970. }
  72971. // List: Retrieves a list of machine types available to the specified
  72972. // project.
  72973. // For details, see https://cloud.google.com/compute/docs/reference/latest/machineTypes/list
  72974. func (r *MachineTypesService) List(project string, zone string) *MachineTypesListCall {
  72975. c := &MachineTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  72976. c.project = project
  72977. c.zone = zone
  72978. return c
  72979. }
  72980. // Filter sets the optional parameter "filter": A filter expression that
  72981. // filters resources listed in the response. The expression must specify
  72982. // the field name, a comparison operator, and the value that you want to
  72983. // use for filtering. The value must be a string, a number, or a
  72984. // boolean. The comparison operator must be either =, !=, >, or <.
  72985. //
  72986. // For example, if you are filtering Compute Engine instances, you can
  72987. // exclude instances named example-instance by specifying name !=
  72988. // example-instance.
  72989. //
  72990. // You can also filter nested fields. For example, you could specify
  72991. // scheduling.automaticRestart = false to include instances only if they
  72992. // are not scheduled for automatic restarts. You can use filtering on
  72993. // nested fields to filter based on resource labels.
  72994. //
  72995. // To filter on multiple expressions, provide each separate expression
  72996. // within parentheses. For example, (scheduling.automaticRestart = true)
  72997. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  72998. // AND expression. However, you can include AND and OR expressions
  72999. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  73000. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  73001. // true).
  73002. func (c *MachineTypesListCall) Filter(filter string) *MachineTypesListCall {
  73003. c.urlParams_.Set("filter", filter)
  73004. return c
  73005. }
  73006. // MaxResults sets the optional parameter "maxResults": The maximum
  73007. // number of results per page that should be returned. If the number of
  73008. // available results is larger than maxResults, Compute Engine returns a
  73009. // nextPageToken that can be used to get the next page of results in
  73010. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  73011. // (Default: 500)
  73012. func (c *MachineTypesListCall) MaxResults(maxResults int64) *MachineTypesListCall {
  73013. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  73014. return c
  73015. }
  73016. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  73017. // a certain order. By default, results are returned in alphanumerical
  73018. // order based on the resource name.
  73019. //
  73020. // You can also sort results in descending order based on the creation
  73021. // timestamp using orderBy="creationTimestamp desc". This sorts results
  73022. // based on the creationTimestamp field in reverse chronological order
  73023. // (newest result first). Use this to sort resources like operations so
  73024. // that the newest operation is returned first.
  73025. //
  73026. // Currently, only sorting by name or creationTimestamp desc is
  73027. // supported.
  73028. func (c *MachineTypesListCall) OrderBy(orderBy string) *MachineTypesListCall {
  73029. c.urlParams_.Set("orderBy", orderBy)
  73030. return c
  73031. }
  73032. // PageToken sets the optional parameter "pageToken": Specifies a page
  73033. // token to use. Set pageToken to the nextPageToken returned by a
  73034. // previous list request to get the next page of results.
  73035. func (c *MachineTypesListCall) PageToken(pageToken string) *MachineTypesListCall {
  73036. c.urlParams_.Set("pageToken", pageToken)
  73037. return c
  73038. }
  73039. // Fields allows partial responses to be retrieved. See
  73040. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  73041. // for more information.
  73042. func (c *MachineTypesListCall) Fields(s ...googleapi.Field) *MachineTypesListCall {
  73043. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  73044. return c
  73045. }
  73046. // IfNoneMatch sets the optional parameter which makes the operation
  73047. // fail if the object's ETag matches the given value. This is useful for
  73048. // getting updates only after the object has changed since the last
  73049. // request. Use googleapi.IsNotModified to check whether the response
  73050. // error from Do is the result of In-None-Match.
  73051. func (c *MachineTypesListCall) IfNoneMatch(entityTag string) *MachineTypesListCall {
  73052. c.ifNoneMatch_ = entityTag
  73053. return c
  73054. }
  73055. // Context sets the context to be used in this call's Do method. Any
  73056. // pending HTTP request will be aborted if the provided context is
  73057. // canceled.
  73058. func (c *MachineTypesListCall) Context(ctx context.Context) *MachineTypesListCall {
  73059. c.ctx_ = ctx
  73060. return c
  73061. }
  73062. // Header returns an http.Header that can be modified by the caller to
  73063. // add HTTP headers to the request.
  73064. func (c *MachineTypesListCall) Header() http.Header {
  73065. if c.header_ == nil {
  73066. c.header_ = make(http.Header)
  73067. }
  73068. return c.header_
  73069. }
  73070. func (c *MachineTypesListCall) doRequest(alt string) (*http.Response, error) {
  73071. reqHeaders := make(http.Header)
  73072. for k, v := range c.header_ {
  73073. reqHeaders[k] = v
  73074. }
  73075. reqHeaders.Set("User-Agent", c.s.userAgent())
  73076. if c.ifNoneMatch_ != "" {
  73077. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  73078. }
  73079. var body io.Reader = nil
  73080. c.urlParams_.Set("alt", alt)
  73081. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/machineTypes")
  73082. urls += "?" + c.urlParams_.Encode()
  73083. req, _ := http.NewRequest("GET", urls, body)
  73084. req.Header = reqHeaders
  73085. googleapi.Expand(req.URL, map[string]string{
  73086. "project": c.project,
  73087. "zone": c.zone,
  73088. })
  73089. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  73090. }
  73091. // Do executes the "compute.machineTypes.list" call.
  73092. // Exactly one of *MachineTypeList or error will be non-nil. Any non-2xx
  73093. // status code is an error. Response headers are in either
  73094. // *MachineTypeList.ServerResponse.Header or (if a response was returned
  73095. // at all) in error.(*googleapi.Error).Header. Use
  73096. // googleapi.IsNotModified to check whether the returned error was
  73097. // because http.StatusNotModified was returned.
  73098. func (c *MachineTypesListCall) Do(opts ...googleapi.CallOption) (*MachineTypeList, error) {
  73099. gensupport.SetOptions(c.urlParams_, opts...)
  73100. res, err := c.doRequest("json")
  73101. if res != nil && res.StatusCode == http.StatusNotModified {
  73102. if res.Body != nil {
  73103. res.Body.Close()
  73104. }
  73105. return nil, &googleapi.Error{
  73106. Code: res.StatusCode,
  73107. Header: res.Header,
  73108. }
  73109. }
  73110. if err != nil {
  73111. return nil, err
  73112. }
  73113. defer googleapi.CloseBody(res)
  73114. if err := googleapi.CheckResponse(res); err != nil {
  73115. return nil, err
  73116. }
  73117. ret := &MachineTypeList{
  73118. ServerResponse: googleapi.ServerResponse{
  73119. Header: res.Header,
  73120. HTTPStatusCode: res.StatusCode,
  73121. },
  73122. }
  73123. target := &ret
  73124. if err := gensupport.DecodeResponse(target, res); err != nil {
  73125. return nil, err
  73126. }
  73127. return ret, nil
  73128. // {
  73129. // "description": "Retrieves a list of machine types available to the specified project.",
  73130. // "httpMethod": "GET",
  73131. // "id": "compute.machineTypes.list",
  73132. // "parameterOrder": [
  73133. // "project",
  73134. // "zone"
  73135. // ],
  73136. // "parameters": {
  73137. // "filter": {
  73138. // "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).",
  73139. // "location": "query",
  73140. // "type": "string"
  73141. // },
  73142. // "maxResults": {
  73143. // "default": "500",
  73144. // "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)",
  73145. // "format": "uint32",
  73146. // "location": "query",
  73147. // "minimum": "0",
  73148. // "type": "integer"
  73149. // },
  73150. // "orderBy": {
  73151. // "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.",
  73152. // "location": "query",
  73153. // "type": "string"
  73154. // },
  73155. // "pageToken": {
  73156. // "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.",
  73157. // "location": "query",
  73158. // "type": "string"
  73159. // },
  73160. // "project": {
  73161. // "description": "Project ID for this request.",
  73162. // "location": "path",
  73163. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  73164. // "required": true,
  73165. // "type": "string"
  73166. // },
  73167. // "zone": {
  73168. // "description": "The name of the zone for this request.",
  73169. // "location": "path",
  73170. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  73171. // "required": true,
  73172. // "type": "string"
  73173. // }
  73174. // },
  73175. // "path": "{project}/zones/{zone}/machineTypes",
  73176. // "response": {
  73177. // "$ref": "MachineTypeList"
  73178. // },
  73179. // "scopes": [
  73180. // "https://www.googleapis.com/auth/cloud-platform",
  73181. // "https://www.googleapis.com/auth/compute",
  73182. // "https://www.googleapis.com/auth/compute.readonly"
  73183. // ]
  73184. // }
  73185. }
  73186. // Pages invokes f for each page of results.
  73187. // A non-nil error returned from f will halt the iteration.
  73188. // The provided context supersedes any context provided to the Context method.
  73189. func (c *MachineTypesListCall) Pages(ctx context.Context, f func(*MachineTypeList) error) error {
  73190. c.ctx_ = ctx
  73191. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  73192. for {
  73193. x, err := c.Do()
  73194. if err != nil {
  73195. return err
  73196. }
  73197. if err := f(x); err != nil {
  73198. return err
  73199. }
  73200. if x.NextPageToken == "" {
  73201. return nil
  73202. }
  73203. c.PageToken(x.NextPageToken)
  73204. }
  73205. }
  73206. // method id "compute.networkEndpointGroups.aggregatedList":
  73207. type NetworkEndpointGroupsAggregatedListCall struct {
  73208. s *Service
  73209. project string
  73210. urlParams_ gensupport.URLParams
  73211. ifNoneMatch_ string
  73212. ctx_ context.Context
  73213. header_ http.Header
  73214. }
  73215. // AggregatedList: Retrieves the list of network endpoint groups and
  73216. // sorts them by zone.
  73217. func (r *NetworkEndpointGroupsService) AggregatedList(project string) *NetworkEndpointGroupsAggregatedListCall {
  73218. c := &NetworkEndpointGroupsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  73219. c.project = project
  73220. return c
  73221. }
  73222. // Filter sets the optional parameter "filter": A filter expression that
  73223. // filters resources listed in the response. The expression must specify
  73224. // the field name, a comparison operator, and the value that you want to
  73225. // use for filtering. The value must be a string, a number, or a
  73226. // boolean. The comparison operator must be either =, !=, >, or <.
  73227. //
  73228. // For example, if you are filtering Compute Engine instances, you can
  73229. // exclude instances named example-instance by specifying name !=
  73230. // example-instance.
  73231. //
  73232. // You can also filter nested fields. For example, you could specify
  73233. // scheduling.automaticRestart = false to include instances only if they
  73234. // are not scheduled for automatic restarts. You can use filtering on
  73235. // nested fields to filter based on resource labels.
  73236. //
  73237. // To filter on multiple expressions, provide each separate expression
  73238. // within parentheses. For example, (scheduling.automaticRestart = true)
  73239. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  73240. // AND expression. However, you can include AND and OR expressions
  73241. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  73242. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  73243. // true).
  73244. func (c *NetworkEndpointGroupsAggregatedListCall) Filter(filter string) *NetworkEndpointGroupsAggregatedListCall {
  73245. c.urlParams_.Set("filter", filter)
  73246. return c
  73247. }
  73248. // MaxResults sets the optional parameter "maxResults": The maximum
  73249. // number of results per page that should be returned. If the number of
  73250. // available results is larger than maxResults, Compute Engine returns a
  73251. // nextPageToken that can be used to get the next page of results in
  73252. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  73253. // (Default: 500)
  73254. func (c *NetworkEndpointGroupsAggregatedListCall) MaxResults(maxResults int64) *NetworkEndpointGroupsAggregatedListCall {
  73255. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  73256. return c
  73257. }
  73258. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  73259. // a certain order. By default, results are returned in alphanumerical
  73260. // order based on the resource name.
  73261. //
  73262. // You can also sort results in descending order based on the creation
  73263. // timestamp using orderBy="creationTimestamp desc". This sorts results
  73264. // based on the creationTimestamp field in reverse chronological order
  73265. // (newest result first). Use this to sort resources like operations so
  73266. // that the newest operation is returned first.
  73267. //
  73268. // Currently, only sorting by name or creationTimestamp desc is
  73269. // supported.
  73270. func (c *NetworkEndpointGroupsAggregatedListCall) OrderBy(orderBy string) *NetworkEndpointGroupsAggregatedListCall {
  73271. c.urlParams_.Set("orderBy", orderBy)
  73272. return c
  73273. }
  73274. // PageToken sets the optional parameter "pageToken": Specifies a page
  73275. // token to use. Set pageToken to the nextPageToken returned by a
  73276. // previous list request to get the next page of results.
  73277. func (c *NetworkEndpointGroupsAggregatedListCall) PageToken(pageToken string) *NetworkEndpointGroupsAggregatedListCall {
  73278. c.urlParams_.Set("pageToken", pageToken)
  73279. return c
  73280. }
  73281. // Fields allows partial responses to be retrieved. See
  73282. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  73283. // for more information.
  73284. func (c *NetworkEndpointGroupsAggregatedListCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsAggregatedListCall {
  73285. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  73286. return c
  73287. }
  73288. // IfNoneMatch sets the optional parameter which makes the operation
  73289. // fail if the object's ETag matches the given value. This is useful for
  73290. // getting updates only after the object has changed since the last
  73291. // request. Use googleapi.IsNotModified to check whether the response
  73292. // error from Do is the result of In-None-Match.
  73293. func (c *NetworkEndpointGroupsAggregatedListCall) IfNoneMatch(entityTag string) *NetworkEndpointGroupsAggregatedListCall {
  73294. c.ifNoneMatch_ = entityTag
  73295. return c
  73296. }
  73297. // Context sets the context to be used in this call's Do method. Any
  73298. // pending HTTP request will be aborted if the provided context is
  73299. // canceled.
  73300. func (c *NetworkEndpointGroupsAggregatedListCall) Context(ctx context.Context) *NetworkEndpointGroupsAggregatedListCall {
  73301. c.ctx_ = ctx
  73302. return c
  73303. }
  73304. // Header returns an http.Header that can be modified by the caller to
  73305. // add HTTP headers to the request.
  73306. func (c *NetworkEndpointGroupsAggregatedListCall) Header() http.Header {
  73307. if c.header_ == nil {
  73308. c.header_ = make(http.Header)
  73309. }
  73310. return c.header_
  73311. }
  73312. func (c *NetworkEndpointGroupsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  73313. reqHeaders := make(http.Header)
  73314. for k, v := range c.header_ {
  73315. reqHeaders[k] = v
  73316. }
  73317. reqHeaders.Set("User-Agent", c.s.userAgent())
  73318. if c.ifNoneMatch_ != "" {
  73319. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  73320. }
  73321. var body io.Reader = nil
  73322. c.urlParams_.Set("alt", alt)
  73323. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/networkEndpointGroups")
  73324. urls += "?" + c.urlParams_.Encode()
  73325. req, _ := http.NewRequest("GET", urls, body)
  73326. req.Header = reqHeaders
  73327. googleapi.Expand(req.URL, map[string]string{
  73328. "project": c.project,
  73329. })
  73330. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  73331. }
  73332. // Do executes the "compute.networkEndpointGroups.aggregatedList" call.
  73333. // Exactly one of *NetworkEndpointGroupAggregatedList or error will be
  73334. // non-nil. Any non-2xx status code is an error. Response headers are in
  73335. // either *NetworkEndpointGroupAggregatedList.ServerResponse.Header or
  73336. // (if a response was returned at all) in
  73337. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  73338. // whether the returned error was because http.StatusNotModified was
  73339. // returned.
  73340. func (c *NetworkEndpointGroupsAggregatedListCall) Do(opts ...googleapi.CallOption) (*NetworkEndpointGroupAggregatedList, error) {
  73341. gensupport.SetOptions(c.urlParams_, opts...)
  73342. res, err := c.doRequest("json")
  73343. if res != nil && res.StatusCode == http.StatusNotModified {
  73344. if res.Body != nil {
  73345. res.Body.Close()
  73346. }
  73347. return nil, &googleapi.Error{
  73348. Code: res.StatusCode,
  73349. Header: res.Header,
  73350. }
  73351. }
  73352. if err != nil {
  73353. return nil, err
  73354. }
  73355. defer googleapi.CloseBody(res)
  73356. if err := googleapi.CheckResponse(res); err != nil {
  73357. return nil, err
  73358. }
  73359. ret := &NetworkEndpointGroupAggregatedList{
  73360. ServerResponse: googleapi.ServerResponse{
  73361. Header: res.Header,
  73362. HTTPStatusCode: res.StatusCode,
  73363. },
  73364. }
  73365. target := &ret
  73366. if err := gensupport.DecodeResponse(target, res); err != nil {
  73367. return nil, err
  73368. }
  73369. return ret, nil
  73370. // {
  73371. // "description": "Retrieves the list of network endpoint groups and sorts them by zone.",
  73372. // "httpMethod": "GET",
  73373. // "id": "compute.networkEndpointGroups.aggregatedList",
  73374. // "parameterOrder": [
  73375. // "project"
  73376. // ],
  73377. // "parameters": {
  73378. // "filter": {
  73379. // "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).",
  73380. // "location": "query",
  73381. // "type": "string"
  73382. // },
  73383. // "maxResults": {
  73384. // "default": "500",
  73385. // "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)",
  73386. // "format": "uint32",
  73387. // "location": "query",
  73388. // "minimum": "0",
  73389. // "type": "integer"
  73390. // },
  73391. // "orderBy": {
  73392. // "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.",
  73393. // "location": "query",
  73394. // "type": "string"
  73395. // },
  73396. // "pageToken": {
  73397. // "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.",
  73398. // "location": "query",
  73399. // "type": "string"
  73400. // },
  73401. // "project": {
  73402. // "description": "Project ID for this request.",
  73403. // "location": "path",
  73404. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  73405. // "required": true,
  73406. // "type": "string"
  73407. // }
  73408. // },
  73409. // "path": "{project}/aggregated/networkEndpointGroups",
  73410. // "response": {
  73411. // "$ref": "NetworkEndpointGroupAggregatedList"
  73412. // },
  73413. // "scopes": [
  73414. // "https://www.googleapis.com/auth/cloud-platform",
  73415. // "https://www.googleapis.com/auth/compute",
  73416. // "https://www.googleapis.com/auth/compute.readonly"
  73417. // ]
  73418. // }
  73419. }
  73420. // Pages invokes f for each page of results.
  73421. // A non-nil error returned from f will halt the iteration.
  73422. // The provided context supersedes any context provided to the Context method.
  73423. func (c *NetworkEndpointGroupsAggregatedListCall) Pages(ctx context.Context, f func(*NetworkEndpointGroupAggregatedList) error) error {
  73424. c.ctx_ = ctx
  73425. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  73426. for {
  73427. x, err := c.Do()
  73428. if err != nil {
  73429. return err
  73430. }
  73431. if err := f(x); err != nil {
  73432. return err
  73433. }
  73434. if x.NextPageToken == "" {
  73435. return nil
  73436. }
  73437. c.PageToken(x.NextPageToken)
  73438. }
  73439. }
  73440. // method id "compute.networkEndpointGroups.attachNetworkEndpoints":
  73441. type NetworkEndpointGroupsAttachNetworkEndpointsCall struct {
  73442. s *Service
  73443. project string
  73444. zone string
  73445. networkEndpointGroup string
  73446. networkendpointgroupsattachendpointsrequest *NetworkEndpointGroupsAttachEndpointsRequest
  73447. urlParams_ gensupport.URLParams
  73448. ctx_ context.Context
  73449. header_ http.Header
  73450. }
  73451. // AttachNetworkEndpoints: Attach a list of network endpoints to the
  73452. // specified network endpoint group.
  73453. func (r *NetworkEndpointGroupsService) AttachNetworkEndpoints(project string, zone string, networkEndpointGroup string, networkendpointgroupsattachendpointsrequest *NetworkEndpointGroupsAttachEndpointsRequest) *NetworkEndpointGroupsAttachNetworkEndpointsCall {
  73454. c := &NetworkEndpointGroupsAttachNetworkEndpointsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  73455. c.project = project
  73456. c.zone = zone
  73457. c.networkEndpointGroup = networkEndpointGroup
  73458. c.networkendpointgroupsattachendpointsrequest = networkendpointgroupsattachendpointsrequest
  73459. return c
  73460. }
  73461. // RequestId sets the optional parameter "requestId": An optional
  73462. // request ID to identify requests. Specify a unique request ID so that
  73463. // if you must retry your request, the server will know to ignore the
  73464. // request if it has already been completed.
  73465. //
  73466. // For example, consider a situation where you make an initial request
  73467. // and the request times out. If you make the request again with the
  73468. // same request ID, the server can check if original operation with the
  73469. // same request ID was received, and if so, will ignore the second
  73470. // request. This prevents clients from accidentally creating duplicate
  73471. // commitments.
  73472. //
  73473. // The request ID must be a valid UUID with the exception that zero UUID
  73474. // is not supported (00000000-0000-0000-0000-000000000000).
  73475. func (c *NetworkEndpointGroupsAttachNetworkEndpointsCall) RequestId(requestId string) *NetworkEndpointGroupsAttachNetworkEndpointsCall {
  73476. c.urlParams_.Set("requestId", requestId)
  73477. return c
  73478. }
  73479. // Fields allows partial responses to be retrieved. See
  73480. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  73481. // for more information.
  73482. func (c *NetworkEndpointGroupsAttachNetworkEndpointsCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsAttachNetworkEndpointsCall {
  73483. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  73484. return c
  73485. }
  73486. // Context sets the context to be used in this call's Do method. Any
  73487. // pending HTTP request will be aborted if the provided context is
  73488. // canceled.
  73489. func (c *NetworkEndpointGroupsAttachNetworkEndpointsCall) Context(ctx context.Context) *NetworkEndpointGroupsAttachNetworkEndpointsCall {
  73490. c.ctx_ = ctx
  73491. return c
  73492. }
  73493. // Header returns an http.Header that can be modified by the caller to
  73494. // add HTTP headers to the request.
  73495. func (c *NetworkEndpointGroupsAttachNetworkEndpointsCall) Header() http.Header {
  73496. if c.header_ == nil {
  73497. c.header_ = make(http.Header)
  73498. }
  73499. return c.header_
  73500. }
  73501. func (c *NetworkEndpointGroupsAttachNetworkEndpointsCall) doRequest(alt string) (*http.Response, error) {
  73502. reqHeaders := make(http.Header)
  73503. for k, v := range c.header_ {
  73504. reqHeaders[k] = v
  73505. }
  73506. reqHeaders.Set("User-Agent", c.s.userAgent())
  73507. var body io.Reader = nil
  73508. body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkendpointgroupsattachendpointsrequest)
  73509. if err != nil {
  73510. return nil, err
  73511. }
  73512. reqHeaders.Set("Content-Type", "application/json")
  73513. c.urlParams_.Set("alt", alt)
  73514. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}/attachNetworkEndpoints")
  73515. urls += "?" + c.urlParams_.Encode()
  73516. req, _ := http.NewRequest("POST", urls, body)
  73517. req.Header = reqHeaders
  73518. googleapi.Expand(req.URL, map[string]string{
  73519. "project": c.project,
  73520. "zone": c.zone,
  73521. "networkEndpointGroup": c.networkEndpointGroup,
  73522. })
  73523. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  73524. }
  73525. // Do executes the "compute.networkEndpointGroups.attachNetworkEndpoints" call.
  73526. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  73527. // status code is an error. Response headers are in either
  73528. // *Operation.ServerResponse.Header or (if a response was returned at
  73529. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  73530. // to check whether the returned error was because
  73531. // http.StatusNotModified was returned.
  73532. func (c *NetworkEndpointGroupsAttachNetworkEndpointsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  73533. gensupport.SetOptions(c.urlParams_, opts...)
  73534. res, err := c.doRequest("json")
  73535. if res != nil && res.StatusCode == http.StatusNotModified {
  73536. if res.Body != nil {
  73537. res.Body.Close()
  73538. }
  73539. return nil, &googleapi.Error{
  73540. Code: res.StatusCode,
  73541. Header: res.Header,
  73542. }
  73543. }
  73544. if err != nil {
  73545. return nil, err
  73546. }
  73547. defer googleapi.CloseBody(res)
  73548. if err := googleapi.CheckResponse(res); err != nil {
  73549. return nil, err
  73550. }
  73551. ret := &Operation{
  73552. ServerResponse: googleapi.ServerResponse{
  73553. Header: res.Header,
  73554. HTTPStatusCode: res.StatusCode,
  73555. },
  73556. }
  73557. target := &ret
  73558. if err := gensupport.DecodeResponse(target, res); err != nil {
  73559. return nil, err
  73560. }
  73561. return ret, nil
  73562. // {
  73563. // "description": "Attach a list of network endpoints to the specified network endpoint group.",
  73564. // "httpMethod": "POST",
  73565. // "id": "compute.networkEndpointGroups.attachNetworkEndpoints",
  73566. // "parameterOrder": [
  73567. // "project",
  73568. // "zone",
  73569. // "networkEndpointGroup"
  73570. // ],
  73571. // "parameters": {
  73572. // "networkEndpointGroup": {
  73573. // "description": "The name of the network endpoint group where you are attaching network endpoints to. It should comply with RFC1035.",
  73574. // "location": "path",
  73575. // "required": true,
  73576. // "type": "string"
  73577. // },
  73578. // "project": {
  73579. // "description": "Project ID for this request.",
  73580. // "location": "path",
  73581. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  73582. // "required": true,
  73583. // "type": "string"
  73584. // },
  73585. // "requestId": {
  73586. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  73587. // "location": "query",
  73588. // "type": "string"
  73589. // },
  73590. // "zone": {
  73591. // "description": "The name of the zone where the network endpoint group is located. It should comply with RFC1035.",
  73592. // "location": "path",
  73593. // "required": true,
  73594. // "type": "string"
  73595. // }
  73596. // },
  73597. // "path": "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}/attachNetworkEndpoints",
  73598. // "request": {
  73599. // "$ref": "NetworkEndpointGroupsAttachEndpointsRequest"
  73600. // },
  73601. // "response": {
  73602. // "$ref": "Operation"
  73603. // },
  73604. // "scopes": [
  73605. // "https://www.googleapis.com/auth/cloud-platform",
  73606. // "https://www.googleapis.com/auth/compute"
  73607. // ]
  73608. // }
  73609. }
  73610. // method id "compute.networkEndpointGroups.delete":
  73611. type NetworkEndpointGroupsDeleteCall struct {
  73612. s *Service
  73613. project string
  73614. zone string
  73615. networkEndpointGroup string
  73616. urlParams_ gensupport.URLParams
  73617. ctx_ context.Context
  73618. header_ http.Header
  73619. }
  73620. // Delete: Deletes the specified network endpoint group. The network
  73621. // endpoints in the NEG and the VM instances they belong to are not
  73622. // terminated when the NEG is deleted. Note that the NEG cannot be
  73623. // deleted if there are backend services referencing it.
  73624. func (r *NetworkEndpointGroupsService) Delete(project string, zone string, networkEndpointGroup string) *NetworkEndpointGroupsDeleteCall {
  73625. c := &NetworkEndpointGroupsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  73626. c.project = project
  73627. c.zone = zone
  73628. c.networkEndpointGroup = networkEndpointGroup
  73629. return c
  73630. }
  73631. // RequestId sets the optional parameter "requestId": An optional
  73632. // request ID to identify requests. Specify a unique request ID so that
  73633. // if you must retry your request, the server will know to ignore the
  73634. // request if it has already been completed.
  73635. //
  73636. // For example, consider a situation where you make an initial request
  73637. // and the request times out. If you make the request again with the
  73638. // same request ID, the server can check if original operation with the
  73639. // same request ID was received, and if so, will ignore the second
  73640. // request. This prevents clients from accidentally creating duplicate
  73641. // commitments.
  73642. //
  73643. // The request ID must be a valid UUID with the exception that zero UUID
  73644. // is not supported (00000000-0000-0000-0000-000000000000).
  73645. func (c *NetworkEndpointGroupsDeleteCall) RequestId(requestId string) *NetworkEndpointGroupsDeleteCall {
  73646. c.urlParams_.Set("requestId", requestId)
  73647. return c
  73648. }
  73649. // Fields allows partial responses to be retrieved. See
  73650. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  73651. // for more information.
  73652. func (c *NetworkEndpointGroupsDeleteCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsDeleteCall {
  73653. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  73654. return c
  73655. }
  73656. // Context sets the context to be used in this call's Do method. Any
  73657. // pending HTTP request will be aborted if the provided context is
  73658. // canceled.
  73659. func (c *NetworkEndpointGroupsDeleteCall) Context(ctx context.Context) *NetworkEndpointGroupsDeleteCall {
  73660. c.ctx_ = ctx
  73661. return c
  73662. }
  73663. // Header returns an http.Header that can be modified by the caller to
  73664. // add HTTP headers to the request.
  73665. func (c *NetworkEndpointGroupsDeleteCall) Header() http.Header {
  73666. if c.header_ == nil {
  73667. c.header_ = make(http.Header)
  73668. }
  73669. return c.header_
  73670. }
  73671. func (c *NetworkEndpointGroupsDeleteCall) doRequest(alt string) (*http.Response, error) {
  73672. reqHeaders := make(http.Header)
  73673. for k, v := range c.header_ {
  73674. reqHeaders[k] = v
  73675. }
  73676. reqHeaders.Set("User-Agent", c.s.userAgent())
  73677. var body io.Reader = nil
  73678. c.urlParams_.Set("alt", alt)
  73679. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}")
  73680. urls += "?" + c.urlParams_.Encode()
  73681. req, _ := http.NewRequest("DELETE", urls, body)
  73682. req.Header = reqHeaders
  73683. googleapi.Expand(req.URL, map[string]string{
  73684. "project": c.project,
  73685. "zone": c.zone,
  73686. "networkEndpointGroup": c.networkEndpointGroup,
  73687. })
  73688. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  73689. }
  73690. // Do executes the "compute.networkEndpointGroups.delete" call.
  73691. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  73692. // status code is an error. Response headers are in either
  73693. // *Operation.ServerResponse.Header or (if a response was returned at
  73694. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  73695. // to check whether the returned error was because
  73696. // http.StatusNotModified was returned.
  73697. func (c *NetworkEndpointGroupsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  73698. gensupport.SetOptions(c.urlParams_, opts...)
  73699. res, err := c.doRequest("json")
  73700. if res != nil && res.StatusCode == http.StatusNotModified {
  73701. if res.Body != nil {
  73702. res.Body.Close()
  73703. }
  73704. return nil, &googleapi.Error{
  73705. Code: res.StatusCode,
  73706. Header: res.Header,
  73707. }
  73708. }
  73709. if err != nil {
  73710. return nil, err
  73711. }
  73712. defer googleapi.CloseBody(res)
  73713. if err := googleapi.CheckResponse(res); err != nil {
  73714. return nil, err
  73715. }
  73716. ret := &Operation{
  73717. ServerResponse: googleapi.ServerResponse{
  73718. Header: res.Header,
  73719. HTTPStatusCode: res.StatusCode,
  73720. },
  73721. }
  73722. target := &ret
  73723. if err := gensupport.DecodeResponse(target, res); err != nil {
  73724. return nil, err
  73725. }
  73726. return ret, nil
  73727. // {
  73728. // "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.",
  73729. // "httpMethod": "DELETE",
  73730. // "id": "compute.networkEndpointGroups.delete",
  73731. // "parameterOrder": [
  73732. // "project",
  73733. // "zone",
  73734. // "networkEndpointGroup"
  73735. // ],
  73736. // "parameters": {
  73737. // "networkEndpointGroup": {
  73738. // "description": "The name of the network endpoint group to delete. It should comply with RFC1035.",
  73739. // "location": "path",
  73740. // "required": true,
  73741. // "type": "string"
  73742. // },
  73743. // "project": {
  73744. // "description": "Project ID for this request.",
  73745. // "location": "path",
  73746. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  73747. // "required": true,
  73748. // "type": "string"
  73749. // },
  73750. // "requestId": {
  73751. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  73752. // "location": "query",
  73753. // "type": "string"
  73754. // },
  73755. // "zone": {
  73756. // "description": "The name of the zone where the network endpoint group is located. It should comply with RFC1035.",
  73757. // "location": "path",
  73758. // "required": true,
  73759. // "type": "string"
  73760. // }
  73761. // },
  73762. // "path": "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}",
  73763. // "response": {
  73764. // "$ref": "Operation"
  73765. // },
  73766. // "scopes": [
  73767. // "https://www.googleapis.com/auth/cloud-platform",
  73768. // "https://www.googleapis.com/auth/compute"
  73769. // ]
  73770. // }
  73771. }
  73772. // method id "compute.networkEndpointGroups.detachNetworkEndpoints":
  73773. type NetworkEndpointGroupsDetachNetworkEndpointsCall struct {
  73774. s *Service
  73775. project string
  73776. zone string
  73777. networkEndpointGroup string
  73778. networkendpointgroupsdetachendpointsrequest *NetworkEndpointGroupsDetachEndpointsRequest
  73779. urlParams_ gensupport.URLParams
  73780. ctx_ context.Context
  73781. header_ http.Header
  73782. }
  73783. // DetachNetworkEndpoints: Detach a list of network endpoints from the
  73784. // specified network endpoint group.
  73785. func (r *NetworkEndpointGroupsService) DetachNetworkEndpoints(project string, zone string, networkEndpointGroup string, networkendpointgroupsdetachendpointsrequest *NetworkEndpointGroupsDetachEndpointsRequest) *NetworkEndpointGroupsDetachNetworkEndpointsCall {
  73786. c := &NetworkEndpointGroupsDetachNetworkEndpointsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  73787. c.project = project
  73788. c.zone = zone
  73789. c.networkEndpointGroup = networkEndpointGroup
  73790. c.networkendpointgroupsdetachendpointsrequest = networkendpointgroupsdetachendpointsrequest
  73791. return c
  73792. }
  73793. // RequestId sets the optional parameter "requestId": An optional
  73794. // request ID to identify requests. Specify a unique request ID so that
  73795. // if you must retry your request, the server will know to ignore the
  73796. // request if it has already been completed.
  73797. //
  73798. // For example, consider a situation where you make an initial request
  73799. // and the request times out. If you make the request again with the
  73800. // same request ID, the server can check if original operation with the
  73801. // same request ID was received, and if so, will ignore the second
  73802. // request. This prevents clients from accidentally creating duplicate
  73803. // commitments.
  73804. //
  73805. // The request ID must be a valid UUID with the exception that zero UUID
  73806. // is not supported (00000000-0000-0000-0000-000000000000).
  73807. func (c *NetworkEndpointGroupsDetachNetworkEndpointsCall) RequestId(requestId string) *NetworkEndpointGroupsDetachNetworkEndpointsCall {
  73808. c.urlParams_.Set("requestId", requestId)
  73809. return c
  73810. }
  73811. // Fields allows partial responses to be retrieved. See
  73812. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  73813. // for more information.
  73814. func (c *NetworkEndpointGroupsDetachNetworkEndpointsCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsDetachNetworkEndpointsCall {
  73815. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  73816. return c
  73817. }
  73818. // Context sets the context to be used in this call's Do method. Any
  73819. // pending HTTP request will be aborted if the provided context is
  73820. // canceled.
  73821. func (c *NetworkEndpointGroupsDetachNetworkEndpointsCall) Context(ctx context.Context) *NetworkEndpointGroupsDetachNetworkEndpointsCall {
  73822. c.ctx_ = ctx
  73823. return c
  73824. }
  73825. // Header returns an http.Header that can be modified by the caller to
  73826. // add HTTP headers to the request.
  73827. func (c *NetworkEndpointGroupsDetachNetworkEndpointsCall) Header() http.Header {
  73828. if c.header_ == nil {
  73829. c.header_ = make(http.Header)
  73830. }
  73831. return c.header_
  73832. }
  73833. func (c *NetworkEndpointGroupsDetachNetworkEndpointsCall) doRequest(alt string) (*http.Response, error) {
  73834. reqHeaders := make(http.Header)
  73835. for k, v := range c.header_ {
  73836. reqHeaders[k] = v
  73837. }
  73838. reqHeaders.Set("User-Agent", c.s.userAgent())
  73839. var body io.Reader = nil
  73840. body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkendpointgroupsdetachendpointsrequest)
  73841. if err != nil {
  73842. return nil, err
  73843. }
  73844. reqHeaders.Set("Content-Type", "application/json")
  73845. c.urlParams_.Set("alt", alt)
  73846. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}/detachNetworkEndpoints")
  73847. urls += "?" + c.urlParams_.Encode()
  73848. req, _ := http.NewRequest("POST", urls, body)
  73849. req.Header = reqHeaders
  73850. googleapi.Expand(req.URL, map[string]string{
  73851. "project": c.project,
  73852. "zone": c.zone,
  73853. "networkEndpointGroup": c.networkEndpointGroup,
  73854. })
  73855. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  73856. }
  73857. // Do executes the "compute.networkEndpointGroups.detachNetworkEndpoints" call.
  73858. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  73859. // status code is an error. Response headers are in either
  73860. // *Operation.ServerResponse.Header or (if a response was returned at
  73861. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  73862. // to check whether the returned error was because
  73863. // http.StatusNotModified was returned.
  73864. func (c *NetworkEndpointGroupsDetachNetworkEndpointsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  73865. gensupport.SetOptions(c.urlParams_, opts...)
  73866. res, err := c.doRequest("json")
  73867. if res != nil && res.StatusCode == http.StatusNotModified {
  73868. if res.Body != nil {
  73869. res.Body.Close()
  73870. }
  73871. return nil, &googleapi.Error{
  73872. Code: res.StatusCode,
  73873. Header: res.Header,
  73874. }
  73875. }
  73876. if err != nil {
  73877. return nil, err
  73878. }
  73879. defer googleapi.CloseBody(res)
  73880. if err := googleapi.CheckResponse(res); err != nil {
  73881. return nil, err
  73882. }
  73883. ret := &Operation{
  73884. ServerResponse: googleapi.ServerResponse{
  73885. Header: res.Header,
  73886. HTTPStatusCode: res.StatusCode,
  73887. },
  73888. }
  73889. target := &ret
  73890. if err := gensupport.DecodeResponse(target, res); err != nil {
  73891. return nil, err
  73892. }
  73893. return ret, nil
  73894. // {
  73895. // "description": "Detach a list of network endpoints from the specified network endpoint group.",
  73896. // "httpMethod": "POST",
  73897. // "id": "compute.networkEndpointGroups.detachNetworkEndpoints",
  73898. // "parameterOrder": [
  73899. // "project",
  73900. // "zone",
  73901. // "networkEndpointGroup"
  73902. // ],
  73903. // "parameters": {
  73904. // "networkEndpointGroup": {
  73905. // "description": "The name of the network endpoint group where you are removing network endpoints. It should comply with RFC1035.",
  73906. // "location": "path",
  73907. // "required": true,
  73908. // "type": "string"
  73909. // },
  73910. // "project": {
  73911. // "description": "Project ID for this request.",
  73912. // "location": "path",
  73913. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  73914. // "required": true,
  73915. // "type": "string"
  73916. // },
  73917. // "requestId": {
  73918. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  73919. // "location": "query",
  73920. // "type": "string"
  73921. // },
  73922. // "zone": {
  73923. // "description": "The name of the zone where the network endpoint group is located. It should comply with RFC1035.",
  73924. // "location": "path",
  73925. // "required": true,
  73926. // "type": "string"
  73927. // }
  73928. // },
  73929. // "path": "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}/detachNetworkEndpoints",
  73930. // "request": {
  73931. // "$ref": "NetworkEndpointGroupsDetachEndpointsRequest"
  73932. // },
  73933. // "response": {
  73934. // "$ref": "Operation"
  73935. // },
  73936. // "scopes": [
  73937. // "https://www.googleapis.com/auth/cloud-platform",
  73938. // "https://www.googleapis.com/auth/compute"
  73939. // ]
  73940. // }
  73941. }
  73942. // method id "compute.networkEndpointGroups.get":
  73943. type NetworkEndpointGroupsGetCall struct {
  73944. s *Service
  73945. project string
  73946. zone string
  73947. networkEndpointGroup string
  73948. urlParams_ gensupport.URLParams
  73949. ifNoneMatch_ string
  73950. ctx_ context.Context
  73951. header_ http.Header
  73952. }
  73953. // Get: Returns the specified network endpoint group. Gets a list of
  73954. // available network endpoint groups by making a list() request.
  73955. func (r *NetworkEndpointGroupsService) Get(project string, zone string, networkEndpointGroup string) *NetworkEndpointGroupsGetCall {
  73956. c := &NetworkEndpointGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  73957. c.project = project
  73958. c.zone = zone
  73959. c.networkEndpointGroup = networkEndpointGroup
  73960. return c
  73961. }
  73962. // Fields allows partial responses to be retrieved. See
  73963. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  73964. // for more information.
  73965. func (c *NetworkEndpointGroupsGetCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsGetCall {
  73966. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  73967. return c
  73968. }
  73969. // IfNoneMatch sets the optional parameter which makes the operation
  73970. // fail if the object's ETag matches the given value. This is useful for
  73971. // getting updates only after the object has changed since the last
  73972. // request. Use googleapi.IsNotModified to check whether the response
  73973. // error from Do is the result of In-None-Match.
  73974. func (c *NetworkEndpointGroupsGetCall) IfNoneMatch(entityTag string) *NetworkEndpointGroupsGetCall {
  73975. c.ifNoneMatch_ = entityTag
  73976. return c
  73977. }
  73978. // Context sets the context to be used in this call's Do method. Any
  73979. // pending HTTP request will be aborted if the provided context is
  73980. // canceled.
  73981. func (c *NetworkEndpointGroupsGetCall) Context(ctx context.Context) *NetworkEndpointGroupsGetCall {
  73982. c.ctx_ = ctx
  73983. return c
  73984. }
  73985. // Header returns an http.Header that can be modified by the caller to
  73986. // add HTTP headers to the request.
  73987. func (c *NetworkEndpointGroupsGetCall) Header() http.Header {
  73988. if c.header_ == nil {
  73989. c.header_ = make(http.Header)
  73990. }
  73991. return c.header_
  73992. }
  73993. func (c *NetworkEndpointGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  73994. reqHeaders := make(http.Header)
  73995. for k, v := range c.header_ {
  73996. reqHeaders[k] = v
  73997. }
  73998. reqHeaders.Set("User-Agent", c.s.userAgent())
  73999. if c.ifNoneMatch_ != "" {
  74000. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  74001. }
  74002. var body io.Reader = nil
  74003. c.urlParams_.Set("alt", alt)
  74004. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}")
  74005. urls += "?" + c.urlParams_.Encode()
  74006. req, _ := http.NewRequest("GET", urls, body)
  74007. req.Header = reqHeaders
  74008. googleapi.Expand(req.URL, map[string]string{
  74009. "project": c.project,
  74010. "zone": c.zone,
  74011. "networkEndpointGroup": c.networkEndpointGroup,
  74012. })
  74013. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  74014. }
  74015. // Do executes the "compute.networkEndpointGroups.get" call.
  74016. // Exactly one of *NetworkEndpointGroup or error will be non-nil. Any
  74017. // non-2xx status code is an error. Response headers are in either
  74018. // *NetworkEndpointGroup.ServerResponse.Header or (if a response was
  74019. // returned at all) in error.(*googleapi.Error).Header. Use
  74020. // googleapi.IsNotModified to check whether the returned error was
  74021. // because http.StatusNotModified was returned.
  74022. func (c *NetworkEndpointGroupsGetCall) Do(opts ...googleapi.CallOption) (*NetworkEndpointGroup, error) {
  74023. gensupport.SetOptions(c.urlParams_, opts...)
  74024. res, err := c.doRequest("json")
  74025. if res != nil && res.StatusCode == http.StatusNotModified {
  74026. if res.Body != nil {
  74027. res.Body.Close()
  74028. }
  74029. return nil, &googleapi.Error{
  74030. Code: res.StatusCode,
  74031. Header: res.Header,
  74032. }
  74033. }
  74034. if err != nil {
  74035. return nil, err
  74036. }
  74037. defer googleapi.CloseBody(res)
  74038. if err := googleapi.CheckResponse(res); err != nil {
  74039. return nil, err
  74040. }
  74041. ret := &NetworkEndpointGroup{
  74042. ServerResponse: googleapi.ServerResponse{
  74043. Header: res.Header,
  74044. HTTPStatusCode: res.StatusCode,
  74045. },
  74046. }
  74047. target := &ret
  74048. if err := gensupport.DecodeResponse(target, res); err != nil {
  74049. return nil, err
  74050. }
  74051. return ret, nil
  74052. // {
  74053. // "description": "Returns the specified network endpoint group. Gets a list of available network endpoint groups by making a list() request.",
  74054. // "httpMethod": "GET",
  74055. // "id": "compute.networkEndpointGroups.get",
  74056. // "parameterOrder": [
  74057. // "project",
  74058. // "zone",
  74059. // "networkEndpointGroup"
  74060. // ],
  74061. // "parameters": {
  74062. // "networkEndpointGroup": {
  74063. // "description": "The name of the network endpoint group. It should comply with RFC1035.",
  74064. // "location": "path",
  74065. // "required": true,
  74066. // "type": "string"
  74067. // },
  74068. // "project": {
  74069. // "description": "Project ID for this request.",
  74070. // "location": "path",
  74071. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  74072. // "required": true,
  74073. // "type": "string"
  74074. // },
  74075. // "zone": {
  74076. // "description": "The name of the zone where the network endpoint group is located. It should comply with RFC1035.",
  74077. // "location": "path",
  74078. // "required": true,
  74079. // "type": "string"
  74080. // }
  74081. // },
  74082. // "path": "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}",
  74083. // "response": {
  74084. // "$ref": "NetworkEndpointGroup"
  74085. // },
  74086. // "scopes": [
  74087. // "https://www.googleapis.com/auth/cloud-platform",
  74088. // "https://www.googleapis.com/auth/compute",
  74089. // "https://www.googleapis.com/auth/compute.readonly"
  74090. // ]
  74091. // }
  74092. }
  74093. // method id "compute.networkEndpointGroups.insert":
  74094. type NetworkEndpointGroupsInsertCall struct {
  74095. s *Service
  74096. project string
  74097. zone string
  74098. networkendpointgroup *NetworkEndpointGroup
  74099. urlParams_ gensupport.URLParams
  74100. ctx_ context.Context
  74101. header_ http.Header
  74102. }
  74103. // Insert: Creates a network endpoint group in the specified project
  74104. // using the parameters that are included in the request.
  74105. func (r *NetworkEndpointGroupsService) Insert(project string, zone string, networkendpointgroup *NetworkEndpointGroup) *NetworkEndpointGroupsInsertCall {
  74106. c := &NetworkEndpointGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  74107. c.project = project
  74108. c.zone = zone
  74109. c.networkendpointgroup = networkendpointgroup
  74110. return c
  74111. }
  74112. // RequestId sets the optional parameter "requestId": An optional
  74113. // request ID to identify requests. Specify a unique request ID so that
  74114. // if you must retry your request, the server will know to ignore the
  74115. // request if it has already been completed.
  74116. //
  74117. // For example, consider a situation where you make an initial request
  74118. // and the request times out. If you make the request again with the
  74119. // same request ID, the server can check if original operation with the
  74120. // same request ID was received, and if so, will ignore the second
  74121. // request. This prevents clients from accidentally creating duplicate
  74122. // commitments.
  74123. //
  74124. // The request ID must be a valid UUID with the exception that zero UUID
  74125. // is not supported (00000000-0000-0000-0000-000000000000).
  74126. func (c *NetworkEndpointGroupsInsertCall) RequestId(requestId string) *NetworkEndpointGroupsInsertCall {
  74127. c.urlParams_.Set("requestId", requestId)
  74128. return c
  74129. }
  74130. // Fields allows partial responses to be retrieved. See
  74131. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  74132. // for more information.
  74133. func (c *NetworkEndpointGroupsInsertCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsInsertCall {
  74134. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  74135. return c
  74136. }
  74137. // Context sets the context to be used in this call's Do method. Any
  74138. // pending HTTP request will be aborted if the provided context is
  74139. // canceled.
  74140. func (c *NetworkEndpointGroupsInsertCall) Context(ctx context.Context) *NetworkEndpointGroupsInsertCall {
  74141. c.ctx_ = ctx
  74142. return c
  74143. }
  74144. // Header returns an http.Header that can be modified by the caller to
  74145. // add HTTP headers to the request.
  74146. func (c *NetworkEndpointGroupsInsertCall) Header() http.Header {
  74147. if c.header_ == nil {
  74148. c.header_ = make(http.Header)
  74149. }
  74150. return c.header_
  74151. }
  74152. func (c *NetworkEndpointGroupsInsertCall) doRequest(alt string) (*http.Response, error) {
  74153. reqHeaders := make(http.Header)
  74154. for k, v := range c.header_ {
  74155. reqHeaders[k] = v
  74156. }
  74157. reqHeaders.Set("User-Agent", c.s.userAgent())
  74158. var body io.Reader = nil
  74159. body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkendpointgroup)
  74160. if err != nil {
  74161. return nil, err
  74162. }
  74163. reqHeaders.Set("Content-Type", "application/json")
  74164. c.urlParams_.Set("alt", alt)
  74165. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/networkEndpointGroups")
  74166. urls += "?" + c.urlParams_.Encode()
  74167. req, _ := http.NewRequest("POST", urls, body)
  74168. req.Header = reqHeaders
  74169. googleapi.Expand(req.URL, map[string]string{
  74170. "project": c.project,
  74171. "zone": c.zone,
  74172. })
  74173. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  74174. }
  74175. // Do executes the "compute.networkEndpointGroups.insert" call.
  74176. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  74177. // status code is an error. Response headers are in either
  74178. // *Operation.ServerResponse.Header or (if a response was returned at
  74179. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  74180. // to check whether the returned error was because
  74181. // http.StatusNotModified was returned.
  74182. func (c *NetworkEndpointGroupsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  74183. gensupport.SetOptions(c.urlParams_, opts...)
  74184. res, err := c.doRequest("json")
  74185. if res != nil && res.StatusCode == http.StatusNotModified {
  74186. if res.Body != nil {
  74187. res.Body.Close()
  74188. }
  74189. return nil, &googleapi.Error{
  74190. Code: res.StatusCode,
  74191. Header: res.Header,
  74192. }
  74193. }
  74194. if err != nil {
  74195. return nil, err
  74196. }
  74197. defer googleapi.CloseBody(res)
  74198. if err := googleapi.CheckResponse(res); err != nil {
  74199. return nil, err
  74200. }
  74201. ret := &Operation{
  74202. ServerResponse: googleapi.ServerResponse{
  74203. Header: res.Header,
  74204. HTTPStatusCode: res.StatusCode,
  74205. },
  74206. }
  74207. target := &ret
  74208. if err := gensupport.DecodeResponse(target, res); err != nil {
  74209. return nil, err
  74210. }
  74211. return ret, nil
  74212. // {
  74213. // "description": "Creates a network endpoint group in the specified project using the parameters that are included in the request.",
  74214. // "httpMethod": "POST",
  74215. // "id": "compute.networkEndpointGroups.insert",
  74216. // "parameterOrder": [
  74217. // "project",
  74218. // "zone"
  74219. // ],
  74220. // "parameters": {
  74221. // "project": {
  74222. // "description": "Project ID for this request.",
  74223. // "location": "path",
  74224. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  74225. // "required": true,
  74226. // "type": "string"
  74227. // },
  74228. // "requestId": {
  74229. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  74230. // "location": "query",
  74231. // "type": "string"
  74232. // },
  74233. // "zone": {
  74234. // "description": "The name of the zone where you want to create the network endpoint group. It should comply with RFC1035.",
  74235. // "location": "path",
  74236. // "required": true,
  74237. // "type": "string"
  74238. // }
  74239. // },
  74240. // "path": "{project}/zones/{zone}/networkEndpointGroups",
  74241. // "request": {
  74242. // "$ref": "NetworkEndpointGroup"
  74243. // },
  74244. // "response": {
  74245. // "$ref": "Operation"
  74246. // },
  74247. // "scopes": [
  74248. // "https://www.googleapis.com/auth/cloud-platform",
  74249. // "https://www.googleapis.com/auth/compute"
  74250. // ]
  74251. // }
  74252. }
  74253. // method id "compute.networkEndpointGroups.list":
  74254. type NetworkEndpointGroupsListCall struct {
  74255. s *Service
  74256. project string
  74257. zone string
  74258. urlParams_ gensupport.URLParams
  74259. ifNoneMatch_ string
  74260. ctx_ context.Context
  74261. header_ http.Header
  74262. }
  74263. // List: Retrieves the list of network endpoint groups that are located
  74264. // in the specified project and zone.
  74265. func (r *NetworkEndpointGroupsService) List(project string, zone string) *NetworkEndpointGroupsListCall {
  74266. c := &NetworkEndpointGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  74267. c.project = project
  74268. c.zone = zone
  74269. return c
  74270. }
  74271. // Filter sets the optional parameter "filter": A filter expression that
  74272. // filters resources listed in the response. The expression must specify
  74273. // the field name, a comparison operator, and the value that you want to
  74274. // use for filtering. The value must be a string, a number, or a
  74275. // boolean. The comparison operator must be either =, !=, >, or <.
  74276. //
  74277. // For example, if you are filtering Compute Engine instances, you can
  74278. // exclude instances named example-instance by specifying name !=
  74279. // example-instance.
  74280. //
  74281. // You can also filter nested fields. For example, you could specify
  74282. // scheduling.automaticRestart = false to include instances only if they
  74283. // are not scheduled for automatic restarts. You can use filtering on
  74284. // nested fields to filter based on resource labels.
  74285. //
  74286. // To filter on multiple expressions, provide each separate expression
  74287. // within parentheses. For example, (scheduling.automaticRestart = true)
  74288. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  74289. // AND expression. However, you can include AND and OR expressions
  74290. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  74291. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  74292. // true).
  74293. func (c *NetworkEndpointGroupsListCall) Filter(filter string) *NetworkEndpointGroupsListCall {
  74294. c.urlParams_.Set("filter", filter)
  74295. return c
  74296. }
  74297. // MaxResults sets the optional parameter "maxResults": The maximum
  74298. // number of results per page that should be returned. If the number of
  74299. // available results is larger than maxResults, Compute Engine returns a
  74300. // nextPageToken that can be used to get the next page of results in
  74301. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  74302. // (Default: 500)
  74303. func (c *NetworkEndpointGroupsListCall) MaxResults(maxResults int64) *NetworkEndpointGroupsListCall {
  74304. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  74305. return c
  74306. }
  74307. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  74308. // a certain order. By default, results are returned in alphanumerical
  74309. // order based on the resource name.
  74310. //
  74311. // You can also sort results in descending order based on the creation
  74312. // timestamp using orderBy="creationTimestamp desc". This sorts results
  74313. // based on the creationTimestamp field in reverse chronological order
  74314. // (newest result first). Use this to sort resources like operations so
  74315. // that the newest operation is returned first.
  74316. //
  74317. // Currently, only sorting by name or creationTimestamp desc is
  74318. // supported.
  74319. func (c *NetworkEndpointGroupsListCall) OrderBy(orderBy string) *NetworkEndpointGroupsListCall {
  74320. c.urlParams_.Set("orderBy", orderBy)
  74321. return c
  74322. }
  74323. // PageToken sets the optional parameter "pageToken": Specifies a page
  74324. // token to use. Set pageToken to the nextPageToken returned by a
  74325. // previous list request to get the next page of results.
  74326. func (c *NetworkEndpointGroupsListCall) PageToken(pageToken string) *NetworkEndpointGroupsListCall {
  74327. c.urlParams_.Set("pageToken", pageToken)
  74328. return c
  74329. }
  74330. // Fields allows partial responses to be retrieved. See
  74331. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  74332. // for more information.
  74333. func (c *NetworkEndpointGroupsListCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsListCall {
  74334. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  74335. return c
  74336. }
  74337. // IfNoneMatch sets the optional parameter which makes the operation
  74338. // fail if the object's ETag matches the given value. This is useful for
  74339. // getting updates only after the object has changed since the last
  74340. // request. Use googleapi.IsNotModified to check whether the response
  74341. // error from Do is the result of In-None-Match.
  74342. func (c *NetworkEndpointGroupsListCall) IfNoneMatch(entityTag string) *NetworkEndpointGroupsListCall {
  74343. c.ifNoneMatch_ = entityTag
  74344. return c
  74345. }
  74346. // Context sets the context to be used in this call's Do method. Any
  74347. // pending HTTP request will be aborted if the provided context is
  74348. // canceled.
  74349. func (c *NetworkEndpointGroupsListCall) Context(ctx context.Context) *NetworkEndpointGroupsListCall {
  74350. c.ctx_ = ctx
  74351. return c
  74352. }
  74353. // Header returns an http.Header that can be modified by the caller to
  74354. // add HTTP headers to the request.
  74355. func (c *NetworkEndpointGroupsListCall) Header() http.Header {
  74356. if c.header_ == nil {
  74357. c.header_ = make(http.Header)
  74358. }
  74359. return c.header_
  74360. }
  74361. func (c *NetworkEndpointGroupsListCall) doRequest(alt string) (*http.Response, error) {
  74362. reqHeaders := make(http.Header)
  74363. for k, v := range c.header_ {
  74364. reqHeaders[k] = v
  74365. }
  74366. reqHeaders.Set("User-Agent", c.s.userAgent())
  74367. if c.ifNoneMatch_ != "" {
  74368. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  74369. }
  74370. var body io.Reader = nil
  74371. c.urlParams_.Set("alt", alt)
  74372. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/networkEndpointGroups")
  74373. urls += "?" + c.urlParams_.Encode()
  74374. req, _ := http.NewRequest("GET", urls, body)
  74375. req.Header = reqHeaders
  74376. googleapi.Expand(req.URL, map[string]string{
  74377. "project": c.project,
  74378. "zone": c.zone,
  74379. })
  74380. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  74381. }
  74382. // Do executes the "compute.networkEndpointGroups.list" call.
  74383. // Exactly one of *NetworkEndpointGroupList or error will be non-nil.
  74384. // Any non-2xx status code is an error. Response headers are in either
  74385. // *NetworkEndpointGroupList.ServerResponse.Header or (if a response was
  74386. // returned at all) in error.(*googleapi.Error).Header. Use
  74387. // googleapi.IsNotModified to check whether the returned error was
  74388. // because http.StatusNotModified was returned.
  74389. func (c *NetworkEndpointGroupsListCall) Do(opts ...googleapi.CallOption) (*NetworkEndpointGroupList, error) {
  74390. gensupport.SetOptions(c.urlParams_, opts...)
  74391. res, err := c.doRequest("json")
  74392. if res != nil && res.StatusCode == http.StatusNotModified {
  74393. if res.Body != nil {
  74394. res.Body.Close()
  74395. }
  74396. return nil, &googleapi.Error{
  74397. Code: res.StatusCode,
  74398. Header: res.Header,
  74399. }
  74400. }
  74401. if err != nil {
  74402. return nil, err
  74403. }
  74404. defer googleapi.CloseBody(res)
  74405. if err := googleapi.CheckResponse(res); err != nil {
  74406. return nil, err
  74407. }
  74408. ret := &NetworkEndpointGroupList{
  74409. ServerResponse: googleapi.ServerResponse{
  74410. Header: res.Header,
  74411. HTTPStatusCode: res.StatusCode,
  74412. },
  74413. }
  74414. target := &ret
  74415. if err := gensupport.DecodeResponse(target, res); err != nil {
  74416. return nil, err
  74417. }
  74418. return ret, nil
  74419. // {
  74420. // "description": "Retrieves the list of network endpoint groups that are located in the specified project and zone.",
  74421. // "httpMethod": "GET",
  74422. // "id": "compute.networkEndpointGroups.list",
  74423. // "parameterOrder": [
  74424. // "project",
  74425. // "zone"
  74426. // ],
  74427. // "parameters": {
  74428. // "filter": {
  74429. // "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).",
  74430. // "location": "query",
  74431. // "type": "string"
  74432. // },
  74433. // "maxResults": {
  74434. // "default": "500",
  74435. // "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)",
  74436. // "format": "uint32",
  74437. // "location": "query",
  74438. // "minimum": "0",
  74439. // "type": "integer"
  74440. // },
  74441. // "orderBy": {
  74442. // "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.",
  74443. // "location": "query",
  74444. // "type": "string"
  74445. // },
  74446. // "pageToken": {
  74447. // "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.",
  74448. // "location": "query",
  74449. // "type": "string"
  74450. // },
  74451. // "project": {
  74452. // "description": "Project ID for this request.",
  74453. // "location": "path",
  74454. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  74455. // "required": true,
  74456. // "type": "string"
  74457. // },
  74458. // "zone": {
  74459. // "description": "The name of the zone where the network endpoint group is located. It should comply with RFC1035.",
  74460. // "location": "path",
  74461. // "required": true,
  74462. // "type": "string"
  74463. // }
  74464. // },
  74465. // "path": "{project}/zones/{zone}/networkEndpointGroups",
  74466. // "response": {
  74467. // "$ref": "NetworkEndpointGroupList"
  74468. // },
  74469. // "scopes": [
  74470. // "https://www.googleapis.com/auth/cloud-platform",
  74471. // "https://www.googleapis.com/auth/compute",
  74472. // "https://www.googleapis.com/auth/compute.readonly"
  74473. // ]
  74474. // }
  74475. }
  74476. // Pages invokes f for each page of results.
  74477. // A non-nil error returned from f will halt the iteration.
  74478. // The provided context supersedes any context provided to the Context method.
  74479. func (c *NetworkEndpointGroupsListCall) Pages(ctx context.Context, f func(*NetworkEndpointGroupList) error) error {
  74480. c.ctx_ = ctx
  74481. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  74482. for {
  74483. x, err := c.Do()
  74484. if err != nil {
  74485. return err
  74486. }
  74487. if err := f(x); err != nil {
  74488. return err
  74489. }
  74490. if x.NextPageToken == "" {
  74491. return nil
  74492. }
  74493. c.PageToken(x.NextPageToken)
  74494. }
  74495. }
  74496. // method id "compute.networkEndpointGroups.listNetworkEndpoints":
  74497. type NetworkEndpointGroupsListNetworkEndpointsCall struct {
  74498. s *Service
  74499. project string
  74500. zone string
  74501. networkEndpointGroup string
  74502. networkendpointgroupslistendpointsrequest *NetworkEndpointGroupsListEndpointsRequest
  74503. urlParams_ gensupport.URLParams
  74504. ctx_ context.Context
  74505. header_ http.Header
  74506. }
  74507. // ListNetworkEndpoints: Lists the network endpoints in the specified
  74508. // network endpoint group.
  74509. func (r *NetworkEndpointGroupsService) ListNetworkEndpoints(project string, zone string, networkEndpointGroup string, networkendpointgroupslistendpointsrequest *NetworkEndpointGroupsListEndpointsRequest) *NetworkEndpointGroupsListNetworkEndpointsCall {
  74510. c := &NetworkEndpointGroupsListNetworkEndpointsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  74511. c.project = project
  74512. c.zone = zone
  74513. c.networkEndpointGroup = networkEndpointGroup
  74514. c.networkendpointgroupslistendpointsrequest = networkendpointgroupslistendpointsrequest
  74515. return c
  74516. }
  74517. // Filter sets the optional parameter "filter": A filter expression that
  74518. // filters resources listed in the response. The expression must specify
  74519. // the field name, a comparison operator, and the value that you want to
  74520. // use for filtering. The value must be a string, a number, or a
  74521. // boolean. The comparison operator must be either =, !=, >, or <.
  74522. //
  74523. // For example, if you are filtering Compute Engine instances, you can
  74524. // exclude instances named example-instance by specifying name !=
  74525. // example-instance.
  74526. //
  74527. // You can also filter nested fields. For example, you could specify
  74528. // scheduling.automaticRestart = false to include instances only if they
  74529. // are not scheduled for automatic restarts. You can use filtering on
  74530. // nested fields to filter based on resource labels.
  74531. //
  74532. // To filter on multiple expressions, provide each separate expression
  74533. // within parentheses. For example, (scheduling.automaticRestart = true)
  74534. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  74535. // AND expression. However, you can include AND and OR expressions
  74536. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  74537. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  74538. // true).
  74539. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) Filter(filter string) *NetworkEndpointGroupsListNetworkEndpointsCall {
  74540. c.urlParams_.Set("filter", filter)
  74541. return c
  74542. }
  74543. // MaxResults sets the optional parameter "maxResults": The maximum
  74544. // number of results per page that should be returned. If the number of
  74545. // available results is larger than maxResults, Compute Engine returns a
  74546. // nextPageToken that can be used to get the next page of results in
  74547. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  74548. // (Default: 500)
  74549. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) MaxResults(maxResults int64) *NetworkEndpointGroupsListNetworkEndpointsCall {
  74550. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  74551. return c
  74552. }
  74553. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  74554. // a certain order. By default, results are returned in alphanumerical
  74555. // order based on the resource name.
  74556. //
  74557. // You can also sort results in descending order based on the creation
  74558. // timestamp using orderBy="creationTimestamp desc". This sorts results
  74559. // based on the creationTimestamp field in reverse chronological order
  74560. // (newest result first). Use this to sort resources like operations so
  74561. // that the newest operation is returned first.
  74562. //
  74563. // Currently, only sorting by name or creationTimestamp desc is
  74564. // supported.
  74565. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) OrderBy(orderBy string) *NetworkEndpointGroupsListNetworkEndpointsCall {
  74566. c.urlParams_.Set("orderBy", orderBy)
  74567. return c
  74568. }
  74569. // PageToken sets the optional parameter "pageToken": Specifies a page
  74570. // token to use. Set pageToken to the nextPageToken returned by a
  74571. // previous list request to get the next page of results.
  74572. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) PageToken(pageToken string) *NetworkEndpointGroupsListNetworkEndpointsCall {
  74573. c.urlParams_.Set("pageToken", pageToken)
  74574. return c
  74575. }
  74576. // Fields allows partial responses to be retrieved. See
  74577. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  74578. // for more information.
  74579. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsListNetworkEndpointsCall {
  74580. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  74581. return c
  74582. }
  74583. // Context sets the context to be used in this call's Do method. Any
  74584. // pending HTTP request will be aborted if the provided context is
  74585. // canceled.
  74586. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) Context(ctx context.Context) *NetworkEndpointGroupsListNetworkEndpointsCall {
  74587. c.ctx_ = ctx
  74588. return c
  74589. }
  74590. // Header returns an http.Header that can be modified by the caller to
  74591. // add HTTP headers to the request.
  74592. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) Header() http.Header {
  74593. if c.header_ == nil {
  74594. c.header_ = make(http.Header)
  74595. }
  74596. return c.header_
  74597. }
  74598. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) doRequest(alt string) (*http.Response, error) {
  74599. reqHeaders := make(http.Header)
  74600. for k, v := range c.header_ {
  74601. reqHeaders[k] = v
  74602. }
  74603. reqHeaders.Set("User-Agent", c.s.userAgent())
  74604. var body io.Reader = nil
  74605. body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkendpointgroupslistendpointsrequest)
  74606. if err != nil {
  74607. return nil, err
  74608. }
  74609. reqHeaders.Set("Content-Type", "application/json")
  74610. c.urlParams_.Set("alt", alt)
  74611. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}/listNetworkEndpoints")
  74612. urls += "?" + c.urlParams_.Encode()
  74613. req, _ := http.NewRequest("POST", urls, body)
  74614. req.Header = reqHeaders
  74615. googleapi.Expand(req.URL, map[string]string{
  74616. "project": c.project,
  74617. "zone": c.zone,
  74618. "networkEndpointGroup": c.networkEndpointGroup,
  74619. })
  74620. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  74621. }
  74622. // Do executes the "compute.networkEndpointGroups.listNetworkEndpoints" call.
  74623. // Exactly one of *NetworkEndpointGroupsListNetworkEndpoints or error
  74624. // will be non-nil. Any non-2xx status code is an error. Response
  74625. // headers are in either
  74626. // *NetworkEndpointGroupsListNetworkEndpoints.ServerResponse.Header or
  74627. // (if a response was returned at all) in
  74628. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  74629. // whether the returned error was because http.StatusNotModified was
  74630. // returned.
  74631. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) Do(opts ...googleapi.CallOption) (*NetworkEndpointGroupsListNetworkEndpoints, error) {
  74632. gensupport.SetOptions(c.urlParams_, opts...)
  74633. res, err := c.doRequest("json")
  74634. if res != nil && res.StatusCode == http.StatusNotModified {
  74635. if res.Body != nil {
  74636. res.Body.Close()
  74637. }
  74638. return nil, &googleapi.Error{
  74639. Code: res.StatusCode,
  74640. Header: res.Header,
  74641. }
  74642. }
  74643. if err != nil {
  74644. return nil, err
  74645. }
  74646. defer googleapi.CloseBody(res)
  74647. if err := googleapi.CheckResponse(res); err != nil {
  74648. return nil, err
  74649. }
  74650. ret := &NetworkEndpointGroupsListNetworkEndpoints{
  74651. ServerResponse: googleapi.ServerResponse{
  74652. Header: res.Header,
  74653. HTTPStatusCode: res.StatusCode,
  74654. },
  74655. }
  74656. target := &ret
  74657. if err := gensupport.DecodeResponse(target, res); err != nil {
  74658. return nil, err
  74659. }
  74660. return ret, nil
  74661. // {
  74662. // "description": "Lists the network endpoints in the specified network endpoint group.",
  74663. // "httpMethod": "POST",
  74664. // "id": "compute.networkEndpointGroups.listNetworkEndpoints",
  74665. // "parameterOrder": [
  74666. // "project",
  74667. // "zone",
  74668. // "networkEndpointGroup"
  74669. // ],
  74670. // "parameters": {
  74671. // "filter": {
  74672. // "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).",
  74673. // "location": "query",
  74674. // "type": "string"
  74675. // },
  74676. // "maxResults": {
  74677. // "default": "500",
  74678. // "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)",
  74679. // "format": "uint32",
  74680. // "location": "query",
  74681. // "minimum": "0",
  74682. // "type": "integer"
  74683. // },
  74684. // "networkEndpointGroup": {
  74685. // "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.",
  74686. // "location": "path",
  74687. // "required": true,
  74688. // "type": "string"
  74689. // },
  74690. // "orderBy": {
  74691. // "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.",
  74692. // "location": "query",
  74693. // "type": "string"
  74694. // },
  74695. // "pageToken": {
  74696. // "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.",
  74697. // "location": "query",
  74698. // "type": "string"
  74699. // },
  74700. // "project": {
  74701. // "description": "Project ID for this request.",
  74702. // "location": "path",
  74703. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  74704. // "required": true,
  74705. // "type": "string"
  74706. // },
  74707. // "zone": {
  74708. // "description": "The name of the zone where the network endpoint group is located. It should comply with RFC1035.",
  74709. // "location": "path",
  74710. // "required": true,
  74711. // "type": "string"
  74712. // }
  74713. // },
  74714. // "path": "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}/listNetworkEndpoints",
  74715. // "request": {
  74716. // "$ref": "NetworkEndpointGroupsListEndpointsRequest"
  74717. // },
  74718. // "response": {
  74719. // "$ref": "NetworkEndpointGroupsListNetworkEndpoints"
  74720. // },
  74721. // "scopes": [
  74722. // "https://www.googleapis.com/auth/cloud-platform",
  74723. // "https://www.googleapis.com/auth/compute",
  74724. // "https://www.googleapis.com/auth/compute.readonly"
  74725. // ]
  74726. // }
  74727. }
  74728. // Pages invokes f for each page of results.
  74729. // A non-nil error returned from f will halt the iteration.
  74730. // The provided context supersedes any context provided to the Context method.
  74731. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) Pages(ctx context.Context, f func(*NetworkEndpointGroupsListNetworkEndpoints) error) error {
  74732. c.ctx_ = ctx
  74733. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  74734. for {
  74735. x, err := c.Do()
  74736. if err != nil {
  74737. return err
  74738. }
  74739. if err := f(x); err != nil {
  74740. return err
  74741. }
  74742. if x.NextPageToken == "" {
  74743. return nil
  74744. }
  74745. c.PageToken(x.NextPageToken)
  74746. }
  74747. }
  74748. // method id "compute.networkEndpointGroups.testIamPermissions":
  74749. type NetworkEndpointGroupsTestIamPermissionsCall struct {
  74750. s *Service
  74751. project string
  74752. zone string
  74753. resource string
  74754. testpermissionsrequest *TestPermissionsRequest
  74755. urlParams_ gensupport.URLParams
  74756. ctx_ context.Context
  74757. header_ http.Header
  74758. }
  74759. // TestIamPermissions: Returns permissions that a caller has on the
  74760. // specified resource.
  74761. func (r *NetworkEndpointGroupsService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *NetworkEndpointGroupsTestIamPermissionsCall {
  74762. c := &NetworkEndpointGroupsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  74763. c.project = project
  74764. c.zone = zone
  74765. c.resource = resource
  74766. c.testpermissionsrequest = testpermissionsrequest
  74767. return c
  74768. }
  74769. // Fields allows partial responses to be retrieved. See
  74770. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  74771. // for more information.
  74772. func (c *NetworkEndpointGroupsTestIamPermissionsCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsTestIamPermissionsCall {
  74773. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  74774. return c
  74775. }
  74776. // Context sets the context to be used in this call's Do method. Any
  74777. // pending HTTP request will be aborted if the provided context is
  74778. // canceled.
  74779. func (c *NetworkEndpointGroupsTestIamPermissionsCall) Context(ctx context.Context) *NetworkEndpointGroupsTestIamPermissionsCall {
  74780. c.ctx_ = ctx
  74781. return c
  74782. }
  74783. // Header returns an http.Header that can be modified by the caller to
  74784. // add HTTP headers to the request.
  74785. func (c *NetworkEndpointGroupsTestIamPermissionsCall) Header() http.Header {
  74786. if c.header_ == nil {
  74787. c.header_ = make(http.Header)
  74788. }
  74789. return c.header_
  74790. }
  74791. func (c *NetworkEndpointGroupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  74792. reqHeaders := make(http.Header)
  74793. for k, v := range c.header_ {
  74794. reqHeaders[k] = v
  74795. }
  74796. reqHeaders.Set("User-Agent", c.s.userAgent())
  74797. var body io.Reader = nil
  74798. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  74799. if err != nil {
  74800. return nil, err
  74801. }
  74802. reqHeaders.Set("Content-Type", "application/json")
  74803. c.urlParams_.Set("alt", alt)
  74804. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/networkEndpointGroups/{resource}/testIamPermissions")
  74805. urls += "?" + c.urlParams_.Encode()
  74806. req, _ := http.NewRequest("POST", urls, body)
  74807. req.Header = reqHeaders
  74808. googleapi.Expand(req.URL, map[string]string{
  74809. "project": c.project,
  74810. "zone": c.zone,
  74811. "resource": c.resource,
  74812. })
  74813. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  74814. }
  74815. // Do executes the "compute.networkEndpointGroups.testIamPermissions" call.
  74816. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  74817. // non-2xx status code is an error. Response headers are in either
  74818. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  74819. // returned at all) in error.(*googleapi.Error).Header. Use
  74820. // googleapi.IsNotModified to check whether the returned error was
  74821. // because http.StatusNotModified was returned.
  74822. func (c *NetworkEndpointGroupsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  74823. gensupport.SetOptions(c.urlParams_, opts...)
  74824. res, err := c.doRequest("json")
  74825. if res != nil && res.StatusCode == http.StatusNotModified {
  74826. if res.Body != nil {
  74827. res.Body.Close()
  74828. }
  74829. return nil, &googleapi.Error{
  74830. Code: res.StatusCode,
  74831. Header: res.Header,
  74832. }
  74833. }
  74834. if err != nil {
  74835. return nil, err
  74836. }
  74837. defer googleapi.CloseBody(res)
  74838. if err := googleapi.CheckResponse(res); err != nil {
  74839. return nil, err
  74840. }
  74841. ret := &TestPermissionsResponse{
  74842. ServerResponse: googleapi.ServerResponse{
  74843. Header: res.Header,
  74844. HTTPStatusCode: res.StatusCode,
  74845. },
  74846. }
  74847. target := &ret
  74848. if err := gensupport.DecodeResponse(target, res); err != nil {
  74849. return nil, err
  74850. }
  74851. return ret, nil
  74852. // {
  74853. // "description": "Returns permissions that a caller has on the specified resource.",
  74854. // "httpMethod": "POST",
  74855. // "id": "compute.networkEndpointGroups.testIamPermissions",
  74856. // "parameterOrder": [
  74857. // "project",
  74858. // "zone",
  74859. // "resource"
  74860. // ],
  74861. // "parameters": {
  74862. // "project": {
  74863. // "description": "Project ID for this request.",
  74864. // "location": "path",
  74865. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  74866. // "required": true,
  74867. // "type": "string"
  74868. // },
  74869. // "resource": {
  74870. // "description": "Name of the resource for this request.",
  74871. // "location": "path",
  74872. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  74873. // "required": true,
  74874. // "type": "string"
  74875. // },
  74876. // "zone": {
  74877. // "description": "The name of the zone for this request.",
  74878. // "location": "path",
  74879. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  74880. // "required": true,
  74881. // "type": "string"
  74882. // }
  74883. // },
  74884. // "path": "{project}/zones/{zone}/networkEndpointGroups/{resource}/testIamPermissions",
  74885. // "request": {
  74886. // "$ref": "TestPermissionsRequest"
  74887. // },
  74888. // "response": {
  74889. // "$ref": "TestPermissionsResponse"
  74890. // },
  74891. // "scopes": [
  74892. // "https://www.googleapis.com/auth/cloud-platform",
  74893. // "https://www.googleapis.com/auth/compute",
  74894. // "https://www.googleapis.com/auth/compute.readonly"
  74895. // ]
  74896. // }
  74897. }
  74898. // method id "compute.networks.addPeering":
  74899. type NetworksAddPeeringCall struct {
  74900. s *Service
  74901. project string
  74902. network string
  74903. networksaddpeeringrequest *NetworksAddPeeringRequest
  74904. urlParams_ gensupport.URLParams
  74905. ctx_ context.Context
  74906. header_ http.Header
  74907. }
  74908. // AddPeering: Adds a peering to the specified network.
  74909. func (r *NetworksService) AddPeering(project string, network string, networksaddpeeringrequest *NetworksAddPeeringRequest) *NetworksAddPeeringCall {
  74910. c := &NetworksAddPeeringCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  74911. c.project = project
  74912. c.network = network
  74913. c.networksaddpeeringrequest = networksaddpeeringrequest
  74914. return c
  74915. }
  74916. // RequestId sets the optional parameter "requestId": An optional
  74917. // request ID to identify requests. Specify a unique request ID so that
  74918. // if you must retry your request, the server will know to ignore the
  74919. // request if it has already been completed.
  74920. //
  74921. // For example, consider a situation where you make an initial request
  74922. // and the request times out. If you make the request again with the
  74923. // same request ID, the server can check if original operation with the
  74924. // same request ID was received, and if so, will ignore the second
  74925. // request. This prevents clients from accidentally creating duplicate
  74926. // commitments.
  74927. //
  74928. // The request ID must be a valid UUID with the exception that zero UUID
  74929. // is not supported (00000000-0000-0000-0000-000000000000).
  74930. func (c *NetworksAddPeeringCall) RequestId(requestId string) *NetworksAddPeeringCall {
  74931. c.urlParams_.Set("requestId", requestId)
  74932. return c
  74933. }
  74934. // Fields allows partial responses to be retrieved. See
  74935. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  74936. // for more information.
  74937. func (c *NetworksAddPeeringCall) Fields(s ...googleapi.Field) *NetworksAddPeeringCall {
  74938. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  74939. return c
  74940. }
  74941. // Context sets the context to be used in this call's Do method. Any
  74942. // pending HTTP request will be aborted if the provided context is
  74943. // canceled.
  74944. func (c *NetworksAddPeeringCall) Context(ctx context.Context) *NetworksAddPeeringCall {
  74945. c.ctx_ = ctx
  74946. return c
  74947. }
  74948. // Header returns an http.Header that can be modified by the caller to
  74949. // add HTTP headers to the request.
  74950. func (c *NetworksAddPeeringCall) Header() http.Header {
  74951. if c.header_ == nil {
  74952. c.header_ = make(http.Header)
  74953. }
  74954. return c.header_
  74955. }
  74956. func (c *NetworksAddPeeringCall) doRequest(alt string) (*http.Response, error) {
  74957. reqHeaders := make(http.Header)
  74958. for k, v := range c.header_ {
  74959. reqHeaders[k] = v
  74960. }
  74961. reqHeaders.Set("User-Agent", c.s.userAgent())
  74962. var body io.Reader = nil
  74963. body, err := googleapi.WithoutDataWrapper.JSONReader(c.networksaddpeeringrequest)
  74964. if err != nil {
  74965. return nil, err
  74966. }
  74967. reqHeaders.Set("Content-Type", "application/json")
  74968. c.urlParams_.Set("alt", alt)
  74969. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}/addPeering")
  74970. urls += "?" + c.urlParams_.Encode()
  74971. req, _ := http.NewRequest("POST", urls, body)
  74972. req.Header = reqHeaders
  74973. googleapi.Expand(req.URL, map[string]string{
  74974. "project": c.project,
  74975. "network": c.network,
  74976. })
  74977. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  74978. }
  74979. // Do executes the "compute.networks.addPeering" call.
  74980. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  74981. // status code is an error. Response headers are in either
  74982. // *Operation.ServerResponse.Header or (if a response was returned at
  74983. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  74984. // to check whether the returned error was because
  74985. // http.StatusNotModified was returned.
  74986. func (c *NetworksAddPeeringCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  74987. gensupport.SetOptions(c.urlParams_, opts...)
  74988. res, err := c.doRequest("json")
  74989. if res != nil && res.StatusCode == http.StatusNotModified {
  74990. if res.Body != nil {
  74991. res.Body.Close()
  74992. }
  74993. return nil, &googleapi.Error{
  74994. Code: res.StatusCode,
  74995. Header: res.Header,
  74996. }
  74997. }
  74998. if err != nil {
  74999. return nil, err
  75000. }
  75001. defer googleapi.CloseBody(res)
  75002. if err := googleapi.CheckResponse(res); err != nil {
  75003. return nil, err
  75004. }
  75005. ret := &Operation{
  75006. ServerResponse: googleapi.ServerResponse{
  75007. Header: res.Header,
  75008. HTTPStatusCode: res.StatusCode,
  75009. },
  75010. }
  75011. target := &ret
  75012. if err := gensupport.DecodeResponse(target, res); err != nil {
  75013. return nil, err
  75014. }
  75015. return ret, nil
  75016. // {
  75017. // "description": "Adds a peering to the specified network.",
  75018. // "httpMethod": "POST",
  75019. // "id": "compute.networks.addPeering",
  75020. // "parameterOrder": [
  75021. // "project",
  75022. // "network"
  75023. // ],
  75024. // "parameters": {
  75025. // "network": {
  75026. // "description": "Name of the network resource to add peering to.",
  75027. // "location": "path",
  75028. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  75029. // "required": true,
  75030. // "type": "string"
  75031. // },
  75032. // "project": {
  75033. // "description": "Project ID for this request.",
  75034. // "location": "path",
  75035. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  75036. // "required": true,
  75037. // "type": "string"
  75038. // },
  75039. // "requestId": {
  75040. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  75041. // "location": "query",
  75042. // "type": "string"
  75043. // }
  75044. // },
  75045. // "path": "{project}/global/networks/{network}/addPeering",
  75046. // "request": {
  75047. // "$ref": "NetworksAddPeeringRequest"
  75048. // },
  75049. // "response": {
  75050. // "$ref": "Operation"
  75051. // },
  75052. // "scopes": [
  75053. // "https://www.googleapis.com/auth/cloud-platform",
  75054. // "https://www.googleapis.com/auth/compute"
  75055. // ]
  75056. // }
  75057. }
  75058. // method id "compute.networks.delete":
  75059. type NetworksDeleteCall struct {
  75060. s *Service
  75061. project string
  75062. network string
  75063. urlParams_ gensupport.URLParams
  75064. ctx_ context.Context
  75065. header_ http.Header
  75066. }
  75067. // Delete: Deletes the specified network.
  75068. // For details, see https://cloud.google.com/compute/docs/reference/latest/networks/delete
  75069. func (r *NetworksService) Delete(project string, network string) *NetworksDeleteCall {
  75070. c := &NetworksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  75071. c.project = project
  75072. c.network = network
  75073. return c
  75074. }
  75075. // RequestId sets the optional parameter "requestId": An optional
  75076. // request ID to identify requests. Specify a unique request ID so that
  75077. // if you must retry your request, the server will know to ignore the
  75078. // request if it has already been completed.
  75079. //
  75080. // For example, consider a situation where you make an initial request
  75081. // and the request times out. If you make the request again with the
  75082. // same request ID, the server can check if original operation with the
  75083. // same request ID was received, and if so, will ignore the second
  75084. // request. This prevents clients from accidentally creating duplicate
  75085. // commitments.
  75086. //
  75087. // The request ID must be a valid UUID with the exception that zero UUID
  75088. // is not supported (00000000-0000-0000-0000-000000000000).
  75089. func (c *NetworksDeleteCall) RequestId(requestId string) *NetworksDeleteCall {
  75090. c.urlParams_.Set("requestId", requestId)
  75091. return c
  75092. }
  75093. // Fields allows partial responses to be retrieved. See
  75094. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  75095. // for more information.
  75096. func (c *NetworksDeleteCall) Fields(s ...googleapi.Field) *NetworksDeleteCall {
  75097. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  75098. return c
  75099. }
  75100. // Context sets the context to be used in this call's Do method. Any
  75101. // pending HTTP request will be aborted if the provided context is
  75102. // canceled.
  75103. func (c *NetworksDeleteCall) Context(ctx context.Context) *NetworksDeleteCall {
  75104. c.ctx_ = ctx
  75105. return c
  75106. }
  75107. // Header returns an http.Header that can be modified by the caller to
  75108. // add HTTP headers to the request.
  75109. func (c *NetworksDeleteCall) Header() http.Header {
  75110. if c.header_ == nil {
  75111. c.header_ = make(http.Header)
  75112. }
  75113. return c.header_
  75114. }
  75115. func (c *NetworksDeleteCall) doRequest(alt string) (*http.Response, error) {
  75116. reqHeaders := make(http.Header)
  75117. for k, v := range c.header_ {
  75118. reqHeaders[k] = v
  75119. }
  75120. reqHeaders.Set("User-Agent", c.s.userAgent())
  75121. var body io.Reader = nil
  75122. c.urlParams_.Set("alt", alt)
  75123. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}")
  75124. urls += "?" + c.urlParams_.Encode()
  75125. req, _ := http.NewRequest("DELETE", urls, body)
  75126. req.Header = reqHeaders
  75127. googleapi.Expand(req.URL, map[string]string{
  75128. "project": c.project,
  75129. "network": c.network,
  75130. })
  75131. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  75132. }
  75133. // Do executes the "compute.networks.delete" call.
  75134. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  75135. // status code is an error. Response headers are in either
  75136. // *Operation.ServerResponse.Header or (if a response was returned at
  75137. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  75138. // to check whether the returned error was because
  75139. // http.StatusNotModified was returned.
  75140. func (c *NetworksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  75141. gensupport.SetOptions(c.urlParams_, opts...)
  75142. res, err := c.doRequest("json")
  75143. if res != nil && res.StatusCode == http.StatusNotModified {
  75144. if res.Body != nil {
  75145. res.Body.Close()
  75146. }
  75147. return nil, &googleapi.Error{
  75148. Code: res.StatusCode,
  75149. Header: res.Header,
  75150. }
  75151. }
  75152. if err != nil {
  75153. return nil, err
  75154. }
  75155. defer googleapi.CloseBody(res)
  75156. if err := googleapi.CheckResponse(res); err != nil {
  75157. return nil, err
  75158. }
  75159. ret := &Operation{
  75160. ServerResponse: googleapi.ServerResponse{
  75161. Header: res.Header,
  75162. HTTPStatusCode: res.StatusCode,
  75163. },
  75164. }
  75165. target := &ret
  75166. if err := gensupport.DecodeResponse(target, res); err != nil {
  75167. return nil, err
  75168. }
  75169. return ret, nil
  75170. // {
  75171. // "description": "Deletes the specified network.",
  75172. // "httpMethod": "DELETE",
  75173. // "id": "compute.networks.delete",
  75174. // "parameterOrder": [
  75175. // "project",
  75176. // "network"
  75177. // ],
  75178. // "parameters": {
  75179. // "network": {
  75180. // "description": "Name of the network to delete.",
  75181. // "location": "path",
  75182. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  75183. // "required": true,
  75184. // "type": "string"
  75185. // },
  75186. // "project": {
  75187. // "description": "Project ID for this request.",
  75188. // "location": "path",
  75189. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  75190. // "required": true,
  75191. // "type": "string"
  75192. // },
  75193. // "requestId": {
  75194. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  75195. // "location": "query",
  75196. // "type": "string"
  75197. // }
  75198. // },
  75199. // "path": "{project}/global/networks/{network}",
  75200. // "response": {
  75201. // "$ref": "Operation"
  75202. // },
  75203. // "scopes": [
  75204. // "https://www.googleapis.com/auth/cloud-platform",
  75205. // "https://www.googleapis.com/auth/compute"
  75206. // ]
  75207. // }
  75208. }
  75209. // method id "compute.networks.get":
  75210. type NetworksGetCall struct {
  75211. s *Service
  75212. project string
  75213. network string
  75214. urlParams_ gensupport.URLParams
  75215. ifNoneMatch_ string
  75216. ctx_ context.Context
  75217. header_ http.Header
  75218. }
  75219. // Get: Returns the specified network. Gets a list of available networks
  75220. // by making a list() request.
  75221. // For details, see https://cloud.google.com/compute/docs/reference/latest/networks/get
  75222. func (r *NetworksService) Get(project string, network string) *NetworksGetCall {
  75223. c := &NetworksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  75224. c.project = project
  75225. c.network = network
  75226. return c
  75227. }
  75228. // Fields allows partial responses to be retrieved. See
  75229. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  75230. // for more information.
  75231. func (c *NetworksGetCall) Fields(s ...googleapi.Field) *NetworksGetCall {
  75232. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  75233. return c
  75234. }
  75235. // IfNoneMatch sets the optional parameter which makes the operation
  75236. // fail if the object's ETag matches the given value. This is useful for
  75237. // getting updates only after the object has changed since the last
  75238. // request. Use googleapi.IsNotModified to check whether the response
  75239. // error from Do is the result of In-None-Match.
  75240. func (c *NetworksGetCall) IfNoneMatch(entityTag string) *NetworksGetCall {
  75241. c.ifNoneMatch_ = entityTag
  75242. return c
  75243. }
  75244. // Context sets the context to be used in this call's Do method. Any
  75245. // pending HTTP request will be aborted if the provided context is
  75246. // canceled.
  75247. func (c *NetworksGetCall) Context(ctx context.Context) *NetworksGetCall {
  75248. c.ctx_ = ctx
  75249. return c
  75250. }
  75251. // Header returns an http.Header that can be modified by the caller to
  75252. // add HTTP headers to the request.
  75253. func (c *NetworksGetCall) Header() http.Header {
  75254. if c.header_ == nil {
  75255. c.header_ = make(http.Header)
  75256. }
  75257. return c.header_
  75258. }
  75259. func (c *NetworksGetCall) doRequest(alt string) (*http.Response, error) {
  75260. reqHeaders := make(http.Header)
  75261. for k, v := range c.header_ {
  75262. reqHeaders[k] = v
  75263. }
  75264. reqHeaders.Set("User-Agent", c.s.userAgent())
  75265. if c.ifNoneMatch_ != "" {
  75266. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  75267. }
  75268. var body io.Reader = nil
  75269. c.urlParams_.Set("alt", alt)
  75270. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}")
  75271. urls += "?" + c.urlParams_.Encode()
  75272. req, _ := http.NewRequest("GET", urls, body)
  75273. req.Header = reqHeaders
  75274. googleapi.Expand(req.URL, map[string]string{
  75275. "project": c.project,
  75276. "network": c.network,
  75277. })
  75278. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  75279. }
  75280. // Do executes the "compute.networks.get" call.
  75281. // Exactly one of *Network or error will be non-nil. Any non-2xx status
  75282. // code is an error. Response headers are in either
  75283. // *Network.ServerResponse.Header or (if a response was returned at all)
  75284. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  75285. // check whether the returned error was because http.StatusNotModified
  75286. // was returned.
  75287. func (c *NetworksGetCall) Do(opts ...googleapi.CallOption) (*Network, error) {
  75288. gensupport.SetOptions(c.urlParams_, opts...)
  75289. res, err := c.doRequest("json")
  75290. if res != nil && res.StatusCode == http.StatusNotModified {
  75291. if res.Body != nil {
  75292. res.Body.Close()
  75293. }
  75294. return nil, &googleapi.Error{
  75295. Code: res.StatusCode,
  75296. Header: res.Header,
  75297. }
  75298. }
  75299. if err != nil {
  75300. return nil, err
  75301. }
  75302. defer googleapi.CloseBody(res)
  75303. if err := googleapi.CheckResponse(res); err != nil {
  75304. return nil, err
  75305. }
  75306. ret := &Network{
  75307. ServerResponse: googleapi.ServerResponse{
  75308. Header: res.Header,
  75309. HTTPStatusCode: res.StatusCode,
  75310. },
  75311. }
  75312. target := &ret
  75313. if err := gensupport.DecodeResponse(target, res); err != nil {
  75314. return nil, err
  75315. }
  75316. return ret, nil
  75317. // {
  75318. // "description": "Returns the specified network. Gets a list of available networks by making a list() request.",
  75319. // "httpMethod": "GET",
  75320. // "id": "compute.networks.get",
  75321. // "parameterOrder": [
  75322. // "project",
  75323. // "network"
  75324. // ],
  75325. // "parameters": {
  75326. // "network": {
  75327. // "description": "Name of the network to return.",
  75328. // "location": "path",
  75329. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  75330. // "required": true,
  75331. // "type": "string"
  75332. // },
  75333. // "project": {
  75334. // "description": "Project ID for this request.",
  75335. // "location": "path",
  75336. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  75337. // "required": true,
  75338. // "type": "string"
  75339. // }
  75340. // },
  75341. // "path": "{project}/global/networks/{network}",
  75342. // "response": {
  75343. // "$ref": "Network"
  75344. // },
  75345. // "scopes": [
  75346. // "https://www.googleapis.com/auth/cloud-platform",
  75347. // "https://www.googleapis.com/auth/compute",
  75348. // "https://www.googleapis.com/auth/compute.readonly"
  75349. // ]
  75350. // }
  75351. }
  75352. // method id "compute.networks.insert":
  75353. type NetworksInsertCall struct {
  75354. s *Service
  75355. project string
  75356. network *Network
  75357. urlParams_ gensupport.URLParams
  75358. ctx_ context.Context
  75359. header_ http.Header
  75360. }
  75361. // Insert: Creates a network in the specified project using the data
  75362. // included in the request.
  75363. // For details, see https://cloud.google.com/compute/docs/reference/latest/networks/insert
  75364. func (r *NetworksService) Insert(project string, network *Network) *NetworksInsertCall {
  75365. c := &NetworksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  75366. c.project = project
  75367. c.network = network
  75368. return c
  75369. }
  75370. // RequestId sets the optional parameter "requestId": An optional
  75371. // request ID to identify requests. Specify a unique request ID so that
  75372. // if you must retry your request, the server will know to ignore the
  75373. // request if it has already been completed.
  75374. //
  75375. // For example, consider a situation where you make an initial request
  75376. // and the request times out. If you make the request again with the
  75377. // same request ID, the server can check if original operation with the
  75378. // same request ID was received, and if so, will ignore the second
  75379. // request. This prevents clients from accidentally creating duplicate
  75380. // commitments.
  75381. //
  75382. // The request ID must be a valid UUID with the exception that zero UUID
  75383. // is not supported (00000000-0000-0000-0000-000000000000).
  75384. func (c *NetworksInsertCall) RequestId(requestId string) *NetworksInsertCall {
  75385. c.urlParams_.Set("requestId", requestId)
  75386. return c
  75387. }
  75388. // Fields allows partial responses to be retrieved. See
  75389. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  75390. // for more information.
  75391. func (c *NetworksInsertCall) Fields(s ...googleapi.Field) *NetworksInsertCall {
  75392. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  75393. return c
  75394. }
  75395. // Context sets the context to be used in this call's Do method. Any
  75396. // pending HTTP request will be aborted if the provided context is
  75397. // canceled.
  75398. func (c *NetworksInsertCall) Context(ctx context.Context) *NetworksInsertCall {
  75399. c.ctx_ = ctx
  75400. return c
  75401. }
  75402. // Header returns an http.Header that can be modified by the caller to
  75403. // add HTTP headers to the request.
  75404. func (c *NetworksInsertCall) Header() http.Header {
  75405. if c.header_ == nil {
  75406. c.header_ = make(http.Header)
  75407. }
  75408. return c.header_
  75409. }
  75410. func (c *NetworksInsertCall) doRequest(alt string) (*http.Response, error) {
  75411. reqHeaders := make(http.Header)
  75412. for k, v := range c.header_ {
  75413. reqHeaders[k] = v
  75414. }
  75415. reqHeaders.Set("User-Agent", c.s.userAgent())
  75416. var body io.Reader = nil
  75417. body, err := googleapi.WithoutDataWrapper.JSONReader(c.network)
  75418. if err != nil {
  75419. return nil, err
  75420. }
  75421. reqHeaders.Set("Content-Type", "application/json")
  75422. c.urlParams_.Set("alt", alt)
  75423. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks")
  75424. urls += "?" + c.urlParams_.Encode()
  75425. req, _ := http.NewRequest("POST", urls, body)
  75426. req.Header = reqHeaders
  75427. googleapi.Expand(req.URL, map[string]string{
  75428. "project": c.project,
  75429. })
  75430. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  75431. }
  75432. // Do executes the "compute.networks.insert" call.
  75433. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  75434. // status code is an error. Response headers are in either
  75435. // *Operation.ServerResponse.Header or (if a response was returned at
  75436. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  75437. // to check whether the returned error was because
  75438. // http.StatusNotModified was returned.
  75439. func (c *NetworksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  75440. gensupport.SetOptions(c.urlParams_, opts...)
  75441. res, err := c.doRequest("json")
  75442. if res != nil && res.StatusCode == http.StatusNotModified {
  75443. if res.Body != nil {
  75444. res.Body.Close()
  75445. }
  75446. return nil, &googleapi.Error{
  75447. Code: res.StatusCode,
  75448. Header: res.Header,
  75449. }
  75450. }
  75451. if err != nil {
  75452. return nil, err
  75453. }
  75454. defer googleapi.CloseBody(res)
  75455. if err := googleapi.CheckResponse(res); err != nil {
  75456. return nil, err
  75457. }
  75458. ret := &Operation{
  75459. ServerResponse: googleapi.ServerResponse{
  75460. Header: res.Header,
  75461. HTTPStatusCode: res.StatusCode,
  75462. },
  75463. }
  75464. target := &ret
  75465. if err := gensupport.DecodeResponse(target, res); err != nil {
  75466. return nil, err
  75467. }
  75468. return ret, nil
  75469. // {
  75470. // "description": "Creates a network in the specified project using the data included in the request.",
  75471. // "httpMethod": "POST",
  75472. // "id": "compute.networks.insert",
  75473. // "parameterOrder": [
  75474. // "project"
  75475. // ],
  75476. // "parameters": {
  75477. // "project": {
  75478. // "description": "Project ID for this request.",
  75479. // "location": "path",
  75480. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  75481. // "required": true,
  75482. // "type": "string"
  75483. // },
  75484. // "requestId": {
  75485. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  75486. // "location": "query",
  75487. // "type": "string"
  75488. // }
  75489. // },
  75490. // "path": "{project}/global/networks",
  75491. // "request": {
  75492. // "$ref": "Network"
  75493. // },
  75494. // "response": {
  75495. // "$ref": "Operation"
  75496. // },
  75497. // "scopes": [
  75498. // "https://www.googleapis.com/auth/cloud-platform",
  75499. // "https://www.googleapis.com/auth/compute"
  75500. // ]
  75501. // }
  75502. }
  75503. // method id "compute.networks.list":
  75504. type NetworksListCall struct {
  75505. s *Service
  75506. project string
  75507. urlParams_ gensupport.URLParams
  75508. ifNoneMatch_ string
  75509. ctx_ context.Context
  75510. header_ http.Header
  75511. }
  75512. // List: Retrieves the list of networks available to the specified
  75513. // project.
  75514. // For details, see https://cloud.google.com/compute/docs/reference/latest/networks/list
  75515. func (r *NetworksService) List(project string) *NetworksListCall {
  75516. c := &NetworksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  75517. c.project = project
  75518. return c
  75519. }
  75520. // Filter sets the optional parameter "filter": A filter expression that
  75521. // filters resources listed in the response. The expression must specify
  75522. // the field name, a comparison operator, and the value that you want to
  75523. // use for filtering. The value must be a string, a number, or a
  75524. // boolean. The comparison operator must be either =, !=, >, or <.
  75525. //
  75526. // For example, if you are filtering Compute Engine instances, you can
  75527. // exclude instances named example-instance by specifying name !=
  75528. // example-instance.
  75529. //
  75530. // You can also filter nested fields. For example, you could specify
  75531. // scheduling.automaticRestart = false to include instances only if they
  75532. // are not scheduled for automatic restarts. You can use filtering on
  75533. // nested fields to filter based on resource labels.
  75534. //
  75535. // To filter on multiple expressions, provide each separate expression
  75536. // within parentheses. For example, (scheduling.automaticRestart = true)
  75537. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  75538. // AND expression. However, you can include AND and OR expressions
  75539. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  75540. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  75541. // true).
  75542. func (c *NetworksListCall) Filter(filter string) *NetworksListCall {
  75543. c.urlParams_.Set("filter", filter)
  75544. return c
  75545. }
  75546. // MaxResults sets the optional parameter "maxResults": The maximum
  75547. // number of results per page that should be returned. If the number of
  75548. // available results is larger than maxResults, Compute Engine returns a
  75549. // nextPageToken that can be used to get the next page of results in
  75550. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  75551. // (Default: 500)
  75552. func (c *NetworksListCall) MaxResults(maxResults int64) *NetworksListCall {
  75553. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  75554. return c
  75555. }
  75556. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  75557. // a certain order. By default, results are returned in alphanumerical
  75558. // order based on the resource name.
  75559. //
  75560. // You can also sort results in descending order based on the creation
  75561. // timestamp using orderBy="creationTimestamp desc". This sorts results
  75562. // based on the creationTimestamp field in reverse chronological order
  75563. // (newest result first). Use this to sort resources like operations so
  75564. // that the newest operation is returned first.
  75565. //
  75566. // Currently, only sorting by name or creationTimestamp desc is
  75567. // supported.
  75568. func (c *NetworksListCall) OrderBy(orderBy string) *NetworksListCall {
  75569. c.urlParams_.Set("orderBy", orderBy)
  75570. return c
  75571. }
  75572. // PageToken sets the optional parameter "pageToken": Specifies a page
  75573. // token to use. Set pageToken to the nextPageToken returned by a
  75574. // previous list request to get the next page of results.
  75575. func (c *NetworksListCall) PageToken(pageToken string) *NetworksListCall {
  75576. c.urlParams_.Set("pageToken", pageToken)
  75577. return c
  75578. }
  75579. // Fields allows partial responses to be retrieved. See
  75580. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  75581. // for more information.
  75582. func (c *NetworksListCall) Fields(s ...googleapi.Field) *NetworksListCall {
  75583. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  75584. return c
  75585. }
  75586. // IfNoneMatch sets the optional parameter which makes the operation
  75587. // fail if the object's ETag matches the given value. This is useful for
  75588. // getting updates only after the object has changed since the last
  75589. // request. Use googleapi.IsNotModified to check whether the response
  75590. // error from Do is the result of In-None-Match.
  75591. func (c *NetworksListCall) IfNoneMatch(entityTag string) *NetworksListCall {
  75592. c.ifNoneMatch_ = entityTag
  75593. return c
  75594. }
  75595. // Context sets the context to be used in this call's Do method. Any
  75596. // pending HTTP request will be aborted if the provided context is
  75597. // canceled.
  75598. func (c *NetworksListCall) Context(ctx context.Context) *NetworksListCall {
  75599. c.ctx_ = ctx
  75600. return c
  75601. }
  75602. // Header returns an http.Header that can be modified by the caller to
  75603. // add HTTP headers to the request.
  75604. func (c *NetworksListCall) Header() http.Header {
  75605. if c.header_ == nil {
  75606. c.header_ = make(http.Header)
  75607. }
  75608. return c.header_
  75609. }
  75610. func (c *NetworksListCall) doRequest(alt string) (*http.Response, error) {
  75611. reqHeaders := make(http.Header)
  75612. for k, v := range c.header_ {
  75613. reqHeaders[k] = v
  75614. }
  75615. reqHeaders.Set("User-Agent", c.s.userAgent())
  75616. if c.ifNoneMatch_ != "" {
  75617. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  75618. }
  75619. var body io.Reader = nil
  75620. c.urlParams_.Set("alt", alt)
  75621. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks")
  75622. urls += "?" + c.urlParams_.Encode()
  75623. req, _ := http.NewRequest("GET", urls, body)
  75624. req.Header = reqHeaders
  75625. googleapi.Expand(req.URL, map[string]string{
  75626. "project": c.project,
  75627. })
  75628. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  75629. }
  75630. // Do executes the "compute.networks.list" call.
  75631. // Exactly one of *NetworkList or error will be non-nil. Any non-2xx
  75632. // status code is an error. Response headers are in either
  75633. // *NetworkList.ServerResponse.Header or (if a response was returned at
  75634. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  75635. // to check whether the returned error was because
  75636. // http.StatusNotModified was returned.
  75637. func (c *NetworksListCall) Do(opts ...googleapi.CallOption) (*NetworkList, error) {
  75638. gensupport.SetOptions(c.urlParams_, opts...)
  75639. res, err := c.doRequest("json")
  75640. if res != nil && res.StatusCode == http.StatusNotModified {
  75641. if res.Body != nil {
  75642. res.Body.Close()
  75643. }
  75644. return nil, &googleapi.Error{
  75645. Code: res.StatusCode,
  75646. Header: res.Header,
  75647. }
  75648. }
  75649. if err != nil {
  75650. return nil, err
  75651. }
  75652. defer googleapi.CloseBody(res)
  75653. if err := googleapi.CheckResponse(res); err != nil {
  75654. return nil, err
  75655. }
  75656. ret := &NetworkList{
  75657. ServerResponse: googleapi.ServerResponse{
  75658. Header: res.Header,
  75659. HTTPStatusCode: res.StatusCode,
  75660. },
  75661. }
  75662. target := &ret
  75663. if err := gensupport.DecodeResponse(target, res); err != nil {
  75664. return nil, err
  75665. }
  75666. return ret, nil
  75667. // {
  75668. // "description": "Retrieves the list of networks available to the specified project.",
  75669. // "httpMethod": "GET",
  75670. // "id": "compute.networks.list",
  75671. // "parameterOrder": [
  75672. // "project"
  75673. // ],
  75674. // "parameters": {
  75675. // "filter": {
  75676. // "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).",
  75677. // "location": "query",
  75678. // "type": "string"
  75679. // },
  75680. // "maxResults": {
  75681. // "default": "500",
  75682. // "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)",
  75683. // "format": "uint32",
  75684. // "location": "query",
  75685. // "minimum": "0",
  75686. // "type": "integer"
  75687. // },
  75688. // "orderBy": {
  75689. // "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.",
  75690. // "location": "query",
  75691. // "type": "string"
  75692. // },
  75693. // "pageToken": {
  75694. // "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.",
  75695. // "location": "query",
  75696. // "type": "string"
  75697. // },
  75698. // "project": {
  75699. // "description": "Project ID for this request.",
  75700. // "location": "path",
  75701. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  75702. // "required": true,
  75703. // "type": "string"
  75704. // }
  75705. // },
  75706. // "path": "{project}/global/networks",
  75707. // "response": {
  75708. // "$ref": "NetworkList"
  75709. // },
  75710. // "scopes": [
  75711. // "https://www.googleapis.com/auth/cloud-platform",
  75712. // "https://www.googleapis.com/auth/compute",
  75713. // "https://www.googleapis.com/auth/compute.readonly"
  75714. // ]
  75715. // }
  75716. }
  75717. // Pages invokes f for each page of results.
  75718. // A non-nil error returned from f will halt the iteration.
  75719. // The provided context supersedes any context provided to the Context method.
  75720. func (c *NetworksListCall) Pages(ctx context.Context, f func(*NetworkList) error) error {
  75721. c.ctx_ = ctx
  75722. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  75723. for {
  75724. x, err := c.Do()
  75725. if err != nil {
  75726. return err
  75727. }
  75728. if err := f(x); err != nil {
  75729. return err
  75730. }
  75731. if x.NextPageToken == "" {
  75732. return nil
  75733. }
  75734. c.PageToken(x.NextPageToken)
  75735. }
  75736. }
  75737. // method id "compute.networks.listIpOwners":
  75738. type NetworksListIpOwnersCall struct {
  75739. s *Service
  75740. project string
  75741. network string
  75742. urlParams_ gensupport.URLParams
  75743. ifNoneMatch_ string
  75744. ctx_ context.Context
  75745. header_ http.Header
  75746. }
  75747. // ListIpOwners: Lists the internal IP owners in the specified network.
  75748. func (r *NetworksService) ListIpOwners(project string, network string) *NetworksListIpOwnersCall {
  75749. c := &NetworksListIpOwnersCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  75750. c.project = project
  75751. c.network = network
  75752. return c
  75753. }
  75754. // Filter sets the optional parameter "filter": A filter expression that
  75755. // filters resources listed in the response. The expression must specify
  75756. // the field name, a comparison operator, and the value that you want to
  75757. // use for filtering. The value must be a string, a number, or a
  75758. // boolean. The comparison operator must be either =, !=, >, or <.
  75759. //
  75760. // For example, if you are filtering Compute Engine instances, you can
  75761. // exclude instances named example-instance by specifying name !=
  75762. // example-instance.
  75763. //
  75764. // You can also filter nested fields. For example, you could specify
  75765. // scheduling.automaticRestart = false to include instances only if they
  75766. // are not scheduled for automatic restarts. You can use filtering on
  75767. // nested fields to filter based on resource labels.
  75768. //
  75769. // To filter on multiple expressions, provide each separate expression
  75770. // within parentheses. For example, (scheduling.automaticRestart = true)
  75771. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  75772. // AND expression. However, you can include AND and OR expressions
  75773. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  75774. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  75775. // true).
  75776. func (c *NetworksListIpOwnersCall) Filter(filter string) *NetworksListIpOwnersCall {
  75777. c.urlParams_.Set("filter", filter)
  75778. return c
  75779. }
  75780. // IpCidrRange sets the optional parameter "ipCidrRange": (Optional) IP
  75781. // CIDR range filter, example: "10.128.10.0/30".
  75782. func (c *NetworksListIpOwnersCall) IpCidrRange(ipCidrRange string) *NetworksListIpOwnersCall {
  75783. c.urlParams_.Set("ipCidrRange", ipCidrRange)
  75784. return c
  75785. }
  75786. // MaxResults sets the optional parameter "maxResults": The maximum
  75787. // number of results per page that should be returned. If the number of
  75788. // available results is larger than maxResults, Compute Engine returns a
  75789. // nextPageToken that can be used to get the next page of results in
  75790. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  75791. // (Default: 500)
  75792. func (c *NetworksListIpOwnersCall) MaxResults(maxResults int64) *NetworksListIpOwnersCall {
  75793. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  75794. return c
  75795. }
  75796. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  75797. // a certain order. By default, results are returned in alphanumerical
  75798. // order based on the resource name.
  75799. //
  75800. // You can also sort results in descending order based on the creation
  75801. // timestamp using orderBy="creationTimestamp desc". This sorts results
  75802. // based on the creationTimestamp field in reverse chronological order
  75803. // (newest result first). Use this to sort resources like operations so
  75804. // that the newest operation is returned first.
  75805. //
  75806. // Currently, only sorting by name or creationTimestamp desc is
  75807. // supported.
  75808. func (c *NetworksListIpOwnersCall) OrderBy(orderBy string) *NetworksListIpOwnersCall {
  75809. c.urlParams_.Set("orderBy", orderBy)
  75810. return c
  75811. }
  75812. // OwnerProjects sets the optional parameter "ownerProjects": (Optional)
  75813. // Project IDs filter, example: "project-1,project-2".
  75814. func (c *NetworksListIpOwnersCall) OwnerProjects(ownerProjects string) *NetworksListIpOwnersCall {
  75815. c.urlParams_.Set("ownerProjects", ownerProjects)
  75816. return c
  75817. }
  75818. // OwnerTypes sets the optional parameter "ownerTypes": (Optional) Owner
  75819. // types filter, example: "instance,forwardingRule".
  75820. func (c *NetworksListIpOwnersCall) OwnerTypes(ownerTypes string) *NetworksListIpOwnersCall {
  75821. c.urlParams_.Set("ownerTypes", ownerTypes)
  75822. return c
  75823. }
  75824. // PageToken sets the optional parameter "pageToken": Specifies a page
  75825. // token to use. Set pageToken to the nextPageToken returned by a
  75826. // previous list request to get the next page of results.
  75827. func (c *NetworksListIpOwnersCall) PageToken(pageToken string) *NetworksListIpOwnersCall {
  75828. c.urlParams_.Set("pageToken", pageToken)
  75829. return c
  75830. }
  75831. // SubnetName sets the optional parameter "subnetName": (Optional)
  75832. // Subnetwork name filter.
  75833. func (c *NetworksListIpOwnersCall) SubnetName(subnetName string) *NetworksListIpOwnersCall {
  75834. c.urlParams_.Set("subnetName", subnetName)
  75835. return c
  75836. }
  75837. // SubnetRegion sets the optional parameter "subnetRegion": (Optional)
  75838. // Subnetwork region filter.
  75839. func (c *NetworksListIpOwnersCall) SubnetRegion(subnetRegion string) *NetworksListIpOwnersCall {
  75840. c.urlParams_.Set("subnetRegion", subnetRegion)
  75841. return c
  75842. }
  75843. // Fields allows partial responses to be retrieved. See
  75844. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  75845. // for more information.
  75846. func (c *NetworksListIpOwnersCall) Fields(s ...googleapi.Field) *NetworksListIpOwnersCall {
  75847. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  75848. return c
  75849. }
  75850. // IfNoneMatch sets the optional parameter which makes the operation
  75851. // fail if the object's ETag matches the given value. This is useful for
  75852. // getting updates only after the object has changed since the last
  75853. // request. Use googleapi.IsNotModified to check whether the response
  75854. // error from Do is the result of In-None-Match.
  75855. func (c *NetworksListIpOwnersCall) IfNoneMatch(entityTag string) *NetworksListIpOwnersCall {
  75856. c.ifNoneMatch_ = entityTag
  75857. return c
  75858. }
  75859. // Context sets the context to be used in this call's Do method. Any
  75860. // pending HTTP request will be aborted if the provided context is
  75861. // canceled.
  75862. func (c *NetworksListIpOwnersCall) Context(ctx context.Context) *NetworksListIpOwnersCall {
  75863. c.ctx_ = ctx
  75864. return c
  75865. }
  75866. // Header returns an http.Header that can be modified by the caller to
  75867. // add HTTP headers to the request.
  75868. func (c *NetworksListIpOwnersCall) Header() http.Header {
  75869. if c.header_ == nil {
  75870. c.header_ = make(http.Header)
  75871. }
  75872. return c.header_
  75873. }
  75874. func (c *NetworksListIpOwnersCall) doRequest(alt string) (*http.Response, error) {
  75875. reqHeaders := make(http.Header)
  75876. for k, v := range c.header_ {
  75877. reqHeaders[k] = v
  75878. }
  75879. reqHeaders.Set("User-Agent", c.s.userAgent())
  75880. if c.ifNoneMatch_ != "" {
  75881. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  75882. }
  75883. var body io.Reader = nil
  75884. c.urlParams_.Set("alt", alt)
  75885. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}/listIpOwners")
  75886. urls += "?" + c.urlParams_.Encode()
  75887. req, _ := http.NewRequest("GET", urls, body)
  75888. req.Header = reqHeaders
  75889. googleapi.Expand(req.URL, map[string]string{
  75890. "project": c.project,
  75891. "network": c.network,
  75892. })
  75893. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  75894. }
  75895. // Do executes the "compute.networks.listIpOwners" call.
  75896. // Exactly one of *IpOwnerList or error will be non-nil. Any non-2xx
  75897. // status code is an error. Response headers are in either
  75898. // *IpOwnerList.ServerResponse.Header or (if a response was returned at
  75899. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  75900. // to check whether the returned error was because
  75901. // http.StatusNotModified was returned.
  75902. func (c *NetworksListIpOwnersCall) Do(opts ...googleapi.CallOption) (*IpOwnerList, error) {
  75903. gensupport.SetOptions(c.urlParams_, opts...)
  75904. res, err := c.doRequest("json")
  75905. if res != nil && res.StatusCode == http.StatusNotModified {
  75906. if res.Body != nil {
  75907. res.Body.Close()
  75908. }
  75909. return nil, &googleapi.Error{
  75910. Code: res.StatusCode,
  75911. Header: res.Header,
  75912. }
  75913. }
  75914. if err != nil {
  75915. return nil, err
  75916. }
  75917. defer googleapi.CloseBody(res)
  75918. if err := googleapi.CheckResponse(res); err != nil {
  75919. return nil, err
  75920. }
  75921. ret := &IpOwnerList{
  75922. ServerResponse: googleapi.ServerResponse{
  75923. Header: res.Header,
  75924. HTTPStatusCode: res.StatusCode,
  75925. },
  75926. }
  75927. target := &ret
  75928. if err := gensupport.DecodeResponse(target, res); err != nil {
  75929. return nil, err
  75930. }
  75931. return ret, nil
  75932. // {
  75933. // "description": "Lists the internal IP owners in the specified network.",
  75934. // "httpMethod": "GET",
  75935. // "id": "compute.networks.listIpOwners",
  75936. // "parameterOrder": [
  75937. // "project",
  75938. // "network"
  75939. // ],
  75940. // "parameters": {
  75941. // "filter": {
  75942. // "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).",
  75943. // "location": "query",
  75944. // "type": "string"
  75945. // },
  75946. // "ipCidrRange": {
  75947. // "description": "(Optional) IP CIDR range filter, example: \"10.128.10.0/30\".",
  75948. // "location": "query",
  75949. // "type": "string"
  75950. // },
  75951. // "maxResults": {
  75952. // "default": "500",
  75953. // "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)",
  75954. // "format": "uint32",
  75955. // "location": "query",
  75956. // "minimum": "0",
  75957. // "type": "integer"
  75958. // },
  75959. // "network": {
  75960. // "description": "Name of the network to return.",
  75961. // "location": "path",
  75962. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  75963. // "required": true,
  75964. // "type": "string"
  75965. // },
  75966. // "orderBy": {
  75967. // "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.",
  75968. // "location": "query",
  75969. // "type": "string"
  75970. // },
  75971. // "ownerProjects": {
  75972. // "description": "(Optional) Project IDs filter, example: \"project-1,project-2\".",
  75973. // "location": "query",
  75974. // "type": "string"
  75975. // },
  75976. // "ownerTypes": {
  75977. // "description": "(Optional) Owner types filter, example: \"instance,forwardingRule\".",
  75978. // "location": "query",
  75979. // "type": "string"
  75980. // },
  75981. // "pageToken": {
  75982. // "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.",
  75983. // "location": "query",
  75984. // "type": "string"
  75985. // },
  75986. // "project": {
  75987. // "description": "Project ID for this request.",
  75988. // "location": "path",
  75989. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  75990. // "required": true,
  75991. // "type": "string"
  75992. // },
  75993. // "subnetName": {
  75994. // "description": "(Optional) Subnetwork name filter.",
  75995. // "location": "query",
  75996. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  75997. // "type": "string"
  75998. // },
  75999. // "subnetRegion": {
  76000. // "description": "(Optional) Subnetwork region filter.",
  76001. // "location": "query",
  76002. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  76003. // "type": "string"
  76004. // }
  76005. // },
  76006. // "path": "{project}/global/networks/{network}/listIpOwners",
  76007. // "response": {
  76008. // "$ref": "IpOwnerList"
  76009. // },
  76010. // "scopes": [
  76011. // "https://www.googleapis.com/auth/cloud-platform",
  76012. // "https://www.googleapis.com/auth/compute",
  76013. // "https://www.googleapis.com/auth/compute.readonly"
  76014. // ]
  76015. // }
  76016. }
  76017. // Pages invokes f for each page of results.
  76018. // A non-nil error returned from f will halt the iteration.
  76019. // The provided context supersedes any context provided to the Context method.
  76020. func (c *NetworksListIpOwnersCall) Pages(ctx context.Context, f func(*IpOwnerList) error) error {
  76021. c.ctx_ = ctx
  76022. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  76023. for {
  76024. x, err := c.Do()
  76025. if err != nil {
  76026. return err
  76027. }
  76028. if err := f(x); err != nil {
  76029. return err
  76030. }
  76031. if x.NextPageToken == "" {
  76032. return nil
  76033. }
  76034. c.PageToken(x.NextPageToken)
  76035. }
  76036. }
  76037. // method id "compute.networks.patch":
  76038. type NetworksPatchCall struct {
  76039. s *Service
  76040. project string
  76041. network string
  76042. network2 *Network
  76043. urlParams_ gensupport.URLParams
  76044. ctx_ context.Context
  76045. header_ http.Header
  76046. }
  76047. // Patch: Patches the specified network with the data included in the
  76048. // request. Only the following fields can be modified:
  76049. // routingConfig.routingMode.
  76050. func (r *NetworksService) Patch(project string, network string, network2 *Network) *NetworksPatchCall {
  76051. c := &NetworksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  76052. c.project = project
  76053. c.network = network
  76054. c.network2 = network2
  76055. return c
  76056. }
  76057. // RequestId sets the optional parameter "requestId": An optional
  76058. // request ID to identify requests. Specify a unique request ID so that
  76059. // if you must retry your request, the server will know to ignore the
  76060. // request if it has already been completed.
  76061. //
  76062. // For example, consider a situation where you make an initial request
  76063. // and the request times out. If you make the request again with the
  76064. // same request ID, the server can check if original operation with the
  76065. // same request ID was received, and if so, will ignore the second
  76066. // request. This prevents clients from accidentally creating duplicate
  76067. // commitments.
  76068. //
  76069. // The request ID must be a valid UUID with the exception that zero UUID
  76070. // is not supported (00000000-0000-0000-0000-000000000000).
  76071. func (c *NetworksPatchCall) RequestId(requestId string) *NetworksPatchCall {
  76072. c.urlParams_.Set("requestId", requestId)
  76073. return c
  76074. }
  76075. // Fields allows partial responses to be retrieved. See
  76076. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  76077. // for more information.
  76078. func (c *NetworksPatchCall) Fields(s ...googleapi.Field) *NetworksPatchCall {
  76079. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  76080. return c
  76081. }
  76082. // Context sets the context to be used in this call's Do method. Any
  76083. // pending HTTP request will be aborted if the provided context is
  76084. // canceled.
  76085. func (c *NetworksPatchCall) Context(ctx context.Context) *NetworksPatchCall {
  76086. c.ctx_ = ctx
  76087. return c
  76088. }
  76089. // Header returns an http.Header that can be modified by the caller to
  76090. // add HTTP headers to the request.
  76091. func (c *NetworksPatchCall) Header() http.Header {
  76092. if c.header_ == nil {
  76093. c.header_ = make(http.Header)
  76094. }
  76095. return c.header_
  76096. }
  76097. func (c *NetworksPatchCall) doRequest(alt string) (*http.Response, error) {
  76098. reqHeaders := make(http.Header)
  76099. for k, v := range c.header_ {
  76100. reqHeaders[k] = v
  76101. }
  76102. reqHeaders.Set("User-Agent", c.s.userAgent())
  76103. var body io.Reader = nil
  76104. body, err := googleapi.WithoutDataWrapper.JSONReader(c.network2)
  76105. if err != nil {
  76106. return nil, err
  76107. }
  76108. reqHeaders.Set("Content-Type", "application/json")
  76109. c.urlParams_.Set("alt", alt)
  76110. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}")
  76111. urls += "?" + c.urlParams_.Encode()
  76112. req, _ := http.NewRequest("PATCH", urls, body)
  76113. req.Header = reqHeaders
  76114. googleapi.Expand(req.URL, map[string]string{
  76115. "project": c.project,
  76116. "network": c.network,
  76117. })
  76118. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  76119. }
  76120. // Do executes the "compute.networks.patch" call.
  76121. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  76122. // status code is an error. Response headers are in either
  76123. // *Operation.ServerResponse.Header or (if a response was returned at
  76124. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  76125. // to check whether the returned error was because
  76126. // http.StatusNotModified was returned.
  76127. func (c *NetworksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  76128. gensupport.SetOptions(c.urlParams_, opts...)
  76129. res, err := c.doRequest("json")
  76130. if res != nil && res.StatusCode == http.StatusNotModified {
  76131. if res.Body != nil {
  76132. res.Body.Close()
  76133. }
  76134. return nil, &googleapi.Error{
  76135. Code: res.StatusCode,
  76136. Header: res.Header,
  76137. }
  76138. }
  76139. if err != nil {
  76140. return nil, err
  76141. }
  76142. defer googleapi.CloseBody(res)
  76143. if err := googleapi.CheckResponse(res); err != nil {
  76144. return nil, err
  76145. }
  76146. ret := &Operation{
  76147. ServerResponse: googleapi.ServerResponse{
  76148. Header: res.Header,
  76149. HTTPStatusCode: res.StatusCode,
  76150. },
  76151. }
  76152. target := &ret
  76153. if err := gensupport.DecodeResponse(target, res); err != nil {
  76154. return nil, err
  76155. }
  76156. return ret, nil
  76157. // {
  76158. // "description": "Patches the specified network with the data included in the request. Only the following fields can be modified: routingConfig.routingMode.",
  76159. // "httpMethod": "PATCH",
  76160. // "id": "compute.networks.patch",
  76161. // "parameterOrder": [
  76162. // "project",
  76163. // "network"
  76164. // ],
  76165. // "parameters": {
  76166. // "network": {
  76167. // "description": "Name of the network to update.",
  76168. // "location": "path",
  76169. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  76170. // "required": true,
  76171. // "type": "string"
  76172. // },
  76173. // "project": {
  76174. // "description": "Project ID for this request.",
  76175. // "location": "path",
  76176. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  76177. // "required": true,
  76178. // "type": "string"
  76179. // },
  76180. // "requestId": {
  76181. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  76182. // "location": "query",
  76183. // "type": "string"
  76184. // }
  76185. // },
  76186. // "path": "{project}/global/networks/{network}",
  76187. // "request": {
  76188. // "$ref": "Network"
  76189. // },
  76190. // "response": {
  76191. // "$ref": "Operation"
  76192. // },
  76193. // "scopes": [
  76194. // "https://www.googleapis.com/auth/cloud-platform",
  76195. // "https://www.googleapis.com/auth/compute"
  76196. // ]
  76197. // }
  76198. }
  76199. // method id "compute.networks.removePeering":
  76200. type NetworksRemovePeeringCall struct {
  76201. s *Service
  76202. project string
  76203. network string
  76204. networksremovepeeringrequest *NetworksRemovePeeringRequest
  76205. urlParams_ gensupport.URLParams
  76206. ctx_ context.Context
  76207. header_ http.Header
  76208. }
  76209. // RemovePeering: Removes a peering from the specified network.
  76210. func (r *NetworksService) RemovePeering(project string, network string, networksremovepeeringrequest *NetworksRemovePeeringRequest) *NetworksRemovePeeringCall {
  76211. c := &NetworksRemovePeeringCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  76212. c.project = project
  76213. c.network = network
  76214. c.networksremovepeeringrequest = networksremovepeeringrequest
  76215. return c
  76216. }
  76217. // RequestId sets the optional parameter "requestId": An optional
  76218. // request ID to identify requests. Specify a unique request ID so that
  76219. // if you must retry your request, the server will know to ignore the
  76220. // request if it has already been completed.
  76221. //
  76222. // For example, consider a situation where you make an initial request
  76223. // and the request times out. If you make the request again with the
  76224. // same request ID, the server can check if original operation with the
  76225. // same request ID was received, and if so, will ignore the second
  76226. // request. This prevents clients from accidentally creating duplicate
  76227. // commitments.
  76228. //
  76229. // The request ID must be a valid UUID with the exception that zero UUID
  76230. // is not supported (00000000-0000-0000-0000-000000000000).
  76231. func (c *NetworksRemovePeeringCall) RequestId(requestId string) *NetworksRemovePeeringCall {
  76232. c.urlParams_.Set("requestId", requestId)
  76233. return c
  76234. }
  76235. // Fields allows partial responses to be retrieved. See
  76236. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  76237. // for more information.
  76238. func (c *NetworksRemovePeeringCall) Fields(s ...googleapi.Field) *NetworksRemovePeeringCall {
  76239. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  76240. return c
  76241. }
  76242. // Context sets the context to be used in this call's Do method. Any
  76243. // pending HTTP request will be aborted if the provided context is
  76244. // canceled.
  76245. func (c *NetworksRemovePeeringCall) Context(ctx context.Context) *NetworksRemovePeeringCall {
  76246. c.ctx_ = ctx
  76247. return c
  76248. }
  76249. // Header returns an http.Header that can be modified by the caller to
  76250. // add HTTP headers to the request.
  76251. func (c *NetworksRemovePeeringCall) Header() http.Header {
  76252. if c.header_ == nil {
  76253. c.header_ = make(http.Header)
  76254. }
  76255. return c.header_
  76256. }
  76257. func (c *NetworksRemovePeeringCall) doRequest(alt string) (*http.Response, error) {
  76258. reqHeaders := make(http.Header)
  76259. for k, v := range c.header_ {
  76260. reqHeaders[k] = v
  76261. }
  76262. reqHeaders.Set("User-Agent", c.s.userAgent())
  76263. var body io.Reader = nil
  76264. body, err := googleapi.WithoutDataWrapper.JSONReader(c.networksremovepeeringrequest)
  76265. if err != nil {
  76266. return nil, err
  76267. }
  76268. reqHeaders.Set("Content-Type", "application/json")
  76269. c.urlParams_.Set("alt", alt)
  76270. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}/removePeering")
  76271. urls += "?" + c.urlParams_.Encode()
  76272. req, _ := http.NewRequest("POST", urls, body)
  76273. req.Header = reqHeaders
  76274. googleapi.Expand(req.URL, map[string]string{
  76275. "project": c.project,
  76276. "network": c.network,
  76277. })
  76278. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  76279. }
  76280. // Do executes the "compute.networks.removePeering" call.
  76281. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  76282. // status code is an error. Response headers are in either
  76283. // *Operation.ServerResponse.Header or (if a response was returned at
  76284. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  76285. // to check whether the returned error was because
  76286. // http.StatusNotModified was returned.
  76287. func (c *NetworksRemovePeeringCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  76288. gensupport.SetOptions(c.urlParams_, opts...)
  76289. res, err := c.doRequest("json")
  76290. if res != nil && res.StatusCode == http.StatusNotModified {
  76291. if res.Body != nil {
  76292. res.Body.Close()
  76293. }
  76294. return nil, &googleapi.Error{
  76295. Code: res.StatusCode,
  76296. Header: res.Header,
  76297. }
  76298. }
  76299. if err != nil {
  76300. return nil, err
  76301. }
  76302. defer googleapi.CloseBody(res)
  76303. if err := googleapi.CheckResponse(res); err != nil {
  76304. return nil, err
  76305. }
  76306. ret := &Operation{
  76307. ServerResponse: googleapi.ServerResponse{
  76308. Header: res.Header,
  76309. HTTPStatusCode: res.StatusCode,
  76310. },
  76311. }
  76312. target := &ret
  76313. if err := gensupport.DecodeResponse(target, res); err != nil {
  76314. return nil, err
  76315. }
  76316. return ret, nil
  76317. // {
  76318. // "description": "Removes a peering from the specified network.",
  76319. // "httpMethod": "POST",
  76320. // "id": "compute.networks.removePeering",
  76321. // "parameterOrder": [
  76322. // "project",
  76323. // "network"
  76324. // ],
  76325. // "parameters": {
  76326. // "network": {
  76327. // "description": "Name of the network resource to remove peering from.",
  76328. // "location": "path",
  76329. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  76330. // "required": true,
  76331. // "type": "string"
  76332. // },
  76333. // "project": {
  76334. // "description": "Project ID for this request.",
  76335. // "location": "path",
  76336. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  76337. // "required": true,
  76338. // "type": "string"
  76339. // },
  76340. // "requestId": {
  76341. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  76342. // "location": "query",
  76343. // "type": "string"
  76344. // }
  76345. // },
  76346. // "path": "{project}/global/networks/{network}/removePeering",
  76347. // "request": {
  76348. // "$ref": "NetworksRemovePeeringRequest"
  76349. // },
  76350. // "response": {
  76351. // "$ref": "Operation"
  76352. // },
  76353. // "scopes": [
  76354. // "https://www.googleapis.com/auth/cloud-platform",
  76355. // "https://www.googleapis.com/auth/compute"
  76356. // ]
  76357. // }
  76358. }
  76359. // method id "compute.networks.switchToCustomMode":
  76360. type NetworksSwitchToCustomModeCall struct {
  76361. s *Service
  76362. project string
  76363. network string
  76364. urlParams_ gensupport.URLParams
  76365. ctx_ context.Context
  76366. header_ http.Header
  76367. }
  76368. // SwitchToCustomMode: Switches the network mode from auto subnet mode
  76369. // to custom subnet mode.
  76370. func (r *NetworksService) SwitchToCustomMode(project string, network string) *NetworksSwitchToCustomModeCall {
  76371. c := &NetworksSwitchToCustomModeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  76372. c.project = project
  76373. c.network = network
  76374. return c
  76375. }
  76376. // RequestId sets the optional parameter "requestId": An optional
  76377. // request ID to identify requests. Specify a unique request ID so that
  76378. // if you must retry your request, the server will know to ignore the
  76379. // request if it has already been completed.
  76380. //
  76381. // For example, consider a situation where you make an initial request
  76382. // and the request times out. If you make the request again with the
  76383. // same request ID, the server can check if original operation with the
  76384. // same request ID was received, and if so, will ignore the second
  76385. // request. This prevents clients from accidentally creating duplicate
  76386. // commitments.
  76387. //
  76388. // The request ID must be a valid UUID with the exception that zero UUID
  76389. // is not supported (00000000-0000-0000-0000-000000000000).
  76390. func (c *NetworksSwitchToCustomModeCall) RequestId(requestId string) *NetworksSwitchToCustomModeCall {
  76391. c.urlParams_.Set("requestId", requestId)
  76392. return c
  76393. }
  76394. // Fields allows partial responses to be retrieved. See
  76395. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  76396. // for more information.
  76397. func (c *NetworksSwitchToCustomModeCall) Fields(s ...googleapi.Field) *NetworksSwitchToCustomModeCall {
  76398. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  76399. return c
  76400. }
  76401. // Context sets the context to be used in this call's Do method. Any
  76402. // pending HTTP request will be aborted if the provided context is
  76403. // canceled.
  76404. func (c *NetworksSwitchToCustomModeCall) Context(ctx context.Context) *NetworksSwitchToCustomModeCall {
  76405. c.ctx_ = ctx
  76406. return c
  76407. }
  76408. // Header returns an http.Header that can be modified by the caller to
  76409. // add HTTP headers to the request.
  76410. func (c *NetworksSwitchToCustomModeCall) Header() http.Header {
  76411. if c.header_ == nil {
  76412. c.header_ = make(http.Header)
  76413. }
  76414. return c.header_
  76415. }
  76416. func (c *NetworksSwitchToCustomModeCall) doRequest(alt string) (*http.Response, error) {
  76417. reqHeaders := make(http.Header)
  76418. for k, v := range c.header_ {
  76419. reqHeaders[k] = v
  76420. }
  76421. reqHeaders.Set("User-Agent", c.s.userAgent())
  76422. var body io.Reader = nil
  76423. c.urlParams_.Set("alt", alt)
  76424. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}/switchToCustomMode")
  76425. urls += "?" + c.urlParams_.Encode()
  76426. req, _ := http.NewRequest("POST", urls, body)
  76427. req.Header = reqHeaders
  76428. googleapi.Expand(req.URL, map[string]string{
  76429. "project": c.project,
  76430. "network": c.network,
  76431. })
  76432. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  76433. }
  76434. // Do executes the "compute.networks.switchToCustomMode" call.
  76435. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  76436. // status code is an error. Response headers are in either
  76437. // *Operation.ServerResponse.Header or (if a response was returned at
  76438. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  76439. // to check whether the returned error was because
  76440. // http.StatusNotModified was returned.
  76441. func (c *NetworksSwitchToCustomModeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  76442. gensupport.SetOptions(c.urlParams_, opts...)
  76443. res, err := c.doRequest("json")
  76444. if res != nil && res.StatusCode == http.StatusNotModified {
  76445. if res.Body != nil {
  76446. res.Body.Close()
  76447. }
  76448. return nil, &googleapi.Error{
  76449. Code: res.StatusCode,
  76450. Header: res.Header,
  76451. }
  76452. }
  76453. if err != nil {
  76454. return nil, err
  76455. }
  76456. defer googleapi.CloseBody(res)
  76457. if err := googleapi.CheckResponse(res); err != nil {
  76458. return nil, err
  76459. }
  76460. ret := &Operation{
  76461. ServerResponse: googleapi.ServerResponse{
  76462. Header: res.Header,
  76463. HTTPStatusCode: res.StatusCode,
  76464. },
  76465. }
  76466. target := &ret
  76467. if err := gensupport.DecodeResponse(target, res); err != nil {
  76468. return nil, err
  76469. }
  76470. return ret, nil
  76471. // {
  76472. // "description": "Switches the network mode from auto subnet mode to custom subnet mode.",
  76473. // "httpMethod": "POST",
  76474. // "id": "compute.networks.switchToCustomMode",
  76475. // "parameterOrder": [
  76476. // "project",
  76477. // "network"
  76478. // ],
  76479. // "parameters": {
  76480. // "network": {
  76481. // "description": "Name of the network to be updated.",
  76482. // "location": "path",
  76483. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  76484. // "required": true,
  76485. // "type": "string"
  76486. // },
  76487. // "project": {
  76488. // "description": "Project ID for this request.",
  76489. // "location": "path",
  76490. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  76491. // "required": true,
  76492. // "type": "string"
  76493. // },
  76494. // "requestId": {
  76495. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  76496. // "location": "query",
  76497. // "type": "string"
  76498. // }
  76499. // },
  76500. // "path": "{project}/global/networks/{network}/switchToCustomMode",
  76501. // "response": {
  76502. // "$ref": "Operation"
  76503. // },
  76504. // "scopes": [
  76505. // "https://www.googleapis.com/auth/cloud-platform",
  76506. // "https://www.googleapis.com/auth/compute"
  76507. // ]
  76508. // }
  76509. }
  76510. // method id "compute.networks.testIamPermissions":
  76511. type NetworksTestIamPermissionsCall struct {
  76512. s *Service
  76513. project string
  76514. resource string
  76515. testpermissionsrequest *TestPermissionsRequest
  76516. urlParams_ gensupport.URLParams
  76517. ctx_ context.Context
  76518. header_ http.Header
  76519. }
  76520. // TestIamPermissions: Returns permissions that a caller has on the
  76521. // specified resource.
  76522. func (r *NetworksService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *NetworksTestIamPermissionsCall {
  76523. c := &NetworksTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  76524. c.project = project
  76525. c.resource = resource
  76526. c.testpermissionsrequest = testpermissionsrequest
  76527. return c
  76528. }
  76529. // Fields allows partial responses to be retrieved. See
  76530. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  76531. // for more information.
  76532. func (c *NetworksTestIamPermissionsCall) Fields(s ...googleapi.Field) *NetworksTestIamPermissionsCall {
  76533. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  76534. return c
  76535. }
  76536. // Context sets the context to be used in this call's Do method. Any
  76537. // pending HTTP request will be aborted if the provided context is
  76538. // canceled.
  76539. func (c *NetworksTestIamPermissionsCall) Context(ctx context.Context) *NetworksTestIamPermissionsCall {
  76540. c.ctx_ = ctx
  76541. return c
  76542. }
  76543. // Header returns an http.Header that can be modified by the caller to
  76544. // add HTTP headers to the request.
  76545. func (c *NetworksTestIamPermissionsCall) Header() http.Header {
  76546. if c.header_ == nil {
  76547. c.header_ = make(http.Header)
  76548. }
  76549. return c.header_
  76550. }
  76551. func (c *NetworksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  76552. reqHeaders := make(http.Header)
  76553. for k, v := range c.header_ {
  76554. reqHeaders[k] = v
  76555. }
  76556. reqHeaders.Set("User-Agent", c.s.userAgent())
  76557. var body io.Reader = nil
  76558. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  76559. if err != nil {
  76560. return nil, err
  76561. }
  76562. reqHeaders.Set("Content-Type", "application/json")
  76563. c.urlParams_.Set("alt", alt)
  76564. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{resource}/testIamPermissions")
  76565. urls += "?" + c.urlParams_.Encode()
  76566. req, _ := http.NewRequest("POST", urls, body)
  76567. req.Header = reqHeaders
  76568. googleapi.Expand(req.URL, map[string]string{
  76569. "project": c.project,
  76570. "resource": c.resource,
  76571. })
  76572. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  76573. }
  76574. // Do executes the "compute.networks.testIamPermissions" call.
  76575. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  76576. // non-2xx status code is an error. Response headers are in either
  76577. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  76578. // returned at all) in error.(*googleapi.Error).Header. Use
  76579. // googleapi.IsNotModified to check whether the returned error was
  76580. // because http.StatusNotModified was returned.
  76581. func (c *NetworksTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  76582. gensupport.SetOptions(c.urlParams_, opts...)
  76583. res, err := c.doRequest("json")
  76584. if res != nil && res.StatusCode == http.StatusNotModified {
  76585. if res.Body != nil {
  76586. res.Body.Close()
  76587. }
  76588. return nil, &googleapi.Error{
  76589. Code: res.StatusCode,
  76590. Header: res.Header,
  76591. }
  76592. }
  76593. if err != nil {
  76594. return nil, err
  76595. }
  76596. defer googleapi.CloseBody(res)
  76597. if err := googleapi.CheckResponse(res); err != nil {
  76598. return nil, err
  76599. }
  76600. ret := &TestPermissionsResponse{
  76601. ServerResponse: googleapi.ServerResponse{
  76602. Header: res.Header,
  76603. HTTPStatusCode: res.StatusCode,
  76604. },
  76605. }
  76606. target := &ret
  76607. if err := gensupport.DecodeResponse(target, res); err != nil {
  76608. return nil, err
  76609. }
  76610. return ret, nil
  76611. // {
  76612. // "description": "Returns permissions that a caller has on the specified resource.",
  76613. // "httpMethod": "POST",
  76614. // "id": "compute.networks.testIamPermissions",
  76615. // "parameterOrder": [
  76616. // "project",
  76617. // "resource"
  76618. // ],
  76619. // "parameters": {
  76620. // "project": {
  76621. // "description": "Project ID for this request.",
  76622. // "location": "path",
  76623. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  76624. // "required": true,
  76625. // "type": "string"
  76626. // },
  76627. // "resource": {
  76628. // "description": "Name of the resource for this request.",
  76629. // "location": "path",
  76630. // "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?",
  76631. // "required": true,
  76632. // "type": "string"
  76633. // }
  76634. // },
  76635. // "path": "{project}/global/networks/{resource}/testIamPermissions",
  76636. // "request": {
  76637. // "$ref": "TestPermissionsRequest"
  76638. // },
  76639. // "response": {
  76640. // "$ref": "TestPermissionsResponse"
  76641. // },
  76642. // "scopes": [
  76643. // "https://www.googleapis.com/auth/cloud-platform",
  76644. // "https://www.googleapis.com/auth/compute",
  76645. // "https://www.googleapis.com/auth/compute.readonly"
  76646. // ]
  76647. // }
  76648. }
  76649. // method id "compute.nodeGroups.addNodes":
  76650. type NodeGroupsAddNodesCall struct {
  76651. s *Service
  76652. project string
  76653. zone string
  76654. nodeGroup string
  76655. nodegroupsaddnodesrequest *NodeGroupsAddNodesRequest
  76656. urlParams_ gensupport.URLParams
  76657. ctx_ context.Context
  76658. header_ http.Header
  76659. }
  76660. // AddNodes: Adds specified number of nodes to the node group.
  76661. func (r *NodeGroupsService) AddNodes(project string, zone string, nodeGroup string, nodegroupsaddnodesrequest *NodeGroupsAddNodesRequest) *NodeGroupsAddNodesCall {
  76662. c := &NodeGroupsAddNodesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  76663. c.project = project
  76664. c.zone = zone
  76665. c.nodeGroup = nodeGroup
  76666. c.nodegroupsaddnodesrequest = nodegroupsaddnodesrequest
  76667. return c
  76668. }
  76669. // RequestId sets the optional parameter "requestId": An optional
  76670. // request ID to identify requests. Specify a unique request ID so that
  76671. // if you must retry your request, the server will know to ignore the
  76672. // request if it has already been completed.
  76673. //
  76674. // For example, consider a situation where you make an initial request
  76675. // and the request times out. If you make the request again with the
  76676. // same request ID, the server can check if original operation with the
  76677. // same request ID was received, and if so, will ignore the second
  76678. // request. This prevents clients from accidentally creating duplicate
  76679. // commitments.
  76680. //
  76681. // The request ID must be a valid UUID with the exception that zero UUID
  76682. // is not supported (00000000-0000-0000-0000-000000000000).
  76683. func (c *NodeGroupsAddNodesCall) RequestId(requestId string) *NodeGroupsAddNodesCall {
  76684. c.urlParams_.Set("requestId", requestId)
  76685. return c
  76686. }
  76687. // Fields allows partial responses to be retrieved. See
  76688. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  76689. // for more information.
  76690. func (c *NodeGroupsAddNodesCall) Fields(s ...googleapi.Field) *NodeGroupsAddNodesCall {
  76691. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  76692. return c
  76693. }
  76694. // Context sets the context to be used in this call's Do method. Any
  76695. // pending HTTP request will be aborted if the provided context is
  76696. // canceled.
  76697. func (c *NodeGroupsAddNodesCall) Context(ctx context.Context) *NodeGroupsAddNodesCall {
  76698. c.ctx_ = ctx
  76699. return c
  76700. }
  76701. // Header returns an http.Header that can be modified by the caller to
  76702. // add HTTP headers to the request.
  76703. func (c *NodeGroupsAddNodesCall) Header() http.Header {
  76704. if c.header_ == nil {
  76705. c.header_ = make(http.Header)
  76706. }
  76707. return c.header_
  76708. }
  76709. func (c *NodeGroupsAddNodesCall) doRequest(alt string) (*http.Response, error) {
  76710. reqHeaders := make(http.Header)
  76711. for k, v := range c.header_ {
  76712. reqHeaders[k] = v
  76713. }
  76714. reqHeaders.Set("User-Agent", c.s.userAgent())
  76715. var body io.Reader = nil
  76716. body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroupsaddnodesrequest)
  76717. if err != nil {
  76718. return nil, err
  76719. }
  76720. reqHeaders.Set("Content-Type", "application/json")
  76721. c.urlParams_.Set("alt", alt)
  76722. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{nodeGroup}/addNodes")
  76723. urls += "?" + c.urlParams_.Encode()
  76724. req, _ := http.NewRequest("POST", urls, body)
  76725. req.Header = reqHeaders
  76726. googleapi.Expand(req.URL, map[string]string{
  76727. "project": c.project,
  76728. "zone": c.zone,
  76729. "nodeGroup": c.nodeGroup,
  76730. })
  76731. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  76732. }
  76733. // Do executes the "compute.nodeGroups.addNodes" call.
  76734. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  76735. // status code is an error. Response headers are in either
  76736. // *Operation.ServerResponse.Header or (if a response was returned at
  76737. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  76738. // to check whether the returned error was because
  76739. // http.StatusNotModified was returned.
  76740. func (c *NodeGroupsAddNodesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  76741. gensupport.SetOptions(c.urlParams_, opts...)
  76742. res, err := c.doRequest("json")
  76743. if res != nil && res.StatusCode == http.StatusNotModified {
  76744. if res.Body != nil {
  76745. res.Body.Close()
  76746. }
  76747. return nil, &googleapi.Error{
  76748. Code: res.StatusCode,
  76749. Header: res.Header,
  76750. }
  76751. }
  76752. if err != nil {
  76753. return nil, err
  76754. }
  76755. defer googleapi.CloseBody(res)
  76756. if err := googleapi.CheckResponse(res); err != nil {
  76757. return nil, err
  76758. }
  76759. ret := &Operation{
  76760. ServerResponse: googleapi.ServerResponse{
  76761. Header: res.Header,
  76762. HTTPStatusCode: res.StatusCode,
  76763. },
  76764. }
  76765. target := &ret
  76766. if err := gensupport.DecodeResponse(target, res); err != nil {
  76767. return nil, err
  76768. }
  76769. return ret, nil
  76770. // {
  76771. // "description": "Adds specified number of nodes to the node group.",
  76772. // "httpMethod": "POST",
  76773. // "id": "compute.nodeGroups.addNodes",
  76774. // "parameterOrder": [
  76775. // "project",
  76776. // "zone",
  76777. // "nodeGroup"
  76778. // ],
  76779. // "parameters": {
  76780. // "nodeGroup": {
  76781. // "description": "Name of the NodeGroup resource to delete.",
  76782. // "location": "path",
  76783. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  76784. // "required": true,
  76785. // "type": "string"
  76786. // },
  76787. // "project": {
  76788. // "description": "Project ID for this request.",
  76789. // "location": "path",
  76790. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  76791. // "required": true,
  76792. // "type": "string"
  76793. // },
  76794. // "requestId": {
  76795. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  76796. // "location": "query",
  76797. // "type": "string"
  76798. // },
  76799. // "zone": {
  76800. // "description": "The name of the zone for this request.",
  76801. // "location": "path",
  76802. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  76803. // "required": true,
  76804. // "type": "string"
  76805. // }
  76806. // },
  76807. // "path": "{project}/zones/{zone}/nodeGroups/{nodeGroup}/addNodes",
  76808. // "request": {
  76809. // "$ref": "NodeGroupsAddNodesRequest"
  76810. // },
  76811. // "response": {
  76812. // "$ref": "Operation"
  76813. // },
  76814. // "scopes": [
  76815. // "https://www.googleapis.com/auth/cloud-platform",
  76816. // "https://www.googleapis.com/auth/compute"
  76817. // ]
  76818. // }
  76819. }
  76820. // method id "compute.nodeGroups.aggregatedList":
  76821. type NodeGroupsAggregatedListCall struct {
  76822. s *Service
  76823. project string
  76824. urlParams_ gensupport.URLParams
  76825. ifNoneMatch_ string
  76826. ctx_ context.Context
  76827. header_ http.Header
  76828. }
  76829. // AggregatedList: Retrieves an aggregated list of node groups.
  76830. func (r *NodeGroupsService) AggregatedList(project string) *NodeGroupsAggregatedListCall {
  76831. c := &NodeGroupsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  76832. c.project = project
  76833. return c
  76834. }
  76835. // Filter sets the optional parameter "filter": A filter expression that
  76836. // filters resources listed in the response. The expression must specify
  76837. // the field name, a comparison operator, and the value that you want to
  76838. // use for filtering. The value must be a string, a number, or a
  76839. // boolean. The comparison operator must be either =, !=, >, or <.
  76840. //
  76841. // For example, if you are filtering Compute Engine instances, you can
  76842. // exclude instances named example-instance by specifying name !=
  76843. // example-instance.
  76844. //
  76845. // You can also filter nested fields. For example, you could specify
  76846. // scheduling.automaticRestart = false to include instances only if they
  76847. // are not scheduled for automatic restarts. You can use filtering on
  76848. // nested fields to filter based on resource labels.
  76849. //
  76850. // To filter on multiple expressions, provide each separate expression
  76851. // within parentheses. For example, (scheduling.automaticRestart = true)
  76852. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  76853. // AND expression. However, you can include AND and OR expressions
  76854. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  76855. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  76856. // true).
  76857. func (c *NodeGroupsAggregatedListCall) Filter(filter string) *NodeGroupsAggregatedListCall {
  76858. c.urlParams_.Set("filter", filter)
  76859. return c
  76860. }
  76861. // MaxResults sets the optional parameter "maxResults": The maximum
  76862. // number of results per page that should be returned. If the number of
  76863. // available results is larger than maxResults, Compute Engine returns a
  76864. // nextPageToken that can be used to get the next page of results in
  76865. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  76866. // (Default: 500)
  76867. func (c *NodeGroupsAggregatedListCall) MaxResults(maxResults int64) *NodeGroupsAggregatedListCall {
  76868. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  76869. return c
  76870. }
  76871. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  76872. // a certain order. By default, results are returned in alphanumerical
  76873. // order based on the resource name.
  76874. //
  76875. // You can also sort results in descending order based on the creation
  76876. // timestamp using orderBy="creationTimestamp desc". This sorts results
  76877. // based on the creationTimestamp field in reverse chronological order
  76878. // (newest result first). Use this to sort resources like operations so
  76879. // that the newest operation is returned first.
  76880. //
  76881. // Currently, only sorting by name or creationTimestamp desc is
  76882. // supported.
  76883. func (c *NodeGroupsAggregatedListCall) OrderBy(orderBy string) *NodeGroupsAggregatedListCall {
  76884. c.urlParams_.Set("orderBy", orderBy)
  76885. return c
  76886. }
  76887. // PageToken sets the optional parameter "pageToken": Specifies a page
  76888. // token to use. Set pageToken to the nextPageToken returned by a
  76889. // previous list request to get the next page of results.
  76890. func (c *NodeGroupsAggregatedListCall) PageToken(pageToken string) *NodeGroupsAggregatedListCall {
  76891. c.urlParams_.Set("pageToken", pageToken)
  76892. return c
  76893. }
  76894. // Fields allows partial responses to be retrieved. See
  76895. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  76896. // for more information.
  76897. func (c *NodeGroupsAggregatedListCall) Fields(s ...googleapi.Field) *NodeGroupsAggregatedListCall {
  76898. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  76899. return c
  76900. }
  76901. // IfNoneMatch sets the optional parameter which makes the operation
  76902. // fail if the object's ETag matches the given value. This is useful for
  76903. // getting updates only after the object has changed since the last
  76904. // request. Use googleapi.IsNotModified to check whether the response
  76905. // error from Do is the result of In-None-Match.
  76906. func (c *NodeGroupsAggregatedListCall) IfNoneMatch(entityTag string) *NodeGroupsAggregatedListCall {
  76907. c.ifNoneMatch_ = entityTag
  76908. return c
  76909. }
  76910. // Context sets the context to be used in this call's Do method. Any
  76911. // pending HTTP request will be aborted if the provided context is
  76912. // canceled.
  76913. func (c *NodeGroupsAggregatedListCall) Context(ctx context.Context) *NodeGroupsAggregatedListCall {
  76914. c.ctx_ = ctx
  76915. return c
  76916. }
  76917. // Header returns an http.Header that can be modified by the caller to
  76918. // add HTTP headers to the request.
  76919. func (c *NodeGroupsAggregatedListCall) Header() http.Header {
  76920. if c.header_ == nil {
  76921. c.header_ = make(http.Header)
  76922. }
  76923. return c.header_
  76924. }
  76925. func (c *NodeGroupsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  76926. reqHeaders := make(http.Header)
  76927. for k, v := range c.header_ {
  76928. reqHeaders[k] = v
  76929. }
  76930. reqHeaders.Set("User-Agent", c.s.userAgent())
  76931. if c.ifNoneMatch_ != "" {
  76932. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  76933. }
  76934. var body io.Reader = nil
  76935. c.urlParams_.Set("alt", alt)
  76936. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/nodeGroups")
  76937. urls += "?" + c.urlParams_.Encode()
  76938. req, _ := http.NewRequest("GET", urls, body)
  76939. req.Header = reqHeaders
  76940. googleapi.Expand(req.URL, map[string]string{
  76941. "project": c.project,
  76942. })
  76943. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  76944. }
  76945. // Do executes the "compute.nodeGroups.aggregatedList" call.
  76946. // Exactly one of *NodeGroupAggregatedList or error will be non-nil. Any
  76947. // non-2xx status code is an error. Response headers are in either
  76948. // *NodeGroupAggregatedList.ServerResponse.Header or (if a response was
  76949. // returned at all) in error.(*googleapi.Error).Header. Use
  76950. // googleapi.IsNotModified to check whether the returned error was
  76951. // because http.StatusNotModified was returned.
  76952. func (c *NodeGroupsAggregatedListCall) Do(opts ...googleapi.CallOption) (*NodeGroupAggregatedList, error) {
  76953. gensupport.SetOptions(c.urlParams_, opts...)
  76954. res, err := c.doRequest("json")
  76955. if res != nil && res.StatusCode == http.StatusNotModified {
  76956. if res.Body != nil {
  76957. res.Body.Close()
  76958. }
  76959. return nil, &googleapi.Error{
  76960. Code: res.StatusCode,
  76961. Header: res.Header,
  76962. }
  76963. }
  76964. if err != nil {
  76965. return nil, err
  76966. }
  76967. defer googleapi.CloseBody(res)
  76968. if err := googleapi.CheckResponse(res); err != nil {
  76969. return nil, err
  76970. }
  76971. ret := &NodeGroupAggregatedList{
  76972. ServerResponse: googleapi.ServerResponse{
  76973. Header: res.Header,
  76974. HTTPStatusCode: res.StatusCode,
  76975. },
  76976. }
  76977. target := &ret
  76978. if err := gensupport.DecodeResponse(target, res); err != nil {
  76979. return nil, err
  76980. }
  76981. return ret, nil
  76982. // {
  76983. // "description": "Retrieves an aggregated list of node groups.",
  76984. // "httpMethod": "GET",
  76985. // "id": "compute.nodeGroups.aggregatedList",
  76986. // "parameterOrder": [
  76987. // "project"
  76988. // ],
  76989. // "parameters": {
  76990. // "filter": {
  76991. // "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).",
  76992. // "location": "query",
  76993. // "type": "string"
  76994. // },
  76995. // "maxResults": {
  76996. // "default": "500",
  76997. // "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)",
  76998. // "format": "uint32",
  76999. // "location": "query",
  77000. // "minimum": "0",
  77001. // "type": "integer"
  77002. // },
  77003. // "orderBy": {
  77004. // "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.",
  77005. // "location": "query",
  77006. // "type": "string"
  77007. // },
  77008. // "pageToken": {
  77009. // "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.",
  77010. // "location": "query",
  77011. // "type": "string"
  77012. // },
  77013. // "project": {
  77014. // "description": "Project ID for this request.",
  77015. // "location": "path",
  77016. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  77017. // "required": true,
  77018. // "type": "string"
  77019. // }
  77020. // },
  77021. // "path": "{project}/aggregated/nodeGroups",
  77022. // "response": {
  77023. // "$ref": "NodeGroupAggregatedList"
  77024. // },
  77025. // "scopes": [
  77026. // "https://www.googleapis.com/auth/cloud-platform",
  77027. // "https://www.googleapis.com/auth/compute",
  77028. // "https://www.googleapis.com/auth/compute.readonly"
  77029. // ]
  77030. // }
  77031. }
  77032. // Pages invokes f for each page of results.
  77033. // A non-nil error returned from f will halt the iteration.
  77034. // The provided context supersedes any context provided to the Context method.
  77035. func (c *NodeGroupsAggregatedListCall) Pages(ctx context.Context, f func(*NodeGroupAggregatedList) error) error {
  77036. c.ctx_ = ctx
  77037. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  77038. for {
  77039. x, err := c.Do()
  77040. if err != nil {
  77041. return err
  77042. }
  77043. if err := f(x); err != nil {
  77044. return err
  77045. }
  77046. if x.NextPageToken == "" {
  77047. return nil
  77048. }
  77049. c.PageToken(x.NextPageToken)
  77050. }
  77051. }
  77052. // method id "compute.nodeGroups.delete":
  77053. type NodeGroupsDeleteCall struct {
  77054. s *Service
  77055. project string
  77056. zone string
  77057. nodeGroup string
  77058. urlParams_ gensupport.URLParams
  77059. ctx_ context.Context
  77060. header_ http.Header
  77061. }
  77062. // Delete: Deletes the specified NodeGroup resource.
  77063. func (r *NodeGroupsService) Delete(project string, zone string, nodeGroup string) *NodeGroupsDeleteCall {
  77064. c := &NodeGroupsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  77065. c.project = project
  77066. c.zone = zone
  77067. c.nodeGroup = nodeGroup
  77068. return c
  77069. }
  77070. // RequestId sets the optional parameter "requestId": An optional
  77071. // request ID to identify requests. Specify a unique request ID so that
  77072. // if you must retry your request, the server will know to ignore the
  77073. // request if it has already been completed.
  77074. //
  77075. // For example, consider a situation where you make an initial request
  77076. // and the request times out. If you make the request again with the
  77077. // same request ID, the server can check if original operation with the
  77078. // same request ID was received, and if so, will ignore the second
  77079. // request. This prevents clients from accidentally creating duplicate
  77080. // commitments.
  77081. //
  77082. // The request ID must be a valid UUID with the exception that zero UUID
  77083. // is not supported (00000000-0000-0000-0000-000000000000).
  77084. func (c *NodeGroupsDeleteCall) RequestId(requestId string) *NodeGroupsDeleteCall {
  77085. c.urlParams_.Set("requestId", requestId)
  77086. return c
  77087. }
  77088. // Fields allows partial responses to be retrieved. See
  77089. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  77090. // for more information.
  77091. func (c *NodeGroupsDeleteCall) Fields(s ...googleapi.Field) *NodeGroupsDeleteCall {
  77092. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  77093. return c
  77094. }
  77095. // Context sets the context to be used in this call's Do method. Any
  77096. // pending HTTP request will be aborted if the provided context is
  77097. // canceled.
  77098. func (c *NodeGroupsDeleteCall) Context(ctx context.Context) *NodeGroupsDeleteCall {
  77099. c.ctx_ = ctx
  77100. return c
  77101. }
  77102. // Header returns an http.Header that can be modified by the caller to
  77103. // add HTTP headers to the request.
  77104. func (c *NodeGroupsDeleteCall) Header() http.Header {
  77105. if c.header_ == nil {
  77106. c.header_ = make(http.Header)
  77107. }
  77108. return c.header_
  77109. }
  77110. func (c *NodeGroupsDeleteCall) doRequest(alt string) (*http.Response, error) {
  77111. reqHeaders := make(http.Header)
  77112. for k, v := range c.header_ {
  77113. reqHeaders[k] = v
  77114. }
  77115. reqHeaders.Set("User-Agent", c.s.userAgent())
  77116. var body io.Reader = nil
  77117. c.urlParams_.Set("alt", alt)
  77118. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{nodeGroup}")
  77119. urls += "?" + c.urlParams_.Encode()
  77120. req, _ := http.NewRequest("DELETE", urls, body)
  77121. req.Header = reqHeaders
  77122. googleapi.Expand(req.URL, map[string]string{
  77123. "project": c.project,
  77124. "zone": c.zone,
  77125. "nodeGroup": c.nodeGroup,
  77126. })
  77127. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  77128. }
  77129. // Do executes the "compute.nodeGroups.delete" call.
  77130. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  77131. // status code is an error. Response headers are in either
  77132. // *Operation.ServerResponse.Header or (if a response was returned at
  77133. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  77134. // to check whether the returned error was because
  77135. // http.StatusNotModified was returned.
  77136. func (c *NodeGroupsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  77137. gensupport.SetOptions(c.urlParams_, opts...)
  77138. res, err := c.doRequest("json")
  77139. if res != nil && res.StatusCode == http.StatusNotModified {
  77140. if res.Body != nil {
  77141. res.Body.Close()
  77142. }
  77143. return nil, &googleapi.Error{
  77144. Code: res.StatusCode,
  77145. Header: res.Header,
  77146. }
  77147. }
  77148. if err != nil {
  77149. return nil, err
  77150. }
  77151. defer googleapi.CloseBody(res)
  77152. if err := googleapi.CheckResponse(res); err != nil {
  77153. return nil, err
  77154. }
  77155. ret := &Operation{
  77156. ServerResponse: googleapi.ServerResponse{
  77157. Header: res.Header,
  77158. HTTPStatusCode: res.StatusCode,
  77159. },
  77160. }
  77161. target := &ret
  77162. if err := gensupport.DecodeResponse(target, res); err != nil {
  77163. return nil, err
  77164. }
  77165. return ret, nil
  77166. // {
  77167. // "description": "Deletes the specified NodeGroup resource.",
  77168. // "httpMethod": "DELETE",
  77169. // "id": "compute.nodeGroups.delete",
  77170. // "parameterOrder": [
  77171. // "project",
  77172. // "zone",
  77173. // "nodeGroup"
  77174. // ],
  77175. // "parameters": {
  77176. // "nodeGroup": {
  77177. // "description": "Name of the NodeGroup resource to delete.",
  77178. // "location": "path",
  77179. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  77180. // "required": true,
  77181. // "type": "string"
  77182. // },
  77183. // "project": {
  77184. // "description": "Project ID for this request.",
  77185. // "location": "path",
  77186. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  77187. // "required": true,
  77188. // "type": "string"
  77189. // },
  77190. // "requestId": {
  77191. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  77192. // "location": "query",
  77193. // "type": "string"
  77194. // },
  77195. // "zone": {
  77196. // "description": "The name of the zone for this request.",
  77197. // "location": "path",
  77198. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  77199. // "required": true,
  77200. // "type": "string"
  77201. // }
  77202. // },
  77203. // "path": "{project}/zones/{zone}/nodeGroups/{nodeGroup}",
  77204. // "response": {
  77205. // "$ref": "Operation"
  77206. // },
  77207. // "scopes": [
  77208. // "https://www.googleapis.com/auth/cloud-platform",
  77209. // "https://www.googleapis.com/auth/compute"
  77210. // ]
  77211. // }
  77212. }
  77213. // method id "compute.nodeGroups.deleteNodes":
  77214. type NodeGroupsDeleteNodesCall struct {
  77215. s *Service
  77216. project string
  77217. zone string
  77218. nodeGroup string
  77219. nodegroupsdeletenodesrequest *NodeGroupsDeleteNodesRequest
  77220. urlParams_ gensupport.URLParams
  77221. ctx_ context.Context
  77222. header_ http.Header
  77223. }
  77224. // DeleteNodes: Deletes specified nodes from the node group.
  77225. func (r *NodeGroupsService) DeleteNodes(project string, zone string, nodeGroup string, nodegroupsdeletenodesrequest *NodeGroupsDeleteNodesRequest) *NodeGroupsDeleteNodesCall {
  77226. c := &NodeGroupsDeleteNodesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  77227. c.project = project
  77228. c.zone = zone
  77229. c.nodeGroup = nodeGroup
  77230. c.nodegroupsdeletenodesrequest = nodegroupsdeletenodesrequest
  77231. return c
  77232. }
  77233. // RequestId sets the optional parameter "requestId": An optional
  77234. // request ID to identify requests. Specify a unique request ID so that
  77235. // if you must retry your request, the server will know to ignore the
  77236. // request if it has already been completed.
  77237. //
  77238. // For example, consider a situation where you make an initial request
  77239. // and the request times out. If you make the request again with the
  77240. // same request ID, the server can check if original operation with the
  77241. // same request ID was received, and if so, will ignore the second
  77242. // request. This prevents clients from accidentally creating duplicate
  77243. // commitments.
  77244. //
  77245. // The request ID must be a valid UUID with the exception that zero UUID
  77246. // is not supported (00000000-0000-0000-0000-000000000000).
  77247. func (c *NodeGroupsDeleteNodesCall) RequestId(requestId string) *NodeGroupsDeleteNodesCall {
  77248. c.urlParams_.Set("requestId", requestId)
  77249. return c
  77250. }
  77251. // Fields allows partial responses to be retrieved. See
  77252. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  77253. // for more information.
  77254. func (c *NodeGroupsDeleteNodesCall) Fields(s ...googleapi.Field) *NodeGroupsDeleteNodesCall {
  77255. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  77256. return c
  77257. }
  77258. // Context sets the context to be used in this call's Do method. Any
  77259. // pending HTTP request will be aborted if the provided context is
  77260. // canceled.
  77261. func (c *NodeGroupsDeleteNodesCall) Context(ctx context.Context) *NodeGroupsDeleteNodesCall {
  77262. c.ctx_ = ctx
  77263. return c
  77264. }
  77265. // Header returns an http.Header that can be modified by the caller to
  77266. // add HTTP headers to the request.
  77267. func (c *NodeGroupsDeleteNodesCall) Header() http.Header {
  77268. if c.header_ == nil {
  77269. c.header_ = make(http.Header)
  77270. }
  77271. return c.header_
  77272. }
  77273. func (c *NodeGroupsDeleteNodesCall) doRequest(alt string) (*http.Response, error) {
  77274. reqHeaders := make(http.Header)
  77275. for k, v := range c.header_ {
  77276. reqHeaders[k] = v
  77277. }
  77278. reqHeaders.Set("User-Agent", c.s.userAgent())
  77279. var body io.Reader = nil
  77280. body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroupsdeletenodesrequest)
  77281. if err != nil {
  77282. return nil, err
  77283. }
  77284. reqHeaders.Set("Content-Type", "application/json")
  77285. c.urlParams_.Set("alt", alt)
  77286. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{nodeGroup}/deleteNodes")
  77287. urls += "?" + c.urlParams_.Encode()
  77288. req, _ := http.NewRequest("POST", urls, body)
  77289. req.Header = reqHeaders
  77290. googleapi.Expand(req.URL, map[string]string{
  77291. "project": c.project,
  77292. "zone": c.zone,
  77293. "nodeGroup": c.nodeGroup,
  77294. })
  77295. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  77296. }
  77297. // Do executes the "compute.nodeGroups.deleteNodes" call.
  77298. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  77299. // status code is an error. Response headers are in either
  77300. // *Operation.ServerResponse.Header or (if a response was returned at
  77301. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  77302. // to check whether the returned error was because
  77303. // http.StatusNotModified was returned.
  77304. func (c *NodeGroupsDeleteNodesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  77305. gensupport.SetOptions(c.urlParams_, opts...)
  77306. res, err := c.doRequest("json")
  77307. if res != nil && res.StatusCode == http.StatusNotModified {
  77308. if res.Body != nil {
  77309. res.Body.Close()
  77310. }
  77311. return nil, &googleapi.Error{
  77312. Code: res.StatusCode,
  77313. Header: res.Header,
  77314. }
  77315. }
  77316. if err != nil {
  77317. return nil, err
  77318. }
  77319. defer googleapi.CloseBody(res)
  77320. if err := googleapi.CheckResponse(res); err != nil {
  77321. return nil, err
  77322. }
  77323. ret := &Operation{
  77324. ServerResponse: googleapi.ServerResponse{
  77325. Header: res.Header,
  77326. HTTPStatusCode: res.StatusCode,
  77327. },
  77328. }
  77329. target := &ret
  77330. if err := gensupport.DecodeResponse(target, res); err != nil {
  77331. return nil, err
  77332. }
  77333. return ret, nil
  77334. // {
  77335. // "description": "Deletes specified nodes from the node group.",
  77336. // "httpMethod": "POST",
  77337. // "id": "compute.nodeGroups.deleteNodes",
  77338. // "parameterOrder": [
  77339. // "project",
  77340. // "zone",
  77341. // "nodeGroup"
  77342. // ],
  77343. // "parameters": {
  77344. // "nodeGroup": {
  77345. // "description": "Name of the NodeGroup resource to delete.",
  77346. // "location": "path",
  77347. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  77348. // "required": true,
  77349. // "type": "string"
  77350. // },
  77351. // "project": {
  77352. // "description": "Project ID for this request.",
  77353. // "location": "path",
  77354. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  77355. // "required": true,
  77356. // "type": "string"
  77357. // },
  77358. // "requestId": {
  77359. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  77360. // "location": "query",
  77361. // "type": "string"
  77362. // },
  77363. // "zone": {
  77364. // "description": "The name of the zone for this request.",
  77365. // "location": "path",
  77366. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  77367. // "required": true,
  77368. // "type": "string"
  77369. // }
  77370. // },
  77371. // "path": "{project}/zones/{zone}/nodeGroups/{nodeGroup}/deleteNodes",
  77372. // "request": {
  77373. // "$ref": "NodeGroupsDeleteNodesRequest"
  77374. // },
  77375. // "response": {
  77376. // "$ref": "Operation"
  77377. // },
  77378. // "scopes": [
  77379. // "https://www.googleapis.com/auth/cloud-platform",
  77380. // "https://www.googleapis.com/auth/compute"
  77381. // ]
  77382. // }
  77383. }
  77384. // method id "compute.nodeGroups.get":
  77385. type NodeGroupsGetCall struct {
  77386. s *Service
  77387. project string
  77388. zone string
  77389. nodeGroup string
  77390. urlParams_ gensupport.URLParams
  77391. ifNoneMatch_ string
  77392. ctx_ context.Context
  77393. header_ http.Header
  77394. }
  77395. // Get: Returns the specified NodeGroup. Get a list of available
  77396. // NodeGroups by making a list() request.
  77397. func (r *NodeGroupsService) Get(project string, zone string, nodeGroup string) *NodeGroupsGetCall {
  77398. c := &NodeGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  77399. c.project = project
  77400. c.zone = zone
  77401. c.nodeGroup = nodeGroup
  77402. return c
  77403. }
  77404. // Fields allows partial responses to be retrieved. See
  77405. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  77406. // for more information.
  77407. func (c *NodeGroupsGetCall) Fields(s ...googleapi.Field) *NodeGroupsGetCall {
  77408. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  77409. return c
  77410. }
  77411. // IfNoneMatch sets the optional parameter which makes the operation
  77412. // fail if the object's ETag matches the given value. This is useful for
  77413. // getting updates only after the object has changed since the last
  77414. // request. Use googleapi.IsNotModified to check whether the response
  77415. // error from Do is the result of In-None-Match.
  77416. func (c *NodeGroupsGetCall) IfNoneMatch(entityTag string) *NodeGroupsGetCall {
  77417. c.ifNoneMatch_ = entityTag
  77418. return c
  77419. }
  77420. // Context sets the context to be used in this call's Do method. Any
  77421. // pending HTTP request will be aborted if the provided context is
  77422. // canceled.
  77423. func (c *NodeGroupsGetCall) Context(ctx context.Context) *NodeGroupsGetCall {
  77424. c.ctx_ = ctx
  77425. return c
  77426. }
  77427. // Header returns an http.Header that can be modified by the caller to
  77428. // add HTTP headers to the request.
  77429. func (c *NodeGroupsGetCall) Header() http.Header {
  77430. if c.header_ == nil {
  77431. c.header_ = make(http.Header)
  77432. }
  77433. return c.header_
  77434. }
  77435. func (c *NodeGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  77436. reqHeaders := make(http.Header)
  77437. for k, v := range c.header_ {
  77438. reqHeaders[k] = v
  77439. }
  77440. reqHeaders.Set("User-Agent", c.s.userAgent())
  77441. if c.ifNoneMatch_ != "" {
  77442. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  77443. }
  77444. var body io.Reader = nil
  77445. c.urlParams_.Set("alt", alt)
  77446. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{nodeGroup}")
  77447. urls += "?" + c.urlParams_.Encode()
  77448. req, _ := http.NewRequest("GET", urls, body)
  77449. req.Header = reqHeaders
  77450. googleapi.Expand(req.URL, map[string]string{
  77451. "project": c.project,
  77452. "zone": c.zone,
  77453. "nodeGroup": c.nodeGroup,
  77454. })
  77455. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  77456. }
  77457. // Do executes the "compute.nodeGroups.get" call.
  77458. // Exactly one of *NodeGroup or error will be non-nil. Any non-2xx
  77459. // status code is an error. Response headers are in either
  77460. // *NodeGroup.ServerResponse.Header or (if a response was returned at
  77461. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  77462. // to check whether the returned error was because
  77463. // http.StatusNotModified was returned.
  77464. func (c *NodeGroupsGetCall) Do(opts ...googleapi.CallOption) (*NodeGroup, error) {
  77465. gensupport.SetOptions(c.urlParams_, opts...)
  77466. res, err := c.doRequest("json")
  77467. if res != nil && res.StatusCode == http.StatusNotModified {
  77468. if res.Body != nil {
  77469. res.Body.Close()
  77470. }
  77471. return nil, &googleapi.Error{
  77472. Code: res.StatusCode,
  77473. Header: res.Header,
  77474. }
  77475. }
  77476. if err != nil {
  77477. return nil, err
  77478. }
  77479. defer googleapi.CloseBody(res)
  77480. if err := googleapi.CheckResponse(res); err != nil {
  77481. return nil, err
  77482. }
  77483. ret := &NodeGroup{
  77484. ServerResponse: googleapi.ServerResponse{
  77485. Header: res.Header,
  77486. HTTPStatusCode: res.StatusCode,
  77487. },
  77488. }
  77489. target := &ret
  77490. if err := gensupport.DecodeResponse(target, res); err != nil {
  77491. return nil, err
  77492. }
  77493. return ret, nil
  77494. // {
  77495. // "description": "Returns the specified NodeGroup. Get a list of available NodeGroups by making a list() request.",
  77496. // "httpMethod": "GET",
  77497. // "id": "compute.nodeGroups.get",
  77498. // "parameterOrder": [
  77499. // "project",
  77500. // "zone",
  77501. // "nodeGroup"
  77502. // ],
  77503. // "parameters": {
  77504. // "nodeGroup": {
  77505. // "description": "Name of the node group to return.",
  77506. // "location": "path",
  77507. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  77508. // "required": true,
  77509. // "type": "string"
  77510. // },
  77511. // "project": {
  77512. // "description": "Project ID for this request.",
  77513. // "location": "path",
  77514. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  77515. // "required": true,
  77516. // "type": "string"
  77517. // },
  77518. // "zone": {
  77519. // "description": "The name of the zone for this request.",
  77520. // "location": "path",
  77521. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  77522. // "required": true,
  77523. // "type": "string"
  77524. // }
  77525. // },
  77526. // "path": "{project}/zones/{zone}/nodeGroups/{nodeGroup}",
  77527. // "response": {
  77528. // "$ref": "NodeGroup"
  77529. // },
  77530. // "scopes": [
  77531. // "https://www.googleapis.com/auth/cloud-platform",
  77532. // "https://www.googleapis.com/auth/compute",
  77533. // "https://www.googleapis.com/auth/compute.readonly"
  77534. // ]
  77535. // }
  77536. }
  77537. // method id "compute.nodeGroups.getIamPolicy":
  77538. type NodeGroupsGetIamPolicyCall struct {
  77539. s *Service
  77540. project string
  77541. zone string
  77542. resource string
  77543. urlParams_ gensupport.URLParams
  77544. ifNoneMatch_ string
  77545. ctx_ context.Context
  77546. header_ http.Header
  77547. }
  77548. // GetIamPolicy: Gets the access control policy for a resource. May be
  77549. // empty if no such policy or resource exists.
  77550. func (r *NodeGroupsService) GetIamPolicy(project string, zone string, resource string) *NodeGroupsGetIamPolicyCall {
  77551. c := &NodeGroupsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  77552. c.project = project
  77553. c.zone = zone
  77554. c.resource = resource
  77555. return c
  77556. }
  77557. // Fields allows partial responses to be retrieved. See
  77558. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  77559. // for more information.
  77560. func (c *NodeGroupsGetIamPolicyCall) Fields(s ...googleapi.Field) *NodeGroupsGetIamPolicyCall {
  77561. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  77562. return c
  77563. }
  77564. // IfNoneMatch sets the optional parameter which makes the operation
  77565. // fail if the object's ETag matches the given value. This is useful for
  77566. // getting updates only after the object has changed since the last
  77567. // request. Use googleapi.IsNotModified to check whether the response
  77568. // error from Do is the result of In-None-Match.
  77569. func (c *NodeGroupsGetIamPolicyCall) IfNoneMatch(entityTag string) *NodeGroupsGetIamPolicyCall {
  77570. c.ifNoneMatch_ = entityTag
  77571. return c
  77572. }
  77573. // Context sets the context to be used in this call's Do method. Any
  77574. // pending HTTP request will be aborted if the provided context is
  77575. // canceled.
  77576. func (c *NodeGroupsGetIamPolicyCall) Context(ctx context.Context) *NodeGroupsGetIamPolicyCall {
  77577. c.ctx_ = ctx
  77578. return c
  77579. }
  77580. // Header returns an http.Header that can be modified by the caller to
  77581. // add HTTP headers to the request.
  77582. func (c *NodeGroupsGetIamPolicyCall) Header() http.Header {
  77583. if c.header_ == nil {
  77584. c.header_ = make(http.Header)
  77585. }
  77586. return c.header_
  77587. }
  77588. func (c *NodeGroupsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  77589. reqHeaders := make(http.Header)
  77590. for k, v := range c.header_ {
  77591. reqHeaders[k] = v
  77592. }
  77593. reqHeaders.Set("User-Agent", c.s.userAgent())
  77594. if c.ifNoneMatch_ != "" {
  77595. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  77596. }
  77597. var body io.Reader = nil
  77598. c.urlParams_.Set("alt", alt)
  77599. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{resource}/getIamPolicy")
  77600. urls += "?" + c.urlParams_.Encode()
  77601. req, _ := http.NewRequest("GET", urls, body)
  77602. req.Header = reqHeaders
  77603. googleapi.Expand(req.URL, map[string]string{
  77604. "project": c.project,
  77605. "zone": c.zone,
  77606. "resource": c.resource,
  77607. })
  77608. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  77609. }
  77610. // Do executes the "compute.nodeGroups.getIamPolicy" call.
  77611. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  77612. // code is an error. Response headers are in either
  77613. // *Policy.ServerResponse.Header or (if a response was returned at all)
  77614. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  77615. // check whether the returned error was because http.StatusNotModified
  77616. // was returned.
  77617. func (c *NodeGroupsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  77618. gensupport.SetOptions(c.urlParams_, opts...)
  77619. res, err := c.doRequest("json")
  77620. if res != nil && res.StatusCode == http.StatusNotModified {
  77621. if res.Body != nil {
  77622. res.Body.Close()
  77623. }
  77624. return nil, &googleapi.Error{
  77625. Code: res.StatusCode,
  77626. Header: res.Header,
  77627. }
  77628. }
  77629. if err != nil {
  77630. return nil, err
  77631. }
  77632. defer googleapi.CloseBody(res)
  77633. if err := googleapi.CheckResponse(res); err != nil {
  77634. return nil, err
  77635. }
  77636. ret := &Policy{
  77637. ServerResponse: googleapi.ServerResponse{
  77638. Header: res.Header,
  77639. HTTPStatusCode: res.StatusCode,
  77640. },
  77641. }
  77642. target := &ret
  77643. if err := gensupport.DecodeResponse(target, res); err != nil {
  77644. return nil, err
  77645. }
  77646. return ret, nil
  77647. // {
  77648. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  77649. // "httpMethod": "GET",
  77650. // "id": "compute.nodeGroups.getIamPolicy",
  77651. // "parameterOrder": [
  77652. // "project",
  77653. // "zone",
  77654. // "resource"
  77655. // ],
  77656. // "parameters": {
  77657. // "project": {
  77658. // "description": "Project ID for this request.",
  77659. // "location": "path",
  77660. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  77661. // "required": true,
  77662. // "type": "string"
  77663. // },
  77664. // "resource": {
  77665. // "description": "Name of the resource for this request.",
  77666. // "location": "path",
  77667. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  77668. // "required": true,
  77669. // "type": "string"
  77670. // },
  77671. // "zone": {
  77672. // "description": "The name of the zone for this request.",
  77673. // "location": "path",
  77674. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  77675. // "required": true,
  77676. // "type": "string"
  77677. // }
  77678. // },
  77679. // "path": "{project}/zones/{zone}/nodeGroups/{resource}/getIamPolicy",
  77680. // "response": {
  77681. // "$ref": "Policy"
  77682. // },
  77683. // "scopes": [
  77684. // "https://www.googleapis.com/auth/cloud-platform",
  77685. // "https://www.googleapis.com/auth/compute",
  77686. // "https://www.googleapis.com/auth/compute.readonly"
  77687. // ]
  77688. // }
  77689. }
  77690. // method id "compute.nodeGroups.insert":
  77691. type NodeGroupsInsertCall struct {
  77692. s *Service
  77693. project string
  77694. zone string
  77695. nodegroup *NodeGroup
  77696. urlParams_ gensupport.URLParams
  77697. ctx_ context.Context
  77698. header_ http.Header
  77699. }
  77700. // Insert: Creates a NodeGroup resource in the specified project using
  77701. // the data included in the request.
  77702. func (r *NodeGroupsService) Insert(project string, zone string, initialNodeCount int64, nodegroup *NodeGroup) *NodeGroupsInsertCall {
  77703. c := &NodeGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  77704. c.project = project
  77705. c.zone = zone
  77706. c.urlParams_.Set("initialNodeCount", fmt.Sprint(initialNodeCount))
  77707. c.nodegroup = nodegroup
  77708. return c
  77709. }
  77710. // RequestId sets the optional parameter "requestId": An optional
  77711. // request ID to identify requests. Specify a unique request ID so that
  77712. // if you must retry your request, the server will know to ignore the
  77713. // request if it has already been completed.
  77714. //
  77715. // For example, consider a situation where you make an initial request
  77716. // and the request times out. If you make the request again with the
  77717. // same request ID, the server can check if original operation with the
  77718. // same request ID was received, and if so, will ignore the second
  77719. // request. This prevents clients from accidentally creating duplicate
  77720. // commitments.
  77721. //
  77722. // The request ID must be a valid UUID with the exception that zero UUID
  77723. // is not supported (00000000-0000-0000-0000-000000000000).
  77724. func (c *NodeGroupsInsertCall) RequestId(requestId string) *NodeGroupsInsertCall {
  77725. c.urlParams_.Set("requestId", requestId)
  77726. return c
  77727. }
  77728. // Fields allows partial responses to be retrieved. See
  77729. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  77730. // for more information.
  77731. func (c *NodeGroupsInsertCall) Fields(s ...googleapi.Field) *NodeGroupsInsertCall {
  77732. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  77733. return c
  77734. }
  77735. // Context sets the context to be used in this call's Do method. Any
  77736. // pending HTTP request will be aborted if the provided context is
  77737. // canceled.
  77738. func (c *NodeGroupsInsertCall) Context(ctx context.Context) *NodeGroupsInsertCall {
  77739. c.ctx_ = ctx
  77740. return c
  77741. }
  77742. // Header returns an http.Header that can be modified by the caller to
  77743. // add HTTP headers to the request.
  77744. func (c *NodeGroupsInsertCall) Header() http.Header {
  77745. if c.header_ == nil {
  77746. c.header_ = make(http.Header)
  77747. }
  77748. return c.header_
  77749. }
  77750. func (c *NodeGroupsInsertCall) doRequest(alt string) (*http.Response, error) {
  77751. reqHeaders := make(http.Header)
  77752. for k, v := range c.header_ {
  77753. reqHeaders[k] = v
  77754. }
  77755. reqHeaders.Set("User-Agent", c.s.userAgent())
  77756. var body io.Reader = nil
  77757. body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroup)
  77758. if err != nil {
  77759. return nil, err
  77760. }
  77761. reqHeaders.Set("Content-Type", "application/json")
  77762. c.urlParams_.Set("alt", alt)
  77763. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups")
  77764. urls += "?" + c.urlParams_.Encode()
  77765. req, _ := http.NewRequest("POST", urls, body)
  77766. req.Header = reqHeaders
  77767. googleapi.Expand(req.URL, map[string]string{
  77768. "project": c.project,
  77769. "zone": c.zone,
  77770. })
  77771. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  77772. }
  77773. // Do executes the "compute.nodeGroups.insert" call.
  77774. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  77775. // status code is an error. Response headers are in either
  77776. // *Operation.ServerResponse.Header or (if a response was returned at
  77777. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  77778. // to check whether the returned error was because
  77779. // http.StatusNotModified was returned.
  77780. func (c *NodeGroupsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  77781. gensupport.SetOptions(c.urlParams_, opts...)
  77782. res, err := c.doRequest("json")
  77783. if res != nil && res.StatusCode == http.StatusNotModified {
  77784. if res.Body != nil {
  77785. res.Body.Close()
  77786. }
  77787. return nil, &googleapi.Error{
  77788. Code: res.StatusCode,
  77789. Header: res.Header,
  77790. }
  77791. }
  77792. if err != nil {
  77793. return nil, err
  77794. }
  77795. defer googleapi.CloseBody(res)
  77796. if err := googleapi.CheckResponse(res); err != nil {
  77797. return nil, err
  77798. }
  77799. ret := &Operation{
  77800. ServerResponse: googleapi.ServerResponse{
  77801. Header: res.Header,
  77802. HTTPStatusCode: res.StatusCode,
  77803. },
  77804. }
  77805. target := &ret
  77806. if err := gensupport.DecodeResponse(target, res); err != nil {
  77807. return nil, err
  77808. }
  77809. return ret, nil
  77810. // {
  77811. // "description": "Creates a NodeGroup resource in the specified project using the data included in the request.",
  77812. // "httpMethod": "POST",
  77813. // "id": "compute.nodeGroups.insert",
  77814. // "parameterOrder": [
  77815. // "project",
  77816. // "zone",
  77817. // "initialNodeCount"
  77818. // ],
  77819. // "parameters": {
  77820. // "initialNodeCount": {
  77821. // "description": "Initial count of nodes in the node group.",
  77822. // "format": "int32",
  77823. // "location": "query",
  77824. // "required": true,
  77825. // "type": "integer"
  77826. // },
  77827. // "project": {
  77828. // "description": "Project ID for this request.",
  77829. // "location": "path",
  77830. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  77831. // "required": true,
  77832. // "type": "string"
  77833. // },
  77834. // "requestId": {
  77835. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  77836. // "location": "query",
  77837. // "type": "string"
  77838. // },
  77839. // "zone": {
  77840. // "description": "The name of the zone for this request.",
  77841. // "location": "path",
  77842. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  77843. // "required": true,
  77844. // "type": "string"
  77845. // }
  77846. // },
  77847. // "path": "{project}/zones/{zone}/nodeGroups",
  77848. // "request": {
  77849. // "$ref": "NodeGroup"
  77850. // },
  77851. // "response": {
  77852. // "$ref": "Operation"
  77853. // },
  77854. // "scopes": [
  77855. // "https://www.googleapis.com/auth/cloud-platform",
  77856. // "https://www.googleapis.com/auth/compute"
  77857. // ]
  77858. // }
  77859. }
  77860. // method id "compute.nodeGroups.list":
  77861. type NodeGroupsListCall struct {
  77862. s *Service
  77863. project string
  77864. zone string
  77865. urlParams_ gensupport.URLParams
  77866. ifNoneMatch_ string
  77867. ctx_ context.Context
  77868. header_ http.Header
  77869. }
  77870. // List: Retrieves a list of node groups available to the specified
  77871. // project.
  77872. func (r *NodeGroupsService) List(project string, zone string) *NodeGroupsListCall {
  77873. c := &NodeGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  77874. c.project = project
  77875. c.zone = zone
  77876. return c
  77877. }
  77878. // Filter sets the optional parameter "filter": A filter expression that
  77879. // filters resources listed in the response. The expression must specify
  77880. // the field name, a comparison operator, and the value that you want to
  77881. // use for filtering. The value must be a string, a number, or a
  77882. // boolean. The comparison operator must be either =, !=, >, or <.
  77883. //
  77884. // For example, if you are filtering Compute Engine instances, you can
  77885. // exclude instances named example-instance by specifying name !=
  77886. // example-instance.
  77887. //
  77888. // You can also filter nested fields. For example, you could specify
  77889. // scheduling.automaticRestart = false to include instances only if they
  77890. // are not scheduled for automatic restarts. You can use filtering on
  77891. // nested fields to filter based on resource labels.
  77892. //
  77893. // To filter on multiple expressions, provide each separate expression
  77894. // within parentheses. For example, (scheduling.automaticRestart = true)
  77895. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  77896. // AND expression. However, you can include AND and OR expressions
  77897. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  77898. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  77899. // true).
  77900. func (c *NodeGroupsListCall) Filter(filter string) *NodeGroupsListCall {
  77901. c.urlParams_.Set("filter", filter)
  77902. return c
  77903. }
  77904. // MaxResults sets the optional parameter "maxResults": The maximum
  77905. // number of results per page that should be returned. If the number of
  77906. // available results is larger than maxResults, Compute Engine returns a
  77907. // nextPageToken that can be used to get the next page of results in
  77908. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  77909. // (Default: 500)
  77910. func (c *NodeGroupsListCall) MaxResults(maxResults int64) *NodeGroupsListCall {
  77911. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  77912. return c
  77913. }
  77914. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  77915. // a certain order. By default, results are returned in alphanumerical
  77916. // order based on the resource name.
  77917. //
  77918. // You can also sort results in descending order based on the creation
  77919. // timestamp using orderBy="creationTimestamp desc". This sorts results
  77920. // based on the creationTimestamp field in reverse chronological order
  77921. // (newest result first). Use this to sort resources like operations so
  77922. // that the newest operation is returned first.
  77923. //
  77924. // Currently, only sorting by name or creationTimestamp desc is
  77925. // supported.
  77926. func (c *NodeGroupsListCall) OrderBy(orderBy string) *NodeGroupsListCall {
  77927. c.urlParams_.Set("orderBy", orderBy)
  77928. return c
  77929. }
  77930. // PageToken sets the optional parameter "pageToken": Specifies a page
  77931. // token to use. Set pageToken to the nextPageToken returned by a
  77932. // previous list request to get the next page of results.
  77933. func (c *NodeGroupsListCall) PageToken(pageToken string) *NodeGroupsListCall {
  77934. c.urlParams_.Set("pageToken", pageToken)
  77935. return c
  77936. }
  77937. // Fields allows partial responses to be retrieved. See
  77938. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  77939. // for more information.
  77940. func (c *NodeGroupsListCall) Fields(s ...googleapi.Field) *NodeGroupsListCall {
  77941. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  77942. return c
  77943. }
  77944. // IfNoneMatch sets the optional parameter which makes the operation
  77945. // fail if the object's ETag matches the given value. This is useful for
  77946. // getting updates only after the object has changed since the last
  77947. // request. Use googleapi.IsNotModified to check whether the response
  77948. // error from Do is the result of In-None-Match.
  77949. func (c *NodeGroupsListCall) IfNoneMatch(entityTag string) *NodeGroupsListCall {
  77950. c.ifNoneMatch_ = entityTag
  77951. return c
  77952. }
  77953. // Context sets the context to be used in this call's Do method. Any
  77954. // pending HTTP request will be aborted if the provided context is
  77955. // canceled.
  77956. func (c *NodeGroupsListCall) Context(ctx context.Context) *NodeGroupsListCall {
  77957. c.ctx_ = ctx
  77958. return c
  77959. }
  77960. // Header returns an http.Header that can be modified by the caller to
  77961. // add HTTP headers to the request.
  77962. func (c *NodeGroupsListCall) Header() http.Header {
  77963. if c.header_ == nil {
  77964. c.header_ = make(http.Header)
  77965. }
  77966. return c.header_
  77967. }
  77968. func (c *NodeGroupsListCall) doRequest(alt string) (*http.Response, error) {
  77969. reqHeaders := make(http.Header)
  77970. for k, v := range c.header_ {
  77971. reqHeaders[k] = v
  77972. }
  77973. reqHeaders.Set("User-Agent", c.s.userAgent())
  77974. if c.ifNoneMatch_ != "" {
  77975. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  77976. }
  77977. var body io.Reader = nil
  77978. c.urlParams_.Set("alt", alt)
  77979. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups")
  77980. urls += "?" + c.urlParams_.Encode()
  77981. req, _ := http.NewRequest("GET", urls, body)
  77982. req.Header = reqHeaders
  77983. googleapi.Expand(req.URL, map[string]string{
  77984. "project": c.project,
  77985. "zone": c.zone,
  77986. })
  77987. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  77988. }
  77989. // Do executes the "compute.nodeGroups.list" call.
  77990. // Exactly one of *NodeGroupList or error will be non-nil. Any non-2xx
  77991. // status code is an error. Response headers are in either
  77992. // *NodeGroupList.ServerResponse.Header or (if a response was returned
  77993. // at all) in error.(*googleapi.Error).Header. Use
  77994. // googleapi.IsNotModified to check whether the returned error was
  77995. // because http.StatusNotModified was returned.
  77996. func (c *NodeGroupsListCall) Do(opts ...googleapi.CallOption) (*NodeGroupList, error) {
  77997. gensupport.SetOptions(c.urlParams_, opts...)
  77998. res, err := c.doRequest("json")
  77999. if res != nil && res.StatusCode == http.StatusNotModified {
  78000. if res.Body != nil {
  78001. res.Body.Close()
  78002. }
  78003. return nil, &googleapi.Error{
  78004. Code: res.StatusCode,
  78005. Header: res.Header,
  78006. }
  78007. }
  78008. if err != nil {
  78009. return nil, err
  78010. }
  78011. defer googleapi.CloseBody(res)
  78012. if err := googleapi.CheckResponse(res); err != nil {
  78013. return nil, err
  78014. }
  78015. ret := &NodeGroupList{
  78016. ServerResponse: googleapi.ServerResponse{
  78017. Header: res.Header,
  78018. HTTPStatusCode: res.StatusCode,
  78019. },
  78020. }
  78021. target := &ret
  78022. if err := gensupport.DecodeResponse(target, res); err != nil {
  78023. return nil, err
  78024. }
  78025. return ret, nil
  78026. // {
  78027. // "description": "Retrieves a list of node groups available to the specified project.",
  78028. // "httpMethod": "GET",
  78029. // "id": "compute.nodeGroups.list",
  78030. // "parameterOrder": [
  78031. // "project",
  78032. // "zone"
  78033. // ],
  78034. // "parameters": {
  78035. // "filter": {
  78036. // "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).",
  78037. // "location": "query",
  78038. // "type": "string"
  78039. // },
  78040. // "maxResults": {
  78041. // "default": "500",
  78042. // "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)",
  78043. // "format": "uint32",
  78044. // "location": "query",
  78045. // "minimum": "0",
  78046. // "type": "integer"
  78047. // },
  78048. // "orderBy": {
  78049. // "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.",
  78050. // "location": "query",
  78051. // "type": "string"
  78052. // },
  78053. // "pageToken": {
  78054. // "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.",
  78055. // "location": "query",
  78056. // "type": "string"
  78057. // },
  78058. // "project": {
  78059. // "description": "Project ID for this request.",
  78060. // "location": "path",
  78061. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  78062. // "required": true,
  78063. // "type": "string"
  78064. // },
  78065. // "zone": {
  78066. // "description": "The name of the zone for this request.",
  78067. // "location": "path",
  78068. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  78069. // "required": true,
  78070. // "type": "string"
  78071. // }
  78072. // },
  78073. // "path": "{project}/zones/{zone}/nodeGroups",
  78074. // "response": {
  78075. // "$ref": "NodeGroupList"
  78076. // },
  78077. // "scopes": [
  78078. // "https://www.googleapis.com/auth/cloud-platform",
  78079. // "https://www.googleapis.com/auth/compute",
  78080. // "https://www.googleapis.com/auth/compute.readonly"
  78081. // ]
  78082. // }
  78083. }
  78084. // Pages invokes f for each page of results.
  78085. // A non-nil error returned from f will halt the iteration.
  78086. // The provided context supersedes any context provided to the Context method.
  78087. func (c *NodeGroupsListCall) Pages(ctx context.Context, f func(*NodeGroupList) error) error {
  78088. c.ctx_ = ctx
  78089. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  78090. for {
  78091. x, err := c.Do()
  78092. if err != nil {
  78093. return err
  78094. }
  78095. if err := f(x); err != nil {
  78096. return err
  78097. }
  78098. if x.NextPageToken == "" {
  78099. return nil
  78100. }
  78101. c.PageToken(x.NextPageToken)
  78102. }
  78103. }
  78104. // method id "compute.nodeGroups.setIamPolicy":
  78105. type NodeGroupsSetIamPolicyCall struct {
  78106. s *Service
  78107. project string
  78108. zone string
  78109. resource string
  78110. zonesetpolicyrequest *ZoneSetPolicyRequest
  78111. urlParams_ gensupport.URLParams
  78112. ctx_ context.Context
  78113. header_ http.Header
  78114. }
  78115. // SetIamPolicy: Sets the access control policy on the specified
  78116. // resource. Replaces any existing policy.
  78117. func (r *NodeGroupsService) SetIamPolicy(project string, zone string, resource string, zonesetpolicyrequest *ZoneSetPolicyRequest) *NodeGroupsSetIamPolicyCall {
  78118. c := &NodeGroupsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  78119. c.project = project
  78120. c.zone = zone
  78121. c.resource = resource
  78122. c.zonesetpolicyrequest = zonesetpolicyrequest
  78123. return c
  78124. }
  78125. // Fields allows partial responses to be retrieved. See
  78126. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  78127. // for more information.
  78128. func (c *NodeGroupsSetIamPolicyCall) Fields(s ...googleapi.Field) *NodeGroupsSetIamPolicyCall {
  78129. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  78130. return c
  78131. }
  78132. // Context sets the context to be used in this call's Do method. Any
  78133. // pending HTTP request will be aborted if the provided context is
  78134. // canceled.
  78135. func (c *NodeGroupsSetIamPolicyCall) Context(ctx context.Context) *NodeGroupsSetIamPolicyCall {
  78136. c.ctx_ = ctx
  78137. return c
  78138. }
  78139. // Header returns an http.Header that can be modified by the caller to
  78140. // add HTTP headers to the request.
  78141. func (c *NodeGroupsSetIamPolicyCall) Header() http.Header {
  78142. if c.header_ == nil {
  78143. c.header_ = make(http.Header)
  78144. }
  78145. return c.header_
  78146. }
  78147. func (c *NodeGroupsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  78148. reqHeaders := make(http.Header)
  78149. for k, v := range c.header_ {
  78150. reqHeaders[k] = v
  78151. }
  78152. reqHeaders.Set("User-Agent", c.s.userAgent())
  78153. var body io.Reader = nil
  78154. body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetpolicyrequest)
  78155. if err != nil {
  78156. return nil, err
  78157. }
  78158. reqHeaders.Set("Content-Type", "application/json")
  78159. c.urlParams_.Set("alt", alt)
  78160. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{resource}/setIamPolicy")
  78161. urls += "?" + c.urlParams_.Encode()
  78162. req, _ := http.NewRequest("POST", urls, body)
  78163. req.Header = reqHeaders
  78164. googleapi.Expand(req.URL, map[string]string{
  78165. "project": c.project,
  78166. "zone": c.zone,
  78167. "resource": c.resource,
  78168. })
  78169. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  78170. }
  78171. // Do executes the "compute.nodeGroups.setIamPolicy" call.
  78172. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  78173. // code is an error. Response headers are in either
  78174. // *Policy.ServerResponse.Header or (if a response was returned at all)
  78175. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  78176. // check whether the returned error was because http.StatusNotModified
  78177. // was returned.
  78178. func (c *NodeGroupsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  78179. gensupport.SetOptions(c.urlParams_, opts...)
  78180. res, err := c.doRequest("json")
  78181. if res != nil && res.StatusCode == http.StatusNotModified {
  78182. if res.Body != nil {
  78183. res.Body.Close()
  78184. }
  78185. return nil, &googleapi.Error{
  78186. Code: res.StatusCode,
  78187. Header: res.Header,
  78188. }
  78189. }
  78190. if err != nil {
  78191. return nil, err
  78192. }
  78193. defer googleapi.CloseBody(res)
  78194. if err := googleapi.CheckResponse(res); err != nil {
  78195. return nil, err
  78196. }
  78197. ret := &Policy{
  78198. ServerResponse: googleapi.ServerResponse{
  78199. Header: res.Header,
  78200. HTTPStatusCode: res.StatusCode,
  78201. },
  78202. }
  78203. target := &ret
  78204. if err := gensupport.DecodeResponse(target, res); err != nil {
  78205. return nil, err
  78206. }
  78207. return ret, nil
  78208. // {
  78209. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  78210. // "httpMethod": "POST",
  78211. // "id": "compute.nodeGroups.setIamPolicy",
  78212. // "parameterOrder": [
  78213. // "project",
  78214. // "zone",
  78215. // "resource"
  78216. // ],
  78217. // "parameters": {
  78218. // "project": {
  78219. // "description": "Project ID for this request.",
  78220. // "location": "path",
  78221. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  78222. // "required": true,
  78223. // "type": "string"
  78224. // },
  78225. // "resource": {
  78226. // "description": "Name of the resource for this request.",
  78227. // "location": "path",
  78228. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  78229. // "required": true,
  78230. // "type": "string"
  78231. // },
  78232. // "zone": {
  78233. // "description": "The name of the zone for this request.",
  78234. // "location": "path",
  78235. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  78236. // "required": true,
  78237. // "type": "string"
  78238. // }
  78239. // },
  78240. // "path": "{project}/zones/{zone}/nodeGroups/{resource}/setIamPolicy",
  78241. // "request": {
  78242. // "$ref": "ZoneSetPolicyRequest"
  78243. // },
  78244. // "response": {
  78245. // "$ref": "Policy"
  78246. // },
  78247. // "scopes": [
  78248. // "https://www.googleapis.com/auth/cloud-platform",
  78249. // "https://www.googleapis.com/auth/compute"
  78250. // ]
  78251. // }
  78252. }
  78253. // method id "compute.nodeGroups.setNodeTemplate":
  78254. type NodeGroupsSetNodeTemplateCall struct {
  78255. s *Service
  78256. project string
  78257. zone string
  78258. nodeGroup string
  78259. nodegroupssetnodetemplaterequest *NodeGroupsSetNodeTemplateRequest
  78260. urlParams_ gensupport.URLParams
  78261. ctx_ context.Context
  78262. header_ http.Header
  78263. }
  78264. // SetNodeTemplate: Updates the node template of the node group.
  78265. func (r *NodeGroupsService) SetNodeTemplate(project string, zone string, nodeGroup string, nodegroupssetnodetemplaterequest *NodeGroupsSetNodeTemplateRequest) *NodeGroupsSetNodeTemplateCall {
  78266. c := &NodeGroupsSetNodeTemplateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  78267. c.project = project
  78268. c.zone = zone
  78269. c.nodeGroup = nodeGroup
  78270. c.nodegroupssetnodetemplaterequest = nodegroupssetnodetemplaterequest
  78271. return c
  78272. }
  78273. // RequestId sets the optional parameter "requestId": An optional
  78274. // request ID to identify requests. Specify a unique request ID so that
  78275. // if you must retry your request, the server will know to ignore the
  78276. // request if it has already been completed.
  78277. //
  78278. // For example, consider a situation where you make an initial request
  78279. // and the request times out. If you make the request again with the
  78280. // same request ID, the server can check if original operation with the
  78281. // same request ID was received, and if so, will ignore the second
  78282. // request. This prevents clients from accidentally creating duplicate
  78283. // commitments.
  78284. //
  78285. // The request ID must be a valid UUID with the exception that zero UUID
  78286. // is not supported (00000000-0000-0000-0000-000000000000).
  78287. func (c *NodeGroupsSetNodeTemplateCall) RequestId(requestId string) *NodeGroupsSetNodeTemplateCall {
  78288. c.urlParams_.Set("requestId", requestId)
  78289. return c
  78290. }
  78291. // Fields allows partial responses to be retrieved. See
  78292. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  78293. // for more information.
  78294. func (c *NodeGroupsSetNodeTemplateCall) Fields(s ...googleapi.Field) *NodeGroupsSetNodeTemplateCall {
  78295. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  78296. return c
  78297. }
  78298. // Context sets the context to be used in this call's Do method. Any
  78299. // pending HTTP request will be aborted if the provided context is
  78300. // canceled.
  78301. func (c *NodeGroupsSetNodeTemplateCall) Context(ctx context.Context) *NodeGroupsSetNodeTemplateCall {
  78302. c.ctx_ = ctx
  78303. return c
  78304. }
  78305. // Header returns an http.Header that can be modified by the caller to
  78306. // add HTTP headers to the request.
  78307. func (c *NodeGroupsSetNodeTemplateCall) Header() http.Header {
  78308. if c.header_ == nil {
  78309. c.header_ = make(http.Header)
  78310. }
  78311. return c.header_
  78312. }
  78313. func (c *NodeGroupsSetNodeTemplateCall) doRequest(alt string) (*http.Response, error) {
  78314. reqHeaders := make(http.Header)
  78315. for k, v := range c.header_ {
  78316. reqHeaders[k] = v
  78317. }
  78318. reqHeaders.Set("User-Agent", c.s.userAgent())
  78319. var body io.Reader = nil
  78320. body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroupssetnodetemplaterequest)
  78321. if err != nil {
  78322. return nil, err
  78323. }
  78324. reqHeaders.Set("Content-Type", "application/json")
  78325. c.urlParams_.Set("alt", alt)
  78326. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{nodeGroup}/setNodeTemplate")
  78327. urls += "?" + c.urlParams_.Encode()
  78328. req, _ := http.NewRequest("POST", urls, body)
  78329. req.Header = reqHeaders
  78330. googleapi.Expand(req.URL, map[string]string{
  78331. "project": c.project,
  78332. "zone": c.zone,
  78333. "nodeGroup": c.nodeGroup,
  78334. })
  78335. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  78336. }
  78337. // Do executes the "compute.nodeGroups.setNodeTemplate" call.
  78338. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  78339. // status code is an error. Response headers are in either
  78340. // *Operation.ServerResponse.Header or (if a response was returned at
  78341. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  78342. // to check whether the returned error was because
  78343. // http.StatusNotModified was returned.
  78344. func (c *NodeGroupsSetNodeTemplateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  78345. gensupport.SetOptions(c.urlParams_, opts...)
  78346. res, err := c.doRequest("json")
  78347. if res != nil && res.StatusCode == http.StatusNotModified {
  78348. if res.Body != nil {
  78349. res.Body.Close()
  78350. }
  78351. return nil, &googleapi.Error{
  78352. Code: res.StatusCode,
  78353. Header: res.Header,
  78354. }
  78355. }
  78356. if err != nil {
  78357. return nil, err
  78358. }
  78359. defer googleapi.CloseBody(res)
  78360. if err := googleapi.CheckResponse(res); err != nil {
  78361. return nil, err
  78362. }
  78363. ret := &Operation{
  78364. ServerResponse: googleapi.ServerResponse{
  78365. Header: res.Header,
  78366. HTTPStatusCode: res.StatusCode,
  78367. },
  78368. }
  78369. target := &ret
  78370. if err := gensupport.DecodeResponse(target, res); err != nil {
  78371. return nil, err
  78372. }
  78373. return ret, nil
  78374. // {
  78375. // "description": "Updates the node template of the node group.",
  78376. // "httpMethod": "POST",
  78377. // "id": "compute.nodeGroups.setNodeTemplate",
  78378. // "parameterOrder": [
  78379. // "project",
  78380. // "zone",
  78381. // "nodeGroup"
  78382. // ],
  78383. // "parameters": {
  78384. // "nodeGroup": {
  78385. // "description": "Name of the NodeGroup resource to delete.",
  78386. // "location": "path",
  78387. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  78388. // "required": true,
  78389. // "type": "string"
  78390. // },
  78391. // "project": {
  78392. // "description": "Project ID for this request.",
  78393. // "location": "path",
  78394. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  78395. // "required": true,
  78396. // "type": "string"
  78397. // },
  78398. // "requestId": {
  78399. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  78400. // "location": "query",
  78401. // "type": "string"
  78402. // },
  78403. // "zone": {
  78404. // "description": "The name of the zone for this request.",
  78405. // "location": "path",
  78406. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  78407. // "required": true,
  78408. // "type": "string"
  78409. // }
  78410. // },
  78411. // "path": "{project}/zones/{zone}/nodeGroups/{nodeGroup}/setNodeTemplate",
  78412. // "request": {
  78413. // "$ref": "NodeGroupsSetNodeTemplateRequest"
  78414. // },
  78415. // "response": {
  78416. // "$ref": "Operation"
  78417. // },
  78418. // "scopes": [
  78419. // "https://www.googleapis.com/auth/cloud-platform",
  78420. // "https://www.googleapis.com/auth/compute"
  78421. // ]
  78422. // }
  78423. }
  78424. // method id "compute.nodeGroups.testIamPermissions":
  78425. type NodeGroupsTestIamPermissionsCall struct {
  78426. s *Service
  78427. project string
  78428. zone string
  78429. resource string
  78430. testpermissionsrequest *TestPermissionsRequest
  78431. urlParams_ gensupport.URLParams
  78432. ctx_ context.Context
  78433. header_ http.Header
  78434. }
  78435. // TestIamPermissions: Returns permissions that a caller has on the
  78436. // specified resource.
  78437. func (r *NodeGroupsService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *NodeGroupsTestIamPermissionsCall {
  78438. c := &NodeGroupsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  78439. c.project = project
  78440. c.zone = zone
  78441. c.resource = resource
  78442. c.testpermissionsrequest = testpermissionsrequest
  78443. return c
  78444. }
  78445. // Fields allows partial responses to be retrieved. See
  78446. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  78447. // for more information.
  78448. func (c *NodeGroupsTestIamPermissionsCall) Fields(s ...googleapi.Field) *NodeGroupsTestIamPermissionsCall {
  78449. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  78450. return c
  78451. }
  78452. // Context sets the context to be used in this call's Do method. Any
  78453. // pending HTTP request will be aborted if the provided context is
  78454. // canceled.
  78455. func (c *NodeGroupsTestIamPermissionsCall) Context(ctx context.Context) *NodeGroupsTestIamPermissionsCall {
  78456. c.ctx_ = ctx
  78457. return c
  78458. }
  78459. // Header returns an http.Header that can be modified by the caller to
  78460. // add HTTP headers to the request.
  78461. func (c *NodeGroupsTestIamPermissionsCall) Header() http.Header {
  78462. if c.header_ == nil {
  78463. c.header_ = make(http.Header)
  78464. }
  78465. return c.header_
  78466. }
  78467. func (c *NodeGroupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  78468. reqHeaders := make(http.Header)
  78469. for k, v := range c.header_ {
  78470. reqHeaders[k] = v
  78471. }
  78472. reqHeaders.Set("User-Agent", c.s.userAgent())
  78473. var body io.Reader = nil
  78474. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  78475. if err != nil {
  78476. return nil, err
  78477. }
  78478. reqHeaders.Set("Content-Type", "application/json")
  78479. c.urlParams_.Set("alt", alt)
  78480. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{resource}/testIamPermissions")
  78481. urls += "?" + c.urlParams_.Encode()
  78482. req, _ := http.NewRequest("POST", urls, body)
  78483. req.Header = reqHeaders
  78484. googleapi.Expand(req.URL, map[string]string{
  78485. "project": c.project,
  78486. "zone": c.zone,
  78487. "resource": c.resource,
  78488. })
  78489. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  78490. }
  78491. // Do executes the "compute.nodeGroups.testIamPermissions" call.
  78492. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  78493. // non-2xx status code is an error. Response headers are in either
  78494. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  78495. // returned at all) in error.(*googleapi.Error).Header. Use
  78496. // googleapi.IsNotModified to check whether the returned error was
  78497. // because http.StatusNotModified was returned.
  78498. func (c *NodeGroupsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  78499. gensupport.SetOptions(c.urlParams_, opts...)
  78500. res, err := c.doRequest("json")
  78501. if res != nil && res.StatusCode == http.StatusNotModified {
  78502. if res.Body != nil {
  78503. res.Body.Close()
  78504. }
  78505. return nil, &googleapi.Error{
  78506. Code: res.StatusCode,
  78507. Header: res.Header,
  78508. }
  78509. }
  78510. if err != nil {
  78511. return nil, err
  78512. }
  78513. defer googleapi.CloseBody(res)
  78514. if err := googleapi.CheckResponse(res); err != nil {
  78515. return nil, err
  78516. }
  78517. ret := &TestPermissionsResponse{
  78518. ServerResponse: googleapi.ServerResponse{
  78519. Header: res.Header,
  78520. HTTPStatusCode: res.StatusCode,
  78521. },
  78522. }
  78523. target := &ret
  78524. if err := gensupport.DecodeResponse(target, res); err != nil {
  78525. return nil, err
  78526. }
  78527. return ret, nil
  78528. // {
  78529. // "description": "Returns permissions that a caller has on the specified resource.",
  78530. // "httpMethod": "POST",
  78531. // "id": "compute.nodeGroups.testIamPermissions",
  78532. // "parameterOrder": [
  78533. // "project",
  78534. // "zone",
  78535. // "resource"
  78536. // ],
  78537. // "parameters": {
  78538. // "project": {
  78539. // "description": "Project ID for this request.",
  78540. // "location": "path",
  78541. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  78542. // "required": true,
  78543. // "type": "string"
  78544. // },
  78545. // "resource": {
  78546. // "description": "Name of the resource for this request.",
  78547. // "location": "path",
  78548. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  78549. // "required": true,
  78550. // "type": "string"
  78551. // },
  78552. // "zone": {
  78553. // "description": "The name of the zone for this request.",
  78554. // "location": "path",
  78555. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  78556. // "required": true,
  78557. // "type": "string"
  78558. // }
  78559. // },
  78560. // "path": "{project}/zones/{zone}/nodeGroups/{resource}/testIamPermissions",
  78561. // "request": {
  78562. // "$ref": "TestPermissionsRequest"
  78563. // },
  78564. // "response": {
  78565. // "$ref": "TestPermissionsResponse"
  78566. // },
  78567. // "scopes": [
  78568. // "https://www.googleapis.com/auth/cloud-platform",
  78569. // "https://www.googleapis.com/auth/compute",
  78570. // "https://www.googleapis.com/auth/compute.readonly"
  78571. // ]
  78572. // }
  78573. }
  78574. // method id "compute.nodeTemplates.aggregatedList":
  78575. type NodeTemplatesAggregatedListCall struct {
  78576. s *Service
  78577. project string
  78578. urlParams_ gensupport.URLParams
  78579. ifNoneMatch_ string
  78580. ctx_ context.Context
  78581. header_ http.Header
  78582. }
  78583. // AggregatedList: Retrieves an aggregated list of node templates.
  78584. func (r *NodeTemplatesService) AggregatedList(project string) *NodeTemplatesAggregatedListCall {
  78585. c := &NodeTemplatesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  78586. c.project = project
  78587. return c
  78588. }
  78589. // Filter sets the optional parameter "filter": A filter expression that
  78590. // filters resources listed in the response. The expression must specify
  78591. // the field name, a comparison operator, and the value that you want to
  78592. // use for filtering. The value must be a string, a number, or a
  78593. // boolean. The comparison operator must be either =, !=, >, or <.
  78594. //
  78595. // For example, if you are filtering Compute Engine instances, you can
  78596. // exclude instances named example-instance by specifying name !=
  78597. // example-instance.
  78598. //
  78599. // You can also filter nested fields. For example, you could specify
  78600. // scheduling.automaticRestart = false to include instances only if they
  78601. // are not scheduled for automatic restarts. You can use filtering on
  78602. // nested fields to filter based on resource labels.
  78603. //
  78604. // To filter on multiple expressions, provide each separate expression
  78605. // within parentheses. For example, (scheduling.automaticRestart = true)
  78606. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  78607. // AND expression. However, you can include AND and OR expressions
  78608. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  78609. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  78610. // true).
  78611. func (c *NodeTemplatesAggregatedListCall) Filter(filter string) *NodeTemplatesAggregatedListCall {
  78612. c.urlParams_.Set("filter", filter)
  78613. return c
  78614. }
  78615. // MaxResults sets the optional parameter "maxResults": The maximum
  78616. // number of results per page that should be returned. If the number of
  78617. // available results is larger than maxResults, Compute Engine returns a
  78618. // nextPageToken that can be used to get the next page of results in
  78619. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  78620. // (Default: 500)
  78621. func (c *NodeTemplatesAggregatedListCall) MaxResults(maxResults int64) *NodeTemplatesAggregatedListCall {
  78622. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  78623. return c
  78624. }
  78625. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  78626. // a certain order. By default, results are returned in alphanumerical
  78627. // order based on the resource name.
  78628. //
  78629. // You can also sort results in descending order based on the creation
  78630. // timestamp using orderBy="creationTimestamp desc". This sorts results
  78631. // based on the creationTimestamp field in reverse chronological order
  78632. // (newest result first). Use this to sort resources like operations so
  78633. // that the newest operation is returned first.
  78634. //
  78635. // Currently, only sorting by name or creationTimestamp desc is
  78636. // supported.
  78637. func (c *NodeTemplatesAggregatedListCall) OrderBy(orderBy string) *NodeTemplatesAggregatedListCall {
  78638. c.urlParams_.Set("orderBy", orderBy)
  78639. return c
  78640. }
  78641. // PageToken sets the optional parameter "pageToken": Specifies a page
  78642. // token to use. Set pageToken to the nextPageToken returned by a
  78643. // previous list request to get the next page of results.
  78644. func (c *NodeTemplatesAggregatedListCall) PageToken(pageToken string) *NodeTemplatesAggregatedListCall {
  78645. c.urlParams_.Set("pageToken", pageToken)
  78646. return c
  78647. }
  78648. // Fields allows partial responses to be retrieved. See
  78649. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  78650. // for more information.
  78651. func (c *NodeTemplatesAggregatedListCall) Fields(s ...googleapi.Field) *NodeTemplatesAggregatedListCall {
  78652. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  78653. return c
  78654. }
  78655. // IfNoneMatch sets the optional parameter which makes the operation
  78656. // fail if the object's ETag matches the given value. This is useful for
  78657. // getting updates only after the object has changed since the last
  78658. // request. Use googleapi.IsNotModified to check whether the response
  78659. // error from Do is the result of In-None-Match.
  78660. func (c *NodeTemplatesAggregatedListCall) IfNoneMatch(entityTag string) *NodeTemplatesAggregatedListCall {
  78661. c.ifNoneMatch_ = entityTag
  78662. return c
  78663. }
  78664. // Context sets the context to be used in this call's Do method. Any
  78665. // pending HTTP request will be aborted if the provided context is
  78666. // canceled.
  78667. func (c *NodeTemplatesAggregatedListCall) Context(ctx context.Context) *NodeTemplatesAggregatedListCall {
  78668. c.ctx_ = ctx
  78669. return c
  78670. }
  78671. // Header returns an http.Header that can be modified by the caller to
  78672. // add HTTP headers to the request.
  78673. func (c *NodeTemplatesAggregatedListCall) Header() http.Header {
  78674. if c.header_ == nil {
  78675. c.header_ = make(http.Header)
  78676. }
  78677. return c.header_
  78678. }
  78679. func (c *NodeTemplatesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  78680. reqHeaders := make(http.Header)
  78681. for k, v := range c.header_ {
  78682. reqHeaders[k] = v
  78683. }
  78684. reqHeaders.Set("User-Agent", c.s.userAgent())
  78685. if c.ifNoneMatch_ != "" {
  78686. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  78687. }
  78688. var body io.Reader = nil
  78689. c.urlParams_.Set("alt", alt)
  78690. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/nodeTemplates")
  78691. urls += "?" + c.urlParams_.Encode()
  78692. req, _ := http.NewRequest("GET", urls, body)
  78693. req.Header = reqHeaders
  78694. googleapi.Expand(req.URL, map[string]string{
  78695. "project": c.project,
  78696. })
  78697. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  78698. }
  78699. // Do executes the "compute.nodeTemplates.aggregatedList" call.
  78700. // Exactly one of *NodeTemplateAggregatedList or error will be non-nil.
  78701. // Any non-2xx status code is an error. Response headers are in either
  78702. // *NodeTemplateAggregatedList.ServerResponse.Header or (if a response
  78703. // was returned at all) in error.(*googleapi.Error).Header. Use
  78704. // googleapi.IsNotModified to check whether the returned error was
  78705. // because http.StatusNotModified was returned.
  78706. func (c *NodeTemplatesAggregatedListCall) Do(opts ...googleapi.CallOption) (*NodeTemplateAggregatedList, error) {
  78707. gensupport.SetOptions(c.urlParams_, opts...)
  78708. res, err := c.doRequest("json")
  78709. if res != nil && res.StatusCode == http.StatusNotModified {
  78710. if res.Body != nil {
  78711. res.Body.Close()
  78712. }
  78713. return nil, &googleapi.Error{
  78714. Code: res.StatusCode,
  78715. Header: res.Header,
  78716. }
  78717. }
  78718. if err != nil {
  78719. return nil, err
  78720. }
  78721. defer googleapi.CloseBody(res)
  78722. if err := googleapi.CheckResponse(res); err != nil {
  78723. return nil, err
  78724. }
  78725. ret := &NodeTemplateAggregatedList{
  78726. ServerResponse: googleapi.ServerResponse{
  78727. Header: res.Header,
  78728. HTTPStatusCode: res.StatusCode,
  78729. },
  78730. }
  78731. target := &ret
  78732. if err := gensupport.DecodeResponse(target, res); err != nil {
  78733. return nil, err
  78734. }
  78735. return ret, nil
  78736. // {
  78737. // "description": "Retrieves an aggregated list of node templates.",
  78738. // "httpMethod": "GET",
  78739. // "id": "compute.nodeTemplates.aggregatedList",
  78740. // "parameterOrder": [
  78741. // "project"
  78742. // ],
  78743. // "parameters": {
  78744. // "filter": {
  78745. // "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).",
  78746. // "location": "query",
  78747. // "type": "string"
  78748. // },
  78749. // "maxResults": {
  78750. // "default": "500",
  78751. // "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)",
  78752. // "format": "uint32",
  78753. // "location": "query",
  78754. // "minimum": "0",
  78755. // "type": "integer"
  78756. // },
  78757. // "orderBy": {
  78758. // "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.",
  78759. // "location": "query",
  78760. // "type": "string"
  78761. // },
  78762. // "pageToken": {
  78763. // "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.",
  78764. // "location": "query",
  78765. // "type": "string"
  78766. // },
  78767. // "project": {
  78768. // "description": "Project ID for this request.",
  78769. // "location": "path",
  78770. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  78771. // "required": true,
  78772. // "type": "string"
  78773. // }
  78774. // },
  78775. // "path": "{project}/aggregated/nodeTemplates",
  78776. // "response": {
  78777. // "$ref": "NodeTemplateAggregatedList"
  78778. // },
  78779. // "scopes": [
  78780. // "https://www.googleapis.com/auth/cloud-platform",
  78781. // "https://www.googleapis.com/auth/compute",
  78782. // "https://www.googleapis.com/auth/compute.readonly"
  78783. // ]
  78784. // }
  78785. }
  78786. // Pages invokes f for each page of results.
  78787. // A non-nil error returned from f will halt the iteration.
  78788. // The provided context supersedes any context provided to the Context method.
  78789. func (c *NodeTemplatesAggregatedListCall) Pages(ctx context.Context, f func(*NodeTemplateAggregatedList) error) error {
  78790. c.ctx_ = ctx
  78791. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  78792. for {
  78793. x, err := c.Do()
  78794. if err != nil {
  78795. return err
  78796. }
  78797. if err := f(x); err != nil {
  78798. return err
  78799. }
  78800. if x.NextPageToken == "" {
  78801. return nil
  78802. }
  78803. c.PageToken(x.NextPageToken)
  78804. }
  78805. }
  78806. // method id "compute.nodeTemplates.delete":
  78807. type NodeTemplatesDeleteCall struct {
  78808. s *Service
  78809. project string
  78810. region string
  78811. nodeTemplate string
  78812. urlParams_ gensupport.URLParams
  78813. ctx_ context.Context
  78814. header_ http.Header
  78815. }
  78816. // Delete: Deletes the specified NodeTemplate resource.
  78817. func (r *NodeTemplatesService) Delete(project string, region string, nodeTemplate string) *NodeTemplatesDeleteCall {
  78818. c := &NodeTemplatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  78819. c.project = project
  78820. c.region = region
  78821. c.nodeTemplate = nodeTemplate
  78822. return c
  78823. }
  78824. // RequestId sets the optional parameter "requestId": An optional
  78825. // request ID to identify requests. Specify a unique request ID so that
  78826. // if you must retry your request, the server will know to ignore the
  78827. // request if it has already been completed.
  78828. //
  78829. // For example, consider a situation where you make an initial request
  78830. // and the request times out. If you make the request again with the
  78831. // same request ID, the server can check if original operation with the
  78832. // same request ID was received, and if so, will ignore the second
  78833. // request. This prevents clients from accidentally creating duplicate
  78834. // commitments.
  78835. //
  78836. // The request ID must be a valid UUID with the exception that zero UUID
  78837. // is not supported (00000000-0000-0000-0000-000000000000).
  78838. func (c *NodeTemplatesDeleteCall) RequestId(requestId string) *NodeTemplatesDeleteCall {
  78839. c.urlParams_.Set("requestId", requestId)
  78840. return c
  78841. }
  78842. // Fields allows partial responses to be retrieved. See
  78843. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  78844. // for more information.
  78845. func (c *NodeTemplatesDeleteCall) Fields(s ...googleapi.Field) *NodeTemplatesDeleteCall {
  78846. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  78847. return c
  78848. }
  78849. // Context sets the context to be used in this call's Do method. Any
  78850. // pending HTTP request will be aborted if the provided context is
  78851. // canceled.
  78852. func (c *NodeTemplatesDeleteCall) Context(ctx context.Context) *NodeTemplatesDeleteCall {
  78853. c.ctx_ = ctx
  78854. return c
  78855. }
  78856. // Header returns an http.Header that can be modified by the caller to
  78857. // add HTTP headers to the request.
  78858. func (c *NodeTemplatesDeleteCall) Header() http.Header {
  78859. if c.header_ == nil {
  78860. c.header_ = make(http.Header)
  78861. }
  78862. return c.header_
  78863. }
  78864. func (c *NodeTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) {
  78865. reqHeaders := make(http.Header)
  78866. for k, v := range c.header_ {
  78867. reqHeaders[k] = v
  78868. }
  78869. reqHeaders.Set("User-Agent", c.s.userAgent())
  78870. var body io.Reader = nil
  78871. c.urlParams_.Set("alt", alt)
  78872. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/nodeTemplates/{nodeTemplate}")
  78873. urls += "?" + c.urlParams_.Encode()
  78874. req, _ := http.NewRequest("DELETE", urls, body)
  78875. req.Header = reqHeaders
  78876. googleapi.Expand(req.URL, map[string]string{
  78877. "project": c.project,
  78878. "region": c.region,
  78879. "nodeTemplate": c.nodeTemplate,
  78880. })
  78881. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  78882. }
  78883. // Do executes the "compute.nodeTemplates.delete" call.
  78884. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  78885. // status code is an error. Response headers are in either
  78886. // *Operation.ServerResponse.Header or (if a response was returned at
  78887. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  78888. // to check whether the returned error was because
  78889. // http.StatusNotModified was returned.
  78890. func (c *NodeTemplatesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  78891. gensupport.SetOptions(c.urlParams_, opts...)
  78892. res, err := c.doRequest("json")
  78893. if res != nil && res.StatusCode == http.StatusNotModified {
  78894. if res.Body != nil {
  78895. res.Body.Close()
  78896. }
  78897. return nil, &googleapi.Error{
  78898. Code: res.StatusCode,
  78899. Header: res.Header,
  78900. }
  78901. }
  78902. if err != nil {
  78903. return nil, err
  78904. }
  78905. defer googleapi.CloseBody(res)
  78906. if err := googleapi.CheckResponse(res); err != nil {
  78907. return nil, err
  78908. }
  78909. ret := &Operation{
  78910. ServerResponse: googleapi.ServerResponse{
  78911. Header: res.Header,
  78912. HTTPStatusCode: res.StatusCode,
  78913. },
  78914. }
  78915. target := &ret
  78916. if err := gensupport.DecodeResponse(target, res); err != nil {
  78917. return nil, err
  78918. }
  78919. return ret, nil
  78920. // {
  78921. // "description": "Deletes the specified NodeTemplate resource.",
  78922. // "httpMethod": "DELETE",
  78923. // "id": "compute.nodeTemplates.delete",
  78924. // "parameterOrder": [
  78925. // "project",
  78926. // "region",
  78927. // "nodeTemplate"
  78928. // ],
  78929. // "parameters": {
  78930. // "nodeTemplate": {
  78931. // "description": "Name of the NodeTemplate resource to delete.",
  78932. // "location": "path",
  78933. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  78934. // "required": true,
  78935. // "type": "string"
  78936. // },
  78937. // "project": {
  78938. // "description": "Project ID for this request.",
  78939. // "location": "path",
  78940. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  78941. // "required": true,
  78942. // "type": "string"
  78943. // },
  78944. // "region": {
  78945. // "description": "The name of the region for this request.",
  78946. // "location": "path",
  78947. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  78948. // "required": true,
  78949. // "type": "string"
  78950. // },
  78951. // "requestId": {
  78952. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  78953. // "location": "query",
  78954. // "type": "string"
  78955. // }
  78956. // },
  78957. // "path": "{project}/regions/{region}/nodeTemplates/{nodeTemplate}",
  78958. // "response": {
  78959. // "$ref": "Operation"
  78960. // },
  78961. // "scopes": [
  78962. // "https://www.googleapis.com/auth/cloud-platform",
  78963. // "https://www.googleapis.com/auth/compute"
  78964. // ]
  78965. // }
  78966. }
  78967. // method id "compute.nodeTemplates.get":
  78968. type NodeTemplatesGetCall struct {
  78969. s *Service
  78970. project string
  78971. region string
  78972. nodeTemplate string
  78973. urlParams_ gensupport.URLParams
  78974. ifNoneMatch_ string
  78975. ctx_ context.Context
  78976. header_ http.Header
  78977. }
  78978. // Get: Returns the specified node template. Gets a list of available
  78979. // node templates by making a list() request.
  78980. func (r *NodeTemplatesService) Get(project string, region string, nodeTemplate string) *NodeTemplatesGetCall {
  78981. c := &NodeTemplatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  78982. c.project = project
  78983. c.region = region
  78984. c.nodeTemplate = nodeTemplate
  78985. return c
  78986. }
  78987. // Fields allows partial responses to be retrieved. See
  78988. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  78989. // for more information.
  78990. func (c *NodeTemplatesGetCall) Fields(s ...googleapi.Field) *NodeTemplatesGetCall {
  78991. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  78992. return c
  78993. }
  78994. // IfNoneMatch sets the optional parameter which makes the operation
  78995. // fail if the object's ETag matches the given value. This is useful for
  78996. // getting updates only after the object has changed since the last
  78997. // request. Use googleapi.IsNotModified to check whether the response
  78998. // error from Do is the result of In-None-Match.
  78999. func (c *NodeTemplatesGetCall) IfNoneMatch(entityTag string) *NodeTemplatesGetCall {
  79000. c.ifNoneMatch_ = entityTag
  79001. return c
  79002. }
  79003. // Context sets the context to be used in this call's Do method. Any
  79004. // pending HTTP request will be aborted if the provided context is
  79005. // canceled.
  79006. func (c *NodeTemplatesGetCall) Context(ctx context.Context) *NodeTemplatesGetCall {
  79007. c.ctx_ = ctx
  79008. return c
  79009. }
  79010. // Header returns an http.Header that can be modified by the caller to
  79011. // add HTTP headers to the request.
  79012. func (c *NodeTemplatesGetCall) Header() http.Header {
  79013. if c.header_ == nil {
  79014. c.header_ = make(http.Header)
  79015. }
  79016. return c.header_
  79017. }
  79018. func (c *NodeTemplatesGetCall) doRequest(alt string) (*http.Response, error) {
  79019. reqHeaders := make(http.Header)
  79020. for k, v := range c.header_ {
  79021. reqHeaders[k] = v
  79022. }
  79023. reqHeaders.Set("User-Agent", c.s.userAgent())
  79024. if c.ifNoneMatch_ != "" {
  79025. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  79026. }
  79027. var body io.Reader = nil
  79028. c.urlParams_.Set("alt", alt)
  79029. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/nodeTemplates/{nodeTemplate}")
  79030. urls += "?" + c.urlParams_.Encode()
  79031. req, _ := http.NewRequest("GET", urls, body)
  79032. req.Header = reqHeaders
  79033. googleapi.Expand(req.URL, map[string]string{
  79034. "project": c.project,
  79035. "region": c.region,
  79036. "nodeTemplate": c.nodeTemplate,
  79037. })
  79038. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  79039. }
  79040. // Do executes the "compute.nodeTemplates.get" call.
  79041. // Exactly one of *NodeTemplate or error will be non-nil. Any non-2xx
  79042. // status code is an error. Response headers are in either
  79043. // *NodeTemplate.ServerResponse.Header or (if a response was returned at
  79044. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  79045. // to check whether the returned error was because
  79046. // http.StatusNotModified was returned.
  79047. func (c *NodeTemplatesGetCall) Do(opts ...googleapi.CallOption) (*NodeTemplate, error) {
  79048. gensupport.SetOptions(c.urlParams_, opts...)
  79049. res, err := c.doRequest("json")
  79050. if res != nil && res.StatusCode == http.StatusNotModified {
  79051. if res.Body != nil {
  79052. res.Body.Close()
  79053. }
  79054. return nil, &googleapi.Error{
  79055. Code: res.StatusCode,
  79056. Header: res.Header,
  79057. }
  79058. }
  79059. if err != nil {
  79060. return nil, err
  79061. }
  79062. defer googleapi.CloseBody(res)
  79063. if err := googleapi.CheckResponse(res); err != nil {
  79064. return nil, err
  79065. }
  79066. ret := &NodeTemplate{
  79067. ServerResponse: googleapi.ServerResponse{
  79068. Header: res.Header,
  79069. HTTPStatusCode: res.StatusCode,
  79070. },
  79071. }
  79072. target := &ret
  79073. if err := gensupport.DecodeResponse(target, res); err != nil {
  79074. return nil, err
  79075. }
  79076. return ret, nil
  79077. // {
  79078. // "description": "Returns the specified node template. Gets a list of available node templates by making a list() request.",
  79079. // "httpMethod": "GET",
  79080. // "id": "compute.nodeTemplates.get",
  79081. // "parameterOrder": [
  79082. // "project",
  79083. // "region",
  79084. // "nodeTemplate"
  79085. // ],
  79086. // "parameters": {
  79087. // "nodeTemplate": {
  79088. // "description": "Name of the node template to return.",
  79089. // "location": "path",
  79090. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  79091. // "required": true,
  79092. // "type": "string"
  79093. // },
  79094. // "project": {
  79095. // "description": "Project ID for this request.",
  79096. // "location": "path",
  79097. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  79098. // "required": true,
  79099. // "type": "string"
  79100. // },
  79101. // "region": {
  79102. // "description": "The name of the region for this request.",
  79103. // "location": "path",
  79104. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  79105. // "required": true,
  79106. // "type": "string"
  79107. // }
  79108. // },
  79109. // "path": "{project}/regions/{region}/nodeTemplates/{nodeTemplate}",
  79110. // "response": {
  79111. // "$ref": "NodeTemplate"
  79112. // },
  79113. // "scopes": [
  79114. // "https://www.googleapis.com/auth/cloud-platform",
  79115. // "https://www.googleapis.com/auth/compute",
  79116. // "https://www.googleapis.com/auth/compute.readonly"
  79117. // ]
  79118. // }
  79119. }
  79120. // method id "compute.nodeTemplates.getIamPolicy":
  79121. type NodeTemplatesGetIamPolicyCall struct {
  79122. s *Service
  79123. project string
  79124. region string
  79125. resource string
  79126. urlParams_ gensupport.URLParams
  79127. ifNoneMatch_ string
  79128. ctx_ context.Context
  79129. header_ http.Header
  79130. }
  79131. // GetIamPolicy: Gets the access control policy for a resource. May be
  79132. // empty if no such policy or resource exists.
  79133. func (r *NodeTemplatesService) GetIamPolicy(project string, region string, resource string) *NodeTemplatesGetIamPolicyCall {
  79134. c := &NodeTemplatesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  79135. c.project = project
  79136. c.region = region
  79137. c.resource = resource
  79138. return c
  79139. }
  79140. // Fields allows partial responses to be retrieved. See
  79141. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  79142. // for more information.
  79143. func (c *NodeTemplatesGetIamPolicyCall) Fields(s ...googleapi.Field) *NodeTemplatesGetIamPolicyCall {
  79144. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  79145. return c
  79146. }
  79147. // IfNoneMatch sets the optional parameter which makes the operation
  79148. // fail if the object's ETag matches the given value. This is useful for
  79149. // getting updates only after the object has changed since the last
  79150. // request. Use googleapi.IsNotModified to check whether the response
  79151. // error from Do is the result of In-None-Match.
  79152. func (c *NodeTemplatesGetIamPolicyCall) IfNoneMatch(entityTag string) *NodeTemplatesGetIamPolicyCall {
  79153. c.ifNoneMatch_ = entityTag
  79154. return c
  79155. }
  79156. // Context sets the context to be used in this call's Do method. Any
  79157. // pending HTTP request will be aborted if the provided context is
  79158. // canceled.
  79159. func (c *NodeTemplatesGetIamPolicyCall) Context(ctx context.Context) *NodeTemplatesGetIamPolicyCall {
  79160. c.ctx_ = ctx
  79161. return c
  79162. }
  79163. // Header returns an http.Header that can be modified by the caller to
  79164. // add HTTP headers to the request.
  79165. func (c *NodeTemplatesGetIamPolicyCall) Header() http.Header {
  79166. if c.header_ == nil {
  79167. c.header_ = make(http.Header)
  79168. }
  79169. return c.header_
  79170. }
  79171. func (c *NodeTemplatesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  79172. reqHeaders := make(http.Header)
  79173. for k, v := range c.header_ {
  79174. reqHeaders[k] = v
  79175. }
  79176. reqHeaders.Set("User-Agent", c.s.userAgent())
  79177. if c.ifNoneMatch_ != "" {
  79178. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  79179. }
  79180. var body io.Reader = nil
  79181. c.urlParams_.Set("alt", alt)
  79182. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/nodeTemplates/{resource}/getIamPolicy")
  79183. urls += "?" + c.urlParams_.Encode()
  79184. req, _ := http.NewRequest("GET", urls, body)
  79185. req.Header = reqHeaders
  79186. googleapi.Expand(req.URL, map[string]string{
  79187. "project": c.project,
  79188. "region": c.region,
  79189. "resource": c.resource,
  79190. })
  79191. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  79192. }
  79193. // Do executes the "compute.nodeTemplates.getIamPolicy" call.
  79194. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  79195. // code is an error. Response headers are in either
  79196. // *Policy.ServerResponse.Header or (if a response was returned at all)
  79197. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  79198. // check whether the returned error was because http.StatusNotModified
  79199. // was returned.
  79200. func (c *NodeTemplatesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  79201. gensupport.SetOptions(c.urlParams_, opts...)
  79202. res, err := c.doRequest("json")
  79203. if res != nil && res.StatusCode == http.StatusNotModified {
  79204. if res.Body != nil {
  79205. res.Body.Close()
  79206. }
  79207. return nil, &googleapi.Error{
  79208. Code: res.StatusCode,
  79209. Header: res.Header,
  79210. }
  79211. }
  79212. if err != nil {
  79213. return nil, err
  79214. }
  79215. defer googleapi.CloseBody(res)
  79216. if err := googleapi.CheckResponse(res); err != nil {
  79217. return nil, err
  79218. }
  79219. ret := &Policy{
  79220. ServerResponse: googleapi.ServerResponse{
  79221. Header: res.Header,
  79222. HTTPStatusCode: res.StatusCode,
  79223. },
  79224. }
  79225. target := &ret
  79226. if err := gensupport.DecodeResponse(target, res); err != nil {
  79227. return nil, err
  79228. }
  79229. return ret, nil
  79230. // {
  79231. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  79232. // "httpMethod": "GET",
  79233. // "id": "compute.nodeTemplates.getIamPolicy",
  79234. // "parameterOrder": [
  79235. // "project",
  79236. // "region",
  79237. // "resource"
  79238. // ],
  79239. // "parameters": {
  79240. // "project": {
  79241. // "description": "Project ID for this request.",
  79242. // "location": "path",
  79243. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  79244. // "required": true,
  79245. // "type": "string"
  79246. // },
  79247. // "region": {
  79248. // "description": "The name of the region for this request.",
  79249. // "location": "path",
  79250. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  79251. // "required": true,
  79252. // "type": "string"
  79253. // },
  79254. // "resource": {
  79255. // "description": "Name of the resource for this request.",
  79256. // "location": "path",
  79257. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  79258. // "required": true,
  79259. // "type": "string"
  79260. // }
  79261. // },
  79262. // "path": "{project}/regions/{region}/nodeTemplates/{resource}/getIamPolicy",
  79263. // "response": {
  79264. // "$ref": "Policy"
  79265. // },
  79266. // "scopes": [
  79267. // "https://www.googleapis.com/auth/cloud-platform",
  79268. // "https://www.googleapis.com/auth/compute",
  79269. // "https://www.googleapis.com/auth/compute.readonly"
  79270. // ]
  79271. // }
  79272. }
  79273. // method id "compute.nodeTemplates.insert":
  79274. type NodeTemplatesInsertCall struct {
  79275. s *Service
  79276. project string
  79277. region string
  79278. nodetemplate *NodeTemplate
  79279. urlParams_ gensupport.URLParams
  79280. ctx_ context.Context
  79281. header_ http.Header
  79282. }
  79283. // Insert: Creates a NodeTemplate resource in the specified project
  79284. // using the data included in the request.
  79285. func (r *NodeTemplatesService) Insert(project string, region string, nodetemplate *NodeTemplate) *NodeTemplatesInsertCall {
  79286. c := &NodeTemplatesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  79287. c.project = project
  79288. c.region = region
  79289. c.nodetemplate = nodetemplate
  79290. return c
  79291. }
  79292. // RequestId sets the optional parameter "requestId": An optional
  79293. // request ID to identify requests. Specify a unique request ID so that
  79294. // if you must retry your request, the server will know to ignore the
  79295. // request if it has already been completed.
  79296. //
  79297. // For example, consider a situation where you make an initial request
  79298. // and the request times out. If you make the request again with the
  79299. // same request ID, the server can check if original operation with the
  79300. // same request ID was received, and if so, will ignore the second
  79301. // request. This prevents clients from accidentally creating duplicate
  79302. // commitments.
  79303. //
  79304. // The request ID must be a valid UUID with the exception that zero UUID
  79305. // is not supported (00000000-0000-0000-0000-000000000000).
  79306. func (c *NodeTemplatesInsertCall) RequestId(requestId string) *NodeTemplatesInsertCall {
  79307. c.urlParams_.Set("requestId", requestId)
  79308. return c
  79309. }
  79310. // Fields allows partial responses to be retrieved. See
  79311. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  79312. // for more information.
  79313. func (c *NodeTemplatesInsertCall) Fields(s ...googleapi.Field) *NodeTemplatesInsertCall {
  79314. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  79315. return c
  79316. }
  79317. // Context sets the context to be used in this call's Do method. Any
  79318. // pending HTTP request will be aborted if the provided context is
  79319. // canceled.
  79320. func (c *NodeTemplatesInsertCall) Context(ctx context.Context) *NodeTemplatesInsertCall {
  79321. c.ctx_ = ctx
  79322. return c
  79323. }
  79324. // Header returns an http.Header that can be modified by the caller to
  79325. // add HTTP headers to the request.
  79326. func (c *NodeTemplatesInsertCall) Header() http.Header {
  79327. if c.header_ == nil {
  79328. c.header_ = make(http.Header)
  79329. }
  79330. return c.header_
  79331. }
  79332. func (c *NodeTemplatesInsertCall) doRequest(alt string) (*http.Response, error) {
  79333. reqHeaders := make(http.Header)
  79334. for k, v := range c.header_ {
  79335. reqHeaders[k] = v
  79336. }
  79337. reqHeaders.Set("User-Agent", c.s.userAgent())
  79338. var body io.Reader = nil
  79339. body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodetemplate)
  79340. if err != nil {
  79341. return nil, err
  79342. }
  79343. reqHeaders.Set("Content-Type", "application/json")
  79344. c.urlParams_.Set("alt", alt)
  79345. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/nodeTemplates")
  79346. urls += "?" + c.urlParams_.Encode()
  79347. req, _ := http.NewRequest("POST", urls, body)
  79348. req.Header = reqHeaders
  79349. googleapi.Expand(req.URL, map[string]string{
  79350. "project": c.project,
  79351. "region": c.region,
  79352. })
  79353. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  79354. }
  79355. // Do executes the "compute.nodeTemplates.insert" call.
  79356. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  79357. // status code is an error. Response headers are in either
  79358. // *Operation.ServerResponse.Header or (if a response was returned at
  79359. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  79360. // to check whether the returned error was because
  79361. // http.StatusNotModified was returned.
  79362. func (c *NodeTemplatesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  79363. gensupport.SetOptions(c.urlParams_, opts...)
  79364. res, err := c.doRequest("json")
  79365. if res != nil && res.StatusCode == http.StatusNotModified {
  79366. if res.Body != nil {
  79367. res.Body.Close()
  79368. }
  79369. return nil, &googleapi.Error{
  79370. Code: res.StatusCode,
  79371. Header: res.Header,
  79372. }
  79373. }
  79374. if err != nil {
  79375. return nil, err
  79376. }
  79377. defer googleapi.CloseBody(res)
  79378. if err := googleapi.CheckResponse(res); err != nil {
  79379. return nil, err
  79380. }
  79381. ret := &Operation{
  79382. ServerResponse: googleapi.ServerResponse{
  79383. Header: res.Header,
  79384. HTTPStatusCode: res.StatusCode,
  79385. },
  79386. }
  79387. target := &ret
  79388. if err := gensupport.DecodeResponse(target, res); err != nil {
  79389. return nil, err
  79390. }
  79391. return ret, nil
  79392. // {
  79393. // "description": "Creates a NodeTemplate resource in the specified project using the data included in the request.",
  79394. // "httpMethod": "POST",
  79395. // "id": "compute.nodeTemplates.insert",
  79396. // "parameterOrder": [
  79397. // "project",
  79398. // "region"
  79399. // ],
  79400. // "parameters": {
  79401. // "project": {
  79402. // "description": "Project ID for this request.",
  79403. // "location": "path",
  79404. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  79405. // "required": true,
  79406. // "type": "string"
  79407. // },
  79408. // "region": {
  79409. // "description": "The name of the region for this request.",
  79410. // "location": "path",
  79411. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  79412. // "required": true,
  79413. // "type": "string"
  79414. // },
  79415. // "requestId": {
  79416. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  79417. // "location": "query",
  79418. // "type": "string"
  79419. // }
  79420. // },
  79421. // "path": "{project}/regions/{region}/nodeTemplates",
  79422. // "request": {
  79423. // "$ref": "NodeTemplate"
  79424. // },
  79425. // "response": {
  79426. // "$ref": "Operation"
  79427. // },
  79428. // "scopes": [
  79429. // "https://www.googleapis.com/auth/cloud-platform",
  79430. // "https://www.googleapis.com/auth/compute"
  79431. // ]
  79432. // }
  79433. }
  79434. // method id "compute.nodeTemplates.list":
  79435. type NodeTemplatesListCall struct {
  79436. s *Service
  79437. project string
  79438. region string
  79439. urlParams_ gensupport.URLParams
  79440. ifNoneMatch_ string
  79441. ctx_ context.Context
  79442. header_ http.Header
  79443. }
  79444. // List: Retrieves a list of node templates available to the specified
  79445. // project.
  79446. func (r *NodeTemplatesService) List(project string, region string) *NodeTemplatesListCall {
  79447. c := &NodeTemplatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  79448. c.project = project
  79449. c.region = region
  79450. return c
  79451. }
  79452. // Filter sets the optional parameter "filter": A filter expression that
  79453. // filters resources listed in the response. The expression must specify
  79454. // the field name, a comparison operator, and the value that you want to
  79455. // use for filtering. The value must be a string, a number, or a
  79456. // boolean. The comparison operator must be either =, !=, >, or <.
  79457. //
  79458. // For example, if you are filtering Compute Engine instances, you can
  79459. // exclude instances named example-instance by specifying name !=
  79460. // example-instance.
  79461. //
  79462. // You can also filter nested fields. For example, you could specify
  79463. // scheduling.automaticRestart = false to include instances only if they
  79464. // are not scheduled for automatic restarts. You can use filtering on
  79465. // nested fields to filter based on resource labels.
  79466. //
  79467. // To filter on multiple expressions, provide each separate expression
  79468. // within parentheses. For example, (scheduling.automaticRestart = true)
  79469. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  79470. // AND expression. However, you can include AND and OR expressions
  79471. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  79472. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  79473. // true).
  79474. func (c *NodeTemplatesListCall) Filter(filter string) *NodeTemplatesListCall {
  79475. c.urlParams_.Set("filter", filter)
  79476. return c
  79477. }
  79478. // MaxResults sets the optional parameter "maxResults": The maximum
  79479. // number of results per page that should be returned. If the number of
  79480. // available results is larger than maxResults, Compute Engine returns a
  79481. // nextPageToken that can be used to get the next page of results in
  79482. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  79483. // (Default: 500)
  79484. func (c *NodeTemplatesListCall) MaxResults(maxResults int64) *NodeTemplatesListCall {
  79485. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  79486. return c
  79487. }
  79488. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  79489. // a certain order. By default, results are returned in alphanumerical
  79490. // order based on the resource name.
  79491. //
  79492. // You can also sort results in descending order based on the creation
  79493. // timestamp using orderBy="creationTimestamp desc". This sorts results
  79494. // based on the creationTimestamp field in reverse chronological order
  79495. // (newest result first). Use this to sort resources like operations so
  79496. // that the newest operation is returned first.
  79497. //
  79498. // Currently, only sorting by name or creationTimestamp desc is
  79499. // supported.
  79500. func (c *NodeTemplatesListCall) OrderBy(orderBy string) *NodeTemplatesListCall {
  79501. c.urlParams_.Set("orderBy", orderBy)
  79502. return c
  79503. }
  79504. // PageToken sets the optional parameter "pageToken": Specifies a page
  79505. // token to use. Set pageToken to the nextPageToken returned by a
  79506. // previous list request to get the next page of results.
  79507. func (c *NodeTemplatesListCall) PageToken(pageToken string) *NodeTemplatesListCall {
  79508. c.urlParams_.Set("pageToken", pageToken)
  79509. return c
  79510. }
  79511. // Fields allows partial responses to be retrieved. See
  79512. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  79513. // for more information.
  79514. func (c *NodeTemplatesListCall) Fields(s ...googleapi.Field) *NodeTemplatesListCall {
  79515. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  79516. return c
  79517. }
  79518. // IfNoneMatch sets the optional parameter which makes the operation
  79519. // fail if the object's ETag matches the given value. This is useful for
  79520. // getting updates only after the object has changed since the last
  79521. // request. Use googleapi.IsNotModified to check whether the response
  79522. // error from Do is the result of In-None-Match.
  79523. func (c *NodeTemplatesListCall) IfNoneMatch(entityTag string) *NodeTemplatesListCall {
  79524. c.ifNoneMatch_ = entityTag
  79525. return c
  79526. }
  79527. // Context sets the context to be used in this call's Do method. Any
  79528. // pending HTTP request will be aborted if the provided context is
  79529. // canceled.
  79530. func (c *NodeTemplatesListCall) Context(ctx context.Context) *NodeTemplatesListCall {
  79531. c.ctx_ = ctx
  79532. return c
  79533. }
  79534. // Header returns an http.Header that can be modified by the caller to
  79535. // add HTTP headers to the request.
  79536. func (c *NodeTemplatesListCall) Header() http.Header {
  79537. if c.header_ == nil {
  79538. c.header_ = make(http.Header)
  79539. }
  79540. return c.header_
  79541. }
  79542. func (c *NodeTemplatesListCall) doRequest(alt string) (*http.Response, error) {
  79543. reqHeaders := make(http.Header)
  79544. for k, v := range c.header_ {
  79545. reqHeaders[k] = v
  79546. }
  79547. reqHeaders.Set("User-Agent", c.s.userAgent())
  79548. if c.ifNoneMatch_ != "" {
  79549. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  79550. }
  79551. var body io.Reader = nil
  79552. c.urlParams_.Set("alt", alt)
  79553. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/nodeTemplates")
  79554. urls += "?" + c.urlParams_.Encode()
  79555. req, _ := http.NewRequest("GET", urls, body)
  79556. req.Header = reqHeaders
  79557. googleapi.Expand(req.URL, map[string]string{
  79558. "project": c.project,
  79559. "region": c.region,
  79560. })
  79561. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  79562. }
  79563. // Do executes the "compute.nodeTemplates.list" call.
  79564. // Exactly one of *NodeTemplateList or error will be non-nil. Any
  79565. // non-2xx status code is an error. Response headers are in either
  79566. // *NodeTemplateList.ServerResponse.Header or (if a response was
  79567. // returned at all) in error.(*googleapi.Error).Header. Use
  79568. // googleapi.IsNotModified to check whether the returned error was
  79569. // because http.StatusNotModified was returned.
  79570. func (c *NodeTemplatesListCall) Do(opts ...googleapi.CallOption) (*NodeTemplateList, error) {
  79571. gensupport.SetOptions(c.urlParams_, opts...)
  79572. res, err := c.doRequest("json")
  79573. if res != nil && res.StatusCode == http.StatusNotModified {
  79574. if res.Body != nil {
  79575. res.Body.Close()
  79576. }
  79577. return nil, &googleapi.Error{
  79578. Code: res.StatusCode,
  79579. Header: res.Header,
  79580. }
  79581. }
  79582. if err != nil {
  79583. return nil, err
  79584. }
  79585. defer googleapi.CloseBody(res)
  79586. if err := googleapi.CheckResponse(res); err != nil {
  79587. return nil, err
  79588. }
  79589. ret := &NodeTemplateList{
  79590. ServerResponse: googleapi.ServerResponse{
  79591. Header: res.Header,
  79592. HTTPStatusCode: res.StatusCode,
  79593. },
  79594. }
  79595. target := &ret
  79596. if err := gensupport.DecodeResponse(target, res); err != nil {
  79597. return nil, err
  79598. }
  79599. return ret, nil
  79600. // {
  79601. // "description": "Retrieves a list of node templates available to the specified project.",
  79602. // "httpMethod": "GET",
  79603. // "id": "compute.nodeTemplates.list",
  79604. // "parameterOrder": [
  79605. // "project",
  79606. // "region"
  79607. // ],
  79608. // "parameters": {
  79609. // "filter": {
  79610. // "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).",
  79611. // "location": "query",
  79612. // "type": "string"
  79613. // },
  79614. // "maxResults": {
  79615. // "default": "500",
  79616. // "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)",
  79617. // "format": "uint32",
  79618. // "location": "query",
  79619. // "minimum": "0",
  79620. // "type": "integer"
  79621. // },
  79622. // "orderBy": {
  79623. // "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.",
  79624. // "location": "query",
  79625. // "type": "string"
  79626. // },
  79627. // "pageToken": {
  79628. // "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.",
  79629. // "location": "query",
  79630. // "type": "string"
  79631. // },
  79632. // "project": {
  79633. // "description": "Project ID for this request.",
  79634. // "location": "path",
  79635. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  79636. // "required": true,
  79637. // "type": "string"
  79638. // },
  79639. // "region": {
  79640. // "description": "The name of the region for this request.",
  79641. // "location": "path",
  79642. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  79643. // "required": true,
  79644. // "type": "string"
  79645. // }
  79646. // },
  79647. // "path": "{project}/regions/{region}/nodeTemplates",
  79648. // "response": {
  79649. // "$ref": "NodeTemplateList"
  79650. // },
  79651. // "scopes": [
  79652. // "https://www.googleapis.com/auth/cloud-platform",
  79653. // "https://www.googleapis.com/auth/compute",
  79654. // "https://www.googleapis.com/auth/compute.readonly"
  79655. // ]
  79656. // }
  79657. }
  79658. // Pages invokes f for each page of results.
  79659. // A non-nil error returned from f will halt the iteration.
  79660. // The provided context supersedes any context provided to the Context method.
  79661. func (c *NodeTemplatesListCall) Pages(ctx context.Context, f func(*NodeTemplateList) error) error {
  79662. c.ctx_ = ctx
  79663. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  79664. for {
  79665. x, err := c.Do()
  79666. if err != nil {
  79667. return err
  79668. }
  79669. if err := f(x); err != nil {
  79670. return err
  79671. }
  79672. if x.NextPageToken == "" {
  79673. return nil
  79674. }
  79675. c.PageToken(x.NextPageToken)
  79676. }
  79677. }
  79678. // method id "compute.nodeTemplates.setIamPolicy":
  79679. type NodeTemplatesSetIamPolicyCall struct {
  79680. s *Service
  79681. project string
  79682. region string
  79683. resource string
  79684. regionsetpolicyrequest *RegionSetPolicyRequest
  79685. urlParams_ gensupport.URLParams
  79686. ctx_ context.Context
  79687. header_ http.Header
  79688. }
  79689. // SetIamPolicy: Sets the access control policy on the specified
  79690. // resource. Replaces any existing policy.
  79691. func (r *NodeTemplatesService) SetIamPolicy(project string, region string, resource string, regionsetpolicyrequest *RegionSetPolicyRequest) *NodeTemplatesSetIamPolicyCall {
  79692. c := &NodeTemplatesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  79693. c.project = project
  79694. c.region = region
  79695. c.resource = resource
  79696. c.regionsetpolicyrequest = regionsetpolicyrequest
  79697. return c
  79698. }
  79699. // Fields allows partial responses to be retrieved. See
  79700. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  79701. // for more information.
  79702. func (c *NodeTemplatesSetIamPolicyCall) Fields(s ...googleapi.Field) *NodeTemplatesSetIamPolicyCall {
  79703. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  79704. return c
  79705. }
  79706. // Context sets the context to be used in this call's Do method. Any
  79707. // pending HTTP request will be aborted if the provided context is
  79708. // canceled.
  79709. func (c *NodeTemplatesSetIamPolicyCall) Context(ctx context.Context) *NodeTemplatesSetIamPolicyCall {
  79710. c.ctx_ = ctx
  79711. return c
  79712. }
  79713. // Header returns an http.Header that can be modified by the caller to
  79714. // add HTTP headers to the request.
  79715. func (c *NodeTemplatesSetIamPolicyCall) Header() http.Header {
  79716. if c.header_ == nil {
  79717. c.header_ = make(http.Header)
  79718. }
  79719. return c.header_
  79720. }
  79721. func (c *NodeTemplatesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  79722. reqHeaders := make(http.Header)
  79723. for k, v := range c.header_ {
  79724. reqHeaders[k] = v
  79725. }
  79726. reqHeaders.Set("User-Agent", c.s.userAgent())
  79727. var body io.Reader = nil
  79728. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest)
  79729. if err != nil {
  79730. return nil, err
  79731. }
  79732. reqHeaders.Set("Content-Type", "application/json")
  79733. c.urlParams_.Set("alt", alt)
  79734. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/nodeTemplates/{resource}/setIamPolicy")
  79735. urls += "?" + c.urlParams_.Encode()
  79736. req, _ := http.NewRequest("POST", urls, body)
  79737. req.Header = reqHeaders
  79738. googleapi.Expand(req.URL, map[string]string{
  79739. "project": c.project,
  79740. "region": c.region,
  79741. "resource": c.resource,
  79742. })
  79743. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  79744. }
  79745. // Do executes the "compute.nodeTemplates.setIamPolicy" call.
  79746. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  79747. // code is an error. Response headers are in either
  79748. // *Policy.ServerResponse.Header or (if a response was returned at all)
  79749. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  79750. // check whether the returned error was because http.StatusNotModified
  79751. // was returned.
  79752. func (c *NodeTemplatesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  79753. gensupport.SetOptions(c.urlParams_, opts...)
  79754. res, err := c.doRequest("json")
  79755. if res != nil && res.StatusCode == http.StatusNotModified {
  79756. if res.Body != nil {
  79757. res.Body.Close()
  79758. }
  79759. return nil, &googleapi.Error{
  79760. Code: res.StatusCode,
  79761. Header: res.Header,
  79762. }
  79763. }
  79764. if err != nil {
  79765. return nil, err
  79766. }
  79767. defer googleapi.CloseBody(res)
  79768. if err := googleapi.CheckResponse(res); err != nil {
  79769. return nil, err
  79770. }
  79771. ret := &Policy{
  79772. ServerResponse: googleapi.ServerResponse{
  79773. Header: res.Header,
  79774. HTTPStatusCode: res.StatusCode,
  79775. },
  79776. }
  79777. target := &ret
  79778. if err := gensupport.DecodeResponse(target, res); err != nil {
  79779. return nil, err
  79780. }
  79781. return ret, nil
  79782. // {
  79783. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  79784. // "httpMethod": "POST",
  79785. // "id": "compute.nodeTemplates.setIamPolicy",
  79786. // "parameterOrder": [
  79787. // "project",
  79788. // "region",
  79789. // "resource"
  79790. // ],
  79791. // "parameters": {
  79792. // "project": {
  79793. // "description": "Project ID for this request.",
  79794. // "location": "path",
  79795. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  79796. // "required": true,
  79797. // "type": "string"
  79798. // },
  79799. // "region": {
  79800. // "description": "The name of the region for this request.",
  79801. // "location": "path",
  79802. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  79803. // "required": true,
  79804. // "type": "string"
  79805. // },
  79806. // "resource": {
  79807. // "description": "Name of the resource for this request.",
  79808. // "location": "path",
  79809. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  79810. // "required": true,
  79811. // "type": "string"
  79812. // }
  79813. // },
  79814. // "path": "{project}/regions/{region}/nodeTemplates/{resource}/setIamPolicy",
  79815. // "request": {
  79816. // "$ref": "RegionSetPolicyRequest"
  79817. // },
  79818. // "response": {
  79819. // "$ref": "Policy"
  79820. // },
  79821. // "scopes": [
  79822. // "https://www.googleapis.com/auth/cloud-platform",
  79823. // "https://www.googleapis.com/auth/compute"
  79824. // ]
  79825. // }
  79826. }
  79827. // method id "compute.nodeTemplates.testIamPermissions":
  79828. type NodeTemplatesTestIamPermissionsCall struct {
  79829. s *Service
  79830. project string
  79831. region string
  79832. resource string
  79833. testpermissionsrequest *TestPermissionsRequest
  79834. urlParams_ gensupport.URLParams
  79835. ctx_ context.Context
  79836. header_ http.Header
  79837. }
  79838. // TestIamPermissions: Returns permissions that a caller has on the
  79839. // specified resource.
  79840. func (r *NodeTemplatesService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *NodeTemplatesTestIamPermissionsCall {
  79841. c := &NodeTemplatesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  79842. c.project = project
  79843. c.region = region
  79844. c.resource = resource
  79845. c.testpermissionsrequest = testpermissionsrequest
  79846. return c
  79847. }
  79848. // Fields allows partial responses to be retrieved. See
  79849. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  79850. // for more information.
  79851. func (c *NodeTemplatesTestIamPermissionsCall) Fields(s ...googleapi.Field) *NodeTemplatesTestIamPermissionsCall {
  79852. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  79853. return c
  79854. }
  79855. // Context sets the context to be used in this call's Do method. Any
  79856. // pending HTTP request will be aborted if the provided context is
  79857. // canceled.
  79858. func (c *NodeTemplatesTestIamPermissionsCall) Context(ctx context.Context) *NodeTemplatesTestIamPermissionsCall {
  79859. c.ctx_ = ctx
  79860. return c
  79861. }
  79862. // Header returns an http.Header that can be modified by the caller to
  79863. // add HTTP headers to the request.
  79864. func (c *NodeTemplatesTestIamPermissionsCall) Header() http.Header {
  79865. if c.header_ == nil {
  79866. c.header_ = make(http.Header)
  79867. }
  79868. return c.header_
  79869. }
  79870. func (c *NodeTemplatesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  79871. reqHeaders := make(http.Header)
  79872. for k, v := range c.header_ {
  79873. reqHeaders[k] = v
  79874. }
  79875. reqHeaders.Set("User-Agent", c.s.userAgent())
  79876. var body io.Reader = nil
  79877. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  79878. if err != nil {
  79879. return nil, err
  79880. }
  79881. reqHeaders.Set("Content-Type", "application/json")
  79882. c.urlParams_.Set("alt", alt)
  79883. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/nodeTemplates/{resource}/testIamPermissions")
  79884. urls += "?" + c.urlParams_.Encode()
  79885. req, _ := http.NewRequest("POST", urls, body)
  79886. req.Header = reqHeaders
  79887. googleapi.Expand(req.URL, map[string]string{
  79888. "project": c.project,
  79889. "region": c.region,
  79890. "resource": c.resource,
  79891. })
  79892. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  79893. }
  79894. // Do executes the "compute.nodeTemplates.testIamPermissions" call.
  79895. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  79896. // non-2xx status code is an error. Response headers are in either
  79897. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  79898. // returned at all) in error.(*googleapi.Error).Header. Use
  79899. // googleapi.IsNotModified to check whether the returned error was
  79900. // because http.StatusNotModified was returned.
  79901. func (c *NodeTemplatesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  79902. gensupport.SetOptions(c.urlParams_, opts...)
  79903. res, err := c.doRequest("json")
  79904. if res != nil && res.StatusCode == http.StatusNotModified {
  79905. if res.Body != nil {
  79906. res.Body.Close()
  79907. }
  79908. return nil, &googleapi.Error{
  79909. Code: res.StatusCode,
  79910. Header: res.Header,
  79911. }
  79912. }
  79913. if err != nil {
  79914. return nil, err
  79915. }
  79916. defer googleapi.CloseBody(res)
  79917. if err := googleapi.CheckResponse(res); err != nil {
  79918. return nil, err
  79919. }
  79920. ret := &TestPermissionsResponse{
  79921. ServerResponse: googleapi.ServerResponse{
  79922. Header: res.Header,
  79923. HTTPStatusCode: res.StatusCode,
  79924. },
  79925. }
  79926. target := &ret
  79927. if err := gensupport.DecodeResponse(target, res); err != nil {
  79928. return nil, err
  79929. }
  79930. return ret, nil
  79931. // {
  79932. // "description": "Returns permissions that a caller has on the specified resource.",
  79933. // "httpMethod": "POST",
  79934. // "id": "compute.nodeTemplates.testIamPermissions",
  79935. // "parameterOrder": [
  79936. // "project",
  79937. // "region",
  79938. // "resource"
  79939. // ],
  79940. // "parameters": {
  79941. // "project": {
  79942. // "description": "Project ID for this request.",
  79943. // "location": "path",
  79944. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  79945. // "required": true,
  79946. // "type": "string"
  79947. // },
  79948. // "region": {
  79949. // "description": "The name of the region for this request.",
  79950. // "location": "path",
  79951. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  79952. // "required": true,
  79953. // "type": "string"
  79954. // },
  79955. // "resource": {
  79956. // "description": "Name of the resource for this request.",
  79957. // "location": "path",
  79958. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  79959. // "required": true,
  79960. // "type": "string"
  79961. // }
  79962. // },
  79963. // "path": "{project}/regions/{region}/nodeTemplates/{resource}/testIamPermissions",
  79964. // "request": {
  79965. // "$ref": "TestPermissionsRequest"
  79966. // },
  79967. // "response": {
  79968. // "$ref": "TestPermissionsResponse"
  79969. // },
  79970. // "scopes": [
  79971. // "https://www.googleapis.com/auth/cloud-platform",
  79972. // "https://www.googleapis.com/auth/compute",
  79973. // "https://www.googleapis.com/auth/compute.readonly"
  79974. // ]
  79975. // }
  79976. }
  79977. // method id "compute.nodeTypes.aggregatedList":
  79978. type NodeTypesAggregatedListCall struct {
  79979. s *Service
  79980. project string
  79981. urlParams_ gensupport.URLParams
  79982. ifNoneMatch_ string
  79983. ctx_ context.Context
  79984. header_ http.Header
  79985. }
  79986. // AggregatedList: Retrieves an aggregated list of node types.
  79987. func (r *NodeTypesService) AggregatedList(project string) *NodeTypesAggregatedListCall {
  79988. c := &NodeTypesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  79989. c.project = project
  79990. return c
  79991. }
  79992. // Filter sets the optional parameter "filter": A filter expression that
  79993. // filters resources listed in the response. The expression must specify
  79994. // the field name, a comparison operator, and the value that you want to
  79995. // use for filtering. The value must be a string, a number, or a
  79996. // boolean. The comparison operator must be either =, !=, >, or <.
  79997. //
  79998. // For example, if you are filtering Compute Engine instances, you can
  79999. // exclude instances named example-instance by specifying name !=
  80000. // example-instance.
  80001. //
  80002. // You can also filter nested fields. For example, you could specify
  80003. // scheduling.automaticRestart = false to include instances only if they
  80004. // are not scheduled for automatic restarts. You can use filtering on
  80005. // nested fields to filter based on resource labels.
  80006. //
  80007. // To filter on multiple expressions, provide each separate expression
  80008. // within parentheses. For example, (scheduling.automaticRestart = true)
  80009. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  80010. // AND expression. However, you can include AND and OR expressions
  80011. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  80012. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  80013. // true).
  80014. func (c *NodeTypesAggregatedListCall) Filter(filter string) *NodeTypesAggregatedListCall {
  80015. c.urlParams_.Set("filter", filter)
  80016. return c
  80017. }
  80018. // MaxResults sets the optional parameter "maxResults": The maximum
  80019. // number of results per page that should be returned. If the number of
  80020. // available results is larger than maxResults, Compute Engine returns a
  80021. // nextPageToken that can be used to get the next page of results in
  80022. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  80023. // (Default: 500)
  80024. func (c *NodeTypesAggregatedListCall) MaxResults(maxResults int64) *NodeTypesAggregatedListCall {
  80025. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  80026. return c
  80027. }
  80028. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  80029. // a certain order. By default, results are returned in alphanumerical
  80030. // order based on the resource name.
  80031. //
  80032. // You can also sort results in descending order based on the creation
  80033. // timestamp using orderBy="creationTimestamp desc". This sorts results
  80034. // based on the creationTimestamp field in reverse chronological order
  80035. // (newest result first). Use this to sort resources like operations so
  80036. // that the newest operation is returned first.
  80037. //
  80038. // Currently, only sorting by name or creationTimestamp desc is
  80039. // supported.
  80040. func (c *NodeTypesAggregatedListCall) OrderBy(orderBy string) *NodeTypesAggregatedListCall {
  80041. c.urlParams_.Set("orderBy", orderBy)
  80042. return c
  80043. }
  80044. // PageToken sets the optional parameter "pageToken": Specifies a page
  80045. // token to use. Set pageToken to the nextPageToken returned by a
  80046. // previous list request to get the next page of results.
  80047. func (c *NodeTypesAggregatedListCall) PageToken(pageToken string) *NodeTypesAggregatedListCall {
  80048. c.urlParams_.Set("pageToken", pageToken)
  80049. return c
  80050. }
  80051. // Fields allows partial responses to be retrieved. See
  80052. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  80053. // for more information.
  80054. func (c *NodeTypesAggregatedListCall) Fields(s ...googleapi.Field) *NodeTypesAggregatedListCall {
  80055. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  80056. return c
  80057. }
  80058. // IfNoneMatch sets the optional parameter which makes the operation
  80059. // fail if the object's ETag matches the given value. This is useful for
  80060. // getting updates only after the object has changed since the last
  80061. // request. Use googleapi.IsNotModified to check whether the response
  80062. // error from Do is the result of In-None-Match.
  80063. func (c *NodeTypesAggregatedListCall) IfNoneMatch(entityTag string) *NodeTypesAggregatedListCall {
  80064. c.ifNoneMatch_ = entityTag
  80065. return c
  80066. }
  80067. // Context sets the context to be used in this call's Do method. Any
  80068. // pending HTTP request will be aborted if the provided context is
  80069. // canceled.
  80070. func (c *NodeTypesAggregatedListCall) Context(ctx context.Context) *NodeTypesAggregatedListCall {
  80071. c.ctx_ = ctx
  80072. return c
  80073. }
  80074. // Header returns an http.Header that can be modified by the caller to
  80075. // add HTTP headers to the request.
  80076. func (c *NodeTypesAggregatedListCall) Header() http.Header {
  80077. if c.header_ == nil {
  80078. c.header_ = make(http.Header)
  80079. }
  80080. return c.header_
  80081. }
  80082. func (c *NodeTypesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  80083. reqHeaders := make(http.Header)
  80084. for k, v := range c.header_ {
  80085. reqHeaders[k] = v
  80086. }
  80087. reqHeaders.Set("User-Agent", c.s.userAgent())
  80088. if c.ifNoneMatch_ != "" {
  80089. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  80090. }
  80091. var body io.Reader = nil
  80092. c.urlParams_.Set("alt", alt)
  80093. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/nodeTypes")
  80094. urls += "?" + c.urlParams_.Encode()
  80095. req, _ := http.NewRequest("GET", urls, body)
  80096. req.Header = reqHeaders
  80097. googleapi.Expand(req.URL, map[string]string{
  80098. "project": c.project,
  80099. })
  80100. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  80101. }
  80102. // Do executes the "compute.nodeTypes.aggregatedList" call.
  80103. // Exactly one of *NodeTypeAggregatedList or error will be non-nil. Any
  80104. // non-2xx status code is an error. Response headers are in either
  80105. // *NodeTypeAggregatedList.ServerResponse.Header or (if a response was
  80106. // returned at all) in error.(*googleapi.Error).Header. Use
  80107. // googleapi.IsNotModified to check whether the returned error was
  80108. // because http.StatusNotModified was returned.
  80109. func (c *NodeTypesAggregatedListCall) Do(opts ...googleapi.CallOption) (*NodeTypeAggregatedList, error) {
  80110. gensupport.SetOptions(c.urlParams_, opts...)
  80111. res, err := c.doRequest("json")
  80112. if res != nil && res.StatusCode == http.StatusNotModified {
  80113. if res.Body != nil {
  80114. res.Body.Close()
  80115. }
  80116. return nil, &googleapi.Error{
  80117. Code: res.StatusCode,
  80118. Header: res.Header,
  80119. }
  80120. }
  80121. if err != nil {
  80122. return nil, err
  80123. }
  80124. defer googleapi.CloseBody(res)
  80125. if err := googleapi.CheckResponse(res); err != nil {
  80126. return nil, err
  80127. }
  80128. ret := &NodeTypeAggregatedList{
  80129. ServerResponse: googleapi.ServerResponse{
  80130. Header: res.Header,
  80131. HTTPStatusCode: res.StatusCode,
  80132. },
  80133. }
  80134. target := &ret
  80135. if err := gensupport.DecodeResponse(target, res); err != nil {
  80136. return nil, err
  80137. }
  80138. return ret, nil
  80139. // {
  80140. // "description": "Retrieves an aggregated list of node types.",
  80141. // "httpMethod": "GET",
  80142. // "id": "compute.nodeTypes.aggregatedList",
  80143. // "parameterOrder": [
  80144. // "project"
  80145. // ],
  80146. // "parameters": {
  80147. // "filter": {
  80148. // "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).",
  80149. // "location": "query",
  80150. // "type": "string"
  80151. // },
  80152. // "maxResults": {
  80153. // "default": "500",
  80154. // "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)",
  80155. // "format": "uint32",
  80156. // "location": "query",
  80157. // "minimum": "0",
  80158. // "type": "integer"
  80159. // },
  80160. // "orderBy": {
  80161. // "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.",
  80162. // "location": "query",
  80163. // "type": "string"
  80164. // },
  80165. // "pageToken": {
  80166. // "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.",
  80167. // "location": "query",
  80168. // "type": "string"
  80169. // },
  80170. // "project": {
  80171. // "description": "Project ID for this request.",
  80172. // "location": "path",
  80173. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  80174. // "required": true,
  80175. // "type": "string"
  80176. // }
  80177. // },
  80178. // "path": "{project}/aggregated/nodeTypes",
  80179. // "response": {
  80180. // "$ref": "NodeTypeAggregatedList"
  80181. // },
  80182. // "scopes": [
  80183. // "https://www.googleapis.com/auth/cloud-platform",
  80184. // "https://www.googleapis.com/auth/compute",
  80185. // "https://www.googleapis.com/auth/compute.readonly"
  80186. // ]
  80187. // }
  80188. }
  80189. // Pages invokes f for each page of results.
  80190. // A non-nil error returned from f will halt the iteration.
  80191. // The provided context supersedes any context provided to the Context method.
  80192. func (c *NodeTypesAggregatedListCall) Pages(ctx context.Context, f func(*NodeTypeAggregatedList) error) error {
  80193. c.ctx_ = ctx
  80194. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  80195. for {
  80196. x, err := c.Do()
  80197. if err != nil {
  80198. return err
  80199. }
  80200. if err := f(x); err != nil {
  80201. return err
  80202. }
  80203. if x.NextPageToken == "" {
  80204. return nil
  80205. }
  80206. c.PageToken(x.NextPageToken)
  80207. }
  80208. }
  80209. // method id "compute.nodeTypes.get":
  80210. type NodeTypesGetCall struct {
  80211. s *Service
  80212. project string
  80213. zone string
  80214. nodeType string
  80215. urlParams_ gensupport.URLParams
  80216. ifNoneMatch_ string
  80217. ctx_ context.Context
  80218. header_ http.Header
  80219. }
  80220. // Get: Returns the specified node type. Gets a list of available node
  80221. // types by making a list() request.
  80222. func (r *NodeTypesService) Get(project string, zone string, nodeType string) *NodeTypesGetCall {
  80223. c := &NodeTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  80224. c.project = project
  80225. c.zone = zone
  80226. c.nodeType = nodeType
  80227. return c
  80228. }
  80229. // Fields allows partial responses to be retrieved. See
  80230. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  80231. // for more information.
  80232. func (c *NodeTypesGetCall) Fields(s ...googleapi.Field) *NodeTypesGetCall {
  80233. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  80234. return c
  80235. }
  80236. // IfNoneMatch sets the optional parameter which makes the operation
  80237. // fail if the object's ETag matches the given value. This is useful for
  80238. // getting updates only after the object has changed since the last
  80239. // request. Use googleapi.IsNotModified to check whether the response
  80240. // error from Do is the result of In-None-Match.
  80241. func (c *NodeTypesGetCall) IfNoneMatch(entityTag string) *NodeTypesGetCall {
  80242. c.ifNoneMatch_ = entityTag
  80243. return c
  80244. }
  80245. // Context sets the context to be used in this call's Do method. Any
  80246. // pending HTTP request will be aborted if the provided context is
  80247. // canceled.
  80248. func (c *NodeTypesGetCall) Context(ctx context.Context) *NodeTypesGetCall {
  80249. c.ctx_ = ctx
  80250. return c
  80251. }
  80252. // Header returns an http.Header that can be modified by the caller to
  80253. // add HTTP headers to the request.
  80254. func (c *NodeTypesGetCall) Header() http.Header {
  80255. if c.header_ == nil {
  80256. c.header_ = make(http.Header)
  80257. }
  80258. return c.header_
  80259. }
  80260. func (c *NodeTypesGetCall) doRequest(alt string) (*http.Response, error) {
  80261. reqHeaders := make(http.Header)
  80262. for k, v := range c.header_ {
  80263. reqHeaders[k] = v
  80264. }
  80265. reqHeaders.Set("User-Agent", c.s.userAgent())
  80266. if c.ifNoneMatch_ != "" {
  80267. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  80268. }
  80269. var body io.Reader = nil
  80270. c.urlParams_.Set("alt", alt)
  80271. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeTypes/{nodeType}")
  80272. urls += "?" + c.urlParams_.Encode()
  80273. req, _ := http.NewRequest("GET", urls, body)
  80274. req.Header = reqHeaders
  80275. googleapi.Expand(req.URL, map[string]string{
  80276. "project": c.project,
  80277. "zone": c.zone,
  80278. "nodeType": c.nodeType,
  80279. })
  80280. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  80281. }
  80282. // Do executes the "compute.nodeTypes.get" call.
  80283. // Exactly one of *NodeType or error will be non-nil. Any non-2xx status
  80284. // code is an error. Response headers are in either
  80285. // *NodeType.ServerResponse.Header or (if a response was returned at
  80286. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  80287. // to check whether the returned error was because
  80288. // http.StatusNotModified was returned.
  80289. func (c *NodeTypesGetCall) Do(opts ...googleapi.CallOption) (*NodeType, error) {
  80290. gensupport.SetOptions(c.urlParams_, opts...)
  80291. res, err := c.doRequest("json")
  80292. if res != nil && res.StatusCode == http.StatusNotModified {
  80293. if res.Body != nil {
  80294. res.Body.Close()
  80295. }
  80296. return nil, &googleapi.Error{
  80297. Code: res.StatusCode,
  80298. Header: res.Header,
  80299. }
  80300. }
  80301. if err != nil {
  80302. return nil, err
  80303. }
  80304. defer googleapi.CloseBody(res)
  80305. if err := googleapi.CheckResponse(res); err != nil {
  80306. return nil, err
  80307. }
  80308. ret := &NodeType{
  80309. ServerResponse: googleapi.ServerResponse{
  80310. Header: res.Header,
  80311. HTTPStatusCode: res.StatusCode,
  80312. },
  80313. }
  80314. target := &ret
  80315. if err := gensupport.DecodeResponse(target, res); err != nil {
  80316. return nil, err
  80317. }
  80318. return ret, nil
  80319. // {
  80320. // "description": "Returns the specified node type. Gets a list of available node types by making a list() request.",
  80321. // "httpMethod": "GET",
  80322. // "id": "compute.nodeTypes.get",
  80323. // "parameterOrder": [
  80324. // "project",
  80325. // "zone",
  80326. // "nodeType"
  80327. // ],
  80328. // "parameters": {
  80329. // "nodeType": {
  80330. // "description": "Name of the node type to return.",
  80331. // "location": "path",
  80332. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  80333. // "required": true,
  80334. // "type": "string"
  80335. // },
  80336. // "project": {
  80337. // "description": "Project ID for this request.",
  80338. // "location": "path",
  80339. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  80340. // "required": true,
  80341. // "type": "string"
  80342. // },
  80343. // "zone": {
  80344. // "description": "The name of the zone for this request.",
  80345. // "location": "path",
  80346. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  80347. // "required": true,
  80348. // "type": "string"
  80349. // }
  80350. // },
  80351. // "path": "{project}/zones/{zone}/nodeTypes/{nodeType}",
  80352. // "response": {
  80353. // "$ref": "NodeType"
  80354. // },
  80355. // "scopes": [
  80356. // "https://www.googleapis.com/auth/cloud-platform",
  80357. // "https://www.googleapis.com/auth/compute",
  80358. // "https://www.googleapis.com/auth/compute.readonly"
  80359. // ]
  80360. // }
  80361. }
  80362. // method id "compute.nodeTypes.list":
  80363. type NodeTypesListCall struct {
  80364. s *Service
  80365. project string
  80366. zone string
  80367. urlParams_ gensupport.URLParams
  80368. ifNoneMatch_ string
  80369. ctx_ context.Context
  80370. header_ http.Header
  80371. }
  80372. // List: Retrieves a list of node types available to the specified
  80373. // project.
  80374. func (r *NodeTypesService) List(project string, zone string) *NodeTypesListCall {
  80375. c := &NodeTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  80376. c.project = project
  80377. c.zone = zone
  80378. return c
  80379. }
  80380. // Filter sets the optional parameter "filter": A filter expression that
  80381. // filters resources listed in the response. The expression must specify
  80382. // the field name, a comparison operator, and the value that you want to
  80383. // use for filtering. The value must be a string, a number, or a
  80384. // boolean. The comparison operator must be either =, !=, >, or <.
  80385. //
  80386. // For example, if you are filtering Compute Engine instances, you can
  80387. // exclude instances named example-instance by specifying name !=
  80388. // example-instance.
  80389. //
  80390. // You can also filter nested fields. For example, you could specify
  80391. // scheduling.automaticRestart = false to include instances only if they
  80392. // are not scheduled for automatic restarts. You can use filtering on
  80393. // nested fields to filter based on resource labels.
  80394. //
  80395. // To filter on multiple expressions, provide each separate expression
  80396. // within parentheses. For example, (scheduling.automaticRestart = true)
  80397. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  80398. // AND expression. However, you can include AND and OR expressions
  80399. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  80400. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  80401. // true).
  80402. func (c *NodeTypesListCall) Filter(filter string) *NodeTypesListCall {
  80403. c.urlParams_.Set("filter", filter)
  80404. return c
  80405. }
  80406. // MaxResults sets the optional parameter "maxResults": The maximum
  80407. // number of results per page that should be returned. If the number of
  80408. // available results is larger than maxResults, Compute Engine returns a
  80409. // nextPageToken that can be used to get the next page of results in
  80410. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  80411. // (Default: 500)
  80412. func (c *NodeTypesListCall) MaxResults(maxResults int64) *NodeTypesListCall {
  80413. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  80414. return c
  80415. }
  80416. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  80417. // a certain order. By default, results are returned in alphanumerical
  80418. // order based on the resource name.
  80419. //
  80420. // You can also sort results in descending order based on the creation
  80421. // timestamp using orderBy="creationTimestamp desc". This sorts results
  80422. // based on the creationTimestamp field in reverse chronological order
  80423. // (newest result first). Use this to sort resources like operations so
  80424. // that the newest operation is returned first.
  80425. //
  80426. // Currently, only sorting by name or creationTimestamp desc is
  80427. // supported.
  80428. func (c *NodeTypesListCall) OrderBy(orderBy string) *NodeTypesListCall {
  80429. c.urlParams_.Set("orderBy", orderBy)
  80430. return c
  80431. }
  80432. // PageToken sets the optional parameter "pageToken": Specifies a page
  80433. // token to use. Set pageToken to the nextPageToken returned by a
  80434. // previous list request to get the next page of results.
  80435. func (c *NodeTypesListCall) PageToken(pageToken string) *NodeTypesListCall {
  80436. c.urlParams_.Set("pageToken", pageToken)
  80437. return c
  80438. }
  80439. // Fields allows partial responses to be retrieved. See
  80440. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  80441. // for more information.
  80442. func (c *NodeTypesListCall) Fields(s ...googleapi.Field) *NodeTypesListCall {
  80443. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  80444. return c
  80445. }
  80446. // IfNoneMatch sets the optional parameter which makes the operation
  80447. // fail if the object's ETag matches the given value. This is useful for
  80448. // getting updates only after the object has changed since the last
  80449. // request. Use googleapi.IsNotModified to check whether the response
  80450. // error from Do is the result of In-None-Match.
  80451. func (c *NodeTypesListCall) IfNoneMatch(entityTag string) *NodeTypesListCall {
  80452. c.ifNoneMatch_ = entityTag
  80453. return c
  80454. }
  80455. // Context sets the context to be used in this call's Do method. Any
  80456. // pending HTTP request will be aborted if the provided context is
  80457. // canceled.
  80458. func (c *NodeTypesListCall) Context(ctx context.Context) *NodeTypesListCall {
  80459. c.ctx_ = ctx
  80460. return c
  80461. }
  80462. // Header returns an http.Header that can be modified by the caller to
  80463. // add HTTP headers to the request.
  80464. func (c *NodeTypesListCall) Header() http.Header {
  80465. if c.header_ == nil {
  80466. c.header_ = make(http.Header)
  80467. }
  80468. return c.header_
  80469. }
  80470. func (c *NodeTypesListCall) doRequest(alt string) (*http.Response, error) {
  80471. reqHeaders := make(http.Header)
  80472. for k, v := range c.header_ {
  80473. reqHeaders[k] = v
  80474. }
  80475. reqHeaders.Set("User-Agent", c.s.userAgent())
  80476. if c.ifNoneMatch_ != "" {
  80477. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  80478. }
  80479. var body io.Reader = nil
  80480. c.urlParams_.Set("alt", alt)
  80481. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeTypes")
  80482. urls += "?" + c.urlParams_.Encode()
  80483. req, _ := http.NewRequest("GET", urls, body)
  80484. req.Header = reqHeaders
  80485. googleapi.Expand(req.URL, map[string]string{
  80486. "project": c.project,
  80487. "zone": c.zone,
  80488. })
  80489. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  80490. }
  80491. // Do executes the "compute.nodeTypes.list" call.
  80492. // Exactly one of *NodeTypeList or error will be non-nil. Any non-2xx
  80493. // status code is an error. Response headers are in either
  80494. // *NodeTypeList.ServerResponse.Header or (if a response was returned at
  80495. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  80496. // to check whether the returned error was because
  80497. // http.StatusNotModified was returned.
  80498. func (c *NodeTypesListCall) Do(opts ...googleapi.CallOption) (*NodeTypeList, error) {
  80499. gensupport.SetOptions(c.urlParams_, opts...)
  80500. res, err := c.doRequest("json")
  80501. if res != nil && res.StatusCode == http.StatusNotModified {
  80502. if res.Body != nil {
  80503. res.Body.Close()
  80504. }
  80505. return nil, &googleapi.Error{
  80506. Code: res.StatusCode,
  80507. Header: res.Header,
  80508. }
  80509. }
  80510. if err != nil {
  80511. return nil, err
  80512. }
  80513. defer googleapi.CloseBody(res)
  80514. if err := googleapi.CheckResponse(res); err != nil {
  80515. return nil, err
  80516. }
  80517. ret := &NodeTypeList{
  80518. ServerResponse: googleapi.ServerResponse{
  80519. Header: res.Header,
  80520. HTTPStatusCode: res.StatusCode,
  80521. },
  80522. }
  80523. target := &ret
  80524. if err := gensupport.DecodeResponse(target, res); err != nil {
  80525. return nil, err
  80526. }
  80527. return ret, nil
  80528. // {
  80529. // "description": "Retrieves a list of node types available to the specified project.",
  80530. // "httpMethod": "GET",
  80531. // "id": "compute.nodeTypes.list",
  80532. // "parameterOrder": [
  80533. // "project",
  80534. // "zone"
  80535. // ],
  80536. // "parameters": {
  80537. // "filter": {
  80538. // "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).",
  80539. // "location": "query",
  80540. // "type": "string"
  80541. // },
  80542. // "maxResults": {
  80543. // "default": "500",
  80544. // "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)",
  80545. // "format": "uint32",
  80546. // "location": "query",
  80547. // "minimum": "0",
  80548. // "type": "integer"
  80549. // },
  80550. // "orderBy": {
  80551. // "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.",
  80552. // "location": "query",
  80553. // "type": "string"
  80554. // },
  80555. // "pageToken": {
  80556. // "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.",
  80557. // "location": "query",
  80558. // "type": "string"
  80559. // },
  80560. // "project": {
  80561. // "description": "Project ID for this request.",
  80562. // "location": "path",
  80563. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  80564. // "required": true,
  80565. // "type": "string"
  80566. // },
  80567. // "zone": {
  80568. // "description": "The name of the zone for this request.",
  80569. // "location": "path",
  80570. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  80571. // "required": true,
  80572. // "type": "string"
  80573. // }
  80574. // },
  80575. // "path": "{project}/zones/{zone}/nodeTypes",
  80576. // "response": {
  80577. // "$ref": "NodeTypeList"
  80578. // },
  80579. // "scopes": [
  80580. // "https://www.googleapis.com/auth/cloud-platform",
  80581. // "https://www.googleapis.com/auth/compute",
  80582. // "https://www.googleapis.com/auth/compute.readonly"
  80583. // ]
  80584. // }
  80585. }
  80586. // Pages invokes f for each page of results.
  80587. // A non-nil error returned from f will halt the iteration.
  80588. // The provided context supersedes any context provided to the Context method.
  80589. func (c *NodeTypesListCall) Pages(ctx context.Context, f func(*NodeTypeList) error) error {
  80590. c.ctx_ = ctx
  80591. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  80592. for {
  80593. x, err := c.Do()
  80594. if err != nil {
  80595. return err
  80596. }
  80597. if err := f(x); err != nil {
  80598. return err
  80599. }
  80600. if x.NextPageToken == "" {
  80601. return nil
  80602. }
  80603. c.PageToken(x.NextPageToken)
  80604. }
  80605. }
  80606. // method id "compute.projects.disableXpnHost":
  80607. type ProjectsDisableXpnHostCall struct {
  80608. s *Service
  80609. project string
  80610. urlParams_ gensupport.URLParams
  80611. ctx_ context.Context
  80612. header_ http.Header
  80613. }
  80614. // DisableXpnHost: Disable this project as a shared VPC host project.
  80615. func (r *ProjectsService) DisableXpnHost(project string) *ProjectsDisableXpnHostCall {
  80616. c := &ProjectsDisableXpnHostCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  80617. c.project = project
  80618. return c
  80619. }
  80620. // RequestId sets the optional parameter "requestId": An optional
  80621. // request ID to identify requests. Specify a unique request ID so that
  80622. // if you must retry your request, the server will know to ignore the
  80623. // request if it has already been completed.
  80624. //
  80625. // For example, consider a situation where you make an initial request
  80626. // and the request times out. If you make the request again with the
  80627. // same request ID, the server can check if original operation with the
  80628. // same request ID was received, and if so, will ignore the second
  80629. // request. This prevents clients from accidentally creating duplicate
  80630. // commitments.
  80631. //
  80632. // The request ID must be a valid UUID with the exception that zero UUID
  80633. // is not supported (00000000-0000-0000-0000-000000000000).
  80634. func (c *ProjectsDisableXpnHostCall) RequestId(requestId string) *ProjectsDisableXpnHostCall {
  80635. c.urlParams_.Set("requestId", requestId)
  80636. return c
  80637. }
  80638. // Fields allows partial responses to be retrieved. See
  80639. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  80640. // for more information.
  80641. func (c *ProjectsDisableXpnHostCall) Fields(s ...googleapi.Field) *ProjectsDisableXpnHostCall {
  80642. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  80643. return c
  80644. }
  80645. // Context sets the context to be used in this call's Do method. Any
  80646. // pending HTTP request will be aborted if the provided context is
  80647. // canceled.
  80648. func (c *ProjectsDisableXpnHostCall) Context(ctx context.Context) *ProjectsDisableXpnHostCall {
  80649. c.ctx_ = ctx
  80650. return c
  80651. }
  80652. // Header returns an http.Header that can be modified by the caller to
  80653. // add HTTP headers to the request.
  80654. func (c *ProjectsDisableXpnHostCall) Header() http.Header {
  80655. if c.header_ == nil {
  80656. c.header_ = make(http.Header)
  80657. }
  80658. return c.header_
  80659. }
  80660. func (c *ProjectsDisableXpnHostCall) doRequest(alt string) (*http.Response, error) {
  80661. reqHeaders := make(http.Header)
  80662. for k, v := range c.header_ {
  80663. reqHeaders[k] = v
  80664. }
  80665. reqHeaders.Set("User-Agent", c.s.userAgent())
  80666. var body io.Reader = nil
  80667. c.urlParams_.Set("alt", alt)
  80668. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/disableXpnHost")
  80669. urls += "?" + c.urlParams_.Encode()
  80670. req, _ := http.NewRequest("POST", urls, body)
  80671. req.Header = reqHeaders
  80672. googleapi.Expand(req.URL, map[string]string{
  80673. "project": c.project,
  80674. })
  80675. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  80676. }
  80677. // Do executes the "compute.projects.disableXpnHost" call.
  80678. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  80679. // status code is an error. Response headers are in either
  80680. // *Operation.ServerResponse.Header or (if a response was returned at
  80681. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  80682. // to check whether the returned error was because
  80683. // http.StatusNotModified was returned.
  80684. func (c *ProjectsDisableXpnHostCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  80685. gensupport.SetOptions(c.urlParams_, opts...)
  80686. res, err := c.doRequest("json")
  80687. if res != nil && res.StatusCode == http.StatusNotModified {
  80688. if res.Body != nil {
  80689. res.Body.Close()
  80690. }
  80691. return nil, &googleapi.Error{
  80692. Code: res.StatusCode,
  80693. Header: res.Header,
  80694. }
  80695. }
  80696. if err != nil {
  80697. return nil, err
  80698. }
  80699. defer googleapi.CloseBody(res)
  80700. if err := googleapi.CheckResponse(res); err != nil {
  80701. return nil, err
  80702. }
  80703. ret := &Operation{
  80704. ServerResponse: googleapi.ServerResponse{
  80705. Header: res.Header,
  80706. HTTPStatusCode: res.StatusCode,
  80707. },
  80708. }
  80709. target := &ret
  80710. if err := gensupport.DecodeResponse(target, res); err != nil {
  80711. return nil, err
  80712. }
  80713. return ret, nil
  80714. // {
  80715. // "description": "Disable this project as a shared VPC host project.",
  80716. // "httpMethod": "POST",
  80717. // "id": "compute.projects.disableXpnHost",
  80718. // "parameterOrder": [
  80719. // "project"
  80720. // ],
  80721. // "parameters": {
  80722. // "project": {
  80723. // "description": "Project ID for this request.",
  80724. // "location": "path",
  80725. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  80726. // "required": true,
  80727. // "type": "string"
  80728. // },
  80729. // "requestId": {
  80730. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  80731. // "location": "query",
  80732. // "type": "string"
  80733. // }
  80734. // },
  80735. // "path": "{project}/disableXpnHost",
  80736. // "response": {
  80737. // "$ref": "Operation"
  80738. // },
  80739. // "scopes": [
  80740. // "https://www.googleapis.com/auth/cloud-platform",
  80741. // "https://www.googleapis.com/auth/compute"
  80742. // ]
  80743. // }
  80744. }
  80745. // method id "compute.projects.disableXpnResource":
  80746. type ProjectsDisableXpnResourceCall struct {
  80747. s *Service
  80748. project string
  80749. projectsdisablexpnresourcerequest *ProjectsDisableXpnResourceRequest
  80750. urlParams_ gensupport.URLParams
  80751. ctx_ context.Context
  80752. header_ http.Header
  80753. }
  80754. // DisableXpnResource: Disable a serivce resource (a.k.a service
  80755. // project) associated with this host project.
  80756. func (r *ProjectsService) DisableXpnResource(project string, projectsdisablexpnresourcerequest *ProjectsDisableXpnResourceRequest) *ProjectsDisableXpnResourceCall {
  80757. c := &ProjectsDisableXpnResourceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  80758. c.project = project
  80759. c.projectsdisablexpnresourcerequest = projectsdisablexpnresourcerequest
  80760. return c
  80761. }
  80762. // RequestId sets the optional parameter "requestId": An optional
  80763. // request ID to identify requests. Specify a unique request ID so that
  80764. // if you must retry your request, the server will know to ignore the
  80765. // request if it has already been completed.
  80766. //
  80767. // For example, consider a situation where you make an initial request
  80768. // and the request times out. If you make the request again with the
  80769. // same request ID, the server can check if original operation with the
  80770. // same request ID was received, and if so, will ignore the second
  80771. // request. This prevents clients from accidentally creating duplicate
  80772. // commitments.
  80773. //
  80774. // The request ID must be a valid UUID with the exception that zero UUID
  80775. // is not supported (00000000-0000-0000-0000-000000000000).
  80776. func (c *ProjectsDisableXpnResourceCall) RequestId(requestId string) *ProjectsDisableXpnResourceCall {
  80777. c.urlParams_.Set("requestId", requestId)
  80778. return c
  80779. }
  80780. // Fields allows partial responses to be retrieved. See
  80781. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  80782. // for more information.
  80783. func (c *ProjectsDisableXpnResourceCall) Fields(s ...googleapi.Field) *ProjectsDisableXpnResourceCall {
  80784. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  80785. return c
  80786. }
  80787. // Context sets the context to be used in this call's Do method. Any
  80788. // pending HTTP request will be aborted if the provided context is
  80789. // canceled.
  80790. func (c *ProjectsDisableXpnResourceCall) Context(ctx context.Context) *ProjectsDisableXpnResourceCall {
  80791. c.ctx_ = ctx
  80792. return c
  80793. }
  80794. // Header returns an http.Header that can be modified by the caller to
  80795. // add HTTP headers to the request.
  80796. func (c *ProjectsDisableXpnResourceCall) Header() http.Header {
  80797. if c.header_ == nil {
  80798. c.header_ = make(http.Header)
  80799. }
  80800. return c.header_
  80801. }
  80802. func (c *ProjectsDisableXpnResourceCall) doRequest(alt string) (*http.Response, error) {
  80803. reqHeaders := make(http.Header)
  80804. for k, v := range c.header_ {
  80805. reqHeaders[k] = v
  80806. }
  80807. reqHeaders.Set("User-Agent", c.s.userAgent())
  80808. var body io.Reader = nil
  80809. body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectsdisablexpnresourcerequest)
  80810. if err != nil {
  80811. return nil, err
  80812. }
  80813. reqHeaders.Set("Content-Type", "application/json")
  80814. c.urlParams_.Set("alt", alt)
  80815. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/disableXpnResource")
  80816. urls += "?" + c.urlParams_.Encode()
  80817. req, _ := http.NewRequest("POST", urls, body)
  80818. req.Header = reqHeaders
  80819. googleapi.Expand(req.URL, map[string]string{
  80820. "project": c.project,
  80821. })
  80822. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  80823. }
  80824. // Do executes the "compute.projects.disableXpnResource" call.
  80825. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  80826. // status code is an error. Response headers are in either
  80827. // *Operation.ServerResponse.Header or (if a response was returned at
  80828. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  80829. // to check whether the returned error was because
  80830. // http.StatusNotModified was returned.
  80831. func (c *ProjectsDisableXpnResourceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  80832. gensupport.SetOptions(c.urlParams_, opts...)
  80833. res, err := c.doRequest("json")
  80834. if res != nil && res.StatusCode == http.StatusNotModified {
  80835. if res.Body != nil {
  80836. res.Body.Close()
  80837. }
  80838. return nil, &googleapi.Error{
  80839. Code: res.StatusCode,
  80840. Header: res.Header,
  80841. }
  80842. }
  80843. if err != nil {
  80844. return nil, err
  80845. }
  80846. defer googleapi.CloseBody(res)
  80847. if err := googleapi.CheckResponse(res); err != nil {
  80848. return nil, err
  80849. }
  80850. ret := &Operation{
  80851. ServerResponse: googleapi.ServerResponse{
  80852. Header: res.Header,
  80853. HTTPStatusCode: res.StatusCode,
  80854. },
  80855. }
  80856. target := &ret
  80857. if err := gensupport.DecodeResponse(target, res); err != nil {
  80858. return nil, err
  80859. }
  80860. return ret, nil
  80861. // {
  80862. // "description": "Disable a serivce resource (a.k.a service project) associated with this host project.",
  80863. // "httpMethod": "POST",
  80864. // "id": "compute.projects.disableXpnResource",
  80865. // "parameterOrder": [
  80866. // "project"
  80867. // ],
  80868. // "parameters": {
  80869. // "project": {
  80870. // "description": "Project ID for this request.",
  80871. // "location": "path",
  80872. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  80873. // "required": true,
  80874. // "type": "string"
  80875. // },
  80876. // "requestId": {
  80877. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  80878. // "location": "query",
  80879. // "type": "string"
  80880. // }
  80881. // },
  80882. // "path": "{project}/disableXpnResource",
  80883. // "request": {
  80884. // "$ref": "ProjectsDisableXpnResourceRequest"
  80885. // },
  80886. // "response": {
  80887. // "$ref": "Operation"
  80888. // },
  80889. // "scopes": [
  80890. // "https://www.googleapis.com/auth/cloud-platform",
  80891. // "https://www.googleapis.com/auth/compute"
  80892. // ]
  80893. // }
  80894. }
  80895. // method id "compute.projects.enableXpnHost":
  80896. type ProjectsEnableXpnHostCall struct {
  80897. s *Service
  80898. project string
  80899. urlParams_ gensupport.URLParams
  80900. ctx_ context.Context
  80901. header_ http.Header
  80902. }
  80903. // EnableXpnHost: Enable this project as a shared VPC host project.
  80904. func (r *ProjectsService) EnableXpnHost(project string) *ProjectsEnableXpnHostCall {
  80905. c := &ProjectsEnableXpnHostCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  80906. c.project = project
  80907. return c
  80908. }
  80909. // RequestId sets the optional parameter "requestId": An optional
  80910. // request ID to identify requests. Specify a unique request ID so that
  80911. // if you must retry your request, the server will know to ignore the
  80912. // request if it has already been completed.
  80913. //
  80914. // For example, consider a situation where you make an initial request
  80915. // and the request times out. If you make the request again with the
  80916. // same request ID, the server can check if original operation with the
  80917. // same request ID was received, and if so, will ignore the second
  80918. // request. This prevents clients from accidentally creating duplicate
  80919. // commitments.
  80920. //
  80921. // The request ID must be a valid UUID with the exception that zero UUID
  80922. // is not supported (00000000-0000-0000-0000-000000000000).
  80923. func (c *ProjectsEnableXpnHostCall) RequestId(requestId string) *ProjectsEnableXpnHostCall {
  80924. c.urlParams_.Set("requestId", requestId)
  80925. return c
  80926. }
  80927. // Fields allows partial responses to be retrieved. See
  80928. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  80929. // for more information.
  80930. func (c *ProjectsEnableXpnHostCall) Fields(s ...googleapi.Field) *ProjectsEnableXpnHostCall {
  80931. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  80932. return c
  80933. }
  80934. // Context sets the context to be used in this call's Do method. Any
  80935. // pending HTTP request will be aborted if the provided context is
  80936. // canceled.
  80937. func (c *ProjectsEnableXpnHostCall) Context(ctx context.Context) *ProjectsEnableXpnHostCall {
  80938. c.ctx_ = ctx
  80939. return c
  80940. }
  80941. // Header returns an http.Header that can be modified by the caller to
  80942. // add HTTP headers to the request.
  80943. func (c *ProjectsEnableXpnHostCall) Header() http.Header {
  80944. if c.header_ == nil {
  80945. c.header_ = make(http.Header)
  80946. }
  80947. return c.header_
  80948. }
  80949. func (c *ProjectsEnableXpnHostCall) doRequest(alt string) (*http.Response, error) {
  80950. reqHeaders := make(http.Header)
  80951. for k, v := range c.header_ {
  80952. reqHeaders[k] = v
  80953. }
  80954. reqHeaders.Set("User-Agent", c.s.userAgent())
  80955. var body io.Reader = nil
  80956. c.urlParams_.Set("alt", alt)
  80957. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/enableXpnHost")
  80958. urls += "?" + c.urlParams_.Encode()
  80959. req, _ := http.NewRequest("POST", urls, body)
  80960. req.Header = reqHeaders
  80961. googleapi.Expand(req.URL, map[string]string{
  80962. "project": c.project,
  80963. })
  80964. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  80965. }
  80966. // Do executes the "compute.projects.enableXpnHost" call.
  80967. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  80968. // status code is an error. Response headers are in either
  80969. // *Operation.ServerResponse.Header or (if a response was returned at
  80970. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  80971. // to check whether the returned error was because
  80972. // http.StatusNotModified was returned.
  80973. func (c *ProjectsEnableXpnHostCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  80974. gensupport.SetOptions(c.urlParams_, opts...)
  80975. res, err := c.doRequest("json")
  80976. if res != nil && res.StatusCode == http.StatusNotModified {
  80977. if res.Body != nil {
  80978. res.Body.Close()
  80979. }
  80980. return nil, &googleapi.Error{
  80981. Code: res.StatusCode,
  80982. Header: res.Header,
  80983. }
  80984. }
  80985. if err != nil {
  80986. return nil, err
  80987. }
  80988. defer googleapi.CloseBody(res)
  80989. if err := googleapi.CheckResponse(res); err != nil {
  80990. return nil, err
  80991. }
  80992. ret := &Operation{
  80993. ServerResponse: googleapi.ServerResponse{
  80994. Header: res.Header,
  80995. HTTPStatusCode: res.StatusCode,
  80996. },
  80997. }
  80998. target := &ret
  80999. if err := gensupport.DecodeResponse(target, res); err != nil {
  81000. return nil, err
  81001. }
  81002. return ret, nil
  81003. // {
  81004. // "description": "Enable this project as a shared VPC host project.",
  81005. // "httpMethod": "POST",
  81006. // "id": "compute.projects.enableXpnHost",
  81007. // "parameterOrder": [
  81008. // "project"
  81009. // ],
  81010. // "parameters": {
  81011. // "project": {
  81012. // "description": "Project ID for this request.",
  81013. // "location": "path",
  81014. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  81015. // "required": true,
  81016. // "type": "string"
  81017. // },
  81018. // "requestId": {
  81019. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  81020. // "location": "query",
  81021. // "type": "string"
  81022. // }
  81023. // },
  81024. // "path": "{project}/enableXpnHost",
  81025. // "response": {
  81026. // "$ref": "Operation"
  81027. // },
  81028. // "scopes": [
  81029. // "https://www.googleapis.com/auth/cloud-platform",
  81030. // "https://www.googleapis.com/auth/compute"
  81031. // ]
  81032. // }
  81033. }
  81034. // method id "compute.projects.enableXpnResource":
  81035. type ProjectsEnableXpnResourceCall struct {
  81036. s *Service
  81037. project string
  81038. projectsenablexpnresourcerequest *ProjectsEnableXpnResourceRequest
  81039. urlParams_ gensupport.URLParams
  81040. ctx_ context.Context
  81041. header_ http.Header
  81042. }
  81043. // EnableXpnResource: Enable service resource (a.k.a service project)
  81044. // for a host project, so that subnets in the host project can be used
  81045. // by instances in the service project.
  81046. func (r *ProjectsService) EnableXpnResource(project string, projectsenablexpnresourcerequest *ProjectsEnableXpnResourceRequest) *ProjectsEnableXpnResourceCall {
  81047. c := &ProjectsEnableXpnResourceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  81048. c.project = project
  81049. c.projectsenablexpnresourcerequest = projectsenablexpnresourcerequest
  81050. return c
  81051. }
  81052. // RequestId sets the optional parameter "requestId": An optional
  81053. // request ID to identify requests. Specify a unique request ID so that
  81054. // if you must retry your request, the server will know to ignore the
  81055. // request if it has already been completed.
  81056. //
  81057. // For example, consider a situation where you make an initial request
  81058. // and the request times out. If you make the request again with the
  81059. // same request ID, the server can check if original operation with the
  81060. // same request ID was received, and if so, will ignore the second
  81061. // request. This prevents clients from accidentally creating duplicate
  81062. // commitments.
  81063. //
  81064. // The request ID must be a valid UUID with the exception that zero UUID
  81065. // is not supported (00000000-0000-0000-0000-000000000000).
  81066. func (c *ProjectsEnableXpnResourceCall) RequestId(requestId string) *ProjectsEnableXpnResourceCall {
  81067. c.urlParams_.Set("requestId", requestId)
  81068. return c
  81069. }
  81070. // Fields allows partial responses to be retrieved. See
  81071. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  81072. // for more information.
  81073. func (c *ProjectsEnableXpnResourceCall) Fields(s ...googleapi.Field) *ProjectsEnableXpnResourceCall {
  81074. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  81075. return c
  81076. }
  81077. // Context sets the context to be used in this call's Do method. Any
  81078. // pending HTTP request will be aborted if the provided context is
  81079. // canceled.
  81080. func (c *ProjectsEnableXpnResourceCall) Context(ctx context.Context) *ProjectsEnableXpnResourceCall {
  81081. c.ctx_ = ctx
  81082. return c
  81083. }
  81084. // Header returns an http.Header that can be modified by the caller to
  81085. // add HTTP headers to the request.
  81086. func (c *ProjectsEnableXpnResourceCall) Header() http.Header {
  81087. if c.header_ == nil {
  81088. c.header_ = make(http.Header)
  81089. }
  81090. return c.header_
  81091. }
  81092. func (c *ProjectsEnableXpnResourceCall) doRequest(alt string) (*http.Response, error) {
  81093. reqHeaders := make(http.Header)
  81094. for k, v := range c.header_ {
  81095. reqHeaders[k] = v
  81096. }
  81097. reqHeaders.Set("User-Agent", c.s.userAgent())
  81098. var body io.Reader = nil
  81099. body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectsenablexpnresourcerequest)
  81100. if err != nil {
  81101. return nil, err
  81102. }
  81103. reqHeaders.Set("Content-Type", "application/json")
  81104. c.urlParams_.Set("alt", alt)
  81105. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/enableXpnResource")
  81106. urls += "?" + c.urlParams_.Encode()
  81107. req, _ := http.NewRequest("POST", urls, body)
  81108. req.Header = reqHeaders
  81109. googleapi.Expand(req.URL, map[string]string{
  81110. "project": c.project,
  81111. })
  81112. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  81113. }
  81114. // Do executes the "compute.projects.enableXpnResource" call.
  81115. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  81116. // status code is an error. Response headers are in either
  81117. // *Operation.ServerResponse.Header or (if a response was returned at
  81118. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  81119. // to check whether the returned error was because
  81120. // http.StatusNotModified was returned.
  81121. func (c *ProjectsEnableXpnResourceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  81122. gensupport.SetOptions(c.urlParams_, opts...)
  81123. res, err := c.doRequest("json")
  81124. if res != nil && res.StatusCode == http.StatusNotModified {
  81125. if res.Body != nil {
  81126. res.Body.Close()
  81127. }
  81128. return nil, &googleapi.Error{
  81129. Code: res.StatusCode,
  81130. Header: res.Header,
  81131. }
  81132. }
  81133. if err != nil {
  81134. return nil, err
  81135. }
  81136. defer googleapi.CloseBody(res)
  81137. if err := googleapi.CheckResponse(res); err != nil {
  81138. return nil, err
  81139. }
  81140. ret := &Operation{
  81141. ServerResponse: googleapi.ServerResponse{
  81142. Header: res.Header,
  81143. HTTPStatusCode: res.StatusCode,
  81144. },
  81145. }
  81146. target := &ret
  81147. if err := gensupport.DecodeResponse(target, res); err != nil {
  81148. return nil, err
  81149. }
  81150. return ret, nil
  81151. // {
  81152. // "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.",
  81153. // "httpMethod": "POST",
  81154. // "id": "compute.projects.enableXpnResource",
  81155. // "parameterOrder": [
  81156. // "project"
  81157. // ],
  81158. // "parameters": {
  81159. // "project": {
  81160. // "description": "Project ID for this request.",
  81161. // "location": "path",
  81162. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  81163. // "required": true,
  81164. // "type": "string"
  81165. // },
  81166. // "requestId": {
  81167. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  81168. // "location": "query",
  81169. // "type": "string"
  81170. // }
  81171. // },
  81172. // "path": "{project}/enableXpnResource",
  81173. // "request": {
  81174. // "$ref": "ProjectsEnableXpnResourceRequest"
  81175. // },
  81176. // "response": {
  81177. // "$ref": "Operation"
  81178. // },
  81179. // "scopes": [
  81180. // "https://www.googleapis.com/auth/cloud-platform",
  81181. // "https://www.googleapis.com/auth/compute"
  81182. // ]
  81183. // }
  81184. }
  81185. // method id "compute.projects.get":
  81186. type ProjectsGetCall struct {
  81187. s *Service
  81188. project string
  81189. urlParams_ gensupport.URLParams
  81190. ifNoneMatch_ string
  81191. ctx_ context.Context
  81192. header_ http.Header
  81193. }
  81194. // Get: Returns the specified Project resource.
  81195. // For details, see https://cloud.google.com/compute/docs/reference/latest/projects/get
  81196. func (r *ProjectsService) Get(project string) *ProjectsGetCall {
  81197. c := &ProjectsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  81198. c.project = project
  81199. return c
  81200. }
  81201. // Fields allows partial responses to be retrieved. See
  81202. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  81203. // for more information.
  81204. func (c *ProjectsGetCall) Fields(s ...googleapi.Field) *ProjectsGetCall {
  81205. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  81206. return c
  81207. }
  81208. // IfNoneMatch sets the optional parameter which makes the operation
  81209. // fail if the object's ETag matches the given value. This is useful for
  81210. // getting updates only after the object has changed since the last
  81211. // request. Use googleapi.IsNotModified to check whether the response
  81212. // error from Do is the result of In-None-Match.
  81213. func (c *ProjectsGetCall) IfNoneMatch(entityTag string) *ProjectsGetCall {
  81214. c.ifNoneMatch_ = entityTag
  81215. return c
  81216. }
  81217. // Context sets the context to be used in this call's Do method. Any
  81218. // pending HTTP request will be aborted if the provided context is
  81219. // canceled.
  81220. func (c *ProjectsGetCall) Context(ctx context.Context) *ProjectsGetCall {
  81221. c.ctx_ = ctx
  81222. return c
  81223. }
  81224. // Header returns an http.Header that can be modified by the caller to
  81225. // add HTTP headers to the request.
  81226. func (c *ProjectsGetCall) Header() http.Header {
  81227. if c.header_ == nil {
  81228. c.header_ = make(http.Header)
  81229. }
  81230. return c.header_
  81231. }
  81232. func (c *ProjectsGetCall) doRequest(alt string) (*http.Response, error) {
  81233. reqHeaders := make(http.Header)
  81234. for k, v := range c.header_ {
  81235. reqHeaders[k] = v
  81236. }
  81237. reqHeaders.Set("User-Agent", c.s.userAgent())
  81238. if c.ifNoneMatch_ != "" {
  81239. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  81240. }
  81241. var body io.Reader = nil
  81242. c.urlParams_.Set("alt", alt)
  81243. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}")
  81244. urls += "?" + c.urlParams_.Encode()
  81245. req, _ := http.NewRequest("GET", urls, body)
  81246. req.Header = reqHeaders
  81247. googleapi.Expand(req.URL, map[string]string{
  81248. "project": c.project,
  81249. })
  81250. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  81251. }
  81252. // Do executes the "compute.projects.get" call.
  81253. // Exactly one of *Project or error will be non-nil. Any non-2xx status
  81254. // code is an error. Response headers are in either
  81255. // *Project.ServerResponse.Header or (if a response was returned at all)
  81256. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  81257. // check whether the returned error was because http.StatusNotModified
  81258. // was returned.
  81259. func (c *ProjectsGetCall) Do(opts ...googleapi.CallOption) (*Project, error) {
  81260. gensupport.SetOptions(c.urlParams_, opts...)
  81261. res, err := c.doRequest("json")
  81262. if res != nil && res.StatusCode == http.StatusNotModified {
  81263. if res.Body != nil {
  81264. res.Body.Close()
  81265. }
  81266. return nil, &googleapi.Error{
  81267. Code: res.StatusCode,
  81268. Header: res.Header,
  81269. }
  81270. }
  81271. if err != nil {
  81272. return nil, err
  81273. }
  81274. defer googleapi.CloseBody(res)
  81275. if err := googleapi.CheckResponse(res); err != nil {
  81276. return nil, err
  81277. }
  81278. ret := &Project{
  81279. ServerResponse: googleapi.ServerResponse{
  81280. Header: res.Header,
  81281. HTTPStatusCode: res.StatusCode,
  81282. },
  81283. }
  81284. target := &ret
  81285. if err := gensupport.DecodeResponse(target, res); err != nil {
  81286. return nil, err
  81287. }
  81288. return ret, nil
  81289. // {
  81290. // "description": "Returns the specified Project resource.",
  81291. // "httpMethod": "GET",
  81292. // "id": "compute.projects.get",
  81293. // "parameterOrder": [
  81294. // "project"
  81295. // ],
  81296. // "parameters": {
  81297. // "project": {
  81298. // "description": "Project ID for this request.",
  81299. // "location": "path",
  81300. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  81301. // "required": true,
  81302. // "type": "string"
  81303. // }
  81304. // },
  81305. // "path": "{project}",
  81306. // "response": {
  81307. // "$ref": "Project"
  81308. // },
  81309. // "scopes": [
  81310. // "https://www.googleapis.com/auth/cloud-platform",
  81311. // "https://www.googleapis.com/auth/compute",
  81312. // "https://www.googleapis.com/auth/compute.readonly"
  81313. // ]
  81314. // }
  81315. }
  81316. // method id "compute.projects.getXpnHost":
  81317. type ProjectsGetXpnHostCall struct {
  81318. s *Service
  81319. project string
  81320. urlParams_ gensupport.URLParams
  81321. ifNoneMatch_ string
  81322. ctx_ context.Context
  81323. header_ http.Header
  81324. }
  81325. // GetXpnHost: Gets the shared VPC host project that this project links
  81326. // to. May be empty if no link exists.
  81327. func (r *ProjectsService) GetXpnHost(project string) *ProjectsGetXpnHostCall {
  81328. c := &ProjectsGetXpnHostCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  81329. c.project = project
  81330. return c
  81331. }
  81332. // Fields allows partial responses to be retrieved. See
  81333. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  81334. // for more information.
  81335. func (c *ProjectsGetXpnHostCall) Fields(s ...googleapi.Field) *ProjectsGetXpnHostCall {
  81336. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  81337. return c
  81338. }
  81339. // IfNoneMatch sets the optional parameter which makes the operation
  81340. // fail if the object's ETag matches the given value. This is useful for
  81341. // getting updates only after the object has changed since the last
  81342. // request. Use googleapi.IsNotModified to check whether the response
  81343. // error from Do is the result of In-None-Match.
  81344. func (c *ProjectsGetXpnHostCall) IfNoneMatch(entityTag string) *ProjectsGetXpnHostCall {
  81345. c.ifNoneMatch_ = entityTag
  81346. return c
  81347. }
  81348. // Context sets the context to be used in this call's Do method. Any
  81349. // pending HTTP request will be aborted if the provided context is
  81350. // canceled.
  81351. func (c *ProjectsGetXpnHostCall) Context(ctx context.Context) *ProjectsGetXpnHostCall {
  81352. c.ctx_ = ctx
  81353. return c
  81354. }
  81355. // Header returns an http.Header that can be modified by the caller to
  81356. // add HTTP headers to the request.
  81357. func (c *ProjectsGetXpnHostCall) Header() http.Header {
  81358. if c.header_ == nil {
  81359. c.header_ = make(http.Header)
  81360. }
  81361. return c.header_
  81362. }
  81363. func (c *ProjectsGetXpnHostCall) doRequest(alt string) (*http.Response, error) {
  81364. reqHeaders := make(http.Header)
  81365. for k, v := range c.header_ {
  81366. reqHeaders[k] = v
  81367. }
  81368. reqHeaders.Set("User-Agent", c.s.userAgent())
  81369. if c.ifNoneMatch_ != "" {
  81370. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  81371. }
  81372. var body io.Reader = nil
  81373. c.urlParams_.Set("alt", alt)
  81374. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/getXpnHost")
  81375. urls += "?" + c.urlParams_.Encode()
  81376. req, _ := http.NewRequest("GET", urls, body)
  81377. req.Header = reqHeaders
  81378. googleapi.Expand(req.URL, map[string]string{
  81379. "project": c.project,
  81380. })
  81381. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  81382. }
  81383. // Do executes the "compute.projects.getXpnHost" call.
  81384. // Exactly one of *Project or error will be non-nil. Any non-2xx status
  81385. // code is an error. Response headers are in either
  81386. // *Project.ServerResponse.Header or (if a response was returned at all)
  81387. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  81388. // check whether the returned error was because http.StatusNotModified
  81389. // was returned.
  81390. func (c *ProjectsGetXpnHostCall) Do(opts ...googleapi.CallOption) (*Project, error) {
  81391. gensupport.SetOptions(c.urlParams_, opts...)
  81392. res, err := c.doRequest("json")
  81393. if res != nil && res.StatusCode == http.StatusNotModified {
  81394. if res.Body != nil {
  81395. res.Body.Close()
  81396. }
  81397. return nil, &googleapi.Error{
  81398. Code: res.StatusCode,
  81399. Header: res.Header,
  81400. }
  81401. }
  81402. if err != nil {
  81403. return nil, err
  81404. }
  81405. defer googleapi.CloseBody(res)
  81406. if err := googleapi.CheckResponse(res); err != nil {
  81407. return nil, err
  81408. }
  81409. ret := &Project{
  81410. ServerResponse: googleapi.ServerResponse{
  81411. Header: res.Header,
  81412. HTTPStatusCode: res.StatusCode,
  81413. },
  81414. }
  81415. target := &ret
  81416. if err := gensupport.DecodeResponse(target, res); err != nil {
  81417. return nil, err
  81418. }
  81419. return ret, nil
  81420. // {
  81421. // "description": "Gets the shared VPC host project that this project links to. May be empty if no link exists.",
  81422. // "httpMethod": "GET",
  81423. // "id": "compute.projects.getXpnHost",
  81424. // "parameterOrder": [
  81425. // "project"
  81426. // ],
  81427. // "parameters": {
  81428. // "project": {
  81429. // "description": "Project ID for this request.",
  81430. // "location": "path",
  81431. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  81432. // "required": true,
  81433. // "type": "string"
  81434. // }
  81435. // },
  81436. // "path": "{project}/getXpnHost",
  81437. // "response": {
  81438. // "$ref": "Project"
  81439. // },
  81440. // "scopes": [
  81441. // "https://www.googleapis.com/auth/cloud-platform",
  81442. // "https://www.googleapis.com/auth/compute"
  81443. // ]
  81444. // }
  81445. }
  81446. // method id "compute.projects.getXpnResources":
  81447. type ProjectsGetXpnResourcesCall struct {
  81448. s *Service
  81449. project string
  81450. urlParams_ gensupport.URLParams
  81451. ifNoneMatch_ string
  81452. ctx_ context.Context
  81453. header_ http.Header
  81454. }
  81455. // GetXpnResources: Gets service resources (a.k.a service project)
  81456. // associated with this host project.
  81457. func (r *ProjectsService) GetXpnResources(project string) *ProjectsGetXpnResourcesCall {
  81458. c := &ProjectsGetXpnResourcesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  81459. c.project = project
  81460. return c
  81461. }
  81462. // Filter sets the optional parameter "filter":
  81463. func (c *ProjectsGetXpnResourcesCall) Filter(filter string) *ProjectsGetXpnResourcesCall {
  81464. c.urlParams_.Set("filter", filter)
  81465. return c
  81466. }
  81467. // MaxResults sets the optional parameter "maxResults":
  81468. func (c *ProjectsGetXpnResourcesCall) MaxResults(maxResults int64) *ProjectsGetXpnResourcesCall {
  81469. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  81470. return c
  81471. }
  81472. // OrderBy sets the optional parameter "order_by":
  81473. func (c *ProjectsGetXpnResourcesCall) OrderBy(orderBy string) *ProjectsGetXpnResourcesCall {
  81474. c.urlParams_.Set("order_by", orderBy)
  81475. return c
  81476. }
  81477. // PageToken sets the optional parameter "pageToken":
  81478. func (c *ProjectsGetXpnResourcesCall) PageToken(pageToken string) *ProjectsGetXpnResourcesCall {
  81479. c.urlParams_.Set("pageToken", pageToken)
  81480. return c
  81481. }
  81482. // Fields allows partial responses to be retrieved. See
  81483. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  81484. // for more information.
  81485. func (c *ProjectsGetXpnResourcesCall) Fields(s ...googleapi.Field) *ProjectsGetXpnResourcesCall {
  81486. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  81487. return c
  81488. }
  81489. // IfNoneMatch sets the optional parameter which makes the operation
  81490. // fail if the object's ETag matches the given value. This is useful for
  81491. // getting updates only after the object has changed since the last
  81492. // request. Use googleapi.IsNotModified to check whether the response
  81493. // error from Do is the result of In-None-Match.
  81494. func (c *ProjectsGetXpnResourcesCall) IfNoneMatch(entityTag string) *ProjectsGetXpnResourcesCall {
  81495. c.ifNoneMatch_ = entityTag
  81496. return c
  81497. }
  81498. // Context sets the context to be used in this call's Do method. Any
  81499. // pending HTTP request will be aborted if the provided context is
  81500. // canceled.
  81501. func (c *ProjectsGetXpnResourcesCall) Context(ctx context.Context) *ProjectsGetXpnResourcesCall {
  81502. c.ctx_ = ctx
  81503. return c
  81504. }
  81505. // Header returns an http.Header that can be modified by the caller to
  81506. // add HTTP headers to the request.
  81507. func (c *ProjectsGetXpnResourcesCall) Header() http.Header {
  81508. if c.header_ == nil {
  81509. c.header_ = make(http.Header)
  81510. }
  81511. return c.header_
  81512. }
  81513. func (c *ProjectsGetXpnResourcesCall) doRequest(alt string) (*http.Response, error) {
  81514. reqHeaders := make(http.Header)
  81515. for k, v := range c.header_ {
  81516. reqHeaders[k] = v
  81517. }
  81518. reqHeaders.Set("User-Agent", c.s.userAgent())
  81519. if c.ifNoneMatch_ != "" {
  81520. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  81521. }
  81522. var body io.Reader = nil
  81523. c.urlParams_.Set("alt", alt)
  81524. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/getXpnResources")
  81525. urls += "?" + c.urlParams_.Encode()
  81526. req, _ := http.NewRequest("GET", urls, body)
  81527. req.Header = reqHeaders
  81528. googleapi.Expand(req.URL, map[string]string{
  81529. "project": c.project,
  81530. })
  81531. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  81532. }
  81533. // Do executes the "compute.projects.getXpnResources" call.
  81534. // Exactly one of *ProjectsGetXpnResources or error will be non-nil. Any
  81535. // non-2xx status code is an error. Response headers are in either
  81536. // *ProjectsGetXpnResources.ServerResponse.Header or (if a response was
  81537. // returned at all) in error.(*googleapi.Error).Header. Use
  81538. // googleapi.IsNotModified to check whether the returned error was
  81539. // because http.StatusNotModified was returned.
  81540. func (c *ProjectsGetXpnResourcesCall) Do(opts ...googleapi.CallOption) (*ProjectsGetXpnResources, error) {
  81541. gensupport.SetOptions(c.urlParams_, opts...)
  81542. res, err := c.doRequest("json")
  81543. if res != nil && res.StatusCode == http.StatusNotModified {
  81544. if res.Body != nil {
  81545. res.Body.Close()
  81546. }
  81547. return nil, &googleapi.Error{
  81548. Code: res.StatusCode,
  81549. Header: res.Header,
  81550. }
  81551. }
  81552. if err != nil {
  81553. return nil, err
  81554. }
  81555. defer googleapi.CloseBody(res)
  81556. if err := googleapi.CheckResponse(res); err != nil {
  81557. return nil, err
  81558. }
  81559. ret := &ProjectsGetXpnResources{
  81560. ServerResponse: googleapi.ServerResponse{
  81561. Header: res.Header,
  81562. HTTPStatusCode: res.StatusCode,
  81563. },
  81564. }
  81565. target := &ret
  81566. if err := gensupport.DecodeResponse(target, res); err != nil {
  81567. return nil, err
  81568. }
  81569. return ret, nil
  81570. // {
  81571. // "description": "Gets service resources (a.k.a service project) associated with this host project.",
  81572. // "httpMethod": "GET",
  81573. // "id": "compute.projects.getXpnResources",
  81574. // "parameterOrder": [
  81575. // "project"
  81576. // ],
  81577. // "parameters": {
  81578. // "filter": {
  81579. // "location": "query",
  81580. // "type": "string"
  81581. // },
  81582. // "maxResults": {
  81583. // "default": "500",
  81584. // "format": "uint32",
  81585. // "location": "query",
  81586. // "minimum": "0",
  81587. // "type": "integer"
  81588. // },
  81589. // "order_by": {
  81590. // "location": "query",
  81591. // "type": "string"
  81592. // },
  81593. // "pageToken": {
  81594. // "location": "query",
  81595. // "type": "string"
  81596. // },
  81597. // "project": {
  81598. // "description": "Project ID for this request.",
  81599. // "location": "path",
  81600. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  81601. // "required": true,
  81602. // "type": "string"
  81603. // }
  81604. // },
  81605. // "path": "{project}/getXpnResources",
  81606. // "response": {
  81607. // "$ref": "ProjectsGetXpnResources"
  81608. // },
  81609. // "scopes": [
  81610. // "https://www.googleapis.com/auth/cloud-platform",
  81611. // "https://www.googleapis.com/auth/compute"
  81612. // ]
  81613. // }
  81614. }
  81615. // Pages invokes f for each page of results.
  81616. // A non-nil error returned from f will halt the iteration.
  81617. // The provided context supersedes any context provided to the Context method.
  81618. func (c *ProjectsGetXpnResourcesCall) Pages(ctx context.Context, f func(*ProjectsGetXpnResources) error) error {
  81619. c.ctx_ = ctx
  81620. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  81621. for {
  81622. x, err := c.Do()
  81623. if err != nil {
  81624. return err
  81625. }
  81626. if err := f(x); err != nil {
  81627. return err
  81628. }
  81629. if x.NextPageToken == "" {
  81630. return nil
  81631. }
  81632. c.PageToken(x.NextPageToken)
  81633. }
  81634. }
  81635. // method id "compute.projects.listXpnHosts":
  81636. type ProjectsListXpnHostsCall struct {
  81637. s *Service
  81638. project string
  81639. projectslistxpnhostsrequest *ProjectsListXpnHostsRequest
  81640. urlParams_ gensupport.URLParams
  81641. ctx_ context.Context
  81642. header_ http.Header
  81643. }
  81644. // ListXpnHosts: Lists all shared VPC host projects visible to the user
  81645. // in an organization.
  81646. func (r *ProjectsService) ListXpnHosts(project string, projectslistxpnhostsrequest *ProjectsListXpnHostsRequest) *ProjectsListXpnHostsCall {
  81647. c := &ProjectsListXpnHostsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  81648. c.project = project
  81649. c.projectslistxpnhostsrequest = projectslistxpnhostsrequest
  81650. return c
  81651. }
  81652. // Filter sets the optional parameter "filter":
  81653. func (c *ProjectsListXpnHostsCall) Filter(filter string) *ProjectsListXpnHostsCall {
  81654. c.urlParams_.Set("filter", filter)
  81655. return c
  81656. }
  81657. // MaxResults sets the optional parameter "maxResults":
  81658. func (c *ProjectsListXpnHostsCall) MaxResults(maxResults int64) *ProjectsListXpnHostsCall {
  81659. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  81660. return c
  81661. }
  81662. // OrderBy sets the optional parameter "order_by":
  81663. func (c *ProjectsListXpnHostsCall) OrderBy(orderBy string) *ProjectsListXpnHostsCall {
  81664. c.urlParams_.Set("order_by", orderBy)
  81665. return c
  81666. }
  81667. // PageToken sets the optional parameter "pageToken":
  81668. func (c *ProjectsListXpnHostsCall) PageToken(pageToken string) *ProjectsListXpnHostsCall {
  81669. c.urlParams_.Set("pageToken", pageToken)
  81670. return c
  81671. }
  81672. // Fields allows partial responses to be retrieved. See
  81673. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  81674. // for more information.
  81675. func (c *ProjectsListXpnHostsCall) Fields(s ...googleapi.Field) *ProjectsListXpnHostsCall {
  81676. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  81677. return c
  81678. }
  81679. // Context sets the context to be used in this call's Do method. Any
  81680. // pending HTTP request will be aborted if the provided context is
  81681. // canceled.
  81682. func (c *ProjectsListXpnHostsCall) Context(ctx context.Context) *ProjectsListXpnHostsCall {
  81683. c.ctx_ = ctx
  81684. return c
  81685. }
  81686. // Header returns an http.Header that can be modified by the caller to
  81687. // add HTTP headers to the request.
  81688. func (c *ProjectsListXpnHostsCall) Header() http.Header {
  81689. if c.header_ == nil {
  81690. c.header_ = make(http.Header)
  81691. }
  81692. return c.header_
  81693. }
  81694. func (c *ProjectsListXpnHostsCall) doRequest(alt string) (*http.Response, error) {
  81695. reqHeaders := make(http.Header)
  81696. for k, v := range c.header_ {
  81697. reqHeaders[k] = v
  81698. }
  81699. reqHeaders.Set("User-Agent", c.s.userAgent())
  81700. var body io.Reader = nil
  81701. body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectslistxpnhostsrequest)
  81702. if err != nil {
  81703. return nil, err
  81704. }
  81705. reqHeaders.Set("Content-Type", "application/json")
  81706. c.urlParams_.Set("alt", alt)
  81707. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/listXpnHosts")
  81708. urls += "?" + c.urlParams_.Encode()
  81709. req, _ := http.NewRequest("POST", urls, body)
  81710. req.Header = reqHeaders
  81711. googleapi.Expand(req.URL, map[string]string{
  81712. "project": c.project,
  81713. })
  81714. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  81715. }
  81716. // Do executes the "compute.projects.listXpnHosts" call.
  81717. // Exactly one of *XpnHostList or error will be non-nil. Any non-2xx
  81718. // status code is an error. Response headers are in either
  81719. // *XpnHostList.ServerResponse.Header or (if a response was returned at
  81720. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  81721. // to check whether the returned error was because
  81722. // http.StatusNotModified was returned.
  81723. func (c *ProjectsListXpnHostsCall) Do(opts ...googleapi.CallOption) (*XpnHostList, error) {
  81724. gensupport.SetOptions(c.urlParams_, opts...)
  81725. res, err := c.doRequest("json")
  81726. if res != nil && res.StatusCode == http.StatusNotModified {
  81727. if res.Body != nil {
  81728. res.Body.Close()
  81729. }
  81730. return nil, &googleapi.Error{
  81731. Code: res.StatusCode,
  81732. Header: res.Header,
  81733. }
  81734. }
  81735. if err != nil {
  81736. return nil, err
  81737. }
  81738. defer googleapi.CloseBody(res)
  81739. if err := googleapi.CheckResponse(res); err != nil {
  81740. return nil, err
  81741. }
  81742. ret := &XpnHostList{
  81743. ServerResponse: googleapi.ServerResponse{
  81744. Header: res.Header,
  81745. HTTPStatusCode: res.StatusCode,
  81746. },
  81747. }
  81748. target := &ret
  81749. if err := gensupport.DecodeResponse(target, res); err != nil {
  81750. return nil, err
  81751. }
  81752. return ret, nil
  81753. // {
  81754. // "description": "Lists all shared VPC host projects visible to the user in an organization.",
  81755. // "httpMethod": "POST",
  81756. // "id": "compute.projects.listXpnHosts",
  81757. // "parameterOrder": [
  81758. // "project"
  81759. // ],
  81760. // "parameters": {
  81761. // "filter": {
  81762. // "location": "query",
  81763. // "type": "string"
  81764. // },
  81765. // "maxResults": {
  81766. // "default": "500",
  81767. // "format": "uint32",
  81768. // "location": "query",
  81769. // "minimum": "0",
  81770. // "type": "integer"
  81771. // },
  81772. // "order_by": {
  81773. // "location": "query",
  81774. // "type": "string"
  81775. // },
  81776. // "pageToken": {
  81777. // "location": "query",
  81778. // "type": "string"
  81779. // },
  81780. // "project": {
  81781. // "description": "Project ID for this request.",
  81782. // "location": "path",
  81783. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  81784. // "required": true,
  81785. // "type": "string"
  81786. // }
  81787. // },
  81788. // "path": "{project}/listXpnHosts",
  81789. // "request": {
  81790. // "$ref": "ProjectsListXpnHostsRequest"
  81791. // },
  81792. // "response": {
  81793. // "$ref": "XpnHostList"
  81794. // },
  81795. // "scopes": [
  81796. // "https://www.googleapis.com/auth/cloud-platform",
  81797. // "https://www.googleapis.com/auth/compute"
  81798. // ]
  81799. // }
  81800. }
  81801. // Pages invokes f for each page of results.
  81802. // A non-nil error returned from f will halt the iteration.
  81803. // The provided context supersedes any context provided to the Context method.
  81804. func (c *ProjectsListXpnHostsCall) Pages(ctx context.Context, f func(*XpnHostList) error) error {
  81805. c.ctx_ = ctx
  81806. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  81807. for {
  81808. x, err := c.Do()
  81809. if err != nil {
  81810. return err
  81811. }
  81812. if err := f(x); err != nil {
  81813. return err
  81814. }
  81815. if x.NextPageToken == "" {
  81816. return nil
  81817. }
  81818. c.PageToken(x.NextPageToken)
  81819. }
  81820. }
  81821. // method id "compute.projects.moveDisk":
  81822. type ProjectsMoveDiskCall struct {
  81823. s *Service
  81824. project string
  81825. diskmoverequest *DiskMoveRequest
  81826. urlParams_ gensupport.URLParams
  81827. ctx_ context.Context
  81828. header_ http.Header
  81829. }
  81830. // MoveDisk: Moves a persistent disk from one zone to another.
  81831. func (r *ProjectsService) MoveDisk(project string, diskmoverequest *DiskMoveRequest) *ProjectsMoveDiskCall {
  81832. c := &ProjectsMoveDiskCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  81833. c.project = project
  81834. c.diskmoverequest = diskmoverequest
  81835. return c
  81836. }
  81837. // RequestId sets the optional parameter "requestId": An optional
  81838. // request ID to identify requests. Specify a unique request ID so that
  81839. // if you must retry your request, the server will know to ignore the
  81840. // request if it has already been completed.
  81841. //
  81842. // For example, consider a situation where you make an initial request
  81843. // and the request times out. If you make the request again with the
  81844. // same request ID, the server can check if original operation with the
  81845. // same request ID was received, and if so, will ignore the second
  81846. // request. This prevents clients from accidentally creating duplicate
  81847. // commitments.
  81848. //
  81849. // The request ID must be a valid UUID with the exception that zero UUID
  81850. // is not supported (00000000-0000-0000-0000-000000000000).
  81851. func (c *ProjectsMoveDiskCall) RequestId(requestId string) *ProjectsMoveDiskCall {
  81852. c.urlParams_.Set("requestId", requestId)
  81853. return c
  81854. }
  81855. // Fields allows partial responses to be retrieved. See
  81856. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  81857. // for more information.
  81858. func (c *ProjectsMoveDiskCall) Fields(s ...googleapi.Field) *ProjectsMoveDiskCall {
  81859. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  81860. return c
  81861. }
  81862. // Context sets the context to be used in this call's Do method. Any
  81863. // pending HTTP request will be aborted if the provided context is
  81864. // canceled.
  81865. func (c *ProjectsMoveDiskCall) Context(ctx context.Context) *ProjectsMoveDiskCall {
  81866. c.ctx_ = ctx
  81867. return c
  81868. }
  81869. // Header returns an http.Header that can be modified by the caller to
  81870. // add HTTP headers to the request.
  81871. func (c *ProjectsMoveDiskCall) Header() http.Header {
  81872. if c.header_ == nil {
  81873. c.header_ = make(http.Header)
  81874. }
  81875. return c.header_
  81876. }
  81877. func (c *ProjectsMoveDiskCall) doRequest(alt string) (*http.Response, error) {
  81878. reqHeaders := make(http.Header)
  81879. for k, v := range c.header_ {
  81880. reqHeaders[k] = v
  81881. }
  81882. reqHeaders.Set("User-Agent", c.s.userAgent())
  81883. var body io.Reader = nil
  81884. body, err := googleapi.WithoutDataWrapper.JSONReader(c.diskmoverequest)
  81885. if err != nil {
  81886. return nil, err
  81887. }
  81888. reqHeaders.Set("Content-Type", "application/json")
  81889. c.urlParams_.Set("alt", alt)
  81890. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/moveDisk")
  81891. urls += "?" + c.urlParams_.Encode()
  81892. req, _ := http.NewRequest("POST", urls, body)
  81893. req.Header = reqHeaders
  81894. googleapi.Expand(req.URL, map[string]string{
  81895. "project": c.project,
  81896. })
  81897. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  81898. }
  81899. // Do executes the "compute.projects.moveDisk" call.
  81900. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  81901. // status code is an error. Response headers are in either
  81902. // *Operation.ServerResponse.Header or (if a response was returned at
  81903. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  81904. // to check whether the returned error was because
  81905. // http.StatusNotModified was returned.
  81906. func (c *ProjectsMoveDiskCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  81907. gensupport.SetOptions(c.urlParams_, opts...)
  81908. res, err := c.doRequest("json")
  81909. if res != nil && res.StatusCode == http.StatusNotModified {
  81910. if res.Body != nil {
  81911. res.Body.Close()
  81912. }
  81913. return nil, &googleapi.Error{
  81914. Code: res.StatusCode,
  81915. Header: res.Header,
  81916. }
  81917. }
  81918. if err != nil {
  81919. return nil, err
  81920. }
  81921. defer googleapi.CloseBody(res)
  81922. if err := googleapi.CheckResponse(res); err != nil {
  81923. return nil, err
  81924. }
  81925. ret := &Operation{
  81926. ServerResponse: googleapi.ServerResponse{
  81927. Header: res.Header,
  81928. HTTPStatusCode: res.StatusCode,
  81929. },
  81930. }
  81931. target := &ret
  81932. if err := gensupport.DecodeResponse(target, res); err != nil {
  81933. return nil, err
  81934. }
  81935. return ret, nil
  81936. // {
  81937. // "description": "Moves a persistent disk from one zone to another.",
  81938. // "httpMethod": "POST",
  81939. // "id": "compute.projects.moveDisk",
  81940. // "parameterOrder": [
  81941. // "project"
  81942. // ],
  81943. // "parameters": {
  81944. // "project": {
  81945. // "description": "Project ID for this request.",
  81946. // "location": "path",
  81947. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  81948. // "required": true,
  81949. // "type": "string"
  81950. // },
  81951. // "requestId": {
  81952. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  81953. // "location": "query",
  81954. // "type": "string"
  81955. // }
  81956. // },
  81957. // "path": "{project}/moveDisk",
  81958. // "request": {
  81959. // "$ref": "DiskMoveRequest"
  81960. // },
  81961. // "response": {
  81962. // "$ref": "Operation"
  81963. // },
  81964. // "scopes": [
  81965. // "https://www.googleapis.com/auth/cloud-platform",
  81966. // "https://www.googleapis.com/auth/compute"
  81967. // ]
  81968. // }
  81969. }
  81970. // method id "compute.projects.moveInstance":
  81971. type ProjectsMoveInstanceCall struct {
  81972. s *Service
  81973. project string
  81974. instancemoverequest *InstanceMoveRequest
  81975. urlParams_ gensupport.URLParams
  81976. ctx_ context.Context
  81977. header_ http.Header
  81978. }
  81979. // MoveInstance: Moves an instance and its attached persistent disks
  81980. // from one zone to another.
  81981. func (r *ProjectsService) MoveInstance(project string, instancemoverequest *InstanceMoveRequest) *ProjectsMoveInstanceCall {
  81982. c := &ProjectsMoveInstanceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  81983. c.project = project
  81984. c.instancemoverequest = instancemoverequest
  81985. return c
  81986. }
  81987. // RequestId sets the optional parameter "requestId": An optional
  81988. // request ID to identify requests. Specify a unique request ID so that
  81989. // if you must retry your request, the server will know to ignore the
  81990. // request if it has already been completed.
  81991. //
  81992. // For example, consider a situation where you make an initial request
  81993. // and the request times out. If you make the request again with the
  81994. // same request ID, the server can check if original operation with the
  81995. // same request ID was received, and if so, will ignore the second
  81996. // request. This prevents clients from accidentally creating duplicate
  81997. // commitments.
  81998. //
  81999. // The request ID must be a valid UUID with the exception that zero UUID
  82000. // is not supported (00000000-0000-0000-0000-000000000000).
  82001. func (c *ProjectsMoveInstanceCall) RequestId(requestId string) *ProjectsMoveInstanceCall {
  82002. c.urlParams_.Set("requestId", requestId)
  82003. return c
  82004. }
  82005. // Fields allows partial responses to be retrieved. See
  82006. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  82007. // for more information.
  82008. func (c *ProjectsMoveInstanceCall) Fields(s ...googleapi.Field) *ProjectsMoveInstanceCall {
  82009. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  82010. return c
  82011. }
  82012. // Context sets the context to be used in this call's Do method. Any
  82013. // pending HTTP request will be aborted if the provided context is
  82014. // canceled.
  82015. func (c *ProjectsMoveInstanceCall) Context(ctx context.Context) *ProjectsMoveInstanceCall {
  82016. c.ctx_ = ctx
  82017. return c
  82018. }
  82019. // Header returns an http.Header that can be modified by the caller to
  82020. // add HTTP headers to the request.
  82021. func (c *ProjectsMoveInstanceCall) Header() http.Header {
  82022. if c.header_ == nil {
  82023. c.header_ = make(http.Header)
  82024. }
  82025. return c.header_
  82026. }
  82027. func (c *ProjectsMoveInstanceCall) doRequest(alt string) (*http.Response, error) {
  82028. reqHeaders := make(http.Header)
  82029. for k, v := range c.header_ {
  82030. reqHeaders[k] = v
  82031. }
  82032. reqHeaders.Set("User-Agent", c.s.userAgent())
  82033. var body io.Reader = nil
  82034. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancemoverequest)
  82035. if err != nil {
  82036. return nil, err
  82037. }
  82038. reqHeaders.Set("Content-Type", "application/json")
  82039. c.urlParams_.Set("alt", alt)
  82040. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/moveInstance")
  82041. urls += "?" + c.urlParams_.Encode()
  82042. req, _ := http.NewRequest("POST", urls, body)
  82043. req.Header = reqHeaders
  82044. googleapi.Expand(req.URL, map[string]string{
  82045. "project": c.project,
  82046. })
  82047. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  82048. }
  82049. // Do executes the "compute.projects.moveInstance" call.
  82050. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  82051. // status code is an error. Response headers are in either
  82052. // *Operation.ServerResponse.Header or (if a response was returned at
  82053. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  82054. // to check whether the returned error was because
  82055. // http.StatusNotModified was returned.
  82056. func (c *ProjectsMoveInstanceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  82057. gensupport.SetOptions(c.urlParams_, opts...)
  82058. res, err := c.doRequest("json")
  82059. if res != nil && res.StatusCode == http.StatusNotModified {
  82060. if res.Body != nil {
  82061. res.Body.Close()
  82062. }
  82063. return nil, &googleapi.Error{
  82064. Code: res.StatusCode,
  82065. Header: res.Header,
  82066. }
  82067. }
  82068. if err != nil {
  82069. return nil, err
  82070. }
  82071. defer googleapi.CloseBody(res)
  82072. if err := googleapi.CheckResponse(res); err != nil {
  82073. return nil, err
  82074. }
  82075. ret := &Operation{
  82076. ServerResponse: googleapi.ServerResponse{
  82077. Header: res.Header,
  82078. HTTPStatusCode: res.StatusCode,
  82079. },
  82080. }
  82081. target := &ret
  82082. if err := gensupport.DecodeResponse(target, res); err != nil {
  82083. return nil, err
  82084. }
  82085. return ret, nil
  82086. // {
  82087. // "description": "Moves an instance and its attached persistent disks from one zone to another.",
  82088. // "httpMethod": "POST",
  82089. // "id": "compute.projects.moveInstance",
  82090. // "parameterOrder": [
  82091. // "project"
  82092. // ],
  82093. // "parameters": {
  82094. // "project": {
  82095. // "description": "Project ID for this request.",
  82096. // "location": "path",
  82097. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  82098. // "required": true,
  82099. // "type": "string"
  82100. // },
  82101. // "requestId": {
  82102. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  82103. // "location": "query",
  82104. // "type": "string"
  82105. // }
  82106. // },
  82107. // "path": "{project}/moveInstance",
  82108. // "request": {
  82109. // "$ref": "InstanceMoveRequest"
  82110. // },
  82111. // "response": {
  82112. // "$ref": "Operation"
  82113. // },
  82114. // "scopes": [
  82115. // "https://www.googleapis.com/auth/cloud-platform",
  82116. // "https://www.googleapis.com/auth/compute"
  82117. // ]
  82118. // }
  82119. }
  82120. // method id "compute.projects.setCommonInstanceMetadata":
  82121. type ProjectsSetCommonInstanceMetadataCall struct {
  82122. s *Service
  82123. project string
  82124. metadata *Metadata
  82125. urlParams_ gensupport.URLParams
  82126. ctx_ context.Context
  82127. header_ http.Header
  82128. }
  82129. // SetCommonInstanceMetadata: Sets metadata common to all instances
  82130. // within the specified project using the data included in the request.
  82131. // For details, see https://cloud.google.com/compute/docs/reference/latest/projects/setCommonInstanceMetadata
  82132. func (r *ProjectsService) SetCommonInstanceMetadata(project string, metadata *Metadata) *ProjectsSetCommonInstanceMetadataCall {
  82133. c := &ProjectsSetCommonInstanceMetadataCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  82134. c.project = project
  82135. c.metadata = metadata
  82136. return c
  82137. }
  82138. // RequestId sets the optional parameter "requestId": An optional
  82139. // request ID to identify requests. Specify a unique request ID so that
  82140. // if you must retry your request, the server will know to ignore the
  82141. // request if it has already been completed.
  82142. //
  82143. // For example, consider a situation where you make an initial request
  82144. // and the request times out. If you make the request again with the
  82145. // same request ID, the server can check if original operation with the
  82146. // same request ID was received, and if so, will ignore the second
  82147. // request. This prevents clients from accidentally creating duplicate
  82148. // commitments.
  82149. //
  82150. // The request ID must be a valid UUID with the exception that zero UUID
  82151. // is not supported (00000000-0000-0000-0000-000000000000).
  82152. func (c *ProjectsSetCommonInstanceMetadataCall) RequestId(requestId string) *ProjectsSetCommonInstanceMetadataCall {
  82153. c.urlParams_.Set("requestId", requestId)
  82154. return c
  82155. }
  82156. // Fields allows partial responses to be retrieved. See
  82157. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  82158. // for more information.
  82159. func (c *ProjectsSetCommonInstanceMetadataCall) Fields(s ...googleapi.Field) *ProjectsSetCommonInstanceMetadataCall {
  82160. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  82161. return c
  82162. }
  82163. // Context sets the context to be used in this call's Do method. Any
  82164. // pending HTTP request will be aborted if the provided context is
  82165. // canceled.
  82166. func (c *ProjectsSetCommonInstanceMetadataCall) Context(ctx context.Context) *ProjectsSetCommonInstanceMetadataCall {
  82167. c.ctx_ = ctx
  82168. return c
  82169. }
  82170. // Header returns an http.Header that can be modified by the caller to
  82171. // add HTTP headers to the request.
  82172. func (c *ProjectsSetCommonInstanceMetadataCall) Header() http.Header {
  82173. if c.header_ == nil {
  82174. c.header_ = make(http.Header)
  82175. }
  82176. return c.header_
  82177. }
  82178. func (c *ProjectsSetCommonInstanceMetadataCall) doRequest(alt string) (*http.Response, error) {
  82179. reqHeaders := make(http.Header)
  82180. for k, v := range c.header_ {
  82181. reqHeaders[k] = v
  82182. }
  82183. reqHeaders.Set("User-Agent", c.s.userAgent())
  82184. var body io.Reader = nil
  82185. body, err := googleapi.WithoutDataWrapper.JSONReader(c.metadata)
  82186. if err != nil {
  82187. return nil, err
  82188. }
  82189. reqHeaders.Set("Content-Type", "application/json")
  82190. c.urlParams_.Set("alt", alt)
  82191. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/setCommonInstanceMetadata")
  82192. urls += "?" + c.urlParams_.Encode()
  82193. req, _ := http.NewRequest("POST", urls, body)
  82194. req.Header = reqHeaders
  82195. googleapi.Expand(req.URL, map[string]string{
  82196. "project": c.project,
  82197. })
  82198. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  82199. }
  82200. // Do executes the "compute.projects.setCommonInstanceMetadata" call.
  82201. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  82202. // status code is an error. Response headers are in either
  82203. // *Operation.ServerResponse.Header or (if a response was returned at
  82204. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  82205. // to check whether the returned error was because
  82206. // http.StatusNotModified was returned.
  82207. func (c *ProjectsSetCommonInstanceMetadataCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  82208. gensupport.SetOptions(c.urlParams_, opts...)
  82209. res, err := c.doRequest("json")
  82210. if res != nil && res.StatusCode == http.StatusNotModified {
  82211. if res.Body != nil {
  82212. res.Body.Close()
  82213. }
  82214. return nil, &googleapi.Error{
  82215. Code: res.StatusCode,
  82216. Header: res.Header,
  82217. }
  82218. }
  82219. if err != nil {
  82220. return nil, err
  82221. }
  82222. defer googleapi.CloseBody(res)
  82223. if err := googleapi.CheckResponse(res); err != nil {
  82224. return nil, err
  82225. }
  82226. ret := &Operation{
  82227. ServerResponse: googleapi.ServerResponse{
  82228. Header: res.Header,
  82229. HTTPStatusCode: res.StatusCode,
  82230. },
  82231. }
  82232. target := &ret
  82233. if err := gensupport.DecodeResponse(target, res); err != nil {
  82234. return nil, err
  82235. }
  82236. return ret, nil
  82237. // {
  82238. // "description": "Sets metadata common to all instances within the specified project using the data included in the request.",
  82239. // "httpMethod": "POST",
  82240. // "id": "compute.projects.setCommonInstanceMetadata",
  82241. // "parameterOrder": [
  82242. // "project"
  82243. // ],
  82244. // "parameters": {
  82245. // "project": {
  82246. // "description": "Project ID for this request.",
  82247. // "location": "path",
  82248. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  82249. // "required": true,
  82250. // "type": "string"
  82251. // },
  82252. // "requestId": {
  82253. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  82254. // "location": "query",
  82255. // "type": "string"
  82256. // }
  82257. // },
  82258. // "path": "{project}/setCommonInstanceMetadata",
  82259. // "request": {
  82260. // "$ref": "Metadata"
  82261. // },
  82262. // "response": {
  82263. // "$ref": "Operation"
  82264. // },
  82265. // "scopes": [
  82266. // "https://www.googleapis.com/auth/cloud-platform",
  82267. // "https://www.googleapis.com/auth/compute"
  82268. // ]
  82269. // }
  82270. }
  82271. // method id "compute.projects.setDefaultNetworkTier":
  82272. type ProjectsSetDefaultNetworkTierCall struct {
  82273. s *Service
  82274. project string
  82275. projectssetdefaultnetworktierrequest *ProjectsSetDefaultNetworkTierRequest
  82276. urlParams_ gensupport.URLParams
  82277. ctx_ context.Context
  82278. header_ http.Header
  82279. }
  82280. // SetDefaultNetworkTier: Sets the default network tier of the project.
  82281. // The default network tier is used when an
  82282. // address/forwardingRule/instance is created without specifying the
  82283. // network tier field.
  82284. func (r *ProjectsService) SetDefaultNetworkTier(project string, projectssetdefaultnetworktierrequest *ProjectsSetDefaultNetworkTierRequest) *ProjectsSetDefaultNetworkTierCall {
  82285. c := &ProjectsSetDefaultNetworkTierCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  82286. c.project = project
  82287. c.projectssetdefaultnetworktierrequest = projectssetdefaultnetworktierrequest
  82288. return c
  82289. }
  82290. // RequestId sets the optional parameter "requestId": An optional
  82291. // request ID to identify requests. Specify a unique request ID so that
  82292. // if you must retry your request, the server will know to ignore the
  82293. // request if it has already been completed.
  82294. //
  82295. // For example, consider a situation where you make an initial request
  82296. // and the request times out. If you make the request again with the
  82297. // same request ID, the server can check if original operation with the
  82298. // same request ID was received, and if so, will ignore the second
  82299. // request. This prevents clients from accidentally creating duplicate
  82300. // commitments.
  82301. //
  82302. // The request ID must be a valid UUID with the exception that zero UUID
  82303. // is not supported (00000000-0000-0000-0000-000000000000).
  82304. func (c *ProjectsSetDefaultNetworkTierCall) RequestId(requestId string) *ProjectsSetDefaultNetworkTierCall {
  82305. c.urlParams_.Set("requestId", requestId)
  82306. return c
  82307. }
  82308. // Fields allows partial responses to be retrieved. See
  82309. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  82310. // for more information.
  82311. func (c *ProjectsSetDefaultNetworkTierCall) Fields(s ...googleapi.Field) *ProjectsSetDefaultNetworkTierCall {
  82312. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  82313. return c
  82314. }
  82315. // Context sets the context to be used in this call's Do method. Any
  82316. // pending HTTP request will be aborted if the provided context is
  82317. // canceled.
  82318. func (c *ProjectsSetDefaultNetworkTierCall) Context(ctx context.Context) *ProjectsSetDefaultNetworkTierCall {
  82319. c.ctx_ = ctx
  82320. return c
  82321. }
  82322. // Header returns an http.Header that can be modified by the caller to
  82323. // add HTTP headers to the request.
  82324. func (c *ProjectsSetDefaultNetworkTierCall) Header() http.Header {
  82325. if c.header_ == nil {
  82326. c.header_ = make(http.Header)
  82327. }
  82328. return c.header_
  82329. }
  82330. func (c *ProjectsSetDefaultNetworkTierCall) doRequest(alt string) (*http.Response, error) {
  82331. reqHeaders := make(http.Header)
  82332. for k, v := range c.header_ {
  82333. reqHeaders[k] = v
  82334. }
  82335. reqHeaders.Set("User-Agent", c.s.userAgent())
  82336. var body io.Reader = nil
  82337. body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectssetdefaultnetworktierrequest)
  82338. if err != nil {
  82339. return nil, err
  82340. }
  82341. reqHeaders.Set("Content-Type", "application/json")
  82342. c.urlParams_.Set("alt", alt)
  82343. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/setDefaultNetworkTier")
  82344. urls += "?" + c.urlParams_.Encode()
  82345. req, _ := http.NewRequest("POST", urls, body)
  82346. req.Header = reqHeaders
  82347. googleapi.Expand(req.URL, map[string]string{
  82348. "project": c.project,
  82349. })
  82350. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  82351. }
  82352. // Do executes the "compute.projects.setDefaultNetworkTier" call.
  82353. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  82354. // status code is an error. Response headers are in either
  82355. // *Operation.ServerResponse.Header or (if a response was returned at
  82356. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  82357. // to check whether the returned error was because
  82358. // http.StatusNotModified was returned.
  82359. func (c *ProjectsSetDefaultNetworkTierCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  82360. gensupport.SetOptions(c.urlParams_, opts...)
  82361. res, err := c.doRequest("json")
  82362. if res != nil && res.StatusCode == http.StatusNotModified {
  82363. if res.Body != nil {
  82364. res.Body.Close()
  82365. }
  82366. return nil, &googleapi.Error{
  82367. Code: res.StatusCode,
  82368. Header: res.Header,
  82369. }
  82370. }
  82371. if err != nil {
  82372. return nil, err
  82373. }
  82374. defer googleapi.CloseBody(res)
  82375. if err := googleapi.CheckResponse(res); err != nil {
  82376. return nil, err
  82377. }
  82378. ret := &Operation{
  82379. ServerResponse: googleapi.ServerResponse{
  82380. Header: res.Header,
  82381. HTTPStatusCode: res.StatusCode,
  82382. },
  82383. }
  82384. target := &ret
  82385. if err := gensupport.DecodeResponse(target, res); err != nil {
  82386. return nil, err
  82387. }
  82388. return ret, nil
  82389. // {
  82390. // "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.",
  82391. // "httpMethod": "POST",
  82392. // "id": "compute.projects.setDefaultNetworkTier",
  82393. // "parameterOrder": [
  82394. // "project"
  82395. // ],
  82396. // "parameters": {
  82397. // "project": {
  82398. // "description": "Project ID for this request.",
  82399. // "location": "path",
  82400. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  82401. // "required": true,
  82402. // "type": "string"
  82403. // },
  82404. // "requestId": {
  82405. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  82406. // "location": "query",
  82407. // "type": "string"
  82408. // }
  82409. // },
  82410. // "path": "{project}/setDefaultNetworkTier",
  82411. // "request": {
  82412. // "$ref": "ProjectsSetDefaultNetworkTierRequest"
  82413. // },
  82414. // "response": {
  82415. // "$ref": "Operation"
  82416. // },
  82417. // "scopes": [
  82418. // "https://www.googleapis.com/auth/cloud-platform",
  82419. // "https://www.googleapis.com/auth/compute"
  82420. // ]
  82421. // }
  82422. }
  82423. // method id "compute.projects.setDefaultServiceAccount":
  82424. type ProjectsSetDefaultServiceAccountCall struct {
  82425. s *Service
  82426. project string
  82427. projectssetdefaultserviceaccountrequest *ProjectsSetDefaultServiceAccountRequest
  82428. urlParams_ gensupport.URLParams
  82429. ctx_ context.Context
  82430. header_ http.Header
  82431. }
  82432. // SetDefaultServiceAccount: Sets the default service account of the
  82433. // project. The default service account is used when a VM instance is
  82434. // created with the service account email address set to "default".
  82435. func (r *ProjectsService) SetDefaultServiceAccount(project string, projectssetdefaultserviceaccountrequest *ProjectsSetDefaultServiceAccountRequest) *ProjectsSetDefaultServiceAccountCall {
  82436. c := &ProjectsSetDefaultServiceAccountCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  82437. c.project = project
  82438. c.projectssetdefaultserviceaccountrequest = projectssetdefaultserviceaccountrequest
  82439. return c
  82440. }
  82441. // RequestId sets the optional parameter "requestId": An optional
  82442. // request ID to identify requests. Specify a unique request ID so that
  82443. // if you must retry your request, the server will know to ignore the
  82444. // request if it has already been completed.
  82445. //
  82446. // For example, consider a situation where you make an initial request
  82447. // and the request times out. If you make the request again with the
  82448. // same request ID, the server can check if original operation with the
  82449. // same request ID was received, and if so, will ignore the second
  82450. // request. This prevents clients from accidentally creating duplicate
  82451. // commitments.
  82452. //
  82453. // The request ID must be a valid UUID with the exception that zero UUID
  82454. // is not supported (00000000-0000-0000-0000-000000000000).
  82455. func (c *ProjectsSetDefaultServiceAccountCall) RequestId(requestId string) *ProjectsSetDefaultServiceAccountCall {
  82456. c.urlParams_.Set("requestId", requestId)
  82457. return c
  82458. }
  82459. // Fields allows partial responses to be retrieved. See
  82460. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  82461. // for more information.
  82462. func (c *ProjectsSetDefaultServiceAccountCall) Fields(s ...googleapi.Field) *ProjectsSetDefaultServiceAccountCall {
  82463. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  82464. return c
  82465. }
  82466. // Context sets the context to be used in this call's Do method. Any
  82467. // pending HTTP request will be aborted if the provided context is
  82468. // canceled.
  82469. func (c *ProjectsSetDefaultServiceAccountCall) Context(ctx context.Context) *ProjectsSetDefaultServiceAccountCall {
  82470. c.ctx_ = ctx
  82471. return c
  82472. }
  82473. // Header returns an http.Header that can be modified by the caller to
  82474. // add HTTP headers to the request.
  82475. func (c *ProjectsSetDefaultServiceAccountCall) Header() http.Header {
  82476. if c.header_ == nil {
  82477. c.header_ = make(http.Header)
  82478. }
  82479. return c.header_
  82480. }
  82481. func (c *ProjectsSetDefaultServiceAccountCall) doRequest(alt string) (*http.Response, error) {
  82482. reqHeaders := make(http.Header)
  82483. for k, v := range c.header_ {
  82484. reqHeaders[k] = v
  82485. }
  82486. reqHeaders.Set("User-Agent", c.s.userAgent())
  82487. var body io.Reader = nil
  82488. body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectssetdefaultserviceaccountrequest)
  82489. if err != nil {
  82490. return nil, err
  82491. }
  82492. reqHeaders.Set("Content-Type", "application/json")
  82493. c.urlParams_.Set("alt", alt)
  82494. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/setDefaultServiceAccount")
  82495. urls += "?" + c.urlParams_.Encode()
  82496. req, _ := http.NewRequest("POST", urls, body)
  82497. req.Header = reqHeaders
  82498. googleapi.Expand(req.URL, map[string]string{
  82499. "project": c.project,
  82500. })
  82501. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  82502. }
  82503. // Do executes the "compute.projects.setDefaultServiceAccount" call.
  82504. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  82505. // status code is an error. Response headers are in either
  82506. // *Operation.ServerResponse.Header or (if a response was returned at
  82507. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  82508. // to check whether the returned error was because
  82509. // http.StatusNotModified was returned.
  82510. func (c *ProjectsSetDefaultServiceAccountCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  82511. gensupport.SetOptions(c.urlParams_, opts...)
  82512. res, err := c.doRequest("json")
  82513. if res != nil && res.StatusCode == http.StatusNotModified {
  82514. if res.Body != nil {
  82515. res.Body.Close()
  82516. }
  82517. return nil, &googleapi.Error{
  82518. Code: res.StatusCode,
  82519. Header: res.Header,
  82520. }
  82521. }
  82522. if err != nil {
  82523. return nil, err
  82524. }
  82525. defer googleapi.CloseBody(res)
  82526. if err := googleapi.CheckResponse(res); err != nil {
  82527. return nil, err
  82528. }
  82529. ret := &Operation{
  82530. ServerResponse: googleapi.ServerResponse{
  82531. Header: res.Header,
  82532. HTTPStatusCode: res.StatusCode,
  82533. },
  82534. }
  82535. target := &ret
  82536. if err := gensupport.DecodeResponse(target, res); err != nil {
  82537. return nil, err
  82538. }
  82539. return ret, nil
  82540. // {
  82541. // "description": "Sets the default service account of the project. The default service account is used when a VM instance is created with the service account email address set to \"default\".",
  82542. // "httpMethod": "POST",
  82543. // "id": "compute.projects.setDefaultServiceAccount",
  82544. // "parameterOrder": [
  82545. // "project"
  82546. // ],
  82547. // "parameters": {
  82548. // "project": {
  82549. // "description": "Project ID for this request.",
  82550. // "location": "path",
  82551. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  82552. // "required": true,
  82553. // "type": "string"
  82554. // },
  82555. // "requestId": {
  82556. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  82557. // "location": "query",
  82558. // "type": "string"
  82559. // }
  82560. // },
  82561. // "path": "{project}/setDefaultServiceAccount",
  82562. // "request": {
  82563. // "$ref": "ProjectsSetDefaultServiceAccountRequest"
  82564. // },
  82565. // "response": {
  82566. // "$ref": "Operation"
  82567. // },
  82568. // "scopes": [
  82569. // "https://www.googleapis.com/auth/cloud-platform",
  82570. // "https://www.googleapis.com/auth/compute"
  82571. // ]
  82572. // }
  82573. }
  82574. // method id "compute.projects.setUsageExportBucket":
  82575. type ProjectsSetUsageExportBucketCall struct {
  82576. s *Service
  82577. project string
  82578. usageexportlocation *UsageExportLocation
  82579. urlParams_ gensupport.URLParams
  82580. ctx_ context.Context
  82581. header_ http.Header
  82582. }
  82583. // SetUsageExportBucket: Enables the usage export feature and sets the
  82584. // usage export bucket where reports are stored. If you provide an empty
  82585. // request body using this method, the usage export feature will be
  82586. // disabled.
  82587. // For details, see https://cloud.google.com/compute/docs/reference/latest/projects/setUsageExportBucket
  82588. func (r *ProjectsService) SetUsageExportBucket(project string, usageexportlocation *UsageExportLocation) *ProjectsSetUsageExportBucketCall {
  82589. c := &ProjectsSetUsageExportBucketCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  82590. c.project = project
  82591. c.usageexportlocation = usageexportlocation
  82592. return c
  82593. }
  82594. // RequestId sets the optional parameter "requestId": An optional
  82595. // request ID to identify requests. Specify a unique request ID so that
  82596. // if you must retry your request, the server will know to ignore the
  82597. // request if it has already been completed.
  82598. //
  82599. // For example, consider a situation where you make an initial request
  82600. // and the request times out. If you make the request again with the
  82601. // same request ID, the server can check if original operation with the
  82602. // same request ID was received, and if so, will ignore the second
  82603. // request. This prevents clients from accidentally creating duplicate
  82604. // commitments.
  82605. //
  82606. // The request ID must be a valid UUID with the exception that zero UUID
  82607. // is not supported (00000000-0000-0000-0000-000000000000).
  82608. func (c *ProjectsSetUsageExportBucketCall) RequestId(requestId string) *ProjectsSetUsageExportBucketCall {
  82609. c.urlParams_.Set("requestId", requestId)
  82610. return c
  82611. }
  82612. // Fields allows partial responses to be retrieved. See
  82613. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  82614. // for more information.
  82615. func (c *ProjectsSetUsageExportBucketCall) Fields(s ...googleapi.Field) *ProjectsSetUsageExportBucketCall {
  82616. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  82617. return c
  82618. }
  82619. // Context sets the context to be used in this call's Do method. Any
  82620. // pending HTTP request will be aborted if the provided context is
  82621. // canceled.
  82622. func (c *ProjectsSetUsageExportBucketCall) Context(ctx context.Context) *ProjectsSetUsageExportBucketCall {
  82623. c.ctx_ = ctx
  82624. return c
  82625. }
  82626. // Header returns an http.Header that can be modified by the caller to
  82627. // add HTTP headers to the request.
  82628. func (c *ProjectsSetUsageExportBucketCall) Header() http.Header {
  82629. if c.header_ == nil {
  82630. c.header_ = make(http.Header)
  82631. }
  82632. return c.header_
  82633. }
  82634. func (c *ProjectsSetUsageExportBucketCall) doRequest(alt string) (*http.Response, error) {
  82635. reqHeaders := make(http.Header)
  82636. for k, v := range c.header_ {
  82637. reqHeaders[k] = v
  82638. }
  82639. reqHeaders.Set("User-Agent", c.s.userAgent())
  82640. var body io.Reader = nil
  82641. body, err := googleapi.WithoutDataWrapper.JSONReader(c.usageexportlocation)
  82642. if err != nil {
  82643. return nil, err
  82644. }
  82645. reqHeaders.Set("Content-Type", "application/json")
  82646. c.urlParams_.Set("alt", alt)
  82647. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/setUsageExportBucket")
  82648. urls += "?" + c.urlParams_.Encode()
  82649. req, _ := http.NewRequest("POST", urls, body)
  82650. req.Header = reqHeaders
  82651. googleapi.Expand(req.URL, map[string]string{
  82652. "project": c.project,
  82653. })
  82654. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  82655. }
  82656. // Do executes the "compute.projects.setUsageExportBucket" call.
  82657. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  82658. // status code is an error. Response headers are in either
  82659. // *Operation.ServerResponse.Header or (if a response was returned at
  82660. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  82661. // to check whether the returned error was because
  82662. // http.StatusNotModified was returned.
  82663. func (c *ProjectsSetUsageExportBucketCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  82664. gensupport.SetOptions(c.urlParams_, opts...)
  82665. res, err := c.doRequest("json")
  82666. if res != nil && res.StatusCode == http.StatusNotModified {
  82667. if res.Body != nil {
  82668. res.Body.Close()
  82669. }
  82670. return nil, &googleapi.Error{
  82671. Code: res.StatusCode,
  82672. Header: res.Header,
  82673. }
  82674. }
  82675. if err != nil {
  82676. return nil, err
  82677. }
  82678. defer googleapi.CloseBody(res)
  82679. if err := googleapi.CheckResponse(res); err != nil {
  82680. return nil, err
  82681. }
  82682. ret := &Operation{
  82683. ServerResponse: googleapi.ServerResponse{
  82684. Header: res.Header,
  82685. HTTPStatusCode: res.StatusCode,
  82686. },
  82687. }
  82688. target := &ret
  82689. if err := gensupport.DecodeResponse(target, res); err != nil {
  82690. return nil, err
  82691. }
  82692. return ret, nil
  82693. // {
  82694. // "description": "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.",
  82695. // "httpMethod": "POST",
  82696. // "id": "compute.projects.setUsageExportBucket",
  82697. // "parameterOrder": [
  82698. // "project"
  82699. // ],
  82700. // "parameters": {
  82701. // "project": {
  82702. // "description": "Project ID for this request.",
  82703. // "location": "path",
  82704. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  82705. // "required": true,
  82706. // "type": "string"
  82707. // },
  82708. // "requestId": {
  82709. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  82710. // "location": "query",
  82711. // "type": "string"
  82712. // }
  82713. // },
  82714. // "path": "{project}/setUsageExportBucket",
  82715. // "request": {
  82716. // "$ref": "UsageExportLocation"
  82717. // },
  82718. // "response": {
  82719. // "$ref": "Operation"
  82720. // },
  82721. // "scopes": [
  82722. // "https://www.googleapis.com/auth/cloud-platform",
  82723. // "https://www.googleapis.com/auth/compute",
  82724. // "https://www.googleapis.com/auth/devstorage.full_control",
  82725. // "https://www.googleapis.com/auth/devstorage.read_only",
  82726. // "https://www.googleapis.com/auth/devstorage.read_write"
  82727. // ]
  82728. // }
  82729. }
  82730. // method id "compute.regionAutoscalers.delete":
  82731. type RegionAutoscalersDeleteCall struct {
  82732. s *Service
  82733. project string
  82734. region string
  82735. autoscaler string
  82736. urlParams_ gensupport.URLParams
  82737. ctx_ context.Context
  82738. header_ http.Header
  82739. }
  82740. // Delete: Deletes the specified autoscaler.
  82741. func (r *RegionAutoscalersService) Delete(project string, region string, autoscaler string) *RegionAutoscalersDeleteCall {
  82742. c := &RegionAutoscalersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  82743. c.project = project
  82744. c.region = region
  82745. c.autoscaler = autoscaler
  82746. return c
  82747. }
  82748. // RequestId sets the optional parameter "requestId": An optional
  82749. // request ID to identify requests. Specify a unique request ID so that
  82750. // if you must retry your request, the server will know to ignore the
  82751. // request if it has already been completed.
  82752. //
  82753. // For example, consider a situation where you make an initial request
  82754. // and the request times out. If you make the request again with the
  82755. // same request ID, the server can check if original operation with the
  82756. // same request ID was received, and if so, will ignore the second
  82757. // request. This prevents clients from accidentally creating duplicate
  82758. // commitments.
  82759. //
  82760. // The request ID must be a valid UUID with the exception that zero UUID
  82761. // is not supported (00000000-0000-0000-0000-000000000000).
  82762. func (c *RegionAutoscalersDeleteCall) RequestId(requestId string) *RegionAutoscalersDeleteCall {
  82763. c.urlParams_.Set("requestId", requestId)
  82764. return c
  82765. }
  82766. // Fields allows partial responses to be retrieved. See
  82767. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  82768. // for more information.
  82769. func (c *RegionAutoscalersDeleteCall) Fields(s ...googleapi.Field) *RegionAutoscalersDeleteCall {
  82770. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  82771. return c
  82772. }
  82773. // Context sets the context to be used in this call's Do method. Any
  82774. // pending HTTP request will be aborted if the provided context is
  82775. // canceled.
  82776. func (c *RegionAutoscalersDeleteCall) Context(ctx context.Context) *RegionAutoscalersDeleteCall {
  82777. c.ctx_ = ctx
  82778. return c
  82779. }
  82780. // Header returns an http.Header that can be modified by the caller to
  82781. // add HTTP headers to the request.
  82782. func (c *RegionAutoscalersDeleteCall) Header() http.Header {
  82783. if c.header_ == nil {
  82784. c.header_ = make(http.Header)
  82785. }
  82786. return c.header_
  82787. }
  82788. func (c *RegionAutoscalersDeleteCall) doRequest(alt string) (*http.Response, error) {
  82789. reqHeaders := make(http.Header)
  82790. for k, v := range c.header_ {
  82791. reqHeaders[k] = v
  82792. }
  82793. reqHeaders.Set("User-Agent", c.s.userAgent())
  82794. var body io.Reader = nil
  82795. c.urlParams_.Set("alt", alt)
  82796. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers/{autoscaler}")
  82797. urls += "?" + c.urlParams_.Encode()
  82798. req, _ := http.NewRequest("DELETE", urls, body)
  82799. req.Header = reqHeaders
  82800. googleapi.Expand(req.URL, map[string]string{
  82801. "project": c.project,
  82802. "region": c.region,
  82803. "autoscaler": c.autoscaler,
  82804. })
  82805. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  82806. }
  82807. // Do executes the "compute.regionAutoscalers.delete" call.
  82808. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  82809. // status code is an error. Response headers are in either
  82810. // *Operation.ServerResponse.Header or (if a response was returned at
  82811. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  82812. // to check whether the returned error was because
  82813. // http.StatusNotModified was returned.
  82814. func (c *RegionAutoscalersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  82815. gensupport.SetOptions(c.urlParams_, opts...)
  82816. res, err := c.doRequest("json")
  82817. if res != nil && res.StatusCode == http.StatusNotModified {
  82818. if res.Body != nil {
  82819. res.Body.Close()
  82820. }
  82821. return nil, &googleapi.Error{
  82822. Code: res.StatusCode,
  82823. Header: res.Header,
  82824. }
  82825. }
  82826. if err != nil {
  82827. return nil, err
  82828. }
  82829. defer googleapi.CloseBody(res)
  82830. if err := googleapi.CheckResponse(res); err != nil {
  82831. return nil, err
  82832. }
  82833. ret := &Operation{
  82834. ServerResponse: googleapi.ServerResponse{
  82835. Header: res.Header,
  82836. HTTPStatusCode: res.StatusCode,
  82837. },
  82838. }
  82839. target := &ret
  82840. if err := gensupport.DecodeResponse(target, res); err != nil {
  82841. return nil, err
  82842. }
  82843. return ret, nil
  82844. // {
  82845. // "description": "Deletes the specified autoscaler.",
  82846. // "httpMethod": "DELETE",
  82847. // "id": "compute.regionAutoscalers.delete",
  82848. // "parameterOrder": [
  82849. // "project",
  82850. // "region",
  82851. // "autoscaler"
  82852. // ],
  82853. // "parameters": {
  82854. // "autoscaler": {
  82855. // "description": "Name of the autoscaler to delete.",
  82856. // "location": "path",
  82857. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  82858. // "required": true,
  82859. // "type": "string"
  82860. // },
  82861. // "project": {
  82862. // "description": "Project ID for this request.",
  82863. // "location": "path",
  82864. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  82865. // "required": true,
  82866. // "type": "string"
  82867. // },
  82868. // "region": {
  82869. // "description": "Name of the region scoping this request.",
  82870. // "location": "path",
  82871. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  82872. // "required": true,
  82873. // "type": "string"
  82874. // },
  82875. // "requestId": {
  82876. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  82877. // "location": "query",
  82878. // "type": "string"
  82879. // }
  82880. // },
  82881. // "path": "{project}/regions/{region}/autoscalers/{autoscaler}",
  82882. // "response": {
  82883. // "$ref": "Operation"
  82884. // },
  82885. // "scopes": [
  82886. // "https://www.googleapis.com/auth/cloud-platform",
  82887. // "https://www.googleapis.com/auth/compute"
  82888. // ]
  82889. // }
  82890. }
  82891. // method id "compute.regionAutoscalers.get":
  82892. type RegionAutoscalersGetCall struct {
  82893. s *Service
  82894. project string
  82895. region string
  82896. autoscaler string
  82897. urlParams_ gensupport.URLParams
  82898. ifNoneMatch_ string
  82899. ctx_ context.Context
  82900. header_ http.Header
  82901. }
  82902. // Get: Returns the specified autoscaler.
  82903. func (r *RegionAutoscalersService) Get(project string, region string, autoscaler string) *RegionAutoscalersGetCall {
  82904. c := &RegionAutoscalersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  82905. c.project = project
  82906. c.region = region
  82907. c.autoscaler = autoscaler
  82908. return c
  82909. }
  82910. // Fields allows partial responses to be retrieved. See
  82911. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  82912. // for more information.
  82913. func (c *RegionAutoscalersGetCall) Fields(s ...googleapi.Field) *RegionAutoscalersGetCall {
  82914. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  82915. return c
  82916. }
  82917. // IfNoneMatch sets the optional parameter which makes the operation
  82918. // fail if the object's ETag matches the given value. This is useful for
  82919. // getting updates only after the object has changed since the last
  82920. // request. Use googleapi.IsNotModified to check whether the response
  82921. // error from Do is the result of In-None-Match.
  82922. func (c *RegionAutoscalersGetCall) IfNoneMatch(entityTag string) *RegionAutoscalersGetCall {
  82923. c.ifNoneMatch_ = entityTag
  82924. return c
  82925. }
  82926. // Context sets the context to be used in this call's Do method. Any
  82927. // pending HTTP request will be aborted if the provided context is
  82928. // canceled.
  82929. func (c *RegionAutoscalersGetCall) Context(ctx context.Context) *RegionAutoscalersGetCall {
  82930. c.ctx_ = ctx
  82931. return c
  82932. }
  82933. // Header returns an http.Header that can be modified by the caller to
  82934. // add HTTP headers to the request.
  82935. func (c *RegionAutoscalersGetCall) Header() http.Header {
  82936. if c.header_ == nil {
  82937. c.header_ = make(http.Header)
  82938. }
  82939. return c.header_
  82940. }
  82941. func (c *RegionAutoscalersGetCall) doRequest(alt string) (*http.Response, error) {
  82942. reqHeaders := make(http.Header)
  82943. for k, v := range c.header_ {
  82944. reqHeaders[k] = v
  82945. }
  82946. reqHeaders.Set("User-Agent", c.s.userAgent())
  82947. if c.ifNoneMatch_ != "" {
  82948. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  82949. }
  82950. var body io.Reader = nil
  82951. c.urlParams_.Set("alt", alt)
  82952. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers/{autoscaler}")
  82953. urls += "?" + c.urlParams_.Encode()
  82954. req, _ := http.NewRequest("GET", urls, body)
  82955. req.Header = reqHeaders
  82956. googleapi.Expand(req.URL, map[string]string{
  82957. "project": c.project,
  82958. "region": c.region,
  82959. "autoscaler": c.autoscaler,
  82960. })
  82961. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  82962. }
  82963. // Do executes the "compute.regionAutoscalers.get" call.
  82964. // Exactly one of *Autoscaler or error will be non-nil. Any non-2xx
  82965. // status code is an error. Response headers are in either
  82966. // *Autoscaler.ServerResponse.Header or (if a response was returned at
  82967. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  82968. // to check whether the returned error was because
  82969. // http.StatusNotModified was returned.
  82970. func (c *RegionAutoscalersGetCall) Do(opts ...googleapi.CallOption) (*Autoscaler, error) {
  82971. gensupport.SetOptions(c.urlParams_, opts...)
  82972. res, err := c.doRequest("json")
  82973. if res != nil && res.StatusCode == http.StatusNotModified {
  82974. if res.Body != nil {
  82975. res.Body.Close()
  82976. }
  82977. return nil, &googleapi.Error{
  82978. Code: res.StatusCode,
  82979. Header: res.Header,
  82980. }
  82981. }
  82982. if err != nil {
  82983. return nil, err
  82984. }
  82985. defer googleapi.CloseBody(res)
  82986. if err := googleapi.CheckResponse(res); err != nil {
  82987. return nil, err
  82988. }
  82989. ret := &Autoscaler{
  82990. ServerResponse: googleapi.ServerResponse{
  82991. Header: res.Header,
  82992. HTTPStatusCode: res.StatusCode,
  82993. },
  82994. }
  82995. target := &ret
  82996. if err := gensupport.DecodeResponse(target, res); err != nil {
  82997. return nil, err
  82998. }
  82999. return ret, nil
  83000. // {
  83001. // "description": "Returns the specified autoscaler.",
  83002. // "httpMethod": "GET",
  83003. // "id": "compute.regionAutoscalers.get",
  83004. // "parameterOrder": [
  83005. // "project",
  83006. // "region",
  83007. // "autoscaler"
  83008. // ],
  83009. // "parameters": {
  83010. // "autoscaler": {
  83011. // "description": "Name of the autoscaler to return.",
  83012. // "location": "path",
  83013. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  83014. // "required": true,
  83015. // "type": "string"
  83016. // },
  83017. // "project": {
  83018. // "description": "Project ID for this request.",
  83019. // "location": "path",
  83020. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  83021. // "required": true,
  83022. // "type": "string"
  83023. // },
  83024. // "region": {
  83025. // "description": "Name of the region scoping this request.",
  83026. // "location": "path",
  83027. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  83028. // "required": true,
  83029. // "type": "string"
  83030. // }
  83031. // },
  83032. // "path": "{project}/regions/{region}/autoscalers/{autoscaler}",
  83033. // "response": {
  83034. // "$ref": "Autoscaler"
  83035. // },
  83036. // "scopes": [
  83037. // "https://www.googleapis.com/auth/cloud-platform",
  83038. // "https://www.googleapis.com/auth/compute",
  83039. // "https://www.googleapis.com/auth/compute.readonly"
  83040. // ]
  83041. // }
  83042. }
  83043. // method id "compute.regionAutoscalers.insert":
  83044. type RegionAutoscalersInsertCall struct {
  83045. s *Service
  83046. project string
  83047. region string
  83048. autoscaler *Autoscaler
  83049. urlParams_ gensupport.URLParams
  83050. ctx_ context.Context
  83051. header_ http.Header
  83052. }
  83053. // Insert: Creates an autoscaler in the specified project using the data
  83054. // included in the request.
  83055. func (r *RegionAutoscalersService) Insert(project string, region string, autoscaler *Autoscaler) *RegionAutoscalersInsertCall {
  83056. c := &RegionAutoscalersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  83057. c.project = project
  83058. c.region = region
  83059. c.autoscaler = autoscaler
  83060. return c
  83061. }
  83062. // RequestId sets the optional parameter "requestId": An optional
  83063. // request ID to identify requests. Specify a unique request ID so that
  83064. // if you must retry your request, the server will know to ignore the
  83065. // request if it has already been completed.
  83066. //
  83067. // For example, consider a situation where you make an initial request
  83068. // and the request times out. If you make the request again with the
  83069. // same request ID, the server can check if original operation with the
  83070. // same request ID was received, and if so, will ignore the second
  83071. // request. This prevents clients from accidentally creating duplicate
  83072. // commitments.
  83073. //
  83074. // The request ID must be a valid UUID with the exception that zero UUID
  83075. // is not supported (00000000-0000-0000-0000-000000000000).
  83076. func (c *RegionAutoscalersInsertCall) RequestId(requestId string) *RegionAutoscalersInsertCall {
  83077. c.urlParams_.Set("requestId", requestId)
  83078. return c
  83079. }
  83080. // Fields allows partial responses to be retrieved. See
  83081. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  83082. // for more information.
  83083. func (c *RegionAutoscalersInsertCall) Fields(s ...googleapi.Field) *RegionAutoscalersInsertCall {
  83084. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  83085. return c
  83086. }
  83087. // Context sets the context to be used in this call's Do method. Any
  83088. // pending HTTP request will be aborted if the provided context is
  83089. // canceled.
  83090. func (c *RegionAutoscalersInsertCall) Context(ctx context.Context) *RegionAutoscalersInsertCall {
  83091. c.ctx_ = ctx
  83092. return c
  83093. }
  83094. // Header returns an http.Header that can be modified by the caller to
  83095. // add HTTP headers to the request.
  83096. func (c *RegionAutoscalersInsertCall) Header() http.Header {
  83097. if c.header_ == nil {
  83098. c.header_ = make(http.Header)
  83099. }
  83100. return c.header_
  83101. }
  83102. func (c *RegionAutoscalersInsertCall) doRequest(alt string) (*http.Response, error) {
  83103. reqHeaders := make(http.Header)
  83104. for k, v := range c.header_ {
  83105. reqHeaders[k] = v
  83106. }
  83107. reqHeaders.Set("User-Agent", c.s.userAgent())
  83108. var body io.Reader = nil
  83109. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  83110. if err != nil {
  83111. return nil, err
  83112. }
  83113. reqHeaders.Set("Content-Type", "application/json")
  83114. c.urlParams_.Set("alt", alt)
  83115. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers")
  83116. urls += "?" + c.urlParams_.Encode()
  83117. req, _ := http.NewRequest("POST", urls, body)
  83118. req.Header = reqHeaders
  83119. googleapi.Expand(req.URL, map[string]string{
  83120. "project": c.project,
  83121. "region": c.region,
  83122. })
  83123. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  83124. }
  83125. // Do executes the "compute.regionAutoscalers.insert" call.
  83126. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  83127. // status code is an error. Response headers are in either
  83128. // *Operation.ServerResponse.Header or (if a response was returned at
  83129. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  83130. // to check whether the returned error was because
  83131. // http.StatusNotModified was returned.
  83132. func (c *RegionAutoscalersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  83133. gensupport.SetOptions(c.urlParams_, opts...)
  83134. res, err := c.doRequest("json")
  83135. if res != nil && res.StatusCode == http.StatusNotModified {
  83136. if res.Body != nil {
  83137. res.Body.Close()
  83138. }
  83139. return nil, &googleapi.Error{
  83140. Code: res.StatusCode,
  83141. Header: res.Header,
  83142. }
  83143. }
  83144. if err != nil {
  83145. return nil, err
  83146. }
  83147. defer googleapi.CloseBody(res)
  83148. if err := googleapi.CheckResponse(res); err != nil {
  83149. return nil, err
  83150. }
  83151. ret := &Operation{
  83152. ServerResponse: googleapi.ServerResponse{
  83153. Header: res.Header,
  83154. HTTPStatusCode: res.StatusCode,
  83155. },
  83156. }
  83157. target := &ret
  83158. if err := gensupport.DecodeResponse(target, res); err != nil {
  83159. return nil, err
  83160. }
  83161. return ret, nil
  83162. // {
  83163. // "description": "Creates an autoscaler in the specified project using the data included in the request.",
  83164. // "httpMethod": "POST",
  83165. // "id": "compute.regionAutoscalers.insert",
  83166. // "parameterOrder": [
  83167. // "project",
  83168. // "region"
  83169. // ],
  83170. // "parameters": {
  83171. // "project": {
  83172. // "description": "Project ID for this request.",
  83173. // "location": "path",
  83174. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  83175. // "required": true,
  83176. // "type": "string"
  83177. // },
  83178. // "region": {
  83179. // "description": "Name of the region scoping this request.",
  83180. // "location": "path",
  83181. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  83182. // "required": true,
  83183. // "type": "string"
  83184. // },
  83185. // "requestId": {
  83186. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  83187. // "location": "query",
  83188. // "type": "string"
  83189. // }
  83190. // },
  83191. // "path": "{project}/regions/{region}/autoscalers",
  83192. // "request": {
  83193. // "$ref": "Autoscaler"
  83194. // },
  83195. // "response": {
  83196. // "$ref": "Operation"
  83197. // },
  83198. // "scopes": [
  83199. // "https://www.googleapis.com/auth/cloud-platform",
  83200. // "https://www.googleapis.com/auth/compute"
  83201. // ]
  83202. // }
  83203. }
  83204. // method id "compute.regionAutoscalers.list":
  83205. type RegionAutoscalersListCall struct {
  83206. s *Service
  83207. project string
  83208. region string
  83209. urlParams_ gensupport.URLParams
  83210. ifNoneMatch_ string
  83211. ctx_ context.Context
  83212. header_ http.Header
  83213. }
  83214. // List: Retrieves a list of autoscalers contained within the specified
  83215. // region.
  83216. func (r *RegionAutoscalersService) List(project string, region string) *RegionAutoscalersListCall {
  83217. c := &RegionAutoscalersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  83218. c.project = project
  83219. c.region = region
  83220. return c
  83221. }
  83222. // Filter sets the optional parameter "filter": A filter expression that
  83223. // filters resources listed in the response. The expression must specify
  83224. // the field name, a comparison operator, and the value that you want to
  83225. // use for filtering. The value must be a string, a number, or a
  83226. // boolean. The comparison operator must be either =, !=, >, or <.
  83227. //
  83228. // For example, if you are filtering Compute Engine instances, you can
  83229. // exclude instances named example-instance by specifying name !=
  83230. // example-instance.
  83231. //
  83232. // You can also filter nested fields. For example, you could specify
  83233. // scheduling.automaticRestart = false to include instances only if they
  83234. // are not scheduled for automatic restarts. You can use filtering on
  83235. // nested fields to filter based on resource labels.
  83236. //
  83237. // To filter on multiple expressions, provide each separate expression
  83238. // within parentheses. For example, (scheduling.automaticRestart = true)
  83239. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  83240. // AND expression. However, you can include AND and OR expressions
  83241. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  83242. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  83243. // true).
  83244. func (c *RegionAutoscalersListCall) Filter(filter string) *RegionAutoscalersListCall {
  83245. c.urlParams_.Set("filter", filter)
  83246. return c
  83247. }
  83248. // MaxResults sets the optional parameter "maxResults": The maximum
  83249. // number of results per page that should be returned. If the number of
  83250. // available results is larger than maxResults, Compute Engine returns a
  83251. // nextPageToken that can be used to get the next page of results in
  83252. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  83253. // (Default: 500)
  83254. func (c *RegionAutoscalersListCall) MaxResults(maxResults int64) *RegionAutoscalersListCall {
  83255. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  83256. return c
  83257. }
  83258. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  83259. // a certain order. By default, results are returned in alphanumerical
  83260. // order based on the resource name.
  83261. //
  83262. // You can also sort results in descending order based on the creation
  83263. // timestamp using orderBy="creationTimestamp desc". This sorts results
  83264. // based on the creationTimestamp field in reverse chronological order
  83265. // (newest result first). Use this to sort resources like operations so
  83266. // that the newest operation is returned first.
  83267. //
  83268. // Currently, only sorting by name or creationTimestamp desc is
  83269. // supported.
  83270. func (c *RegionAutoscalersListCall) OrderBy(orderBy string) *RegionAutoscalersListCall {
  83271. c.urlParams_.Set("orderBy", orderBy)
  83272. return c
  83273. }
  83274. // PageToken sets the optional parameter "pageToken": Specifies a page
  83275. // token to use. Set pageToken to the nextPageToken returned by a
  83276. // previous list request to get the next page of results.
  83277. func (c *RegionAutoscalersListCall) PageToken(pageToken string) *RegionAutoscalersListCall {
  83278. c.urlParams_.Set("pageToken", pageToken)
  83279. return c
  83280. }
  83281. // Fields allows partial responses to be retrieved. See
  83282. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  83283. // for more information.
  83284. func (c *RegionAutoscalersListCall) Fields(s ...googleapi.Field) *RegionAutoscalersListCall {
  83285. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  83286. return c
  83287. }
  83288. // IfNoneMatch sets the optional parameter which makes the operation
  83289. // fail if the object's ETag matches the given value. This is useful for
  83290. // getting updates only after the object has changed since the last
  83291. // request. Use googleapi.IsNotModified to check whether the response
  83292. // error from Do is the result of In-None-Match.
  83293. func (c *RegionAutoscalersListCall) IfNoneMatch(entityTag string) *RegionAutoscalersListCall {
  83294. c.ifNoneMatch_ = entityTag
  83295. return c
  83296. }
  83297. // Context sets the context to be used in this call's Do method. Any
  83298. // pending HTTP request will be aborted if the provided context is
  83299. // canceled.
  83300. func (c *RegionAutoscalersListCall) Context(ctx context.Context) *RegionAutoscalersListCall {
  83301. c.ctx_ = ctx
  83302. return c
  83303. }
  83304. // Header returns an http.Header that can be modified by the caller to
  83305. // add HTTP headers to the request.
  83306. func (c *RegionAutoscalersListCall) Header() http.Header {
  83307. if c.header_ == nil {
  83308. c.header_ = make(http.Header)
  83309. }
  83310. return c.header_
  83311. }
  83312. func (c *RegionAutoscalersListCall) doRequest(alt string) (*http.Response, error) {
  83313. reqHeaders := make(http.Header)
  83314. for k, v := range c.header_ {
  83315. reqHeaders[k] = v
  83316. }
  83317. reqHeaders.Set("User-Agent", c.s.userAgent())
  83318. if c.ifNoneMatch_ != "" {
  83319. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  83320. }
  83321. var body io.Reader = nil
  83322. c.urlParams_.Set("alt", alt)
  83323. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers")
  83324. urls += "?" + c.urlParams_.Encode()
  83325. req, _ := http.NewRequest("GET", urls, body)
  83326. req.Header = reqHeaders
  83327. googleapi.Expand(req.URL, map[string]string{
  83328. "project": c.project,
  83329. "region": c.region,
  83330. })
  83331. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  83332. }
  83333. // Do executes the "compute.regionAutoscalers.list" call.
  83334. // Exactly one of *RegionAutoscalerList or error will be non-nil. Any
  83335. // non-2xx status code is an error. Response headers are in either
  83336. // *RegionAutoscalerList.ServerResponse.Header or (if a response was
  83337. // returned at all) in error.(*googleapi.Error).Header. Use
  83338. // googleapi.IsNotModified to check whether the returned error was
  83339. // because http.StatusNotModified was returned.
  83340. func (c *RegionAutoscalersListCall) Do(opts ...googleapi.CallOption) (*RegionAutoscalerList, error) {
  83341. gensupport.SetOptions(c.urlParams_, opts...)
  83342. res, err := c.doRequest("json")
  83343. if res != nil && res.StatusCode == http.StatusNotModified {
  83344. if res.Body != nil {
  83345. res.Body.Close()
  83346. }
  83347. return nil, &googleapi.Error{
  83348. Code: res.StatusCode,
  83349. Header: res.Header,
  83350. }
  83351. }
  83352. if err != nil {
  83353. return nil, err
  83354. }
  83355. defer googleapi.CloseBody(res)
  83356. if err := googleapi.CheckResponse(res); err != nil {
  83357. return nil, err
  83358. }
  83359. ret := &RegionAutoscalerList{
  83360. ServerResponse: googleapi.ServerResponse{
  83361. Header: res.Header,
  83362. HTTPStatusCode: res.StatusCode,
  83363. },
  83364. }
  83365. target := &ret
  83366. if err := gensupport.DecodeResponse(target, res); err != nil {
  83367. return nil, err
  83368. }
  83369. return ret, nil
  83370. // {
  83371. // "description": "Retrieves a list of autoscalers contained within the specified region.",
  83372. // "httpMethod": "GET",
  83373. // "id": "compute.regionAutoscalers.list",
  83374. // "parameterOrder": [
  83375. // "project",
  83376. // "region"
  83377. // ],
  83378. // "parameters": {
  83379. // "filter": {
  83380. // "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).",
  83381. // "location": "query",
  83382. // "type": "string"
  83383. // },
  83384. // "maxResults": {
  83385. // "default": "500",
  83386. // "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)",
  83387. // "format": "uint32",
  83388. // "location": "query",
  83389. // "minimum": "0",
  83390. // "type": "integer"
  83391. // },
  83392. // "orderBy": {
  83393. // "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.",
  83394. // "location": "query",
  83395. // "type": "string"
  83396. // },
  83397. // "pageToken": {
  83398. // "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.",
  83399. // "location": "query",
  83400. // "type": "string"
  83401. // },
  83402. // "project": {
  83403. // "description": "Project ID for this request.",
  83404. // "location": "path",
  83405. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  83406. // "required": true,
  83407. // "type": "string"
  83408. // },
  83409. // "region": {
  83410. // "description": "Name of the region scoping this request.",
  83411. // "location": "path",
  83412. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  83413. // "required": true,
  83414. // "type": "string"
  83415. // }
  83416. // },
  83417. // "path": "{project}/regions/{region}/autoscalers",
  83418. // "response": {
  83419. // "$ref": "RegionAutoscalerList"
  83420. // },
  83421. // "scopes": [
  83422. // "https://www.googleapis.com/auth/cloud-platform",
  83423. // "https://www.googleapis.com/auth/compute",
  83424. // "https://www.googleapis.com/auth/compute.readonly"
  83425. // ]
  83426. // }
  83427. }
  83428. // Pages invokes f for each page of results.
  83429. // A non-nil error returned from f will halt the iteration.
  83430. // The provided context supersedes any context provided to the Context method.
  83431. func (c *RegionAutoscalersListCall) Pages(ctx context.Context, f func(*RegionAutoscalerList) error) error {
  83432. c.ctx_ = ctx
  83433. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  83434. for {
  83435. x, err := c.Do()
  83436. if err != nil {
  83437. return err
  83438. }
  83439. if err := f(x); err != nil {
  83440. return err
  83441. }
  83442. if x.NextPageToken == "" {
  83443. return nil
  83444. }
  83445. c.PageToken(x.NextPageToken)
  83446. }
  83447. }
  83448. // method id "compute.regionAutoscalers.patch":
  83449. type RegionAutoscalersPatchCall struct {
  83450. s *Service
  83451. project string
  83452. region string
  83453. autoscaler *Autoscaler
  83454. urlParams_ gensupport.URLParams
  83455. ctx_ context.Context
  83456. header_ http.Header
  83457. }
  83458. // Patch: Updates an autoscaler in the specified project using the data
  83459. // included in the request. This method supports PATCH semantics and
  83460. // uses the JSON merge patch format and processing rules.
  83461. func (r *RegionAutoscalersService) Patch(project string, region string, autoscaler *Autoscaler) *RegionAutoscalersPatchCall {
  83462. c := &RegionAutoscalersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  83463. c.project = project
  83464. c.region = region
  83465. c.autoscaler = autoscaler
  83466. return c
  83467. }
  83468. // Autoscaler sets the optional parameter "autoscaler": Name of the
  83469. // autoscaler to patch.
  83470. func (c *RegionAutoscalersPatchCall) Autoscaler(autoscaler string) *RegionAutoscalersPatchCall {
  83471. c.urlParams_.Set("autoscaler", autoscaler)
  83472. return c
  83473. }
  83474. // RequestId sets the optional parameter "requestId": An optional
  83475. // request ID to identify requests. Specify a unique request ID so that
  83476. // if you must retry your request, the server will know to ignore the
  83477. // request if it has already been completed.
  83478. //
  83479. // For example, consider a situation where you make an initial request
  83480. // and the request times out. If you make the request again with the
  83481. // same request ID, the server can check if original operation with the
  83482. // same request ID was received, and if so, will ignore the second
  83483. // request. This prevents clients from accidentally creating duplicate
  83484. // commitments.
  83485. //
  83486. // The request ID must be a valid UUID with the exception that zero UUID
  83487. // is not supported (00000000-0000-0000-0000-000000000000).
  83488. func (c *RegionAutoscalersPatchCall) RequestId(requestId string) *RegionAutoscalersPatchCall {
  83489. c.urlParams_.Set("requestId", requestId)
  83490. return c
  83491. }
  83492. // Fields allows partial responses to be retrieved. See
  83493. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  83494. // for more information.
  83495. func (c *RegionAutoscalersPatchCall) Fields(s ...googleapi.Field) *RegionAutoscalersPatchCall {
  83496. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  83497. return c
  83498. }
  83499. // Context sets the context to be used in this call's Do method. Any
  83500. // pending HTTP request will be aborted if the provided context is
  83501. // canceled.
  83502. func (c *RegionAutoscalersPatchCall) Context(ctx context.Context) *RegionAutoscalersPatchCall {
  83503. c.ctx_ = ctx
  83504. return c
  83505. }
  83506. // Header returns an http.Header that can be modified by the caller to
  83507. // add HTTP headers to the request.
  83508. func (c *RegionAutoscalersPatchCall) Header() http.Header {
  83509. if c.header_ == nil {
  83510. c.header_ = make(http.Header)
  83511. }
  83512. return c.header_
  83513. }
  83514. func (c *RegionAutoscalersPatchCall) doRequest(alt string) (*http.Response, error) {
  83515. reqHeaders := make(http.Header)
  83516. for k, v := range c.header_ {
  83517. reqHeaders[k] = v
  83518. }
  83519. reqHeaders.Set("User-Agent", c.s.userAgent())
  83520. var body io.Reader = nil
  83521. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  83522. if err != nil {
  83523. return nil, err
  83524. }
  83525. reqHeaders.Set("Content-Type", "application/json")
  83526. c.urlParams_.Set("alt", alt)
  83527. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers")
  83528. urls += "?" + c.urlParams_.Encode()
  83529. req, _ := http.NewRequest("PATCH", urls, body)
  83530. req.Header = reqHeaders
  83531. googleapi.Expand(req.URL, map[string]string{
  83532. "project": c.project,
  83533. "region": c.region,
  83534. })
  83535. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  83536. }
  83537. // Do executes the "compute.regionAutoscalers.patch" call.
  83538. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  83539. // status code is an error. Response headers are in either
  83540. // *Operation.ServerResponse.Header or (if a response was returned at
  83541. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  83542. // to check whether the returned error was because
  83543. // http.StatusNotModified was returned.
  83544. func (c *RegionAutoscalersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  83545. gensupport.SetOptions(c.urlParams_, opts...)
  83546. res, err := c.doRequest("json")
  83547. if res != nil && res.StatusCode == http.StatusNotModified {
  83548. if res.Body != nil {
  83549. res.Body.Close()
  83550. }
  83551. return nil, &googleapi.Error{
  83552. Code: res.StatusCode,
  83553. Header: res.Header,
  83554. }
  83555. }
  83556. if err != nil {
  83557. return nil, err
  83558. }
  83559. defer googleapi.CloseBody(res)
  83560. if err := googleapi.CheckResponse(res); err != nil {
  83561. return nil, err
  83562. }
  83563. ret := &Operation{
  83564. ServerResponse: googleapi.ServerResponse{
  83565. Header: res.Header,
  83566. HTTPStatusCode: res.StatusCode,
  83567. },
  83568. }
  83569. target := &ret
  83570. if err := gensupport.DecodeResponse(target, res); err != nil {
  83571. return nil, err
  83572. }
  83573. return ret, nil
  83574. // {
  83575. // "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.",
  83576. // "httpMethod": "PATCH",
  83577. // "id": "compute.regionAutoscalers.patch",
  83578. // "parameterOrder": [
  83579. // "project",
  83580. // "region"
  83581. // ],
  83582. // "parameters": {
  83583. // "autoscaler": {
  83584. // "description": "Name of the autoscaler to patch.",
  83585. // "location": "query",
  83586. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  83587. // "type": "string"
  83588. // },
  83589. // "project": {
  83590. // "description": "Project ID for this request.",
  83591. // "location": "path",
  83592. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  83593. // "required": true,
  83594. // "type": "string"
  83595. // },
  83596. // "region": {
  83597. // "description": "Name of the region scoping this request.",
  83598. // "location": "path",
  83599. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  83600. // "required": true,
  83601. // "type": "string"
  83602. // },
  83603. // "requestId": {
  83604. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  83605. // "location": "query",
  83606. // "type": "string"
  83607. // }
  83608. // },
  83609. // "path": "{project}/regions/{region}/autoscalers",
  83610. // "request": {
  83611. // "$ref": "Autoscaler"
  83612. // },
  83613. // "response": {
  83614. // "$ref": "Operation"
  83615. // },
  83616. // "scopes": [
  83617. // "https://www.googleapis.com/auth/cloud-platform",
  83618. // "https://www.googleapis.com/auth/compute"
  83619. // ]
  83620. // }
  83621. }
  83622. // method id "compute.regionAutoscalers.testIamPermissions":
  83623. type RegionAutoscalersTestIamPermissionsCall struct {
  83624. s *Service
  83625. project string
  83626. region string
  83627. resource string
  83628. testpermissionsrequest *TestPermissionsRequest
  83629. urlParams_ gensupport.URLParams
  83630. ctx_ context.Context
  83631. header_ http.Header
  83632. }
  83633. // TestIamPermissions: Returns permissions that a caller has on the
  83634. // specified resource.
  83635. func (r *RegionAutoscalersService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionAutoscalersTestIamPermissionsCall {
  83636. c := &RegionAutoscalersTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  83637. c.project = project
  83638. c.region = region
  83639. c.resource = resource
  83640. c.testpermissionsrequest = testpermissionsrequest
  83641. return c
  83642. }
  83643. // Fields allows partial responses to be retrieved. See
  83644. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  83645. // for more information.
  83646. func (c *RegionAutoscalersTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionAutoscalersTestIamPermissionsCall {
  83647. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  83648. return c
  83649. }
  83650. // Context sets the context to be used in this call's Do method. Any
  83651. // pending HTTP request will be aborted if the provided context is
  83652. // canceled.
  83653. func (c *RegionAutoscalersTestIamPermissionsCall) Context(ctx context.Context) *RegionAutoscalersTestIamPermissionsCall {
  83654. c.ctx_ = ctx
  83655. return c
  83656. }
  83657. // Header returns an http.Header that can be modified by the caller to
  83658. // add HTTP headers to the request.
  83659. func (c *RegionAutoscalersTestIamPermissionsCall) Header() http.Header {
  83660. if c.header_ == nil {
  83661. c.header_ = make(http.Header)
  83662. }
  83663. return c.header_
  83664. }
  83665. func (c *RegionAutoscalersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  83666. reqHeaders := make(http.Header)
  83667. for k, v := range c.header_ {
  83668. reqHeaders[k] = v
  83669. }
  83670. reqHeaders.Set("User-Agent", c.s.userAgent())
  83671. var body io.Reader = nil
  83672. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  83673. if err != nil {
  83674. return nil, err
  83675. }
  83676. reqHeaders.Set("Content-Type", "application/json")
  83677. c.urlParams_.Set("alt", alt)
  83678. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers/{resource}/testIamPermissions")
  83679. urls += "?" + c.urlParams_.Encode()
  83680. req, _ := http.NewRequest("POST", urls, body)
  83681. req.Header = reqHeaders
  83682. googleapi.Expand(req.URL, map[string]string{
  83683. "project": c.project,
  83684. "region": c.region,
  83685. "resource": c.resource,
  83686. })
  83687. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  83688. }
  83689. // Do executes the "compute.regionAutoscalers.testIamPermissions" call.
  83690. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  83691. // non-2xx status code is an error. Response headers are in either
  83692. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  83693. // returned at all) in error.(*googleapi.Error).Header. Use
  83694. // googleapi.IsNotModified to check whether the returned error was
  83695. // because http.StatusNotModified was returned.
  83696. func (c *RegionAutoscalersTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  83697. gensupport.SetOptions(c.urlParams_, opts...)
  83698. res, err := c.doRequest("json")
  83699. if res != nil && res.StatusCode == http.StatusNotModified {
  83700. if res.Body != nil {
  83701. res.Body.Close()
  83702. }
  83703. return nil, &googleapi.Error{
  83704. Code: res.StatusCode,
  83705. Header: res.Header,
  83706. }
  83707. }
  83708. if err != nil {
  83709. return nil, err
  83710. }
  83711. defer googleapi.CloseBody(res)
  83712. if err := googleapi.CheckResponse(res); err != nil {
  83713. return nil, err
  83714. }
  83715. ret := &TestPermissionsResponse{
  83716. ServerResponse: googleapi.ServerResponse{
  83717. Header: res.Header,
  83718. HTTPStatusCode: res.StatusCode,
  83719. },
  83720. }
  83721. target := &ret
  83722. if err := gensupport.DecodeResponse(target, res); err != nil {
  83723. return nil, err
  83724. }
  83725. return ret, nil
  83726. // {
  83727. // "description": "Returns permissions that a caller has on the specified resource.",
  83728. // "httpMethod": "POST",
  83729. // "id": "compute.regionAutoscalers.testIamPermissions",
  83730. // "parameterOrder": [
  83731. // "project",
  83732. // "region",
  83733. // "resource"
  83734. // ],
  83735. // "parameters": {
  83736. // "project": {
  83737. // "description": "Project ID for this request.",
  83738. // "location": "path",
  83739. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  83740. // "required": true,
  83741. // "type": "string"
  83742. // },
  83743. // "region": {
  83744. // "description": "The name of the region for this request.",
  83745. // "location": "path",
  83746. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  83747. // "required": true,
  83748. // "type": "string"
  83749. // },
  83750. // "resource": {
  83751. // "description": "Name of the resource for this request.",
  83752. // "location": "path",
  83753. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  83754. // "required": true,
  83755. // "type": "string"
  83756. // }
  83757. // },
  83758. // "path": "{project}/regions/{region}/autoscalers/{resource}/testIamPermissions",
  83759. // "request": {
  83760. // "$ref": "TestPermissionsRequest"
  83761. // },
  83762. // "response": {
  83763. // "$ref": "TestPermissionsResponse"
  83764. // },
  83765. // "scopes": [
  83766. // "https://www.googleapis.com/auth/cloud-platform",
  83767. // "https://www.googleapis.com/auth/compute",
  83768. // "https://www.googleapis.com/auth/compute.readonly"
  83769. // ]
  83770. // }
  83771. }
  83772. // method id "compute.regionAutoscalers.update":
  83773. type RegionAutoscalersUpdateCall struct {
  83774. s *Service
  83775. project string
  83776. region string
  83777. autoscaler *Autoscaler
  83778. urlParams_ gensupport.URLParams
  83779. ctx_ context.Context
  83780. header_ http.Header
  83781. }
  83782. // Update: Updates an autoscaler in the specified project using the data
  83783. // included in the request.
  83784. func (r *RegionAutoscalersService) Update(project string, region string, autoscaler *Autoscaler) *RegionAutoscalersUpdateCall {
  83785. c := &RegionAutoscalersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  83786. c.project = project
  83787. c.region = region
  83788. c.autoscaler = autoscaler
  83789. return c
  83790. }
  83791. // Autoscaler sets the optional parameter "autoscaler": Name of the
  83792. // autoscaler to update.
  83793. func (c *RegionAutoscalersUpdateCall) Autoscaler(autoscaler string) *RegionAutoscalersUpdateCall {
  83794. c.urlParams_.Set("autoscaler", autoscaler)
  83795. return c
  83796. }
  83797. // RequestId sets the optional parameter "requestId": An optional
  83798. // request ID to identify requests. Specify a unique request ID so that
  83799. // if you must retry your request, the server will know to ignore the
  83800. // request if it has already been completed.
  83801. //
  83802. // For example, consider a situation where you make an initial request
  83803. // and the request times out. If you make the request again with the
  83804. // same request ID, the server can check if original operation with the
  83805. // same request ID was received, and if so, will ignore the second
  83806. // request. This prevents clients from accidentally creating duplicate
  83807. // commitments.
  83808. //
  83809. // The request ID must be a valid UUID with the exception that zero UUID
  83810. // is not supported (00000000-0000-0000-0000-000000000000).
  83811. func (c *RegionAutoscalersUpdateCall) RequestId(requestId string) *RegionAutoscalersUpdateCall {
  83812. c.urlParams_.Set("requestId", requestId)
  83813. return c
  83814. }
  83815. // Fields allows partial responses to be retrieved. See
  83816. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  83817. // for more information.
  83818. func (c *RegionAutoscalersUpdateCall) Fields(s ...googleapi.Field) *RegionAutoscalersUpdateCall {
  83819. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  83820. return c
  83821. }
  83822. // Context sets the context to be used in this call's Do method. Any
  83823. // pending HTTP request will be aborted if the provided context is
  83824. // canceled.
  83825. func (c *RegionAutoscalersUpdateCall) Context(ctx context.Context) *RegionAutoscalersUpdateCall {
  83826. c.ctx_ = ctx
  83827. return c
  83828. }
  83829. // Header returns an http.Header that can be modified by the caller to
  83830. // add HTTP headers to the request.
  83831. func (c *RegionAutoscalersUpdateCall) Header() http.Header {
  83832. if c.header_ == nil {
  83833. c.header_ = make(http.Header)
  83834. }
  83835. return c.header_
  83836. }
  83837. func (c *RegionAutoscalersUpdateCall) doRequest(alt string) (*http.Response, error) {
  83838. reqHeaders := make(http.Header)
  83839. for k, v := range c.header_ {
  83840. reqHeaders[k] = v
  83841. }
  83842. reqHeaders.Set("User-Agent", c.s.userAgent())
  83843. var body io.Reader = nil
  83844. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  83845. if err != nil {
  83846. return nil, err
  83847. }
  83848. reqHeaders.Set("Content-Type", "application/json")
  83849. c.urlParams_.Set("alt", alt)
  83850. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers")
  83851. urls += "?" + c.urlParams_.Encode()
  83852. req, _ := http.NewRequest("PUT", urls, body)
  83853. req.Header = reqHeaders
  83854. googleapi.Expand(req.URL, map[string]string{
  83855. "project": c.project,
  83856. "region": c.region,
  83857. })
  83858. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  83859. }
  83860. // Do executes the "compute.regionAutoscalers.update" call.
  83861. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  83862. // status code is an error. Response headers are in either
  83863. // *Operation.ServerResponse.Header or (if a response was returned at
  83864. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  83865. // to check whether the returned error was because
  83866. // http.StatusNotModified was returned.
  83867. func (c *RegionAutoscalersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  83868. gensupport.SetOptions(c.urlParams_, opts...)
  83869. res, err := c.doRequest("json")
  83870. if res != nil && res.StatusCode == http.StatusNotModified {
  83871. if res.Body != nil {
  83872. res.Body.Close()
  83873. }
  83874. return nil, &googleapi.Error{
  83875. Code: res.StatusCode,
  83876. Header: res.Header,
  83877. }
  83878. }
  83879. if err != nil {
  83880. return nil, err
  83881. }
  83882. defer googleapi.CloseBody(res)
  83883. if err := googleapi.CheckResponse(res); err != nil {
  83884. return nil, err
  83885. }
  83886. ret := &Operation{
  83887. ServerResponse: googleapi.ServerResponse{
  83888. Header: res.Header,
  83889. HTTPStatusCode: res.StatusCode,
  83890. },
  83891. }
  83892. target := &ret
  83893. if err := gensupport.DecodeResponse(target, res); err != nil {
  83894. return nil, err
  83895. }
  83896. return ret, nil
  83897. // {
  83898. // "description": "Updates an autoscaler in the specified project using the data included in the request.",
  83899. // "httpMethod": "PUT",
  83900. // "id": "compute.regionAutoscalers.update",
  83901. // "parameterOrder": [
  83902. // "project",
  83903. // "region"
  83904. // ],
  83905. // "parameters": {
  83906. // "autoscaler": {
  83907. // "description": "Name of the autoscaler to update.",
  83908. // "location": "query",
  83909. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  83910. // "type": "string"
  83911. // },
  83912. // "project": {
  83913. // "description": "Project ID for this request.",
  83914. // "location": "path",
  83915. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  83916. // "required": true,
  83917. // "type": "string"
  83918. // },
  83919. // "region": {
  83920. // "description": "Name of the region scoping this request.",
  83921. // "location": "path",
  83922. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  83923. // "required": true,
  83924. // "type": "string"
  83925. // },
  83926. // "requestId": {
  83927. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  83928. // "location": "query",
  83929. // "type": "string"
  83930. // }
  83931. // },
  83932. // "path": "{project}/regions/{region}/autoscalers",
  83933. // "request": {
  83934. // "$ref": "Autoscaler"
  83935. // },
  83936. // "response": {
  83937. // "$ref": "Operation"
  83938. // },
  83939. // "scopes": [
  83940. // "https://www.googleapis.com/auth/cloud-platform",
  83941. // "https://www.googleapis.com/auth/compute"
  83942. // ]
  83943. // }
  83944. }
  83945. // method id "compute.regionBackendServices.delete":
  83946. type RegionBackendServicesDeleteCall struct {
  83947. s *Service
  83948. project string
  83949. region string
  83950. backendService string
  83951. urlParams_ gensupport.URLParams
  83952. ctx_ context.Context
  83953. header_ http.Header
  83954. }
  83955. // Delete: Deletes the specified regional BackendService resource.
  83956. func (r *RegionBackendServicesService) Delete(project string, region string, backendService string) *RegionBackendServicesDeleteCall {
  83957. c := &RegionBackendServicesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  83958. c.project = project
  83959. c.region = region
  83960. c.backendService = backendService
  83961. return c
  83962. }
  83963. // RequestId sets the optional parameter "requestId": An optional
  83964. // request ID to identify requests. Specify a unique request ID so that
  83965. // if you must retry your request, the server will know to ignore the
  83966. // request if it has already been completed.
  83967. //
  83968. // For example, consider a situation where you make an initial request
  83969. // and the request times out. If you make the request again with the
  83970. // same request ID, the server can check if original operation with the
  83971. // same request ID was received, and if so, will ignore the second
  83972. // request. This prevents clients from accidentally creating duplicate
  83973. // commitments.
  83974. //
  83975. // The request ID must be a valid UUID with the exception that zero UUID
  83976. // is not supported (00000000-0000-0000-0000-000000000000).
  83977. func (c *RegionBackendServicesDeleteCall) RequestId(requestId string) *RegionBackendServicesDeleteCall {
  83978. c.urlParams_.Set("requestId", requestId)
  83979. return c
  83980. }
  83981. // Fields allows partial responses to be retrieved. See
  83982. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  83983. // for more information.
  83984. func (c *RegionBackendServicesDeleteCall) Fields(s ...googleapi.Field) *RegionBackendServicesDeleteCall {
  83985. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  83986. return c
  83987. }
  83988. // Context sets the context to be used in this call's Do method. Any
  83989. // pending HTTP request will be aborted if the provided context is
  83990. // canceled.
  83991. func (c *RegionBackendServicesDeleteCall) Context(ctx context.Context) *RegionBackendServicesDeleteCall {
  83992. c.ctx_ = ctx
  83993. return c
  83994. }
  83995. // Header returns an http.Header that can be modified by the caller to
  83996. // add HTTP headers to the request.
  83997. func (c *RegionBackendServicesDeleteCall) Header() http.Header {
  83998. if c.header_ == nil {
  83999. c.header_ = make(http.Header)
  84000. }
  84001. return c.header_
  84002. }
  84003. func (c *RegionBackendServicesDeleteCall) doRequest(alt string) (*http.Response, error) {
  84004. reqHeaders := make(http.Header)
  84005. for k, v := range c.header_ {
  84006. reqHeaders[k] = v
  84007. }
  84008. reqHeaders.Set("User-Agent", c.s.userAgent())
  84009. var body io.Reader = nil
  84010. c.urlParams_.Set("alt", alt)
  84011. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices/{backendService}")
  84012. urls += "?" + c.urlParams_.Encode()
  84013. req, _ := http.NewRequest("DELETE", urls, body)
  84014. req.Header = reqHeaders
  84015. googleapi.Expand(req.URL, map[string]string{
  84016. "project": c.project,
  84017. "region": c.region,
  84018. "backendService": c.backendService,
  84019. })
  84020. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  84021. }
  84022. // Do executes the "compute.regionBackendServices.delete" call.
  84023. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  84024. // status code is an error. Response headers are in either
  84025. // *Operation.ServerResponse.Header or (if a response was returned at
  84026. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  84027. // to check whether the returned error was because
  84028. // http.StatusNotModified was returned.
  84029. func (c *RegionBackendServicesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  84030. gensupport.SetOptions(c.urlParams_, opts...)
  84031. res, err := c.doRequest("json")
  84032. if res != nil && res.StatusCode == http.StatusNotModified {
  84033. if res.Body != nil {
  84034. res.Body.Close()
  84035. }
  84036. return nil, &googleapi.Error{
  84037. Code: res.StatusCode,
  84038. Header: res.Header,
  84039. }
  84040. }
  84041. if err != nil {
  84042. return nil, err
  84043. }
  84044. defer googleapi.CloseBody(res)
  84045. if err := googleapi.CheckResponse(res); err != nil {
  84046. return nil, err
  84047. }
  84048. ret := &Operation{
  84049. ServerResponse: googleapi.ServerResponse{
  84050. Header: res.Header,
  84051. HTTPStatusCode: res.StatusCode,
  84052. },
  84053. }
  84054. target := &ret
  84055. if err := gensupport.DecodeResponse(target, res); err != nil {
  84056. return nil, err
  84057. }
  84058. return ret, nil
  84059. // {
  84060. // "description": "Deletes the specified regional BackendService resource.",
  84061. // "httpMethod": "DELETE",
  84062. // "id": "compute.regionBackendServices.delete",
  84063. // "parameterOrder": [
  84064. // "project",
  84065. // "region",
  84066. // "backendService"
  84067. // ],
  84068. // "parameters": {
  84069. // "backendService": {
  84070. // "description": "Name of the BackendService resource to delete.",
  84071. // "location": "path",
  84072. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  84073. // "required": true,
  84074. // "type": "string"
  84075. // },
  84076. // "project": {
  84077. // "description": "Project ID for this request.",
  84078. // "location": "path",
  84079. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  84080. // "required": true,
  84081. // "type": "string"
  84082. // },
  84083. // "region": {
  84084. // "description": "Name of the region scoping this request.",
  84085. // "location": "path",
  84086. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  84087. // "required": true,
  84088. // "type": "string"
  84089. // },
  84090. // "requestId": {
  84091. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  84092. // "location": "query",
  84093. // "type": "string"
  84094. // }
  84095. // },
  84096. // "path": "{project}/regions/{region}/backendServices/{backendService}",
  84097. // "response": {
  84098. // "$ref": "Operation"
  84099. // },
  84100. // "scopes": [
  84101. // "https://www.googleapis.com/auth/cloud-platform",
  84102. // "https://www.googleapis.com/auth/compute"
  84103. // ]
  84104. // }
  84105. }
  84106. // method id "compute.regionBackendServices.get":
  84107. type RegionBackendServicesGetCall struct {
  84108. s *Service
  84109. project string
  84110. region string
  84111. backendService string
  84112. urlParams_ gensupport.URLParams
  84113. ifNoneMatch_ string
  84114. ctx_ context.Context
  84115. header_ http.Header
  84116. }
  84117. // Get: Returns the specified regional BackendService resource.
  84118. func (r *RegionBackendServicesService) Get(project string, region string, backendService string) *RegionBackendServicesGetCall {
  84119. c := &RegionBackendServicesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  84120. c.project = project
  84121. c.region = region
  84122. c.backendService = backendService
  84123. return c
  84124. }
  84125. // Fields allows partial responses to be retrieved. See
  84126. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  84127. // for more information.
  84128. func (c *RegionBackendServicesGetCall) Fields(s ...googleapi.Field) *RegionBackendServicesGetCall {
  84129. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  84130. return c
  84131. }
  84132. // IfNoneMatch sets the optional parameter which makes the operation
  84133. // fail if the object's ETag matches the given value. This is useful for
  84134. // getting updates only after the object has changed since the last
  84135. // request. Use googleapi.IsNotModified to check whether the response
  84136. // error from Do is the result of In-None-Match.
  84137. func (c *RegionBackendServicesGetCall) IfNoneMatch(entityTag string) *RegionBackendServicesGetCall {
  84138. c.ifNoneMatch_ = entityTag
  84139. return c
  84140. }
  84141. // Context sets the context to be used in this call's Do method. Any
  84142. // pending HTTP request will be aborted if the provided context is
  84143. // canceled.
  84144. func (c *RegionBackendServicesGetCall) Context(ctx context.Context) *RegionBackendServicesGetCall {
  84145. c.ctx_ = ctx
  84146. return c
  84147. }
  84148. // Header returns an http.Header that can be modified by the caller to
  84149. // add HTTP headers to the request.
  84150. func (c *RegionBackendServicesGetCall) Header() http.Header {
  84151. if c.header_ == nil {
  84152. c.header_ = make(http.Header)
  84153. }
  84154. return c.header_
  84155. }
  84156. func (c *RegionBackendServicesGetCall) doRequest(alt string) (*http.Response, error) {
  84157. reqHeaders := make(http.Header)
  84158. for k, v := range c.header_ {
  84159. reqHeaders[k] = v
  84160. }
  84161. reqHeaders.Set("User-Agent", c.s.userAgent())
  84162. if c.ifNoneMatch_ != "" {
  84163. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  84164. }
  84165. var body io.Reader = nil
  84166. c.urlParams_.Set("alt", alt)
  84167. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices/{backendService}")
  84168. urls += "?" + c.urlParams_.Encode()
  84169. req, _ := http.NewRequest("GET", urls, body)
  84170. req.Header = reqHeaders
  84171. googleapi.Expand(req.URL, map[string]string{
  84172. "project": c.project,
  84173. "region": c.region,
  84174. "backendService": c.backendService,
  84175. })
  84176. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  84177. }
  84178. // Do executes the "compute.regionBackendServices.get" call.
  84179. // Exactly one of *BackendService or error will be non-nil. Any non-2xx
  84180. // status code is an error. Response headers are in either
  84181. // *BackendService.ServerResponse.Header or (if a response was returned
  84182. // at all) in error.(*googleapi.Error).Header. Use
  84183. // googleapi.IsNotModified to check whether the returned error was
  84184. // because http.StatusNotModified was returned.
  84185. func (c *RegionBackendServicesGetCall) Do(opts ...googleapi.CallOption) (*BackendService, error) {
  84186. gensupport.SetOptions(c.urlParams_, opts...)
  84187. res, err := c.doRequest("json")
  84188. if res != nil && res.StatusCode == http.StatusNotModified {
  84189. if res.Body != nil {
  84190. res.Body.Close()
  84191. }
  84192. return nil, &googleapi.Error{
  84193. Code: res.StatusCode,
  84194. Header: res.Header,
  84195. }
  84196. }
  84197. if err != nil {
  84198. return nil, err
  84199. }
  84200. defer googleapi.CloseBody(res)
  84201. if err := googleapi.CheckResponse(res); err != nil {
  84202. return nil, err
  84203. }
  84204. ret := &BackendService{
  84205. ServerResponse: googleapi.ServerResponse{
  84206. Header: res.Header,
  84207. HTTPStatusCode: res.StatusCode,
  84208. },
  84209. }
  84210. target := &ret
  84211. if err := gensupport.DecodeResponse(target, res); err != nil {
  84212. return nil, err
  84213. }
  84214. return ret, nil
  84215. // {
  84216. // "description": "Returns the specified regional BackendService resource.",
  84217. // "httpMethod": "GET",
  84218. // "id": "compute.regionBackendServices.get",
  84219. // "parameterOrder": [
  84220. // "project",
  84221. // "region",
  84222. // "backendService"
  84223. // ],
  84224. // "parameters": {
  84225. // "backendService": {
  84226. // "description": "Name of the BackendService resource to return.",
  84227. // "location": "path",
  84228. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  84229. // "required": true,
  84230. // "type": "string"
  84231. // },
  84232. // "project": {
  84233. // "description": "Project ID for this request.",
  84234. // "location": "path",
  84235. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  84236. // "required": true,
  84237. // "type": "string"
  84238. // },
  84239. // "region": {
  84240. // "description": "Name of the region scoping this request.",
  84241. // "location": "path",
  84242. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  84243. // "required": true,
  84244. // "type": "string"
  84245. // }
  84246. // },
  84247. // "path": "{project}/regions/{region}/backendServices/{backendService}",
  84248. // "response": {
  84249. // "$ref": "BackendService"
  84250. // },
  84251. // "scopes": [
  84252. // "https://www.googleapis.com/auth/cloud-platform",
  84253. // "https://www.googleapis.com/auth/compute",
  84254. // "https://www.googleapis.com/auth/compute.readonly"
  84255. // ]
  84256. // }
  84257. }
  84258. // method id "compute.regionBackendServices.getHealth":
  84259. type RegionBackendServicesGetHealthCall struct {
  84260. s *Service
  84261. project string
  84262. region string
  84263. backendService string
  84264. resourcegroupreference *ResourceGroupReference
  84265. urlParams_ gensupport.URLParams
  84266. ctx_ context.Context
  84267. header_ http.Header
  84268. }
  84269. // GetHealth: Gets the most recent health check results for this
  84270. // regional BackendService.
  84271. func (r *RegionBackendServicesService) GetHealth(project string, region string, backendService string, resourcegroupreference *ResourceGroupReference) *RegionBackendServicesGetHealthCall {
  84272. c := &RegionBackendServicesGetHealthCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  84273. c.project = project
  84274. c.region = region
  84275. c.backendService = backendService
  84276. c.resourcegroupreference = resourcegroupreference
  84277. return c
  84278. }
  84279. // Fields allows partial responses to be retrieved. See
  84280. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  84281. // for more information.
  84282. func (c *RegionBackendServicesGetHealthCall) Fields(s ...googleapi.Field) *RegionBackendServicesGetHealthCall {
  84283. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  84284. return c
  84285. }
  84286. // Context sets the context to be used in this call's Do method. Any
  84287. // pending HTTP request will be aborted if the provided context is
  84288. // canceled.
  84289. func (c *RegionBackendServicesGetHealthCall) Context(ctx context.Context) *RegionBackendServicesGetHealthCall {
  84290. c.ctx_ = ctx
  84291. return c
  84292. }
  84293. // Header returns an http.Header that can be modified by the caller to
  84294. // add HTTP headers to the request.
  84295. func (c *RegionBackendServicesGetHealthCall) Header() http.Header {
  84296. if c.header_ == nil {
  84297. c.header_ = make(http.Header)
  84298. }
  84299. return c.header_
  84300. }
  84301. func (c *RegionBackendServicesGetHealthCall) doRequest(alt string) (*http.Response, error) {
  84302. reqHeaders := make(http.Header)
  84303. for k, v := range c.header_ {
  84304. reqHeaders[k] = v
  84305. }
  84306. reqHeaders.Set("User-Agent", c.s.userAgent())
  84307. var body io.Reader = nil
  84308. body, err := googleapi.WithoutDataWrapper.JSONReader(c.resourcegroupreference)
  84309. if err != nil {
  84310. return nil, err
  84311. }
  84312. reqHeaders.Set("Content-Type", "application/json")
  84313. c.urlParams_.Set("alt", alt)
  84314. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices/{backendService}/getHealth")
  84315. urls += "?" + c.urlParams_.Encode()
  84316. req, _ := http.NewRequest("POST", urls, body)
  84317. req.Header = reqHeaders
  84318. googleapi.Expand(req.URL, map[string]string{
  84319. "project": c.project,
  84320. "region": c.region,
  84321. "backendService": c.backendService,
  84322. })
  84323. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  84324. }
  84325. // Do executes the "compute.regionBackendServices.getHealth" call.
  84326. // Exactly one of *BackendServiceGroupHealth or error will be non-nil.
  84327. // Any non-2xx status code is an error. Response headers are in either
  84328. // *BackendServiceGroupHealth.ServerResponse.Header or (if a response
  84329. // was returned at all) in error.(*googleapi.Error).Header. Use
  84330. // googleapi.IsNotModified to check whether the returned error was
  84331. // because http.StatusNotModified was returned.
  84332. func (c *RegionBackendServicesGetHealthCall) Do(opts ...googleapi.CallOption) (*BackendServiceGroupHealth, error) {
  84333. gensupport.SetOptions(c.urlParams_, opts...)
  84334. res, err := c.doRequest("json")
  84335. if res != nil && res.StatusCode == http.StatusNotModified {
  84336. if res.Body != nil {
  84337. res.Body.Close()
  84338. }
  84339. return nil, &googleapi.Error{
  84340. Code: res.StatusCode,
  84341. Header: res.Header,
  84342. }
  84343. }
  84344. if err != nil {
  84345. return nil, err
  84346. }
  84347. defer googleapi.CloseBody(res)
  84348. if err := googleapi.CheckResponse(res); err != nil {
  84349. return nil, err
  84350. }
  84351. ret := &BackendServiceGroupHealth{
  84352. ServerResponse: googleapi.ServerResponse{
  84353. Header: res.Header,
  84354. HTTPStatusCode: res.StatusCode,
  84355. },
  84356. }
  84357. target := &ret
  84358. if err := gensupport.DecodeResponse(target, res); err != nil {
  84359. return nil, err
  84360. }
  84361. return ret, nil
  84362. // {
  84363. // "description": "Gets the most recent health check results for this regional BackendService.",
  84364. // "httpMethod": "POST",
  84365. // "id": "compute.regionBackendServices.getHealth",
  84366. // "parameterOrder": [
  84367. // "project",
  84368. // "region",
  84369. // "backendService"
  84370. // ],
  84371. // "parameters": {
  84372. // "backendService": {
  84373. // "description": "Name of the BackendService resource for which to get health.",
  84374. // "location": "path",
  84375. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  84376. // "required": true,
  84377. // "type": "string"
  84378. // },
  84379. // "project": {
  84380. // "location": "path",
  84381. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  84382. // "required": true,
  84383. // "type": "string"
  84384. // },
  84385. // "region": {
  84386. // "description": "Name of the region scoping this request.",
  84387. // "location": "path",
  84388. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  84389. // "required": true,
  84390. // "type": "string"
  84391. // }
  84392. // },
  84393. // "path": "{project}/regions/{region}/backendServices/{backendService}/getHealth",
  84394. // "request": {
  84395. // "$ref": "ResourceGroupReference"
  84396. // },
  84397. // "response": {
  84398. // "$ref": "BackendServiceGroupHealth"
  84399. // },
  84400. // "scopes": [
  84401. // "https://www.googleapis.com/auth/cloud-platform",
  84402. // "https://www.googleapis.com/auth/compute",
  84403. // "https://www.googleapis.com/auth/compute.readonly"
  84404. // ]
  84405. // }
  84406. }
  84407. // method id "compute.regionBackendServices.insert":
  84408. type RegionBackendServicesInsertCall struct {
  84409. s *Service
  84410. project string
  84411. region string
  84412. backendservice *BackendService
  84413. urlParams_ gensupport.URLParams
  84414. ctx_ context.Context
  84415. header_ http.Header
  84416. }
  84417. // Insert: Creates a regional BackendService resource in the specified
  84418. // project using the data included in the request. There are several
  84419. // restrictions and guidelines to keep in mind when creating a regional
  84420. // backend service. Read Restrictions and Guidelines for more
  84421. // information.
  84422. func (r *RegionBackendServicesService) Insert(project string, region string, backendservice *BackendService) *RegionBackendServicesInsertCall {
  84423. c := &RegionBackendServicesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  84424. c.project = project
  84425. c.region = region
  84426. c.backendservice = backendservice
  84427. return c
  84428. }
  84429. // RequestId sets the optional parameter "requestId": An optional
  84430. // request ID to identify requests. Specify a unique request ID so that
  84431. // if you must retry your request, the server will know to ignore the
  84432. // request if it has already been completed.
  84433. //
  84434. // For example, consider a situation where you make an initial request
  84435. // and the request times out. If you make the request again with the
  84436. // same request ID, the server can check if original operation with the
  84437. // same request ID was received, and if so, will ignore the second
  84438. // request. This prevents clients from accidentally creating duplicate
  84439. // commitments.
  84440. //
  84441. // The request ID must be a valid UUID with the exception that zero UUID
  84442. // is not supported (00000000-0000-0000-0000-000000000000).
  84443. func (c *RegionBackendServicesInsertCall) RequestId(requestId string) *RegionBackendServicesInsertCall {
  84444. c.urlParams_.Set("requestId", requestId)
  84445. return c
  84446. }
  84447. // Fields allows partial responses to be retrieved. See
  84448. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  84449. // for more information.
  84450. func (c *RegionBackendServicesInsertCall) Fields(s ...googleapi.Field) *RegionBackendServicesInsertCall {
  84451. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  84452. return c
  84453. }
  84454. // Context sets the context to be used in this call's Do method. Any
  84455. // pending HTTP request will be aborted if the provided context is
  84456. // canceled.
  84457. func (c *RegionBackendServicesInsertCall) Context(ctx context.Context) *RegionBackendServicesInsertCall {
  84458. c.ctx_ = ctx
  84459. return c
  84460. }
  84461. // Header returns an http.Header that can be modified by the caller to
  84462. // add HTTP headers to the request.
  84463. func (c *RegionBackendServicesInsertCall) Header() http.Header {
  84464. if c.header_ == nil {
  84465. c.header_ = make(http.Header)
  84466. }
  84467. return c.header_
  84468. }
  84469. func (c *RegionBackendServicesInsertCall) doRequest(alt string) (*http.Response, error) {
  84470. reqHeaders := make(http.Header)
  84471. for k, v := range c.header_ {
  84472. reqHeaders[k] = v
  84473. }
  84474. reqHeaders.Set("User-Agent", c.s.userAgent())
  84475. var body io.Reader = nil
  84476. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  84477. if err != nil {
  84478. return nil, err
  84479. }
  84480. reqHeaders.Set("Content-Type", "application/json")
  84481. c.urlParams_.Set("alt", alt)
  84482. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices")
  84483. urls += "?" + c.urlParams_.Encode()
  84484. req, _ := http.NewRequest("POST", urls, body)
  84485. req.Header = reqHeaders
  84486. googleapi.Expand(req.URL, map[string]string{
  84487. "project": c.project,
  84488. "region": c.region,
  84489. })
  84490. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  84491. }
  84492. // Do executes the "compute.regionBackendServices.insert" call.
  84493. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  84494. // status code is an error. Response headers are in either
  84495. // *Operation.ServerResponse.Header or (if a response was returned at
  84496. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  84497. // to check whether the returned error was because
  84498. // http.StatusNotModified was returned.
  84499. func (c *RegionBackendServicesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  84500. gensupport.SetOptions(c.urlParams_, opts...)
  84501. res, err := c.doRequest("json")
  84502. if res != nil && res.StatusCode == http.StatusNotModified {
  84503. if res.Body != nil {
  84504. res.Body.Close()
  84505. }
  84506. return nil, &googleapi.Error{
  84507. Code: res.StatusCode,
  84508. Header: res.Header,
  84509. }
  84510. }
  84511. if err != nil {
  84512. return nil, err
  84513. }
  84514. defer googleapi.CloseBody(res)
  84515. if err := googleapi.CheckResponse(res); err != nil {
  84516. return nil, err
  84517. }
  84518. ret := &Operation{
  84519. ServerResponse: googleapi.ServerResponse{
  84520. Header: res.Header,
  84521. HTTPStatusCode: res.StatusCode,
  84522. },
  84523. }
  84524. target := &ret
  84525. if err := gensupport.DecodeResponse(target, res); err != nil {
  84526. return nil, err
  84527. }
  84528. return ret, nil
  84529. // {
  84530. // "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.",
  84531. // "httpMethod": "POST",
  84532. // "id": "compute.regionBackendServices.insert",
  84533. // "parameterOrder": [
  84534. // "project",
  84535. // "region"
  84536. // ],
  84537. // "parameters": {
  84538. // "project": {
  84539. // "description": "Project ID for this request.",
  84540. // "location": "path",
  84541. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  84542. // "required": true,
  84543. // "type": "string"
  84544. // },
  84545. // "region": {
  84546. // "description": "Name of the region scoping this request.",
  84547. // "location": "path",
  84548. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  84549. // "required": true,
  84550. // "type": "string"
  84551. // },
  84552. // "requestId": {
  84553. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  84554. // "location": "query",
  84555. // "type": "string"
  84556. // }
  84557. // },
  84558. // "path": "{project}/regions/{region}/backendServices",
  84559. // "request": {
  84560. // "$ref": "BackendService"
  84561. // },
  84562. // "response": {
  84563. // "$ref": "Operation"
  84564. // },
  84565. // "scopes": [
  84566. // "https://www.googleapis.com/auth/cloud-platform",
  84567. // "https://www.googleapis.com/auth/compute"
  84568. // ]
  84569. // }
  84570. }
  84571. // method id "compute.regionBackendServices.list":
  84572. type RegionBackendServicesListCall struct {
  84573. s *Service
  84574. project string
  84575. region string
  84576. urlParams_ gensupport.URLParams
  84577. ifNoneMatch_ string
  84578. ctx_ context.Context
  84579. header_ http.Header
  84580. }
  84581. // List: Retrieves the list of regional BackendService resources
  84582. // available to the specified project in the given region.
  84583. func (r *RegionBackendServicesService) List(project string, region string) *RegionBackendServicesListCall {
  84584. c := &RegionBackendServicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  84585. c.project = project
  84586. c.region = region
  84587. return c
  84588. }
  84589. // Filter sets the optional parameter "filter": A filter expression that
  84590. // filters resources listed in the response. The expression must specify
  84591. // the field name, a comparison operator, and the value that you want to
  84592. // use for filtering. The value must be a string, a number, or a
  84593. // boolean. The comparison operator must be either =, !=, >, or <.
  84594. //
  84595. // For example, if you are filtering Compute Engine instances, you can
  84596. // exclude instances named example-instance by specifying name !=
  84597. // example-instance.
  84598. //
  84599. // You can also filter nested fields. For example, you could specify
  84600. // scheduling.automaticRestart = false to include instances only if they
  84601. // are not scheduled for automatic restarts. You can use filtering on
  84602. // nested fields to filter based on resource labels.
  84603. //
  84604. // To filter on multiple expressions, provide each separate expression
  84605. // within parentheses. For example, (scheduling.automaticRestart = true)
  84606. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  84607. // AND expression. However, you can include AND and OR expressions
  84608. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  84609. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  84610. // true).
  84611. func (c *RegionBackendServicesListCall) Filter(filter string) *RegionBackendServicesListCall {
  84612. c.urlParams_.Set("filter", filter)
  84613. return c
  84614. }
  84615. // MaxResults sets the optional parameter "maxResults": The maximum
  84616. // number of results per page that should be returned. If the number of
  84617. // available results is larger than maxResults, Compute Engine returns a
  84618. // nextPageToken that can be used to get the next page of results in
  84619. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  84620. // (Default: 500)
  84621. func (c *RegionBackendServicesListCall) MaxResults(maxResults int64) *RegionBackendServicesListCall {
  84622. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  84623. return c
  84624. }
  84625. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  84626. // a certain order. By default, results are returned in alphanumerical
  84627. // order based on the resource name.
  84628. //
  84629. // You can also sort results in descending order based on the creation
  84630. // timestamp using orderBy="creationTimestamp desc". This sorts results
  84631. // based on the creationTimestamp field in reverse chronological order
  84632. // (newest result first). Use this to sort resources like operations so
  84633. // that the newest operation is returned first.
  84634. //
  84635. // Currently, only sorting by name or creationTimestamp desc is
  84636. // supported.
  84637. func (c *RegionBackendServicesListCall) OrderBy(orderBy string) *RegionBackendServicesListCall {
  84638. c.urlParams_.Set("orderBy", orderBy)
  84639. return c
  84640. }
  84641. // PageToken sets the optional parameter "pageToken": Specifies a page
  84642. // token to use. Set pageToken to the nextPageToken returned by a
  84643. // previous list request to get the next page of results.
  84644. func (c *RegionBackendServicesListCall) PageToken(pageToken string) *RegionBackendServicesListCall {
  84645. c.urlParams_.Set("pageToken", pageToken)
  84646. return c
  84647. }
  84648. // Fields allows partial responses to be retrieved. See
  84649. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  84650. // for more information.
  84651. func (c *RegionBackendServicesListCall) Fields(s ...googleapi.Field) *RegionBackendServicesListCall {
  84652. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  84653. return c
  84654. }
  84655. // IfNoneMatch sets the optional parameter which makes the operation
  84656. // fail if the object's ETag matches the given value. This is useful for
  84657. // getting updates only after the object has changed since the last
  84658. // request. Use googleapi.IsNotModified to check whether the response
  84659. // error from Do is the result of In-None-Match.
  84660. func (c *RegionBackendServicesListCall) IfNoneMatch(entityTag string) *RegionBackendServicesListCall {
  84661. c.ifNoneMatch_ = entityTag
  84662. return c
  84663. }
  84664. // Context sets the context to be used in this call's Do method. Any
  84665. // pending HTTP request will be aborted if the provided context is
  84666. // canceled.
  84667. func (c *RegionBackendServicesListCall) Context(ctx context.Context) *RegionBackendServicesListCall {
  84668. c.ctx_ = ctx
  84669. return c
  84670. }
  84671. // Header returns an http.Header that can be modified by the caller to
  84672. // add HTTP headers to the request.
  84673. func (c *RegionBackendServicesListCall) Header() http.Header {
  84674. if c.header_ == nil {
  84675. c.header_ = make(http.Header)
  84676. }
  84677. return c.header_
  84678. }
  84679. func (c *RegionBackendServicesListCall) doRequest(alt string) (*http.Response, error) {
  84680. reqHeaders := make(http.Header)
  84681. for k, v := range c.header_ {
  84682. reqHeaders[k] = v
  84683. }
  84684. reqHeaders.Set("User-Agent", c.s.userAgent())
  84685. if c.ifNoneMatch_ != "" {
  84686. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  84687. }
  84688. var body io.Reader = nil
  84689. c.urlParams_.Set("alt", alt)
  84690. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices")
  84691. urls += "?" + c.urlParams_.Encode()
  84692. req, _ := http.NewRequest("GET", urls, body)
  84693. req.Header = reqHeaders
  84694. googleapi.Expand(req.URL, map[string]string{
  84695. "project": c.project,
  84696. "region": c.region,
  84697. })
  84698. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  84699. }
  84700. // Do executes the "compute.regionBackendServices.list" call.
  84701. // Exactly one of *BackendServiceList or error will be non-nil. Any
  84702. // non-2xx status code is an error. Response headers are in either
  84703. // *BackendServiceList.ServerResponse.Header or (if a response was
  84704. // returned at all) in error.(*googleapi.Error).Header. Use
  84705. // googleapi.IsNotModified to check whether the returned error was
  84706. // because http.StatusNotModified was returned.
  84707. func (c *RegionBackendServicesListCall) Do(opts ...googleapi.CallOption) (*BackendServiceList, error) {
  84708. gensupport.SetOptions(c.urlParams_, opts...)
  84709. res, err := c.doRequest("json")
  84710. if res != nil && res.StatusCode == http.StatusNotModified {
  84711. if res.Body != nil {
  84712. res.Body.Close()
  84713. }
  84714. return nil, &googleapi.Error{
  84715. Code: res.StatusCode,
  84716. Header: res.Header,
  84717. }
  84718. }
  84719. if err != nil {
  84720. return nil, err
  84721. }
  84722. defer googleapi.CloseBody(res)
  84723. if err := googleapi.CheckResponse(res); err != nil {
  84724. return nil, err
  84725. }
  84726. ret := &BackendServiceList{
  84727. ServerResponse: googleapi.ServerResponse{
  84728. Header: res.Header,
  84729. HTTPStatusCode: res.StatusCode,
  84730. },
  84731. }
  84732. target := &ret
  84733. if err := gensupport.DecodeResponse(target, res); err != nil {
  84734. return nil, err
  84735. }
  84736. return ret, nil
  84737. // {
  84738. // "description": "Retrieves the list of regional BackendService resources available to the specified project in the given region.",
  84739. // "httpMethod": "GET",
  84740. // "id": "compute.regionBackendServices.list",
  84741. // "parameterOrder": [
  84742. // "project",
  84743. // "region"
  84744. // ],
  84745. // "parameters": {
  84746. // "filter": {
  84747. // "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).",
  84748. // "location": "query",
  84749. // "type": "string"
  84750. // },
  84751. // "maxResults": {
  84752. // "default": "500",
  84753. // "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)",
  84754. // "format": "uint32",
  84755. // "location": "query",
  84756. // "minimum": "0",
  84757. // "type": "integer"
  84758. // },
  84759. // "orderBy": {
  84760. // "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.",
  84761. // "location": "query",
  84762. // "type": "string"
  84763. // },
  84764. // "pageToken": {
  84765. // "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.",
  84766. // "location": "query",
  84767. // "type": "string"
  84768. // },
  84769. // "project": {
  84770. // "description": "Project ID for this request.",
  84771. // "location": "path",
  84772. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  84773. // "required": true,
  84774. // "type": "string"
  84775. // },
  84776. // "region": {
  84777. // "description": "Name of the region scoping this request.",
  84778. // "location": "path",
  84779. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  84780. // "required": true,
  84781. // "type": "string"
  84782. // }
  84783. // },
  84784. // "path": "{project}/regions/{region}/backendServices",
  84785. // "response": {
  84786. // "$ref": "BackendServiceList"
  84787. // },
  84788. // "scopes": [
  84789. // "https://www.googleapis.com/auth/cloud-platform",
  84790. // "https://www.googleapis.com/auth/compute",
  84791. // "https://www.googleapis.com/auth/compute.readonly"
  84792. // ]
  84793. // }
  84794. }
  84795. // Pages invokes f for each page of results.
  84796. // A non-nil error returned from f will halt the iteration.
  84797. // The provided context supersedes any context provided to the Context method.
  84798. func (c *RegionBackendServicesListCall) Pages(ctx context.Context, f func(*BackendServiceList) error) error {
  84799. c.ctx_ = ctx
  84800. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  84801. for {
  84802. x, err := c.Do()
  84803. if err != nil {
  84804. return err
  84805. }
  84806. if err := f(x); err != nil {
  84807. return err
  84808. }
  84809. if x.NextPageToken == "" {
  84810. return nil
  84811. }
  84812. c.PageToken(x.NextPageToken)
  84813. }
  84814. }
  84815. // method id "compute.regionBackendServices.patch":
  84816. type RegionBackendServicesPatchCall struct {
  84817. s *Service
  84818. project string
  84819. region string
  84820. backendService string
  84821. backendservice *BackendService
  84822. urlParams_ gensupport.URLParams
  84823. ctx_ context.Context
  84824. header_ http.Header
  84825. }
  84826. // Patch: Updates the specified regional BackendService resource with
  84827. // the data included in the request. There are several restrictions and
  84828. // guidelines to keep in mind when updating a backend service. Read
  84829. // Restrictions and Guidelines for more information. This method
  84830. // supports PATCH semantics and uses the JSON merge patch format and
  84831. // processing rules.
  84832. func (r *RegionBackendServicesService) Patch(project string, region string, backendService string, backendservice *BackendService) *RegionBackendServicesPatchCall {
  84833. c := &RegionBackendServicesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  84834. c.project = project
  84835. c.region = region
  84836. c.backendService = backendService
  84837. c.backendservice = backendservice
  84838. return c
  84839. }
  84840. // RequestId sets the optional parameter "requestId": An optional
  84841. // request ID to identify requests. Specify a unique request ID so that
  84842. // if you must retry your request, the server will know to ignore the
  84843. // request if it has already been completed.
  84844. //
  84845. // For example, consider a situation where you make an initial request
  84846. // and the request times out. If you make the request again with the
  84847. // same request ID, the server can check if original operation with the
  84848. // same request ID was received, and if so, will ignore the second
  84849. // request. This prevents clients from accidentally creating duplicate
  84850. // commitments.
  84851. //
  84852. // The request ID must be a valid UUID with the exception that zero UUID
  84853. // is not supported (00000000-0000-0000-0000-000000000000).
  84854. func (c *RegionBackendServicesPatchCall) RequestId(requestId string) *RegionBackendServicesPatchCall {
  84855. c.urlParams_.Set("requestId", requestId)
  84856. return c
  84857. }
  84858. // Fields allows partial responses to be retrieved. See
  84859. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  84860. // for more information.
  84861. func (c *RegionBackendServicesPatchCall) Fields(s ...googleapi.Field) *RegionBackendServicesPatchCall {
  84862. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  84863. return c
  84864. }
  84865. // Context sets the context to be used in this call's Do method. Any
  84866. // pending HTTP request will be aborted if the provided context is
  84867. // canceled.
  84868. func (c *RegionBackendServicesPatchCall) Context(ctx context.Context) *RegionBackendServicesPatchCall {
  84869. c.ctx_ = ctx
  84870. return c
  84871. }
  84872. // Header returns an http.Header that can be modified by the caller to
  84873. // add HTTP headers to the request.
  84874. func (c *RegionBackendServicesPatchCall) Header() http.Header {
  84875. if c.header_ == nil {
  84876. c.header_ = make(http.Header)
  84877. }
  84878. return c.header_
  84879. }
  84880. func (c *RegionBackendServicesPatchCall) doRequest(alt string) (*http.Response, error) {
  84881. reqHeaders := make(http.Header)
  84882. for k, v := range c.header_ {
  84883. reqHeaders[k] = v
  84884. }
  84885. reqHeaders.Set("User-Agent", c.s.userAgent())
  84886. var body io.Reader = nil
  84887. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  84888. if err != nil {
  84889. return nil, err
  84890. }
  84891. reqHeaders.Set("Content-Type", "application/json")
  84892. c.urlParams_.Set("alt", alt)
  84893. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices/{backendService}")
  84894. urls += "?" + c.urlParams_.Encode()
  84895. req, _ := http.NewRequest("PATCH", urls, body)
  84896. req.Header = reqHeaders
  84897. googleapi.Expand(req.URL, map[string]string{
  84898. "project": c.project,
  84899. "region": c.region,
  84900. "backendService": c.backendService,
  84901. })
  84902. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  84903. }
  84904. // Do executes the "compute.regionBackendServices.patch" call.
  84905. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  84906. // status code is an error. Response headers are in either
  84907. // *Operation.ServerResponse.Header or (if a response was returned at
  84908. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  84909. // to check whether the returned error was because
  84910. // http.StatusNotModified was returned.
  84911. func (c *RegionBackendServicesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  84912. gensupport.SetOptions(c.urlParams_, opts...)
  84913. res, err := c.doRequest("json")
  84914. if res != nil && res.StatusCode == http.StatusNotModified {
  84915. if res.Body != nil {
  84916. res.Body.Close()
  84917. }
  84918. return nil, &googleapi.Error{
  84919. Code: res.StatusCode,
  84920. Header: res.Header,
  84921. }
  84922. }
  84923. if err != nil {
  84924. return nil, err
  84925. }
  84926. defer googleapi.CloseBody(res)
  84927. if err := googleapi.CheckResponse(res); err != nil {
  84928. return nil, err
  84929. }
  84930. ret := &Operation{
  84931. ServerResponse: googleapi.ServerResponse{
  84932. Header: res.Header,
  84933. HTTPStatusCode: res.StatusCode,
  84934. },
  84935. }
  84936. target := &ret
  84937. if err := gensupport.DecodeResponse(target, res); err != nil {
  84938. return nil, err
  84939. }
  84940. return ret, nil
  84941. // {
  84942. // "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.",
  84943. // "httpMethod": "PATCH",
  84944. // "id": "compute.regionBackendServices.patch",
  84945. // "parameterOrder": [
  84946. // "project",
  84947. // "region",
  84948. // "backendService"
  84949. // ],
  84950. // "parameters": {
  84951. // "backendService": {
  84952. // "description": "Name of the BackendService resource to patch.",
  84953. // "location": "path",
  84954. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  84955. // "required": true,
  84956. // "type": "string"
  84957. // },
  84958. // "project": {
  84959. // "description": "Project ID for this request.",
  84960. // "location": "path",
  84961. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  84962. // "required": true,
  84963. // "type": "string"
  84964. // },
  84965. // "region": {
  84966. // "description": "Name of the region scoping this request.",
  84967. // "location": "path",
  84968. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  84969. // "required": true,
  84970. // "type": "string"
  84971. // },
  84972. // "requestId": {
  84973. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  84974. // "location": "query",
  84975. // "type": "string"
  84976. // }
  84977. // },
  84978. // "path": "{project}/regions/{region}/backendServices/{backendService}",
  84979. // "request": {
  84980. // "$ref": "BackendService"
  84981. // },
  84982. // "response": {
  84983. // "$ref": "Operation"
  84984. // },
  84985. // "scopes": [
  84986. // "https://www.googleapis.com/auth/cloud-platform",
  84987. // "https://www.googleapis.com/auth/compute"
  84988. // ]
  84989. // }
  84990. }
  84991. // method id "compute.regionBackendServices.testIamPermissions":
  84992. type RegionBackendServicesTestIamPermissionsCall struct {
  84993. s *Service
  84994. project string
  84995. region string
  84996. resource string
  84997. testpermissionsrequest *TestPermissionsRequest
  84998. urlParams_ gensupport.URLParams
  84999. ctx_ context.Context
  85000. header_ http.Header
  85001. }
  85002. // TestIamPermissions: Returns permissions that a caller has on the
  85003. // specified resource.
  85004. func (r *RegionBackendServicesService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionBackendServicesTestIamPermissionsCall {
  85005. c := &RegionBackendServicesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  85006. c.project = project
  85007. c.region = region
  85008. c.resource = resource
  85009. c.testpermissionsrequest = testpermissionsrequest
  85010. return c
  85011. }
  85012. // Fields allows partial responses to be retrieved. See
  85013. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  85014. // for more information.
  85015. func (c *RegionBackendServicesTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionBackendServicesTestIamPermissionsCall {
  85016. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  85017. return c
  85018. }
  85019. // Context sets the context to be used in this call's Do method. Any
  85020. // pending HTTP request will be aborted if the provided context is
  85021. // canceled.
  85022. func (c *RegionBackendServicesTestIamPermissionsCall) Context(ctx context.Context) *RegionBackendServicesTestIamPermissionsCall {
  85023. c.ctx_ = ctx
  85024. return c
  85025. }
  85026. // Header returns an http.Header that can be modified by the caller to
  85027. // add HTTP headers to the request.
  85028. func (c *RegionBackendServicesTestIamPermissionsCall) Header() http.Header {
  85029. if c.header_ == nil {
  85030. c.header_ = make(http.Header)
  85031. }
  85032. return c.header_
  85033. }
  85034. func (c *RegionBackendServicesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  85035. reqHeaders := make(http.Header)
  85036. for k, v := range c.header_ {
  85037. reqHeaders[k] = v
  85038. }
  85039. reqHeaders.Set("User-Agent", c.s.userAgent())
  85040. var body io.Reader = nil
  85041. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  85042. if err != nil {
  85043. return nil, err
  85044. }
  85045. reqHeaders.Set("Content-Type", "application/json")
  85046. c.urlParams_.Set("alt", alt)
  85047. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices/{resource}/testIamPermissions")
  85048. urls += "?" + c.urlParams_.Encode()
  85049. req, _ := http.NewRequest("POST", urls, body)
  85050. req.Header = reqHeaders
  85051. googleapi.Expand(req.URL, map[string]string{
  85052. "project": c.project,
  85053. "region": c.region,
  85054. "resource": c.resource,
  85055. })
  85056. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  85057. }
  85058. // Do executes the "compute.regionBackendServices.testIamPermissions" call.
  85059. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  85060. // non-2xx status code is an error. Response headers are in either
  85061. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  85062. // returned at all) in error.(*googleapi.Error).Header. Use
  85063. // googleapi.IsNotModified to check whether the returned error was
  85064. // because http.StatusNotModified was returned.
  85065. func (c *RegionBackendServicesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  85066. gensupport.SetOptions(c.urlParams_, opts...)
  85067. res, err := c.doRequest("json")
  85068. if res != nil && res.StatusCode == http.StatusNotModified {
  85069. if res.Body != nil {
  85070. res.Body.Close()
  85071. }
  85072. return nil, &googleapi.Error{
  85073. Code: res.StatusCode,
  85074. Header: res.Header,
  85075. }
  85076. }
  85077. if err != nil {
  85078. return nil, err
  85079. }
  85080. defer googleapi.CloseBody(res)
  85081. if err := googleapi.CheckResponse(res); err != nil {
  85082. return nil, err
  85083. }
  85084. ret := &TestPermissionsResponse{
  85085. ServerResponse: googleapi.ServerResponse{
  85086. Header: res.Header,
  85087. HTTPStatusCode: res.StatusCode,
  85088. },
  85089. }
  85090. target := &ret
  85091. if err := gensupport.DecodeResponse(target, res); err != nil {
  85092. return nil, err
  85093. }
  85094. return ret, nil
  85095. // {
  85096. // "description": "Returns permissions that a caller has on the specified resource.",
  85097. // "httpMethod": "POST",
  85098. // "id": "compute.regionBackendServices.testIamPermissions",
  85099. // "parameterOrder": [
  85100. // "project",
  85101. // "region",
  85102. // "resource"
  85103. // ],
  85104. // "parameters": {
  85105. // "project": {
  85106. // "description": "Project ID for this request.",
  85107. // "location": "path",
  85108. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  85109. // "required": true,
  85110. // "type": "string"
  85111. // },
  85112. // "region": {
  85113. // "description": "The name of the region for this request.",
  85114. // "location": "path",
  85115. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  85116. // "required": true,
  85117. // "type": "string"
  85118. // },
  85119. // "resource": {
  85120. // "description": "Name of the resource for this request.",
  85121. // "location": "path",
  85122. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  85123. // "required": true,
  85124. // "type": "string"
  85125. // }
  85126. // },
  85127. // "path": "{project}/regions/{region}/backendServices/{resource}/testIamPermissions",
  85128. // "request": {
  85129. // "$ref": "TestPermissionsRequest"
  85130. // },
  85131. // "response": {
  85132. // "$ref": "TestPermissionsResponse"
  85133. // },
  85134. // "scopes": [
  85135. // "https://www.googleapis.com/auth/cloud-platform",
  85136. // "https://www.googleapis.com/auth/compute",
  85137. // "https://www.googleapis.com/auth/compute.readonly"
  85138. // ]
  85139. // }
  85140. }
  85141. // method id "compute.regionBackendServices.update":
  85142. type RegionBackendServicesUpdateCall struct {
  85143. s *Service
  85144. project string
  85145. region string
  85146. backendService string
  85147. backendservice *BackendService
  85148. urlParams_ gensupport.URLParams
  85149. ctx_ context.Context
  85150. header_ http.Header
  85151. }
  85152. // Update: Updates the specified regional BackendService resource with
  85153. // the data included in the request. There are several restrictions and
  85154. // guidelines to keep in mind when updating a backend service. Read
  85155. // Restrictions and Guidelines for more information.
  85156. func (r *RegionBackendServicesService) Update(project string, region string, backendService string, backendservice *BackendService) *RegionBackendServicesUpdateCall {
  85157. c := &RegionBackendServicesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  85158. c.project = project
  85159. c.region = region
  85160. c.backendService = backendService
  85161. c.backendservice = backendservice
  85162. return c
  85163. }
  85164. // RequestId sets the optional parameter "requestId": An optional
  85165. // request ID to identify requests. Specify a unique request ID so that
  85166. // if you must retry your request, the server will know to ignore the
  85167. // request if it has already been completed.
  85168. //
  85169. // For example, consider a situation where you make an initial request
  85170. // and the request times out. If you make the request again with the
  85171. // same request ID, the server can check if original operation with the
  85172. // same request ID was received, and if so, will ignore the second
  85173. // request. This prevents clients from accidentally creating duplicate
  85174. // commitments.
  85175. //
  85176. // The request ID must be a valid UUID with the exception that zero UUID
  85177. // is not supported (00000000-0000-0000-0000-000000000000).
  85178. func (c *RegionBackendServicesUpdateCall) RequestId(requestId string) *RegionBackendServicesUpdateCall {
  85179. c.urlParams_.Set("requestId", requestId)
  85180. return c
  85181. }
  85182. // Fields allows partial responses to be retrieved. See
  85183. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  85184. // for more information.
  85185. func (c *RegionBackendServicesUpdateCall) Fields(s ...googleapi.Field) *RegionBackendServicesUpdateCall {
  85186. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  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 *RegionBackendServicesUpdateCall) Context(ctx context.Context) *RegionBackendServicesUpdateCall {
  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 *RegionBackendServicesUpdateCall) Header() http.Header {
  85199. if c.header_ == nil {
  85200. c.header_ = make(http.Header)
  85201. }
  85202. return c.header_
  85203. }
  85204. func (c *RegionBackendServicesUpdateCall) 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. var body io.Reader = nil
  85211. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  85212. if err != nil {
  85213. return nil, err
  85214. }
  85215. reqHeaders.Set("Content-Type", "application/json")
  85216. c.urlParams_.Set("alt", alt)
  85217. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices/{backendService}")
  85218. urls += "?" + c.urlParams_.Encode()
  85219. req, _ := http.NewRequest("PUT", urls, body)
  85220. req.Header = reqHeaders
  85221. googleapi.Expand(req.URL, map[string]string{
  85222. "project": c.project,
  85223. "region": c.region,
  85224. "backendService": c.backendService,
  85225. })
  85226. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  85227. }
  85228. // Do executes the "compute.regionBackendServices.update" call.
  85229. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  85230. // status code is an error. Response headers are in either
  85231. // *Operation.ServerResponse.Header or (if a response was returned at
  85232. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  85233. // to check whether the returned error was because
  85234. // http.StatusNotModified was returned.
  85235. func (c *RegionBackendServicesUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, 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 := &Operation{
  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": "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.",
  85267. // "httpMethod": "PUT",
  85268. // "id": "compute.regionBackendServices.update",
  85269. // "parameterOrder": [
  85270. // "project",
  85271. // "region",
  85272. // "backendService"
  85273. // ],
  85274. // "parameters": {
  85275. // "backendService": {
  85276. // "description": "Name of the BackendService resource to update.",
  85277. // "location": "path",
  85278. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  85279. // "required": true,
  85280. // "type": "string"
  85281. // },
  85282. // "project": {
  85283. // "description": "Project ID for this request.",
  85284. // "location": "path",
  85285. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  85286. // "required": true,
  85287. // "type": "string"
  85288. // },
  85289. // "region": {
  85290. // "description": "Name of the region scoping this request.",
  85291. // "location": "path",
  85292. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  85293. // "required": true,
  85294. // "type": "string"
  85295. // },
  85296. // "requestId": {
  85297. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  85298. // "location": "query",
  85299. // "type": "string"
  85300. // }
  85301. // },
  85302. // "path": "{project}/regions/{region}/backendServices/{backendService}",
  85303. // "request": {
  85304. // "$ref": "BackendService"
  85305. // },
  85306. // "response": {
  85307. // "$ref": "Operation"
  85308. // },
  85309. // "scopes": [
  85310. // "https://www.googleapis.com/auth/cloud-platform",
  85311. // "https://www.googleapis.com/auth/compute"
  85312. // ]
  85313. // }
  85314. }
  85315. // method id "compute.regionCommitments.aggregatedList":
  85316. type RegionCommitmentsAggregatedListCall struct {
  85317. s *Service
  85318. project string
  85319. urlParams_ gensupport.URLParams
  85320. ifNoneMatch_ string
  85321. ctx_ context.Context
  85322. header_ http.Header
  85323. }
  85324. // AggregatedList: Retrieves an aggregated list of commitments.
  85325. func (r *RegionCommitmentsService) AggregatedList(project string) *RegionCommitmentsAggregatedListCall {
  85326. c := &RegionCommitmentsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  85327. c.project = project
  85328. return c
  85329. }
  85330. // Filter sets the optional parameter "filter": A filter expression that
  85331. // filters resources listed in the response. The expression must specify
  85332. // the field name, a comparison operator, and the value that you want to
  85333. // use for filtering. The value must be a string, a number, or a
  85334. // boolean. The comparison operator must be either =, !=, >, or <.
  85335. //
  85336. // For example, if you are filtering Compute Engine instances, you can
  85337. // exclude instances named example-instance by specifying name !=
  85338. // example-instance.
  85339. //
  85340. // You can also filter nested fields. For example, you could specify
  85341. // scheduling.automaticRestart = false to include instances only if they
  85342. // are not scheduled for automatic restarts. You can use filtering on
  85343. // nested fields to filter based on resource labels.
  85344. //
  85345. // To filter on multiple expressions, provide each separate expression
  85346. // within parentheses. For example, (scheduling.automaticRestart = true)
  85347. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  85348. // AND expression. However, you can include AND and OR expressions
  85349. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  85350. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  85351. // true).
  85352. func (c *RegionCommitmentsAggregatedListCall) Filter(filter string) *RegionCommitmentsAggregatedListCall {
  85353. c.urlParams_.Set("filter", filter)
  85354. return c
  85355. }
  85356. // MaxResults sets the optional parameter "maxResults": The maximum
  85357. // number of results per page that should be returned. If the number of
  85358. // available results is larger than maxResults, Compute Engine returns a
  85359. // nextPageToken that can be used to get the next page of results in
  85360. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  85361. // (Default: 500)
  85362. func (c *RegionCommitmentsAggregatedListCall) MaxResults(maxResults int64) *RegionCommitmentsAggregatedListCall {
  85363. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  85364. return c
  85365. }
  85366. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  85367. // a certain order. By default, results are returned in alphanumerical
  85368. // order based on the resource name.
  85369. //
  85370. // You can also sort results in descending order based on the creation
  85371. // timestamp using orderBy="creationTimestamp desc". This sorts results
  85372. // based on the creationTimestamp field in reverse chronological order
  85373. // (newest result first). Use this to sort resources like operations so
  85374. // that the newest operation is returned first.
  85375. //
  85376. // Currently, only sorting by name or creationTimestamp desc is
  85377. // supported.
  85378. func (c *RegionCommitmentsAggregatedListCall) OrderBy(orderBy string) *RegionCommitmentsAggregatedListCall {
  85379. c.urlParams_.Set("orderBy", orderBy)
  85380. return c
  85381. }
  85382. // PageToken sets the optional parameter "pageToken": Specifies a page
  85383. // token to use. Set pageToken to the nextPageToken returned by a
  85384. // previous list request to get the next page of results.
  85385. func (c *RegionCommitmentsAggregatedListCall) PageToken(pageToken string) *RegionCommitmentsAggregatedListCall {
  85386. c.urlParams_.Set("pageToken", pageToken)
  85387. return c
  85388. }
  85389. // Fields allows partial responses to be retrieved. See
  85390. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  85391. // for more information.
  85392. func (c *RegionCommitmentsAggregatedListCall) Fields(s ...googleapi.Field) *RegionCommitmentsAggregatedListCall {
  85393. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  85394. return c
  85395. }
  85396. // IfNoneMatch sets the optional parameter which makes the operation
  85397. // fail if the object's ETag matches the given value. This is useful for
  85398. // getting updates only after the object has changed since the last
  85399. // request. Use googleapi.IsNotModified to check whether the response
  85400. // error from Do is the result of In-None-Match.
  85401. func (c *RegionCommitmentsAggregatedListCall) IfNoneMatch(entityTag string) *RegionCommitmentsAggregatedListCall {
  85402. c.ifNoneMatch_ = entityTag
  85403. return c
  85404. }
  85405. // Context sets the context to be used in this call's Do method. Any
  85406. // pending HTTP request will be aborted if the provided context is
  85407. // canceled.
  85408. func (c *RegionCommitmentsAggregatedListCall) Context(ctx context.Context) *RegionCommitmentsAggregatedListCall {
  85409. c.ctx_ = ctx
  85410. return c
  85411. }
  85412. // Header returns an http.Header that can be modified by the caller to
  85413. // add HTTP headers to the request.
  85414. func (c *RegionCommitmentsAggregatedListCall) Header() http.Header {
  85415. if c.header_ == nil {
  85416. c.header_ = make(http.Header)
  85417. }
  85418. return c.header_
  85419. }
  85420. func (c *RegionCommitmentsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  85421. reqHeaders := make(http.Header)
  85422. for k, v := range c.header_ {
  85423. reqHeaders[k] = v
  85424. }
  85425. reqHeaders.Set("User-Agent", c.s.userAgent())
  85426. if c.ifNoneMatch_ != "" {
  85427. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  85428. }
  85429. var body io.Reader = nil
  85430. c.urlParams_.Set("alt", alt)
  85431. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/commitments")
  85432. urls += "?" + c.urlParams_.Encode()
  85433. req, _ := http.NewRequest("GET", urls, body)
  85434. req.Header = reqHeaders
  85435. googleapi.Expand(req.URL, map[string]string{
  85436. "project": c.project,
  85437. })
  85438. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  85439. }
  85440. // Do executes the "compute.regionCommitments.aggregatedList" call.
  85441. // Exactly one of *CommitmentAggregatedList or error will be non-nil.
  85442. // Any non-2xx status code is an error. Response headers are in either
  85443. // *CommitmentAggregatedList.ServerResponse.Header or (if a response was
  85444. // returned at all) in error.(*googleapi.Error).Header. Use
  85445. // googleapi.IsNotModified to check whether the returned error was
  85446. // because http.StatusNotModified was returned.
  85447. func (c *RegionCommitmentsAggregatedListCall) Do(opts ...googleapi.CallOption) (*CommitmentAggregatedList, error) {
  85448. gensupport.SetOptions(c.urlParams_, opts...)
  85449. res, err := c.doRequest("json")
  85450. if res != nil && res.StatusCode == http.StatusNotModified {
  85451. if res.Body != nil {
  85452. res.Body.Close()
  85453. }
  85454. return nil, &googleapi.Error{
  85455. Code: res.StatusCode,
  85456. Header: res.Header,
  85457. }
  85458. }
  85459. if err != nil {
  85460. return nil, err
  85461. }
  85462. defer googleapi.CloseBody(res)
  85463. if err := googleapi.CheckResponse(res); err != nil {
  85464. return nil, err
  85465. }
  85466. ret := &CommitmentAggregatedList{
  85467. ServerResponse: googleapi.ServerResponse{
  85468. Header: res.Header,
  85469. HTTPStatusCode: res.StatusCode,
  85470. },
  85471. }
  85472. target := &ret
  85473. if err := gensupport.DecodeResponse(target, res); err != nil {
  85474. return nil, err
  85475. }
  85476. return ret, nil
  85477. // {
  85478. // "description": "Retrieves an aggregated list of commitments.",
  85479. // "httpMethod": "GET",
  85480. // "id": "compute.regionCommitments.aggregatedList",
  85481. // "parameterOrder": [
  85482. // "project"
  85483. // ],
  85484. // "parameters": {
  85485. // "filter": {
  85486. // "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).",
  85487. // "location": "query",
  85488. // "type": "string"
  85489. // },
  85490. // "maxResults": {
  85491. // "default": "500",
  85492. // "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)",
  85493. // "format": "uint32",
  85494. // "location": "query",
  85495. // "minimum": "0",
  85496. // "type": "integer"
  85497. // },
  85498. // "orderBy": {
  85499. // "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.",
  85500. // "location": "query",
  85501. // "type": "string"
  85502. // },
  85503. // "pageToken": {
  85504. // "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.",
  85505. // "location": "query",
  85506. // "type": "string"
  85507. // },
  85508. // "project": {
  85509. // "description": "Project ID for this request.",
  85510. // "location": "path",
  85511. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  85512. // "required": true,
  85513. // "type": "string"
  85514. // }
  85515. // },
  85516. // "path": "{project}/aggregated/commitments",
  85517. // "response": {
  85518. // "$ref": "CommitmentAggregatedList"
  85519. // },
  85520. // "scopes": [
  85521. // "https://www.googleapis.com/auth/cloud-platform",
  85522. // "https://www.googleapis.com/auth/compute",
  85523. // "https://www.googleapis.com/auth/compute.readonly"
  85524. // ]
  85525. // }
  85526. }
  85527. // Pages invokes f for each page of results.
  85528. // A non-nil error returned from f will halt the iteration.
  85529. // The provided context supersedes any context provided to the Context method.
  85530. func (c *RegionCommitmentsAggregatedListCall) Pages(ctx context.Context, f func(*CommitmentAggregatedList) error) error {
  85531. c.ctx_ = ctx
  85532. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  85533. for {
  85534. x, err := c.Do()
  85535. if err != nil {
  85536. return err
  85537. }
  85538. if err := f(x); err != nil {
  85539. return err
  85540. }
  85541. if x.NextPageToken == "" {
  85542. return nil
  85543. }
  85544. c.PageToken(x.NextPageToken)
  85545. }
  85546. }
  85547. // method id "compute.regionCommitments.get":
  85548. type RegionCommitmentsGetCall struct {
  85549. s *Service
  85550. project string
  85551. region string
  85552. commitment string
  85553. urlParams_ gensupport.URLParams
  85554. ifNoneMatch_ string
  85555. ctx_ context.Context
  85556. header_ http.Header
  85557. }
  85558. // Get: Returns the specified commitment resource. Gets a list of
  85559. // available commitments by making a list() request.
  85560. func (r *RegionCommitmentsService) Get(project string, region string, commitment string) *RegionCommitmentsGetCall {
  85561. c := &RegionCommitmentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  85562. c.project = project
  85563. c.region = region
  85564. c.commitment = commitment
  85565. return c
  85566. }
  85567. // Fields allows partial responses to be retrieved. See
  85568. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  85569. // for more information.
  85570. func (c *RegionCommitmentsGetCall) Fields(s ...googleapi.Field) *RegionCommitmentsGetCall {
  85571. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  85572. return c
  85573. }
  85574. // IfNoneMatch sets the optional parameter which makes the operation
  85575. // fail if the object's ETag matches the given value. This is useful for
  85576. // getting updates only after the object has changed since the last
  85577. // request. Use googleapi.IsNotModified to check whether the response
  85578. // error from Do is the result of In-None-Match.
  85579. func (c *RegionCommitmentsGetCall) IfNoneMatch(entityTag string) *RegionCommitmentsGetCall {
  85580. c.ifNoneMatch_ = entityTag
  85581. return c
  85582. }
  85583. // Context sets the context to be used in this call's Do method. Any
  85584. // pending HTTP request will be aborted if the provided context is
  85585. // canceled.
  85586. func (c *RegionCommitmentsGetCall) Context(ctx context.Context) *RegionCommitmentsGetCall {
  85587. c.ctx_ = ctx
  85588. return c
  85589. }
  85590. // Header returns an http.Header that can be modified by the caller to
  85591. // add HTTP headers to the request.
  85592. func (c *RegionCommitmentsGetCall) Header() http.Header {
  85593. if c.header_ == nil {
  85594. c.header_ = make(http.Header)
  85595. }
  85596. return c.header_
  85597. }
  85598. func (c *RegionCommitmentsGetCall) doRequest(alt string) (*http.Response, error) {
  85599. reqHeaders := make(http.Header)
  85600. for k, v := range c.header_ {
  85601. reqHeaders[k] = v
  85602. }
  85603. reqHeaders.Set("User-Agent", c.s.userAgent())
  85604. if c.ifNoneMatch_ != "" {
  85605. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  85606. }
  85607. var body io.Reader = nil
  85608. c.urlParams_.Set("alt", alt)
  85609. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/commitments/{commitment}")
  85610. urls += "?" + c.urlParams_.Encode()
  85611. req, _ := http.NewRequest("GET", urls, body)
  85612. req.Header = reqHeaders
  85613. googleapi.Expand(req.URL, map[string]string{
  85614. "project": c.project,
  85615. "region": c.region,
  85616. "commitment": c.commitment,
  85617. })
  85618. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  85619. }
  85620. // Do executes the "compute.regionCommitments.get" call.
  85621. // Exactly one of *Commitment or error will be non-nil. Any non-2xx
  85622. // status code is an error. Response headers are in either
  85623. // *Commitment.ServerResponse.Header or (if a response was returned at
  85624. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  85625. // to check whether the returned error was because
  85626. // http.StatusNotModified was returned.
  85627. func (c *RegionCommitmentsGetCall) Do(opts ...googleapi.CallOption) (*Commitment, error) {
  85628. gensupport.SetOptions(c.urlParams_, opts...)
  85629. res, err := c.doRequest("json")
  85630. if res != nil && res.StatusCode == http.StatusNotModified {
  85631. if res.Body != nil {
  85632. res.Body.Close()
  85633. }
  85634. return nil, &googleapi.Error{
  85635. Code: res.StatusCode,
  85636. Header: res.Header,
  85637. }
  85638. }
  85639. if err != nil {
  85640. return nil, err
  85641. }
  85642. defer googleapi.CloseBody(res)
  85643. if err := googleapi.CheckResponse(res); err != nil {
  85644. return nil, err
  85645. }
  85646. ret := &Commitment{
  85647. ServerResponse: googleapi.ServerResponse{
  85648. Header: res.Header,
  85649. HTTPStatusCode: res.StatusCode,
  85650. },
  85651. }
  85652. target := &ret
  85653. if err := gensupport.DecodeResponse(target, res); err != nil {
  85654. return nil, err
  85655. }
  85656. return ret, nil
  85657. // {
  85658. // "description": "Returns the specified commitment resource. Gets a list of available commitments by making a list() request.",
  85659. // "httpMethod": "GET",
  85660. // "id": "compute.regionCommitments.get",
  85661. // "parameterOrder": [
  85662. // "project",
  85663. // "region",
  85664. // "commitment"
  85665. // ],
  85666. // "parameters": {
  85667. // "commitment": {
  85668. // "description": "Name of the commitment to return.",
  85669. // "location": "path",
  85670. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  85671. // "required": true,
  85672. // "type": "string"
  85673. // },
  85674. // "project": {
  85675. // "description": "Project ID for this request.",
  85676. // "location": "path",
  85677. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  85678. // "required": true,
  85679. // "type": "string"
  85680. // },
  85681. // "region": {
  85682. // "description": "Name of the region for this request.",
  85683. // "location": "path",
  85684. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  85685. // "required": true,
  85686. // "type": "string"
  85687. // }
  85688. // },
  85689. // "path": "{project}/regions/{region}/commitments/{commitment}",
  85690. // "response": {
  85691. // "$ref": "Commitment"
  85692. // },
  85693. // "scopes": [
  85694. // "https://www.googleapis.com/auth/cloud-platform",
  85695. // "https://www.googleapis.com/auth/compute",
  85696. // "https://www.googleapis.com/auth/compute.readonly"
  85697. // ]
  85698. // }
  85699. }
  85700. // method id "compute.regionCommitments.insert":
  85701. type RegionCommitmentsInsertCall struct {
  85702. s *Service
  85703. project string
  85704. region string
  85705. commitment *Commitment
  85706. urlParams_ gensupport.URLParams
  85707. ctx_ context.Context
  85708. header_ http.Header
  85709. }
  85710. // Insert: Creates a commitment in the specified project using the data
  85711. // included in the request.
  85712. func (r *RegionCommitmentsService) Insert(project string, region string, commitment *Commitment) *RegionCommitmentsInsertCall {
  85713. c := &RegionCommitmentsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  85714. c.project = project
  85715. c.region = region
  85716. c.commitment = commitment
  85717. return c
  85718. }
  85719. // RequestId sets the optional parameter "requestId": An optional
  85720. // request ID to identify requests. Specify a unique request ID so that
  85721. // if you must retry your request, the server will know to ignore the
  85722. // request if it has already been completed.
  85723. //
  85724. // For example, consider a situation where you make an initial request
  85725. // and the request times out. If you make the request again with the
  85726. // same request ID, the server can check if original operation with the
  85727. // same request ID was received, and if so, will ignore the second
  85728. // request. This prevents clients from accidentally creating duplicate
  85729. // commitments.
  85730. //
  85731. // The request ID must be a valid UUID with the exception that zero UUID
  85732. // is not supported (00000000-0000-0000-0000-000000000000).
  85733. func (c *RegionCommitmentsInsertCall) RequestId(requestId string) *RegionCommitmentsInsertCall {
  85734. c.urlParams_.Set("requestId", requestId)
  85735. return c
  85736. }
  85737. // Fields allows partial responses to be retrieved. See
  85738. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  85739. // for more information.
  85740. func (c *RegionCommitmentsInsertCall) Fields(s ...googleapi.Field) *RegionCommitmentsInsertCall {
  85741. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  85742. return c
  85743. }
  85744. // Context sets the context to be used in this call's Do method. Any
  85745. // pending HTTP request will be aborted if the provided context is
  85746. // canceled.
  85747. func (c *RegionCommitmentsInsertCall) Context(ctx context.Context) *RegionCommitmentsInsertCall {
  85748. c.ctx_ = ctx
  85749. return c
  85750. }
  85751. // Header returns an http.Header that can be modified by the caller to
  85752. // add HTTP headers to the request.
  85753. func (c *RegionCommitmentsInsertCall) Header() http.Header {
  85754. if c.header_ == nil {
  85755. c.header_ = make(http.Header)
  85756. }
  85757. return c.header_
  85758. }
  85759. func (c *RegionCommitmentsInsertCall) doRequest(alt string) (*http.Response, error) {
  85760. reqHeaders := make(http.Header)
  85761. for k, v := range c.header_ {
  85762. reqHeaders[k] = v
  85763. }
  85764. reqHeaders.Set("User-Agent", c.s.userAgent())
  85765. var body io.Reader = nil
  85766. body, err := googleapi.WithoutDataWrapper.JSONReader(c.commitment)
  85767. if err != nil {
  85768. return nil, err
  85769. }
  85770. reqHeaders.Set("Content-Type", "application/json")
  85771. c.urlParams_.Set("alt", alt)
  85772. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/commitments")
  85773. urls += "?" + c.urlParams_.Encode()
  85774. req, _ := http.NewRequest("POST", urls, body)
  85775. req.Header = reqHeaders
  85776. googleapi.Expand(req.URL, map[string]string{
  85777. "project": c.project,
  85778. "region": c.region,
  85779. })
  85780. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  85781. }
  85782. // Do executes the "compute.regionCommitments.insert" call.
  85783. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  85784. // status code is an error. Response headers are in either
  85785. // *Operation.ServerResponse.Header or (if a response was returned at
  85786. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  85787. // to check whether the returned error was because
  85788. // http.StatusNotModified was returned.
  85789. func (c *RegionCommitmentsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  85790. gensupport.SetOptions(c.urlParams_, opts...)
  85791. res, err := c.doRequest("json")
  85792. if res != nil && res.StatusCode == http.StatusNotModified {
  85793. if res.Body != nil {
  85794. res.Body.Close()
  85795. }
  85796. return nil, &googleapi.Error{
  85797. Code: res.StatusCode,
  85798. Header: res.Header,
  85799. }
  85800. }
  85801. if err != nil {
  85802. return nil, err
  85803. }
  85804. defer googleapi.CloseBody(res)
  85805. if err := googleapi.CheckResponse(res); err != nil {
  85806. return nil, err
  85807. }
  85808. ret := &Operation{
  85809. ServerResponse: googleapi.ServerResponse{
  85810. Header: res.Header,
  85811. HTTPStatusCode: res.StatusCode,
  85812. },
  85813. }
  85814. target := &ret
  85815. if err := gensupport.DecodeResponse(target, res); err != nil {
  85816. return nil, err
  85817. }
  85818. return ret, nil
  85819. // {
  85820. // "description": "Creates a commitment in the specified project using the data included in the request.",
  85821. // "httpMethod": "POST",
  85822. // "id": "compute.regionCommitments.insert",
  85823. // "parameterOrder": [
  85824. // "project",
  85825. // "region"
  85826. // ],
  85827. // "parameters": {
  85828. // "project": {
  85829. // "description": "Project ID for this request.",
  85830. // "location": "path",
  85831. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  85832. // "required": true,
  85833. // "type": "string"
  85834. // },
  85835. // "region": {
  85836. // "description": "Name of the region for this request.",
  85837. // "location": "path",
  85838. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  85839. // "required": true,
  85840. // "type": "string"
  85841. // },
  85842. // "requestId": {
  85843. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  85844. // "location": "query",
  85845. // "type": "string"
  85846. // }
  85847. // },
  85848. // "path": "{project}/regions/{region}/commitments",
  85849. // "request": {
  85850. // "$ref": "Commitment"
  85851. // },
  85852. // "response": {
  85853. // "$ref": "Operation"
  85854. // },
  85855. // "scopes": [
  85856. // "https://www.googleapis.com/auth/cloud-platform",
  85857. // "https://www.googleapis.com/auth/compute"
  85858. // ]
  85859. // }
  85860. }
  85861. // method id "compute.regionCommitments.list":
  85862. type RegionCommitmentsListCall struct {
  85863. s *Service
  85864. project string
  85865. region string
  85866. urlParams_ gensupport.URLParams
  85867. ifNoneMatch_ string
  85868. ctx_ context.Context
  85869. header_ http.Header
  85870. }
  85871. // List: Retrieves a list of commitments contained within the specified
  85872. // region.
  85873. func (r *RegionCommitmentsService) List(project string, region string) *RegionCommitmentsListCall {
  85874. c := &RegionCommitmentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  85875. c.project = project
  85876. c.region = region
  85877. return c
  85878. }
  85879. // Filter sets the optional parameter "filter": A filter expression that
  85880. // filters resources listed in the response. The expression must specify
  85881. // the field name, a comparison operator, and the value that you want to
  85882. // use for filtering. The value must be a string, a number, or a
  85883. // boolean. The comparison operator must be either =, !=, >, or <.
  85884. //
  85885. // For example, if you are filtering Compute Engine instances, you can
  85886. // exclude instances named example-instance by specifying name !=
  85887. // example-instance.
  85888. //
  85889. // You can also filter nested fields. For example, you could specify
  85890. // scheduling.automaticRestart = false to include instances only if they
  85891. // are not scheduled for automatic restarts. You can use filtering on
  85892. // nested fields to filter based on resource labels.
  85893. //
  85894. // To filter on multiple expressions, provide each separate expression
  85895. // within parentheses. For example, (scheduling.automaticRestart = true)
  85896. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  85897. // AND expression. However, you can include AND and OR expressions
  85898. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  85899. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  85900. // true).
  85901. func (c *RegionCommitmentsListCall) Filter(filter string) *RegionCommitmentsListCall {
  85902. c.urlParams_.Set("filter", filter)
  85903. return c
  85904. }
  85905. // MaxResults sets the optional parameter "maxResults": The maximum
  85906. // number of results per page that should be returned. If the number of
  85907. // available results is larger than maxResults, Compute Engine returns a
  85908. // nextPageToken that can be used to get the next page of results in
  85909. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  85910. // (Default: 500)
  85911. func (c *RegionCommitmentsListCall) MaxResults(maxResults int64) *RegionCommitmentsListCall {
  85912. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  85913. return c
  85914. }
  85915. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  85916. // a certain order. By default, results are returned in alphanumerical
  85917. // order based on the resource name.
  85918. //
  85919. // You can also sort results in descending order based on the creation
  85920. // timestamp using orderBy="creationTimestamp desc". This sorts results
  85921. // based on the creationTimestamp field in reverse chronological order
  85922. // (newest result first). Use this to sort resources like operations so
  85923. // that the newest operation is returned first.
  85924. //
  85925. // Currently, only sorting by name or creationTimestamp desc is
  85926. // supported.
  85927. func (c *RegionCommitmentsListCall) OrderBy(orderBy string) *RegionCommitmentsListCall {
  85928. c.urlParams_.Set("orderBy", orderBy)
  85929. return c
  85930. }
  85931. // PageToken sets the optional parameter "pageToken": Specifies a page
  85932. // token to use. Set pageToken to the nextPageToken returned by a
  85933. // previous list request to get the next page of results.
  85934. func (c *RegionCommitmentsListCall) PageToken(pageToken string) *RegionCommitmentsListCall {
  85935. c.urlParams_.Set("pageToken", pageToken)
  85936. return c
  85937. }
  85938. // Fields allows partial responses to be retrieved. See
  85939. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  85940. // for more information.
  85941. func (c *RegionCommitmentsListCall) Fields(s ...googleapi.Field) *RegionCommitmentsListCall {
  85942. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  85943. return c
  85944. }
  85945. // IfNoneMatch sets the optional parameter which makes the operation
  85946. // fail if the object's ETag matches the given value. This is useful for
  85947. // getting updates only after the object has changed since the last
  85948. // request. Use googleapi.IsNotModified to check whether the response
  85949. // error from Do is the result of In-None-Match.
  85950. func (c *RegionCommitmentsListCall) IfNoneMatch(entityTag string) *RegionCommitmentsListCall {
  85951. c.ifNoneMatch_ = entityTag
  85952. return c
  85953. }
  85954. // Context sets the context to be used in this call's Do method. Any
  85955. // pending HTTP request will be aborted if the provided context is
  85956. // canceled.
  85957. func (c *RegionCommitmentsListCall) Context(ctx context.Context) *RegionCommitmentsListCall {
  85958. c.ctx_ = ctx
  85959. return c
  85960. }
  85961. // Header returns an http.Header that can be modified by the caller to
  85962. // add HTTP headers to the request.
  85963. func (c *RegionCommitmentsListCall) Header() http.Header {
  85964. if c.header_ == nil {
  85965. c.header_ = make(http.Header)
  85966. }
  85967. return c.header_
  85968. }
  85969. func (c *RegionCommitmentsListCall) doRequest(alt string) (*http.Response, error) {
  85970. reqHeaders := make(http.Header)
  85971. for k, v := range c.header_ {
  85972. reqHeaders[k] = v
  85973. }
  85974. reqHeaders.Set("User-Agent", c.s.userAgent())
  85975. if c.ifNoneMatch_ != "" {
  85976. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  85977. }
  85978. var body io.Reader = nil
  85979. c.urlParams_.Set("alt", alt)
  85980. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/commitments")
  85981. urls += "?" + c.urlParams_.Encode()
  85982. req, _ := http.NewRequest("GET", urls, body)
  85983. req.Header = reqHeaders
  85984. googleapi.Expand(req.URL, map[string]string{
  85985. "project": c.project,
  85986. "region": c.region,
  85987. })
  85988. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  85989. }
  85990. // Do executes the "compute.regionCommitments.list" call.
  85991. // Exactly one of *CommitmentList or error will be non-nil. Any non-2xx
  85992. // status code is an error. Response headers are in either
  85993. // *CommitmentList.ServerResponse.Header or (if a response was returned
  85994. // at all) in error.(*googleapi.Error).Header. Use
  85995. // googleapi.IsNotModified to check whether the returned error was
  85996. // because http.StatusNotModified was returned.
  85997. func (c *RegionCommitmentsListCall) Do(opts ...googleapi.CallOption) (*CommitmentList, error) {
  85998. gensupport.SetOptions(c.urlParams_, opts...)
  85999. res, err := c.doRequest("json")
  86000. if res != nil && res.StatusCode == http.StatusNotModified {
  86001. if res.Body != nil {
  86002. res.Body.Close()
  86003. }
  86004. return nil, &googleapi.Error{
  86005. Code: res.StatusCode,
  86006. Header: res.Header,
  86007. }
  86008. }
  86009. if err != nil {
  86010. return nil, err
  86011. }
  86012. defer googleapi.CloseBody(res)
  86013. if err := googleapi.CheckResponse(res); err != nil {
  86014. return nil, err
  86015. }
  86016. ret := &CommitmentList{
  86017. ServerResponse: googleapi.ServerResponse{
  86018. Header: res.Header,
  86019. HTTPStatusCode: res.StatusCode,
  86020. },
  86021. }
  86022. target := &ret
  86023. if err := gensupport.DecodeResponse(target, res); err != nil {
  86024. return nil, err
  86025. }
  86026. return ret, nil
  86027. // {
  86028. // "description": "Retrieves a list of commitments contained within the specified region.",
  86029. // "httpMethod": "GET",
  86030. // "id": "compute.regionCommitments.list",
  86031. // "parameterOrder": [
  86032. // "project",
  86033. // "region"
  86034. // ],
  86035. // "parameters": {
  86036. // "filter": {
  86037. // "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).",
  86038. // "location": "query",
  86039. // "type": "string"
  86040. // },
  86041. // "maxResults": {
  86042. // "default": "500",
  86043. // "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)",
  86044. // "format": "uint32",
  86045. // "location": "query",
  86046. // "minimum": "0",
  86047. // "type": "integer"
  86048. // },
  86049. // "orderBy": {
  86050. // "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.",
  86051. // "location": "query",
  86052. // "type": "string"
  86053. // },
  86054. // "pageToken": {
  86055. // "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.",
  86056. // "location": "query",
  86057. // "type": "string"
  86058. // },
  86059. // "project": {
  86060. // "description": "Project ID for this request.",
  86061. // "location": "path",
  86062. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  86063. // "required": true,
  86064. // "type": "string"
  86065. // },
  86066. // "region": {
  86067. // "description": "Name of the region for this request.",
  86068. // "location": "path",
  86069. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  86070. // "required": true,
  86071. // "type": "string"
  86072. // }
  86073. // },
  86074. // "path": "{project}/regions/{region}/commitments",
  86075. // "response": {
  86076. // "$ref": "CommitmentList"
  86077. // },
  86078. // "scopes": [
  86079. // "https://www.googleapis.com/auth/cloud-platform",
  86080. // "https://www.googleapis.com/auth/compute",
  86081. // "https://www.googleapis.com/auth/compute.readonly"
  86082. // ]
  86083. // }
  86084. }
  86085. // Pages invokes f for each page of results.
  86086. // A non-nil error returned from f will halt the iteration.
  86087. // The provided context supersedes any context provided to the Context method.
  86088. func (c *RegionCommitmentsListCall) Pages(ctx context.Context, f func(*CommitmentList) error) error {
  86089. c.ctx_ = ctx
  86090. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  86091. for {
  86092. x, err := c.Do()
  86093. if err != nil {
  86094. return err
  86095. }
  86096. if err := f(x); err != nil {
  86097. return err
  86098. }
  86099. if x.NextPageToken == "" {
  86100. return nil
  86101. }
  86102. c.PageToken(x.NextPageToken)
  86103. }
  86104. }
  86105. // method id "compute.regionCommitments.testIamPermissions":
  86106. type RegionCommitmentsTestIamPermissionsCall struct {
  86107. s *Service
  86108. project string
  86109. region string
  86110. resource string
  86111. testpermissionsrequest *TestPermissionsRequest
  86112. urlParams_ gensupport.URLParams
  86113. ctx_ context.Context
  86114. header_ http.Header
  86115. }
  86116. // TestIamPermissions: Returns permissions that a caller has on the
  86117. // specified resource.
  86118. func (r *RegionCommitmentsService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionCommitmentsTestIamPermissionsCall {
  86119. c := &RegionCommitmentsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  86120. c.project = project
  86121. c.region = region
  86122. c.resource = resource
  86123. c.testpermissionsrequest = testpermissionsrequest
  86124. return c
  86125. }
  86126. // Fields allows partial responses to be retrieved. See
  86127. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  86128. // for more information.
  86129. func (c *RegionCommitmentsTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionCommitmentsTestIamPermissionsCall {
  86130. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  86131. return c
  86132. }
  86133. // Context sets the context to be used in this call's Do method. Any
  86134. // pending HTTP request will be aborted if the provided context is
  86135. // canceled.
  86136. func (c *RegionCommitmentsTestIamPermissionsCall) Context(ctx context.Context) *RegionCommitmentsTestIamPermissionsCall {
  86137. c.ctx_ = ctx
  86138. return c
  86139. }
  86140. // Header returns an http.Header that can be modified by the caller to
  86141. // add HTTP headers to the request.
  86142. func (c *RegionCommitmentsTestIamPermissionsCall) Header() http.Header {
  86143. if c.header_ == nil {
  86144. c.header_ = make(http.Header)
  86145. }
  86146. return c.header_
  86147. }
  86148. func (c *RegionCommitmentsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  86149. reqHeaders := make(http.Header)
  86150. for k, v := range c.header_ {
  86151. reqHeaders[k] = v
  86152. }
  86153. reqHeaders.Set("User-Agent", c.s.userAgent())
  86154. var body io.Reader = nil
  86155. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  86156. if err != nil {
  86157. return nil, err
  86158. }
  86159. reqHeaders.Set("Content-Type", "application/json")
  86160. c.urlParams_.Set("alt", alt)
  86161. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/commitments/{resource}/testIamPermissions")
  86162. urls += "?" + c.urlParams_.Encode()
  86163. req, _ := http.NewRequest("POST", urls, body)
  86164. req.Header = reqHeaders
  86165. googleapi.Expand(req.URL, map[string]string{
  86166. "project": c.project,
  86167. "region": c.region,
  86168. "resource": c.resource,
  86169. })
  86170. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  86171. }
  86172. // Do executes the "compute.regionCommitments.testIamPermissions" call.
  86173. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  86174. // non-2xx status code is an error. Response headers are in either
  86175. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  86176. // returned at all) in error.(*googleapi.Error).Header. Use
  86177. // googleapi.IsNotModified to check whether the returned error was
  86178. // because http.StatusNotModified was returned.
  86179. func (c *RegionCommitmentsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  86180. gensupport.SetOptions(c.urlParams_, opts...)
  86181. res, err := c.doRequest("json")
  86182. if res != nil && res.StatusCode == http.StatusNotModified {
  86183. if res.Body != nil {
  86184. res.Body.Close()
  86185. }
  86186. return nil, &googleapi.Error{
  86187. Code: res.StatusCode,
  86188. Header: res.Header,
  86189. }
  86190. }
  86191. if err != nil {
  86192. return nil, err
  86193. }
  86194. defer googleapi.CloseBody(res)
  86195. if err := googleapi.CheckResponse(res); err != nil {
  86196. return nil, err
  86197. }
  86198. ret := &TestPermissionsResponse{
  86199. ServerResponse: googleapi.ServerResponse{
  86200. Header: res.Header,
  86201. HTTPStatusCode: res.StatusCode,
  86202. },
  86203. }
  86204. target := &ret
  86205. if err := gensupport.DecodeResponse(target, res); err != nil {
  86206. return nil, err
  86207. }
  86208. return ret, nil
  86209. // {
  86210. // "description": "Returns permissions that a caller has on the specified resource.",
  86211. // "httpMethod": "POST",
  86212. // "id": "compute.regionCommitments.testIamPermissions",
  86213. // "parameterOrder": [
  86214. // "project",
  86215. // "region",
  86216. // "resource"
  86217. // ],
  86218. // "parameters": {
  86219. // "project": {
  86220. // "description": "Project ID for this request.",
  86221. // "location": "path",
  86222. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  86223. // "required": true,
  86224. // "type": "string"
  86225. // },
  86226. // "region": {
  86227. // "description": "The name of the region for this request.",
  86228. // "location": "path",
  86229. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  86230. // "required": true,
  86231. // "type": "string"
  86232. // },
  86233. // "resource": {
  86234. // "description": "Name of the resource for this request.",
  86235. // "location": "path",
  86236. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  86237. // "required": true,
  86238. // "type": "string"
  86239. // }
  86240. // },
  86241. // "path": "{project}/regions/{region}/commitments/{resource}/testIamPermissions",
  86242. // "request": {
  86243. // "$ref": "TestPermissionsRequest"
  86244. // },
  86245. // "response": {
  86246. // "$ref": "TestPermissionsResponse"
  86247. // },
  86248. // "scopes": [
  86249. // "https://www.googleapis.com/auth/cloud-platform",
  86250. // "https://www.googleapis.com/auth/compute",
  86251. // "https://www.googleapis.com/auth/compute.readonly"
  86252. // ]
  86253. // }
  86254. }
  86255. // method id "compute.regionDiskTypes.get":
  86256. type RegionDiskTypesGetCall struct {
  86257. s *Service
  86258. project string
  86259. region string
  86260. diskType string
  86261. urlParams_ gensupport.URLParams
  86262. ifNoneMatch_ string
  86263. ctx_ context.Context
  86264. header_ http.Header
  86265. }
  86266. // Get: Returns the specified regional disk type. Gets a list of
  86267. // available disk types by making a list() request.
  86268. func (r *RegionDiskTypesService) Get(project string, region string, diskType string) *RegionDiskTypesGetCall {
  86269. c := &RegionDiskTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  86270. c.project = project
  86271. c.region = region
  86272. c.diskType = diskType
  86273. return c
  86274. }
  86275. // Fields allows partial responses to be retrieved. See
  86276. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  86277. // for more information.
  86278. func (c *RegionDiskTypesGetCall) Fields(s ...googleapi.Field) *RegionDiskTypesGetCall {
  86279. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  86280. return c
  86281. }
  86282. // IfNoneMatch sets the optional parameter which makes the operation
  86283. // fail if the object's ETag matches the given value. This is useful for
  86284. // getting updates only after the object has changed since the last
  86285. // request. Use googleapi.IsNotModified to check whether the response
  86286. // error from Do is the result of In-None-Match.
  86287. func (c *RegionDiskTypesGetCall) IfNoneMatch(entityTag string) *RegionDiskTypesGetCall {
  86288. c.ifNoneMatch_ = entityTag
  86289. return c
  86290. }
  86291. // Context sets the context to be used in this call's Do method. Any
  86292. // pending HTTP request will be aborted if the provided context is
  86293. // canceled.
  86294. func (c *RegionDiskTypesGetCall) Context(ctx context.Context) *RegionDiskTypesGetCall {
  86295. c.ctx_ = ctx
  86296. return c
  86297. }
  86298. // Header returns an http.Header that can be modified by the caller to
  86299. // add HTTP headers to the request.
  86300. func (c *RegionDiskTypesGetCall) Header() http.Header {
  86301. if c.header_ == nil {
  86302. c.header_ = make(http.Header)
  86303. }
  86304. return c.header_
  86305. }
  86306. func (c *RegionDiskTypesGetCall) doRequest(alt string) (*http.Response, error) {
  86307. reqHeaders := make(http.Header)
  86308. for k, v := range c.header_ {
  86309. reqHeaders[k] = v
  86310. }
  86311. reqHeaders.Set("User-Agent", c.s.userAgent())
  86312. if c.ifNoneMatch_ != "" {
  86313. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  86314. }
  86315. var body io.Reader = nil
  86316. c.urlParams_.Set("alt", alt)
  86317. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/diskTypes/{diskType}")
  86318. urls += "?" + c.urlParams_.Encode()
  86319. req, _ := http.NewRequest("GET", urls, body)
  86320. req.Header = reqHeaders
  86321. googleapi.Expand(req.URL, map[string]string{
  86322. "project": c.project,
  86323. "region": c.region,
  86324. "diskType": c.diskType,
  86325. })
  86326. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  86327. }
  86328. // Do executes the "compute.regionDiskTypes.get" call.
  86329. // Exactly one of *DiskType or error will be non-nil. Any non-2xx status
  86330. // code is an error. Response headers are in either
  86331. // *DiskType.ServerResponse.Header or (if a response was returned at
  86332. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  86333. // to check whether the returned error was because
  86334. // http.StatusNotModified was returned.
  86335. func (c *RegionDiskTypesGetCall) Do(opts ...googleapi.CallOption) (*DiskType, error) {
  86336. gensupport.SetOptions(c.urlParams_, opts...)
  86337. res, err := c.doRequest("json")
  86338. if res != nil && res.StatusCode == http.StatusNotModified {
  86339. if res.Body != nil {
  86340. res.Body.Close()
  86341. }
  86342. return nil, &googleapi.Error{
  86343. Code: res.StatusCode,
  86344. Header: res.Header,
  86345. }
  86346. }
  86347. if err != nil {
  86348. return nil, err
  86349. }
  86350. defer googleapi.CloseBody(res)
  86351. if err := googleapi.CheckResponse(res); err != nil {
  86352. return nil, err
  86353. }
  86354. ret := &DiskType{
  86355. ServerResponse: googleapi.ServerResponse{
  86356. Header: res.Header,
  86357. HTTPStatusCode: res.StatusCode,
  86358. },
  86359. }
  86360. target := &ret
  86361. if err := gensupport.DecodeResponse(target, res); err != nil {
  86362. return nil, err
  86363. }
  86364. return ret, nil
  86365. // {
  86366. // "description": "Returns the specified regional disk type. Gets a list of available disk types by making a list() request.",
  86367. // "httpMethod": "GET",
  86368. // "id": "compute.regionDiskTypes.get",
  86369. // "parameterOrder": [
  86370. // "project",
  86371. // "region",
  86372. // "diskType"
  86373. // ],
  86374. // "parameters": {
  86375. // "diskType": {
  86376. // "description": "Name of the disk type to return.",
  86377. // "location": "path",
  86378. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  86379. // "required": true,
  86380. // "type": "string"
  86381. // },
  86382. // "project": {
  86383. // "description": "Project ID for this request.",
  86384. // "location": "path",
  86385. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  86386. // "required": true,
  86387. // "type": "string"
  86388. // },
  86389. // "region": {
  86390. // "description": "The name of the region for this request.",
  86391. // "location": "path",
  86392. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  86393. // "required": true,
  86394. // "type": "string"
  86395. // }
  86396. // },
  86397. // "path": "{project}/regions/{region}/diskTypes/{diskType}",
  86398. // "response": {
  86399. // "$ref": "DiskType"
  86400. // },
  86401. // "scopes": [
  86402. // "https://www.googleapis.com/auth/cloud-platform",
  86403. // "https://www.googleapis.com/auth/compute",
  86404. // "https://www.googleapis.com/auth/compute.readonly"
  86405. // ]
  86406. // }
  86407. }
  86408. // method id "compute.regionDiskTypes.list":
  86409. type RegionDiskTypesListCall struct {
  86410. s *Service
  86411. project string
  86412. region string
  86413. urlParams_ gensupport.URLParams
  86414. ifNoneMatch_ string
  86415. ctx_ context.Context
  86416. header_ http.Header
  86417. }
  86418. // List: Retrieves a list of regional disk types available to the
  86419. // specified project.
  86420. func (r *RegionDiskTypesService) List(project string, region string) *RegionDiskTypesListCall {
  86421. c := &RegionDiskTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  86422. c.project = project
  86423. c.region = region
  86424. return c
  86425. }
  86426. // Filter sets the optional parameter "filter": A filter expression that
  86427. // filters resources listed in the response. The expression must specify
  86428. // the field name, a comparison operator, and the value that you want to
  86429. // use for filtering. The value must be a string, a number, or a
  86430. // boolean. The comparison operator must be either =, !=, >, or <.
  86431. //
  86432. // For example, if you are filtering Compute Engine instances, you can
  86433. // exclude instances named example-instance by specifying name !=
  86434. // example-instance.
  86435. //
  86436. // You can also filter nested fields. For example, you could specify
  86437. // scheduling.automaticRestart = false to include instances only if they
  86438. // are not scheduled for automatic restarts. You can use filtering on
  86439. // nested fields to filter based on resource labels.
  86440. //
  86441. // To filter on multiple expressions, provide each separate expression
  86442. // within parentheses. For example, (scheduling.automaticRestart = true)
  86443. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  86444. // AND expression. However, you can include AND and OR expressions
  86445. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  86446. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  86447. // true).
  86448. func (c *RegionDiskTypesListCall) Filter(filter string) *RegionDiskTypesListCall {
  86449. c.urlParams_.Set("filter", filter)
  86450. return c
  86451. }
  86452. // MaxResults sets the optional parameter "maxResults": The maximum
  86453. // number of results per page that should be returned. If the number of
  86454. // available results is larger than maxResults, Compute Engine returns a
  86455. // nextPageToken that can be used to get the next page of results in
  86456. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  86457. // (Default: 500)
  86458. func (c *RegionDiskTypesListCall) MaxResults(maxResults int64) *RegionDiskTypesListCall {
  86459. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  86460. return c
  86461. }
  86462. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  86463. // a certain order. By default, results are returned in alphanumerical
  86464. // order based on the resource name.
  86465. //
  86466. // You can also sort results in descending order based on the creation
  86467. // timestamp using orderBy="creationTimestamp desc". This sorts results
  86468. // based on the creationTimestamp field in reverse chronological order
  86469. // (newest result first). Use this to sort resources like operations so
  86470. // that the newest operation is returned first.
  86471. //
  86472. // Currently, only sorting by name or creationTimestamp desc is
  86473. // supported.
  86474. func (c *RegionDiskTypesListCall) OrderBy(orderBy string) *RegionDiskTypesListCall {
  86475. c.urlParams_.Set("orderBy", orderBy)
  86476. return c
  86477. }
  86478. // PageToken sets the optional parameter "pageToken": Specifies a page
  86479. // token to use. Set pageToken to the nextPageToken returned by a
  86480. // previous list request to get the next page of results.
  86481. func (c *RegionDiskTypesListCall) PageToken(pageToken string) *RegionDiskTypesListCall {
  86482. c.urlParams_.Set("pageToken", pageToken)
  86483. return c
  86484. }
  86485. // Fields allows partial responses to be retrieved. See
  86486. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  86487. // for more information.
  86488. func (c *RegionDiskTypesListCall) Fields(s ...googleapi.Field) *RegionDiskTypesListCall {
  86489. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  86490. return c
  86491. }
  86492. // IfNoneMatch sets the optional parameter which makes the operation
  86493. // fail if the object's ETag matches the given value. This is useful for
  86494. // getting updates only after the object has changed since the last
  86495. // request. Use googleapi.IsNotModified to check whether the response
  86496. // error from Do is the result of In-None-Match.
  86497. func (c *RegionDiskTypesListCall) IfNoneMatch(entityTag string) *RegionDiskTypesListCall {
  86498. c.ifNoneMatch_ = entityTag
  86499. return c
  86500. }
  86501. // Context sets the context to be used in this call's Do method. Any
  86502. // pending HTTP request will be aborted if the provided context is
  86503. // canceled.
  86504. func (c *RegionDiskTypesListCall) Context(ctx context.Context) *RegionDiskTypesListCall {
  86505. c.ctx_ = ctx
  86506. return c
  86507. }
  86508. // Header returns an http.Header that can be modified by the caller to
  86509. // add HTTP headers to the request.
  86510. func (c *RegionDiskTypesListCall) Header() http.Header {
  86511. if c.header_ == nil {
  86512. c.header_ = make(http.Header)
  86513. }
  86514. return c.header_
  86515. }
  86516. func (c *RegionDiskTypesListCall) doRequest(alt string) (*http.Response, error) {
  86517. reqHeaders := make(http.Header)
  86518. for k, v := range c.header_ {
  86519. reqHeaders[k] = v
  86520. }
  86521. reqHeaders.Set("User-Agent", c.s.userAgent())
  86522. if c.ifNoneMatch_ != "" {
  86523. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  86524. }
  86525. var body io.Reader = nil
  86526. c.urlParams_.Set("alt", alt)
  86527. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/diskTypes")
  86528. urls += "?" + c.urlParams_.Encode()
  86529. req, _ := http.NewRequest("GET", urls, body)
  86530. req.Header = reqHeaders
  86531. googleapi.Expand(req.URL, map[string]string{
  86532. "project": c.project,
  86533. "region": c.region,
  86534. })
  86535. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  86536. }
  86537. // Do executes the "compute.regionDiskTypes.list" call.
  86538. // Exactly one of *RegionDiskTypeList or error will be non-nil. Any
  86539. // non-2xx status code is an error. Response headers are in either
  86540. // *RegionDiskTypeList.ServerResponse.Header or (if a response was
  86541. // returned at all) in error.(*googleapi.Error).Header. Use
  86542. // googleapi.IsNotModified to check whether the returned error was
  86543. // because http.StatusNotModified was returned.
  86544. func (c *RegionDiskTypesListCall) Do(opts ...googleapi.CallOption) (*RegionDiskTypeList, error) {
  86545. gensupport.SetOptions(c.urlParams_, opts...)
  86546. res, err := c.doRequest("json")
  86547. if res != nil && res.StatusCode == http.StatusNotModified {
  86548. if res.Body != nil {
  86549. res.Body.Close()
  86550. }
  86551. return nil, &googleapi.Error{
  86552. Code: res.StatusCode,
  86553. Header: res.Header,
  86554. }
  86555. }
  86556. if err != nil {
  86557. return nil, err
  86558. }
  86559. defer googleapi.CloseBody(res)
  86560. if err := googleapi.CheckResponse(res); err != nil {
  86561. return nil, err
  86562. }
  86563. ret := &RegionDiskTypeList{
  86564. ServerResponse: googleapi.ServerResponse{
  86565. Header: res.Header,
  86566. HTTPStatusCode: res.StatusCode,
  86567. },
  86568. }
  86569. target := &ret
  86570. if err := gensupport.DecodeResponse(target, res); err != nil {
  86571. return nil, err
  86572. }
  86573. return ret, nil
  86574. // {
  86575. // "description": "Retrieves a list of regional disk types available to the specified project.",
  86576. // "httpMethod": "GET",
  86577. // "id": "compute.regionDiskTypes.list",
  86578. // "parameterOrder": [
  86579. // "project",
  86580. // "region"
  86581. // ],
  86582. // "parameters": {
  86583. // "filter": {
  86584. // "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).",
  86585. // "location": "query",
  86586. // "type": "string"
  86587. // },
  86588. // "maxResults": {
  86589. // "default": "500",
  86590. // "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)",
  86591. // "format": "uint32",
  86592. // "location": "query",
  86593. // "minimum": "0",
  86594. // "type": "integer"
  86595. // },
  86596. // "orderBy": {
  86597. // "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.",
  86598. // "location": "query",
  86599. // "type": "string"
  86600. // },
  86601. // "pageToken": {
  86602. // "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.",
  86603. // "location": "query",
  86604. // "type": "string"
  86605. // },
  86606. // "project": {
  86607. // "description": "Project ID for this request.",
  86608. // "location": "path",
  86609. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  86610. // "required": true,
  86611. // "type": "string"
  86612. // },
  86613. // "region": {
  86614. // "description": "The name of the region for this request.",
  86615. // "location": "path",
  86616. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  86617. // "required": true,
  86618. // "type": "string"
  86619. // }
  86620. // },
  86621. // "path": "{project}/regions/{region}/diskTypes",
  86622. // "response": {
  86623. // "$ref": "RegionDiskTypeList"
  86624. // },
  86625. // "scopes": [
  86626. // "https://www.googleapis.com/auth/cloud-platform",
  86627. // "https://www.googleapis.com/auth/compute",
  86628. // "https://www.googleapis.com/auth/compute.readonly"
  86629. // ]
  86630. // }
  86631. }
  86632. // Pages invokes f for each page of results.
  86633. // A non-nil error returned from f will halt the iteration.
  86634. // The provided context supersedes any context provided to the Context method.
  86635. func (c *RegionDiskTypesListCall) Pages(ctx context.Context, f func(*RegionDiskTypeList) error) error {
  86636. c.ctx_ = ctx
  86637. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  86638. for {
  86639. x, err := c.Do()
  86640. if err != nil {
  86641. return err
  86642. }
  86643. if err := f(x); err != nil {
  86644. return err
  86645. }
  86646. if x.NextPageToken == "" {
  86647. return nil
  86648. }
  86649. c.PageToken(x.NextPageToken)
  86650. }
  86651. }
  86652. // method id "compute.regionDisks.createSnapshot":
  86653. type RegionDisksCreateSnapshotCall struct {
  86654. s *Service
  86655. project string
  86656. region string
  86657. disk string
  86658. snapshot *Snapshot
  86659. urlParams_ gensupport.URLParams
  86660. ctx_ context.Context
  86661. header_ http.Header
  86662. }
  86663. // CreateSnapshot: Creates a snapshot of this regional disk.
  86664. func (r *RegionDisksService) CreateSnapshot(project string, region string, disk string, snapshot *Snapshot) *RegionDisksCreateSnapshotCall {
  86665. c := &RegionDisksCreateSnapshotCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  86666. c.project = project
  86667. c.region = region
  86668. c.disk = disk
  86669. c.snapshot = snapshot
  86670. return c
  86671. }
  86672. // GuestFlush sets the optional parameter "guestFlush":
  86673. func (c *RegionDisksCreateSnapshotCall) GuestFlush(guestFlush bool) *RegionDisksCreateSnapshotCall {
  86674. c.urlParams_.Set("guestFlush", fmt.Sprint(guestFlush))
  86675. return c
  86676. }
  86677. // RequestId sets the optional parameter "requestId": An optional
  86678. // request ID to identify requests. Specify a unique request ID so that
  86679. // if you must retry your request, the server will know to ignore the
  86680. // request if it has already been completed.
  86681. //
  86682. // For example, consider a situation where you make an initial request
  86683. // and the request times out. If you make the request again with the
  86684. // same request ID, the server can check if original operation with the
  86685. // same request ID was received, and if so, will ignore the second
  86686. // request. This prevents clients from accidentally creating duplicate
  86687. // commitments.
  86688. //
  86689. // The request ID must be a valid UUID with the exception that zero UUID
  86690. // is not supported (00000000-0000-0000-0000-000000000000).
  86691. func (c *RegionDisksCreateSnapshotCall) RequestId(requestId string) *RegionDisksCreateSnapshotCall {
  86692. c.urlParams_.Set("requestId", requestId)
  86693. return c
  86694. }
  86695. // Fields allows partial responses to be retrieved. See
  86696. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  86697. // for more information.
  86698. func (c *RegionDisksCreateSnapshotCall) Fields(s ...googleapi.Field) *RegionDisksCreateSnapshotCall {
  86699. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  86700. return c
  86701. }
  86702. // Context sets the context to be used in this call's Do method. Any
  86703. // pending HTTP request will be aborted if the provided context is
  86704. // canceled.
  86705. func (c *RegionDisksCreateSnapshotCall) Context(ctx context.Context) *RegionDisksCreateSnapshotCall {
  86706. c.ctx_ = ctx
  86707. return c
  86708. }
  86709. // Header returns an http.Header that can be modified by the caller to
  86710. // add HTTP headers to the request.
  86711. func (c *RegionDisksCreateSnapshotCall) Header() http.Header {
  86712. if c.header_ == nil {
  86713. c.header_ = make(http.Header)
  86714. }
  86715. return c.header_
  86716. }
  86717. func (c *RegionDisksCreateSnapshotCall) doRequest(alt string) (*http.Response, error) {
  86718. reqHeaders := make(http.Header)
  86719. for k, v := range c.header_ {
  86720. reqHeaders[k] = v
  86721. }
  86722. reqHeaders.Set("User-Agent", c.s.userAgent())
  86723. var body io.Reader = nil
  86724. body, err := googleapi.WithoutDataWrapper.JSONReader(c.snapshot)
  86725. if err != nil {
  86726. return nil, err
  86727. }
  86728. reqHeaders.Set("Content-Type", "application/json")
  86729. c.urlParams_.Set("alt", alt)
  86730. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{disk}/createSnapshot")
  86731. urls += "?" + c.urlParams_.Encode()
  86732. req, _ := http.NewRequest("POST", urls, body)
  86733. req.Header = reqHeaders
  86734. googleapi.Expand(req.URL, map[string]string{
  86735. "project": c.project,
  86736. "region": c.region,
  86737. "disk": c.disk,
  86738. })
  86739. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  86740. }
  86741. // Do executes the "compute.regionDisks.createSnapshot" call.
  86742. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  86743. // status code is an error. Response headers are in either
  86744. // *Operation.ServerResponse.Header or (if a response was returned at
  86745. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  86746. // to check whether the returned error was because
  86747. // http.StatusNotModified was returned.
  86748. func (c *RegionDisksCreateSnapshotCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  86749. gensupport.SetOptions(c.urlParams_, opts...)
  86750. res, err := c.doRequest("json")
  86751. if res != nil && res.StatusCode == http.StatusNotModified {
  86752. if res.Body != nil {
  86753. res.Body.Close()
  86754. }
  86755. return nil, &googleapi.Error{
  86756. Code: res.StatusCode,
  86757. Header: res.Header,
  86758. }
  86759. }
  86760. if err != nil {
  86761. return nil, err
  86762. }
  86763. defer googleapi.CloseBody(res)
  86764. if err := googleapi.CheckResponse(res); err != nil {
  86765. return nil, err
  86766. }
  86767. ret := &Operation{
  86768. ServerResponse: googleapi.ServerResponse{
  86769. Header: res.Header,
  86770. HTTPStatusCode: res.StatusCode,
  86771. },
  86772. }
  86773. target := &ret
  86774. if err := gensupport.DecodeResponse(target, res); err != nil {
  86775. return nil, err
  86776. }
  86777. return ret, nil
  86778. // {
  86779. // "description": "Creates a snapshot of this regional disk.",
  86780. // "httpMethod": "POST",
  86781. // "id": "compute.regionDisks.createSnapshot",
  86782. // "parameterOrder": [
  86783. // "project",
  86784. // "region",
  86785. // "disk"
  86786. // ],
  86787. // "parameters": {
  86788. // "disk": {
  86789. // "description": "Name of the regional persistent disk to snapshot.",
  86790. // "location": "path",
  86791. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  86792. // "required": true,
  86793. // "type": "string"
  86794. // },
  86795. // "guestFlush": {
  86796. // "location": "query",
  86797. // "type": "boolean"
  86798. // },
  86799. // "project": {
  86800. // "description": "Project ID for this request.",
  86801. // "location": "path",
  86802. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  86803. // "required": true,
  86804. // "type": "string"
  86805. // },
  86806. // "region": {
  86807. // "description": "Name of the region for this request.",
  86808. // "location": "path",
  86809. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  86810. // "required": true,
  86811. // "type": "string"
  86812. // },
  86813. // "requestId": {
  86814. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  86815. // "location": "query",
  86816. // "type": "string"
  86817. // }
  86818. // },
  86819. // "path": "{project}/regions/{region}/disks/{disk}/createSnapshot",
  86820. // "request": {
  86821. // "$ref": "Snapshot"
  86822. // },
  86823. // "response": {
  86824. // "$ref": "Operation"
  86825. // },
  86826. // "scopes": [
  86827. // "https://www.googleapis.com/auth/cloud-platform",
  86828. // "https://www.googleapis.com/auth/compute"
  86829. // ]
  86830. // }
  86831. }
  86832. // method id "compute.regionDisks.delete":
  86833. type RegionDisksDeleteCall struct {
  86834. s *Service
  86835. project string
  86836. region string
  86837. disk string
  86838. urlParams_ gensupport.URLParams
  86839. ctx_ context.Context
  86840. header_ http.Header
  86841. }
  86842. // Delete: Deletes the specified regional persistent disk. Deleting a
  86843. // regional disk removes all the replicas of its data permanently and is
  86844. // irreversible. However, deleting a disk does not delete any snapshots
  86845. // previously made from the disk. You must separately delete snapshots.
  86846. func (r *RegionDisksService) Delete(project string, region string, disk string) *RegionDisksDeleteCall {
  86847. c := &RegionDisksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  86848. c.project = project
  86849. c.region = region
  86850. c.disk = disk
  86851. return c
  86852. }
  86853. // RequestId sets the optional parameter "requestId": An optional
  86854. // request ID to identify requests. Specify a unique request ID so that
  86855. // if you must retry your request, the server will know to ignore the
  86856. // request if it has already been completed.
  86857. //
  86858. // For example, consider a situation where you make an initial request
  86859. // and the request times out. If you make the request again with the
  86860. // same request ID, the server can check if original operation with the
  86861. // same request ID was received, and if so, will ignore the second
  86862. // request. This prevents clients from accidentally creating duplicate
  86863. // commitments.
  86864. //
  86865. // The request ID must be a valid UUID with the exception that zero UUID
  86866. // is not supported (00000000-0000-0000-0000-000000000000).
  86867. func (c *RegionDisksDeleteCall) RequestId(requestId string) *RegionDisksDeleteCall {
  86868. c.urlParams_.Set("requestId", requestId)
  86869. return c
  86870. }
  86871. // Fields allows partial responses to be retrieved. See
  86872. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  86873. // for more information.
  86874. func (c *RegionDisksDeleteCall) Fields(s ...googleapi.Field) *RegionDisksDeleteCall {
  86875. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  86876. return c
  86877. }
  86878. // Context sets the context to be used in this call's Do method. Any
  86879. // pending HTTP request will be aborted if the provided context is
  86880. // canceled.
  86881. func (c *RegionDisksDeleteCall) Context(ctx context.Context) *RegionDisksDeleteCall {
  86882. c.ctx_ = ctx
  86883. return c
  86884. }
  86885. // Header returns an http.Header that can be modified by the caller to
  86886. // add HTTP headers to the request.
  86887. func (c *RegionDisksDeleteCall) Header() http.Header {
  86888. if c.header_ == nil {
  86889. c.header_ = make(http.Header)
  86890. }
  86891. return c.header_
  86892. }
  86893. func (c *RegionDisksDeleteCall) doRequest(alt string) (*http.Response, error) {
  86894. reqHeaders := make(http.Header)
  86895. for k, v := range c.header_ {
  86896. reqHeaders[k] = v
  86897. }
  86898. reqHeaders.Set("User-Agent", c.s.userAgent())
  86899. var body io.Reader = nil
  86900. c.urlParams_.Set("alt", alt)
  86901. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{disk}")
  86902. urls += "?" + c.urlParams_.Encode()
  86903. req, _ := http.NewRequest("DELETE", urls, body)
  86904. req.Header = reqHeaders
  86905. googleapi.Expand(req.URL, map[string]string{
  86906. "project": c.project,
  86907. "region": c.region,
  86908. "disk": c.disk,
  86909. })
  86910. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  86911. }
  86912. // Do executes the "compute.regionDisks.delete" call.
  86913. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  86914. // status code is an error. Response headers are in either
  86915. // *Operation.ServerResponse.Header or (if a response was returned at
  86916. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  86917. // to check whether the returned error was because
  86918. // http.StatusNotModified was returned.
  86919. func (c *RegionDisksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  86920. gensupport.SetOptions(c.urlParams_, opts...)
  86921. res, err := c.doRequest("json")
  86922. if res != nil && res.StatusCode == http.StatusNotModified {
  86923. if res.Body != nil {
  86924. res.Body.Close()
  86925. }
  86926. return nil, &googleapi.Error{
  86927. Code: res.StatusCode,
  86928. Header: res.Header,
  86929. }
  86930. }
  86931. if err != nil {
  86932. return nil, err
  86933. }
  86934. defer googleapi.CloseBody(res)
  86935. if err := googleapi.CheckResponse(res); err != nil {
  86936. return nil, err
  86937. }
  86938. ret := &Operation{
  86939. ServerResponse: googleapi.ServerResponse{
  86940. Header: res.Header,
  86941. HTTPStatusCode: res.StatusCode,
  86942. },
  86943. }
  86944. target := &ret
  86945. if err := gensupport.DecodeResponse(target, res); err != nil {
  86946. return nil, err
  86947. }
  86948. return ret, nil
  86949. // {
  86950. // "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.",
  86951. // "httpMethod": "DELETE",
  86952. // "id": "compute.regionDisks.delete",
  86953. // "parameterOrder": [
  86954. // "project",
  86955. // "region",
  86956. // "disk"
  86957. // ],
  86958. // "parameters": {
  86959. // "disk": {
  86960. // "description": "Name of the regional persistent disk to delete.",
  86961. // "location": "path",
  86962. // "required": true,
  86963. // "type": "string"
  86964. // },
  86965. // "project": {
  86966. // "description": "Project ID for this request.",
  86967. // "location": "path",
  86968. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  86969. // "required": true,
  86970. // "type": "string"
  86971. // },
  86972. // "region": {
  86973. // "description": "Name of the region for this request.",
  86974. // "location": "path",
  86975. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  86976. // "required": true,
  86977. // "type": "string"
  86978. // },
  86979. // "requestId": {
  86980. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  86981. // "location": "query",
  86982. // "type": "string"
  86983. // }
  86984. // },
  86985. // "path": "{project}/regions/{region}/disks/{disk}",
  86986. // "response": {
  86987. // "$ref": "Operation"
  86988. // },
  86989. // "scopes": [
  86990. // "https://www.googleapis.com/auth/cloud-platform",
  86991. // "https://www.googleapis.com/auth/compute"
  86992. // ]
  86993. // }
  86994. }
  86995. // method id "compute.regionDisks.get":
  86996. type RegionDisksGetCall struct {
  86997. s *Service
  86998. project string
  86999. region string
  87000. disk string
  87001. urlParams_ gensupport.URLParams
  87002. ifNoneMatch_ string
  87003. ctx_ context.Context
  87004. header_ http.Header
  87005. }
  87006. // Get: Returns a specified regional persistent disk.
  87007. func (r *RegionDisksService) Get(project string, region string, disk string) *RegionDisksGetCall {
  87008. c := &RegionDisksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  87009. c.project = project
  87010. c.region = region
  87011. c.disk = disk
  87012. return c
  87013. }
  87014. // Fields allows partial responses to be retrieved. See
  87015. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  87016. // for more information.
  87017. func (c *RegionDisksGetCall) Fields(s ...googleapi.Field) *RegionDisksGetCall {
  87018. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  87019. return c
  87020. }
  87021. // IfNoneMatch sets the optional parameter which makes the operation
  87022. // fail if the object's ETag matches the given value. This is useful for
  87023. // getting updates only after the object has changed since the last
  87024. // request. Use googleapi.IsNotModified to check whether the response
  87025. // error from Do is the result of In-None-Match.
  87026. func (c *RegionDisksGetCall) IfNoneMatch(entityTag string) *RegionDisksGetCall {
  87027. c.ifNoneMatch_ = entityTag
  87028. return c
  87029. }
  87030. // Context sets the context to be used in this call's Do method. Any
  87031. // pending HTTP request will be aborted if the provided context is
  87032. // canceled.
  87033. func (c *RegionDisksGetCall) Context(ctx context.Context) *RegionDisksGetCall {
  87034. c.ctx_ = ctx
  87035. return c
  87036. }
  87037. // Header returns an http.Header that can be modified by the caller to
  87038. // add HTTP headers to the request.
  87039. func (c *RegionDisksGetCall) Header() http.Header {
  87040. if c.header_ == nil {
  87041. c.header_ = make(http.Header)
  87042. }
  87043. return c.header_
  87044. }
  87045. func (c *RegionDisksGetCall) doRequest(alt string) (*http.Response, error) {
  87046. reqHeaders := make(http.Header)
  87047. for k, v := range c.header_ {
  87048. reqHeaders[k] = v
  87049. }
  87050. reqHeaders.Set("User-Agent", c.s.userAgent())
  87051. if c.ifNoneMatch_ != "" {
  87052. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  87053. }
  87054. var body io.Reader = nil
  87055. c.urlParams_.Set("alt", alt)
  87056. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{disk}")
  87057. urls += "?" + c.urlParams_.Encode()
  87058. req, _ := http.NewRequest("GET", urls, body)
  87059. req.Header = reqHeaders
  87060. googleapi.Expand(req.URL, map[string]string{
  87061. "project": c.project,
  87062. "region": c.region,
  87063. "disk": c.disk,
  87064. })
  87065. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  87066. }
  87067. // Do executes the "compute.regionDisks.get" call.
  87068. // Exactly one of *Disk or error will be non-nil. Any non-2xx status
  87069. // code is an error. Response headers are in either
  87070. // *Disk.ServerResponse.Header or (if a response was returned at all) in
  87071. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  87072. // whether the returned error was because http.StatusNotModified was
  87073. // returned.
  87074. func (c *RegionDisksGetCall) Do(opts ...googleapi.CallOption) (*Disk, error) {
  87075. gensupport.SetOptions(c.urlParams_, opts...)
  87076. res, err := c.doRequest("json")
  87077. if res != nil && res.StatusCode == http.StatusNotModified {
  87078. if res.Body != nil {
  87079. res.Body.Close()
  87080. }
  87081. return nil, &googleapi.Error{
  87082. Code: res.StatusCode,
  87083. Header: res.Header,
  87084. }
  87085. }
  87086. if err != nil {
  87087. return nil, err
  87088. }
  87089. defer googleapi.CloseBody(res)
  87090. if err := googleapi.CheckResponse(res); err != nil {
  87091. return nil, err
  87092. }
  87093. ret := &Disk{
  87094. ServerResponse: googleapi.ServerResponse{
  87095. Header: res.Header,
  87096. HTTPStatusCode: res.StatusCode,
  87097. },
  87098. }
  87099. target := &ret
  87100. if err := gensupport.DecodeResponse(target, res); err != nil {
  87101. return nil, err
  87102. }
  87103. return ret, nil
  87104. // {
  87105. // "description": "Returns a specified regional persistent disk.",
  87106. // "httpMethod": "GET",
  87107. // "id": "compute.regionDisks.get",
  87108. // "parameterOrder": [
  87109. // "project",
  87110. // "region",
  87111. // "disk"
  87112. // ],
  87113. // "parameters": {
  87114. // "disk": {
  87115. // "description": "Name of the regional persistent disk to return.",
  87116. // "location": "path",
  87117. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  87118. // "required": true,
  87119. // "type": "string"
  87120. // },
  87121. // "project": {
  87122. // "description": "Project ID for this request.",
  87123. // "location": "path",
  87124. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  87125. // "required": true,
  87126. // "type": "string"
  87127. // },
  87128. // "region": {
  87129. // "description": "Name of the region for this request.",
  87130. // "location": "path",
  87131. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  87132. // "required": true,
  87133. // "type": "string"
  87134. // }
  87135. // },
  87136. // "path": "{project}/regions/{region}/disks/{disk}",
  87137. // "response": {
  87138. // "$ref": "Disk"
  87139. // },
  87140. // "scopes": [
  87141. // "https://www.googleapis.com/auth/cloud-platform",
  87142. // "https://www.googleapis.com/auth/compute",
  87143. // "https://www.googleapis.com/auth/compute.readonly"
  87144. // ]
  87145. // }
  87146. }
  87147. // method id "compute.regionDisks.insert":
  87148. type RegionDisksInsertCall struct {
  87149. s *Service
  87150. project string
  87151. region string
  87152. disk *Disk
  87153. urlParams_ gensupport.URLParams
  87154. ctx_ context.Context
  87155. header_ http.Header
  87156. }
  87157. // Insert: Creates a persistent regional disk in the specified project
  87158. // using the data included in the request.
  87159. func (r *RegionDisksService) Insert(project string, region string, disk *Disk) *RegionDisksInsertCall {
  87160. c := &RegionDisksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  87161. c.project = project
  87162. c.region = region
  87163. c.disk = disk
  87164. return c
  87165. }
  87166. // RequestId sets the optional parameter "requestId": An optional
  87167. // request ID to identify requests. Specify a unique request ID so that
  87168. // if you must retry your request, the server will know to ignore the
  87169. // request if it has already been completed.
  87170. //
  87171. // For example, consider a situation where you make an initial request
  87172. // and the request times out. If you make the request again with the
  87173. // same request ID, the server can check if original operation with the
  87174. // same request ID was received, and if so, will ignore the second
  87175. // request. This prevents clients from accidentally creating duplicate
  87176. // commitments.
  87177. //
  87178. // The request ID must be a valid UUID with the exception that zero UUID
  87179. // is not supported (00000000-0000-0000-0000-000000000000).
  87180. func (c *RegionDisksInsertCall) RequestId(requestId string) *RegionDisksInsertCall {
  87181. c.urlParams_.Set("requestId", requestId)
  87182. return c
  87183. }
  87184. // SourceImage sets the optional parameter "sourceImage": Source image
  87185. // to restore onto a disk.
  87186. func (c *RegionDisksInsertCall) SourceImage(sourceImage string) *RegionDisksInsertCall {
  87187. c.urlParams_.Set("sourceImage", sourceImage)
  87188. return c
  87189. }
  87190. // Fields allows partial responses to be retrieved. See
  87191. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  87192. // for more information.
  87193. func (c *RegionDisksInsertCall) Fields(s ...googleapi.Field) *RegionDisksInsertCall {
  87194. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  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 *RegionDisksInsertCall) Context(ctx context.Context) *RegionDisksInsertCall {
  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 *RegionDisksInsertCall) Header() http.Header {
  87207. if c.header_ == nil {
  87208. c.header_ = make(http.Header)
  87209. }
  87210. return c.header_
  87211. }
  87212. func (c *RegionDisksInsertCall) 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. var body io.Reader = nil
  87219. body, err := googleapi.WithoutDataWrapper.JSONReader(c.disk)
  87220. if err != nil {
  87221. return nil, err
  87222. }
  87223. reqHeaders.Set("Content-Type", "application/json")
  87224. c.urlParams_.Set("alt", alt)
  87225. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks")
  87226. urls += "?" + c.urlParams_.Encode()
  87227. req, _ := http.NewRequest("POST", urls, body)
  87228. req.Header = reqHeaders
  87229. googleapi.Expand(req.URL, map[string]string{
  87230. "project": c.project,
  87231. "region": c.region,
  87232. })
  87233. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  87234. }
  87235. // Do executes the "compute.regionDisks.insert" call.
  87236. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  87237. // status code is an error. Response headers are in either
  87238. // *Operation.ServerResponse.Header or (if a response was returned at
  87239. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  87240. // to check whether the returned error was because
  87241. // http.StatusNotModified was returned.
  87242. func (c *RegionDisksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  87243. gensupport.SetOptions(c.urlParams_, opts...)
  87244. res, err := c.doRequest("json")
  87245. if res != nil && res.StatusCode == http.StatusNotModified {
  87246. if res.Body != nil {
  87247. res.Body.Close()
  87248. }
  87249. return nil, &googleapi.Error{
  87250. Code: res.StatusCode,
  87251. Header: res.Header,
  87252. }
  87253. }
  87254. if err != nil {
  87255. return nil, err
  87256. }
  87257. defer googleapi.CloseBody(res)
  87258. if err := googleapi.CheckResponse(res); err != nil {
  87259. return nil, err
  87260. }
  87261. ret := &Operation{
  87262. ServerResponse: googleapi.ServerResponse{
  87263. Header: res.Header,
  87264. HTTPStatusCode: res.StatusCode,
  87265. },
  87266. }
  87267. target := &ret
  87268. if err := gensupport.DecodeResponse(target, res); err != nil {
  87269. return nil, err
  87270. }
  87271. return ret, nil
  87272. // {
  87273. // "description": "Creates a persistent regional disk in the specified project using the data included in the request.",
  87274. // "httpMethod": "POST",
  87275. // "id": "compute.regionDisks.insert",
  87276. // "parameterOrder": [
  87277. // "project",
  87278. // "region"
  87279. // ],
  87280. // "parameters": {
  87281. // "project": {
  87282. // "description": "Project ID for this request.",
  87283. // "location": "path",
  87284. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  87285. // "required": true,
  87286. // "type": "string"
  87287. // },
  87288. // "region": {
  87289. // "description": "Name of the region for this request.",
  87290. // "location": "path",
  87291. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  87292. // "required": true,
  87293. // "type": "string"
  87294. // },
  87295. // "requestId": {
  87296. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  87297. // "location": "query",
  87298. // "type": "string"
  87299. // },
  87300. // "sourceImage": {
  87301. // "description": "Optional. Source image to restore onto a disk.",
  87302. // "location": "query",
  87303. // "type": "string"
  87304. // }
  87305. // },
  87306. // "path": "{project}/regions/{region}/disks",
  87307. // "request": {
  87308. // "$ref": "Disk"
  87309. // },
  87310. // "response": {
  87311. // "$ref": "Operation"
  87312. // },
  87313. // "scopes": [
  87314. // "https://www.googleapis.com/auth/cloud-platform",
  87315. // "https://www.googleapis.com/auth/compute"
  87316. // ]
  87317. // }
  87318. }
  87319. // method id "compute.regionDisks.list":
  87320. type RegionDisksListCall struct {
  87321. s *Service
  87322. project string
  87323. region string
  87324. urlParams_ gensupport.URLParams
  87325. ifNoneMatch_ string
  87326. ctx_ context.Context
  87327. header_ http.Header
  87328. }
  87329. // List: Retrieves the list of persistent disks contained within the
  87330. // specified region.
  87331. func (r *RegionDisksService) List(project string, region string) *RegionDisksListCall {
  87332. c := &RegionDisksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  87333. c.project = project
  87334. c.region = region
  87335. return c
  87336. }
  87337. // Filter sets the optional parameter "filter": A filter expression that
  87338. // filters resources listed in the response. The expression must specify
  87339. // the field name, a comparison operator, and the value that you want to
  87340. // use for filtering. The value must be a string, a number, or a
  87341. // boolean. The comparison operator must be either =, !=, >, or <.
  87342. //
  87343. // For example, if you are filtering Compute Engine instances, you can
  87344. // exclude instances named example-instance by specifying name !=
  87345. // example-instance.
  87346. //
  87347. // You can also filter nested fields. For example, you could specify
  87348. // scheduling.automaticRestart = false to include instances only if they
  87349. // are not scheduled for automatic restarts. You can use filtering on
  87350. // nested fields to filter based on resource labels.
  87351. //
  87352. // To filter on multiple expressions, provide each separate expression
  87353. // within parentheses. For example, (scheduling.automaticRestart = true)
  87354. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  87355. // AND expression. However, you can include AND and OR expressions
  87356. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  87357. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  87358. // true).
  87359. func (c *RegionDisksListCall) Filter(filter string) *RegionDisksListCall {
  87360. c.urlParams_.Set("filter", filter)
  87361. return c
  87362. }
  87363. // MaxResults sets the optional parameter "maxResults": The maximum
  87364. // number of results per page that should be returned. If the number of
  87365. // available results is larger than maxResults, Compute Engine returns a
  87366. // nextPageToken that can be used to get the next page of results in
  87367. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  87368. // (Default: 500)
  87369. func (c *RegionDisksListCall) MaxResults(maxResults int64) *RegionDisksListCall {
  87370. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  87371. return c
  87372. }
  87373. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  87374. // a certain order. By default, results are returned in alphanumerical
  87375. // order based on the resource name.
  87376. //
  87377. // You can also sort results in descending order based on the creation
  87378. // timestamp using orderBy="creationTimestamp desc". This sorts results
  87379. // based on the creationTimestamp field in reverse chronological order
  87380. // (newest result first). Use this to sort resources like operations so
  87381. // that the newest operation is returned first.
  87382. //
  87383. // Currently, only sorting by name or creationTimestamp desc is
  87384. // supported.
  87385. func (c *RegionDisksListCall) OrderBy(orderBy string) *RegionDisksListCall {
  87386. c.urlParams_.Set("orderBy", orderBy)
  87387. return c
  87388. }
  87389. // PageToken sets the optional parameter "pageToken": Specifies a page
  87390. // token to use. Set pageToken to the nextPageToken returned by a
  87391. // previous list request to get the next page of results.
  87392. func (c *RegionDisksListCall) PageToken(pageToken string) *RegionDisksListCall {
  87393. c.urlParams_.Set("pageToken", pageToken)
  87394. return c
  87395. }
  87396. // Fields allows partial responses to be retrieved. See
  87397. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  87398. // for more information.
  87399. func (c *RegionDisksListCall) Fields(s ...googleapi.Field) *RegionDisksListCall {
  87400. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  87401. return c
  87402. }
  87403. // IfNoneMatch sets the optional parameter which makes the operation
  87404. // fail if the object's ETag matches the given value. This is useful for
  87405. // getting updates only after the object has changed since the last
  87406. // request. Use googleapi.IsNotModified to check whether the response
  87407. // error from Do is the result of In-None-Match.
  87408. func (c *RegionDisksListCall) IfNoneMatch(entityTag string) *RegionDisksListCall {
  87409. c.ifNoneMatch_ = entityTag
  87410. return c
  87411. }
  87412. // Context sets the context to be used in this call's Do method. Any
  87413. // pending HTTP request will be aborted if the provided context is
  87414. // canceled.
  87415. func (c *RegionDisksListCall) Context(ctx context.Context) *RegionDisksListCall {
  87416. c.ctx_ = ctx
  87417. return c
  87418. }
  87419. // Header returns an http.Header that can be modified by the caller to
  87420. // add HTTP headers to the request.
  87421. func (c *RegionDisksListCall) Header() http.Header {
  87422. if c.header_ == nil {
  87423. c.header_ = make(http.Header)
  87424. }
  87425. return c.header_
  87426. }
  87427. func (c *RegionDisksListCall) doRequest(alt string) (*http.Response, error) {
  87428. reqHeaders := make(http.Header)
  87429. for k, v := range c.header_ {
  87430. reqHeaders[k] = v
  87431. }
  87432. reqHeaders.Set("User-Agent", c.s.userAgent())
  87433. if c.ifNoneMatch_ != "" {
  87434. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  87435. }
  87436. var body io.Reader = nil
  87437. c.urlParams_.Set("alt", alt)
  87438. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks")
  87439. urls += "?" + c.urlParams_.Encode()
  87440. req, _ := http.NewRequest("GET", urls, body)
  87441. req.Header = reqHeaders
  87442. googleapi.Expand(req.URL, map[string]string{
  87443. "project": c.project,
  87444. "region": c.region,
  87445. })
  87446. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  87447. }
  87448. // Do executes the "compute.regionDisks.list" call.
  87449. // Exactly one of *DiskList or error will be non-nil. Any non-2xx status
  87450. // code is an error. Response headers are in either
  87451. // *DiskList.ServerResponse.Header or (if a response was returned at
  87452. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  87453. // to check whether the returned error was because
  87454. // http.StatusNotModified was returned.
  87455. func (c *RegionDisksListCall) Do(opts ...googleapi.CallOption) (*DiskList, error) {
  87456. gensupport.SetOptions(c.urlParams_, opts...)
  87457. res, err := c.doRequest("json")
  87458. if res != nil && res.StatusCode == http.StatusNotModified {
  87459. if res.Body != nil {
  87460. res.Body.Close()
  87461. }
  87462. return nil, &googleapi.Error{
  87463. Code: res.StatusCode,
  87464. Header: res.Header,
  87465. }
  87466. }
  87467. if err != nil {
  87468. return nil, err
  87469. }
  87470. defer googleapi.CloseBody(res)
  87471. if err := googleapi.CheckResponse(res); err != nil {
  87472. return nil, err
  87473. }
  87474. ret := &DiskList{
  87475. ServerResponse: googleapi.ServerResponse{
  87476. Header: res.Header,
  87477. HTTPStatusCode: res.StatusCode,
  87478. },
  87479. }
  87480. target := &ret
  87481. if err := gensupport.DecodeResponse(target, res); err != nil {
  87482. return nil, err
  87483. }
  87484. return ret, nil
  87485. // {
  87486. // "description": "Retrieves the list of persistent disks contained within the specified region.",
  87487. // "httpMethod": "GET",
  87488. // "id": "compute.regionDisks.list",
  87489. // "parameterOrder": [
  87490. // "project",
  87491. // "region"
  87492. // ],
  87493. // "parameters": {
  87494. // "filter": {
  87495. // "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).",
  87496. // "location": "query",
  87497. // "type": "string"
  87498. // },
  87499. // "maxResults": {
  87500. // "default": "500",
  87501. // "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)",
  87502. // "format": "uint32",
  87503. // "location": "query",
  87504. // "minimum": "0",
  87505. // "type": "integer"
  87506. // },
  87507. // "orderBy": {
  87508. // "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.",
  87509. // "location": "query",
  87510. // "type": "string"
  87511. // },
  87512. // "pageToken": {
  87513. // "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.",
  87514. // "location": "query",
  87515. // "type": "string"
  87516. // },
  87517. // "project": {
  87518. // "description": "Project ID for this request.",
  87519. // "location": "path",
  87520. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  87521. // "required": true,
  87522. // "type": "string"
  87523. // },
  87524. // "region": {
  87525. // "description": "Name of the region for this request.",
  87526. // "location": "path",
  87527. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  87528. // "required": true,
  87529. // "type": "string"
  87530. // }
  87531. // },
  87532. // "path": "{project}/regions/{region}/disks",
  87533. // "response": {
  87534. // "$ref": "DiskList"
  87535. // },
  87536. // "scopes": [
  87537. // "https://www.googleapis.com/auth/cloud-platform",
  87538. // "https://www.googleapis.com/auth/compute",
  87539. // "https://www.googleapis.com/auth/compute.readonly"
  87540. // ]
  87541. // }
  87542. }
  87543. // Pages invokes f for each page of results.
  87544. // A non-nil error returned from f will halt the iteration.
  87545. // The provided context supersedes any context provided to the Context method.
  87546. func (c *RegionDisksListCall) Pages(ctx context.Context, f func(*DiskList) error) error {
  87547. c.ctx_ = ctx
  87548. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  87549. for {
  87550. x, err := c.Do()
  87551. if err != nil {
  87552. return err
  87553. }
  87554. if err := f(x); err != nil {
  87555. return err
  87556. }
  87557. if x.NextPageToken == "" {
  87558. return nil
  87559. }
  87560. c.PageToken(x.NextPageToken)
  87561. }
  87562. }
  87563. // method id "compute.regionDisks.resize":
  87564. type RegionDisksResizeCall struct {
  87565. s *Service
  87566. project string
  87567. region string
  87568. disk string
  87569. regiondisksresizerequest *RegionDisksResizeRequest
  87570. urlParams_ gensupport.URLParams
  87571. ctx_ context.Context
  87572. header_ http.Header
  87573. }
  87574. // Resize: Resizes the specified regional persistent disk.
  87575. func (r *RegionDisksService) Resize(project string, region string, disk string, regiondisksresizerequest *RegionDisksResizeRequest) *RegionDisksResizeCall {
  87576. c := &RegionDisksResizeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  87577. c.project = project
  87578. c.region = region
  87579. c.disk = disk
  87580. c.regiondisksresizerequest = regiondisksresizerequest
  87581. return c
  87582. }
  87583. // RequestId sets the optional parameter "requestId": An optional
  87584. // request ID to identify requests. Specify a unique request ID so that
  87585. // if you must retry your request, the server will know to ignore the
  87586. // request if it has already been completed.
  87587. //
  87588. // For example, consider a situation where you make an initial request
  87589. // and the request times out. If you make the request again with the
  87590. // same request ID, the server can check if original operation with the
  87591. // same request ID was received, and if so, will ignore the second
  87592. // request. This prevents clients from accidentally creating duplicate
  87593. // commitments.
  87594. //
  87595. // The request ID must be a valid UUID with the exception that zero UUID
  87596. // is not supported (00000000-0000-0000-0000-000000000000).
  87597. func (c *RegionDisksResizeCall) RequestId(requestId string) *RegionDisksResizeCall {
  87598. c.urlParams_.Set("requestId", requestId)
  87599. return c
  87600. }
  87601. // Fields allows partial responses to be retrieved. See
  87602. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  87603. // for more information.
  87604. func (c *RegionDisksResizeCall) Fields(s ...googleapi.Field) *RegionDisksResizeCall {
  87605. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  87606. return c
  87607. }
  87608. // Context sets the context to be used in this call's Do method. Any
  87609. // pending HTTP request will be aborted if the provided context is
  87610. // canceled.
  87611. func (c *RegionDisksResizeCall) Context(ctx context.Context) *RegionDisksResizeCall {
  87612. c.ctx_ = ctx
  87613. return c
  87614. }
  87615. // Header returns an http.Header that can be modified by the caller to
  87616. // add HTTP headers to the request.
  87617. func (c *RegionDisksResizeCall) Header() http.Header {
  87618. if c.header_ == nil {
  87619. c.header_ = make(http.Header)
  87620. }
  87621. return c.header_
  87622. }
  87623. func (c *RegionDisksResizeCall) doRequest(alt string) (*http.Response, error) {
  87624. reqHeaders := make(http.Header)
  87625. for k, v := range c.header_ {
  87626. reqHeaders[k] = v
  87627. }
  87628. reqHeaders.Set("User-Agent", c.s.userAgent())
  87629. var body io.Reader = nil
  87630. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regiondisksresizerequest)
  87631. if err != nil {
  87632. return nil, err
  87633. }
  87634. reqHeaders.Set("Content-Type", "application/json")
  87635. c.urlParams_.Set("alt", alt)
  87636. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{disk}/resize")
  87637. urls += "?" + c.urlParams_.Encode()
  87638. req, _ := http.NewRequest("POST", urls, body)
  87639. req.Header = reqHeaders
  87640. googleapi.Expand(req.URL, map[string]string{
  87641. "project": c.project,
  87642. "region": c.region,
  87643. "disk": c.disk,
  87644. })
  87645. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  87646. }
  87647. // Do executes the "compute.regionDisks.resize" call.
  87648. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  87649. // status code is an error. Response headers are in either
  87650. // *Operation.ServerResponse.Header or (if a response was returned at
  87651. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  87652. // to check whether the returned error was because
  87653. // http.StatusNotModified was returned.
  87654. func (c *RegionDisksResizeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  87655. gensupport.SetOptions(c.urlParams_, opts...)
  87656. res, err := c.doRequest("json")
  87657. if res != nil && res.StatusCode == http.StatusNotModified {
  87658. if res.Body != nil {
  87659. res.Body.Close()
  87660. }
  87661. return nil, &googleapi.Error{
  87662. Code: res.StatusCode,
  87663. Header: res.Header,
  87664. }
  87665. }
  87666. if err != nil {
  87667. return nil, err
  87668. }
  87669. defer googleapi.CloseBody(res)
  87670. if err := googleapi.CheckResponse(res); err != nil {
  87671. return nil, err
  87672. }
  87673. ret := &Operation{
  87674. ServerResponse: googleapi.ServerResponse{
  87675. Header: res.Header,
  87676. HTTPStatusCode: res.StatusCode,
  87677. },
  87678. }
  87679. target := &ret
  87680. if err := gensupport.DecodeResponse(target, res); err != nil {
  87681. return nil, err
  87682. }
  87683. return ret, nil
  87684. // {
  87685. // "description": "Resizes the specified regional persistent disk.",
  87686. // "httpMethod": "POST",
  87687. // "id": "compute.regionDisks.resize",
  87688. // "parameterOrder": [
  87689. // "project",
  87690. // "region",
  87691. // "disk"
  87692. // ],
  87693. // "parameters": {
  87694. // "disk": {
  87695. // "description": "Name of the regional persistent disk.",
  87696. // "location": "path",
  87697. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  87698. // "required": true,
  87699. // "type": "string"
  87700. // },
  87701. // "project": {
  87702. // "description": "The project ID for this request.",
  87703. // "location": "path",
  87704. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  87705. // "required": true,
  87706. // "type": "string"
  87707. // },
  87708. // "region": {
  87709. // "description": "Name of the region for this request.",
  87710. // "location": "path",
  87711. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  87712. // "required": true,
  87713. // "type": "string"
  87714. // },
  87715. // "requestId": {
  87716. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  87717. // "location": "query",
  87718. // "type": "string"
  87719. // }
  87720. // },
  87721. // "path": "{project}/regions/{region}/disks/{disk}/resize",
  87722. // "request": {
  87723. // "$ref": "RegionDisksResizeRequest"
  87724. // },
  87725. // "response": {
  87726. // "$ref": "Operation"
  87727. // },
  87728. // "scopes": [
  87729. // "https://www.googleapis.com/auth/cloud-platform",
  87730. // "https://www.googleapis.com/auth/compute"
  87731. // ]
  87732. // }
  87733. }
  87734. // method id "compute.regionDisks.setLabels":
  87735. type RegionDisksSetLabelsCall struct {
  87736. s *Service
  87737. project string
  87738. region string
  87739. resource string
  87740. regionsetlabelsrequest *RegionSetLabelsRequest
  87741. urlParams_ gensupport.URLParams
  87742. ctx_ context.Context
  87743. header_ http.Header
  87744. }
  87745. // SetLabels: Sets the labels on the target regional disk.
  87746. func (r *RegionDisksService) SetLabels(project string, region string, resource string, regionsetlabelsrequest *RegionSetLabelsRequest) *RegionDisksSetLabelsCall {
  87747. c := &RegionDisksSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  87748. c.project = project
  87749. c.region = region
  87750. c.resource = resource
  87751. c.regionsetlabelsrequest = regionsetlabelsrequest
  87752. return c
  87753. }
  87754. // RequestId sets the optional parameter "requestId": An optional
  87755. // request ID to identify requests. Specify a unique request ID so that
  87756. // if you must retry your request, the server will know to ignore the
  87757. // request if it has already been completed.
  87758. //
  87759. // For example, consider a situation where you make an initial request
  87760. // and the request times out. If you make the request again with the
  87761. // same request ID, the server can check if original operation with the
  87762. // same request ID was received, and if so, will ignore the second
  87763. // request. This prevents clients from accidentally creating duplicate
  87764. // commitments.
  87765. //
  87766. // The request ID must be a valid UUID with the exception that zero UUID
  87767. // is not supported (00000000-0000-0000-0000-000000000000).
  87768. func (c *RegionDisksSetLabelsCall) RequestId(requestId string) *RegionDisksSetLabelsCall {
  87769. c.urlParams_.Set("requestId", requestId)
  87770. return c
  87771. }
  87772. // Fields allows partial responses to be retrieved. See
  87773. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  87774. // for more information.
  87775. func (c *RegionDisksSetLabelsCall) Fields(s ...googleapi.Field) *RegionDisksSetLabelsCall {
  87776. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  87777. return c
  87778. }
  87779. // Context sets the context to be used in this call's Do method. Any
  87780. // pending HTTP request will be aborted if the provided context is
  87781. // canceled.
  87782. func (c *RegionDisksSetLabelsCall) Context(ctx context.Context) *RegionDisksSetLabelsCall {
  87783. c.ctx_ = ctx
  87784. return c
  87785. }
  87786. // Header returns an http.Header that can be modified by the caller to
  87787. // add HTTP headers to the request.
  87788. func (c *RegionDisksSetLabelsCall) Header() http.Header {
  87789. if c.header_ == nil {
  87790. c.header_ = make(http.Header)
  87791. }
  87792. return c.header_
  87793. }
  87794. func (c *RegionDisksSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  87795. reqHeaders := make(http.Header)
  87796. for k, v := range c.header_ {
  87797. reqHeaders[k] = v
  87798. }
  87799. reqHeaders.Set("User-Agent", c.s.userAgent())
  87800. var body io.Reader = nil
  87801. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest)
  87802. if err != nil {
  87803. return nil, err
  87804. }
  87805. reqHeaders.Set("Content-Type", "application/json")
  87806. c.urlParams_.Set("alt", alt)
  87807. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{resource}/setLabels")
  87808. urls += "?" + c.urlParams_.Encode()
  87809. req, _ := http.NewRequest("POST", urls, body)
  87810. req.Header = reqHeaders
  87811. googleapi.Expand(req.URL, map[string]string{
  87812. "project": c.project,
  87813. "region": c.region,
  87814. "resource": c.resource,
  87815. })
  87816. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  87817. }
  87818. // Do executes the "compute.regionDisks.setLabels" call.
  87819. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  87820. // status code is an error. Response headers are in either
  87821. // *Operation.ServerResponse.Header or (if a response was returned at
  87822. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  87823. // to check whether the returned error was because
  87824. // http.StatusNotModified was returned.
  87825. func (c *RegionDisksSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  87826. gensupport.SetOptions(c.urlParams_, opts...)
  87827. res, err := c.doRequest("json")
  87828. if res != nil && res.StatusCode == http.StatusNotModified {
  87829. if res.Body != nil {
  87830. res.Body.Close()
  87831. }
  87832. return nil, &googleapi.Error{
  87833. Code: res.StatusCode,
  87834. Header: res.Header,
  87835. }
  87836. }
  87837. if err != nil {
  87838. return nil, err
  87839. }
  87840. defer googleapi.CloseBody(res)
  87841. if err := googleapi.CheckResponse(res); err != nil {
  87842. return nil, err
  87843. }
  87844. ret := &Operation{
  87845. ServerResponse: googleapi.ServerResponse{
  87846. Header: res.Header,
  87847. HTTPStatusCode: res.StatusCode,
  87848. },
  87849. }
  87850. target := &ret
  87851. if err := gensupport.DecodeResponse(target, res); err != nil {
  87852. return nil, err
  87853. }
  87854. return ret, nil
  87855. // {
  87856. // "description": "Sets the labels on the target regional disk.",
  87857. // "httpMethod": "POST",
  87858. // "id": "compute.regionDisks.setLabels",
  87859. // "parameterOrder": [
  87860. // "project",
  87861. // "region",
  87862. // "resource"
  87863. // ],
  87864. // "parameters": {
  87865. // "project": {
  87866. // "description": "Project ID for this request.",
  87867. // "location": "path",
  87868. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  87869. // "required": true,
  87870. // "type": "string"
  87871. // },
  87872. // "region": {
  87873. // "description": "The region for this request.",
  87874. // "location": "path",
  87875. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  87876. // "required": true,
  87877. // "type": "string"
  87878. // },
  87879. // "requestId": {
  87880. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  87881. // "location": "query",
  87882. // "type": "string"
  87883. // },
  87884. // "resource": {
  87885. // "description": "Name of the resource for this request.",
  87886. // "location": "path",
  87887. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  87888. // "required": true,
  87889. // "type": "string"
  87890. // }
  87891. // },
  87892. // "path": "{project}/regions/{region}/disks/{resource}/setLabels",
  87893. // "request": {
  87894. // "$ref": "RegionSetLabelsRequest"
  87895. // },
  87896. // "response": {
  87897. // "$ref": "Operation"
  87898. // },
  87899. // "scopes": [
  87900. // "https://www.googleapis.com/auth/cloud-platform",
  87901. // "https://www.googleapis.com/auth/compute"
  87902. // ]
  87903. // }
  87904. }
  87905. // method id "compute.regionDisks.testIamPermissions":
  87906. type RegionDisksTestIamPermissionsCall struct {
  87907. s *Service
  87908. project string
  87909. region string
  87910. resource string
  87911. testpermissionsrequest *TestPermissionsRequest
  87912. urlParams_ gensupport.URLParams
  87913. ctx_ context.Context
  87914. header_ http.Header
  87915. }
  87916. // TestIamPermissions: Returns permissions that a caller has on the
  87917. // specified resource.
  87918. func (r *RegionDisksService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionDisksTestIamPermissionsCall {
  87919. c := &RegionDisksTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  87920. c.project = project
  87921. c.region = region
  87922. c.resource = resource
  87923. c.testpermissionsrequest = testpermissionsrequest
  87924. return c
  87925. }
  87926. // Fields allows partial responses to be retrieved. See
  87927. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  87928. // for more information.
  87929. func (c *RegionDisksTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionDisksTestIamPermissionsCall {
  87930. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  87931. return c
  87932. }
  87933. // Context sets the context to be used in this call's Do method. Any
  87934. // pending HTTP request will be aborted if the provided context is
  87935. // canceled.
  87936. func (c *RegionDisksTestIamPermissionsCall) Context(ctx context.Context) *RegionDisksTestIamPermissionsCall {
  87937. c.ctx_ = ctx
  87938. return c
  87939. }
  87940. // Header returns an http.Header that can be modified by the caller to
  87941. // add HTTP headers to the request.
  87942. func (c *RegionDisksTestIamPermissionsCall) Header() http.Header {
  87943. if c.header_ == nil {
  87944. c.header_ = make(http.Header)
  87945. }
  87946. return c.header_
  87947. }
  87948. func (c *RegionDisksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  87949. reqHeaders := make(http.Header)
  87950. for k, v := range c.header_ {
  87951. reqHeaders[k] = v
  87952. }
  87953. reqHeaders.Set("User-Agent", c.s.userAgent())
  87954. var body io.Reader = nil
  87955. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  87956. if err != nil {
  87957. return nil, err
  87958. }
  87959. reqHeaders.Set("Content-Type", "application/json")
  87960. c.urlParams_.Set("alt", alt)
  87961. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{resource}/testIamPermissions")
  87962. urls += "?" + c.urlParams_.Encode()
  87963. req, _ := http.NewRequest("POST", urls, body)
  87964. req.Header = reqHeaders
  87965. googleapi.Expand(req.URL, map[string]string{
  87966. "project": c.project,
  87967. "region": c.region,
  87968. "resource": c.resource,
  87969. })
  87970. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  87971. }
  87972. // Do executes the "compute.regionDisks.testIamPermissions" call.
  87973. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  87974. // non-2xx status code is an error. Response headers are in either
  87975. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  87976. // returned at all) in error.(*googleapi.Error).Header. Use
  87977. // googleapi.IsNotModified to check whether the returned error was
  87978. // because http.StatusNotModified was returned.
  87979. func (c *RegionDisksTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  87980. gensupport.SetOptions(c.urlParams_, opts...)
  87981. res, err := c.doRequest("json")
  87982. if res != nil && res.StatusCode == http.StatusNotModified {
  87983. if res.Body != nil {
  87984. res.Body.Close()
  87985. }
  87986. return nil, &googleapi.Error{
  87987. Code: res.StatusCode,
  87988. Header: res.Header,
  87989. }
  87990. }
  87991. if err != nil {
  87992. return nil, err
  87993. }
  87994. defer googleapi.CloseBody(res)
  87995. if err := googleapi.CheckResponse(res); err != nil {
  87996. return nil, err
  87997. }
  87998. ret := &TestPermissionsResponse{
  87999. ServerResponse: googleapi.ServerResponse{
  88000. Header: res.Header,
  88001. HTTPStatusCode: res.StatusCode,
  88002. },
  88003. }
  88004. target := &ret
  88005. if err := gensupport.DecodeResponse(target, res); err != nil {
  88006. return nil, err
  88007. }
  88008. return ret, nil
  88009. // {
  88010. // "description": "Returns permissions that a caller has on the specified resource.",
  88011. // "httpMethod": "POST",
  88012. // "id": "compute.regionDisks.testIamPermissions",
  88013. // "parameterOrder": [
  88014. // "project",
  88015. // "region",
  88016. // "resource"
  88017. // ],
  88018. // "parameters": {
  88019. // "project": {
  88020. // "description": "Project ID for this request.",
  88021. // "location": "path",
  88022. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  88023. // "required": true,
  88024. // "type": "string"
  88025. // },
  88026. // "region": {
  88027. // "description": "The name of the region for this request.",
  88028. // "location": "path",
  88029. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  88030. // "required": true,
  88031. // "type": "string"
  88032. // },
  88033. // "resource": {
  88034. // "description": "Name of the resource for this request.",
  88035. // "location": "path",
  88036. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  88037. // "required": true,
  88038. // "type": "string"
  88039. // }
  88040. // },
  88041. // "path": "{project}/regions/{region}/disks/{resource}/testIamPermissions",
  88042. // "request": {
  88043. // "$ref": "TestPermissionsRequest"
  88044. // },
  88045. // "response": {
  88046. // "$ref": "TestPermissionsResponse"
  88047. // },
  88048. // "scopes": [
  88049. // "https://www.googleapis.com/auth/cloud-platform",
  88050. // "https://www.googleapis.com/auth/compute",
  88051. // "https://www.googleapis.com/auth/compute.readonly"
  88052. // ]
  88053. // }
  88054. }
  88055. // method id "compute.regionHealthChecks.delete":
  88056. type RegionHealthChecksDeleteCall struct {
  88057. s *Service
  88058. project string
  88059. region string
  88060. healthCheck string
  88061. urlParams_ gensupport.URLParams
  88062. ctx_ context.Context
  88063. header_ http.Header
  88064. }
  88065. // Delete: Deletes the specified HealthCheck resource.
  88066. func (r *RegionHealthChecksService) Delete(project string, region string, healthCheck string) *RegionHealthChecksDeleteCall {
  88067. c := &RegionHealthChecksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  88068. c.project = project
  88069. c.region = region
  88070. c.healthCheck = healthCheck
  88071. return c
  88072. }
  88073. // RequestId sets the optional parameter "requestId": An optional
  88074. // request ID to identify requests. Specify a unique request ID so that
  88075. // if you must retry your request, the server will know to ignore the
  88076. // request if it has already been completed.
  88077. //
  88078. // For example, consider a situation where you make an initial request
  88079. // and the request times out. If you make the request again with the
  88080. // same request ID, the server can check if original operation with the
  88081. // same request ID was received, and if so, will ignore the second
  88082. // request. This prevents clients from accidentally creating duplicate
  88083. // commitments.
  88084. //
  88085. // The request ID must be a valid UUID with the exception that zero UUID
  88086. // is not supported (00000000-0000-0000-0000-000000000000).
  88087. func (c *RegionHealthChecksDeleteCall) RequestId(requestId string) *RegionHealthChecksDeleteCall {
  88088. c.urlParams_.Set("requestId", requestId)
  88089. return c
  88090. }
  88091. // Fields allows partial responses to be retrieved. See
  88092. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  88093. // for more information.
  88094. func (c *RegionHealthChecksDeleteCall) Fields(s ...googleapi.Field) *RegionHealthChecksDeleteCall {
  88095. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  88096. return c
  88097. }
  88098. // Context sets the context to be used in this call's Do method. Any
  88099. // pending HTTP request will be aborted if the provided context is
  88100. // canceled.
  88101. func (c *RegionHealthChecksDeleteCall) Context(ctx context.Context) *RegionHealthChecksDeleteCall {
  88102. c.ctx_ = ctx
  88103. return c
  88104. }
  88105. // Header returns an http.Header that can be modified by the caller to
  88106. // add HTTP headers to the request.
  88107. func (c *RegionHealthChecksDeleteCall) Header() http.Header {
  88108. if c.header_ == nil {
  88109. c.header_ = make(http.Header)
  88110. }
  88111. return c.header_
  88112. }
  88113. func (c *RegionHealthChecksDeleteCall) doRequest(alt string) (*http.Response, error) {
  88114. reqHeaders := make(http.Header)
  88115. for k, v := range c.header_ {
  88116. reqHeaders[k] = v
  88117. }
  88118. reqHeaders.Set("User-Agent", c.s.userAgent())
  88119. var body io.Reader = nil
  88120. c.urlParams_.Set("alt", alt)
  88121. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/healthChecks/{healthCheck}")
  88122. urls += "?" + c.urlParams_.Encode()
  88123. req, _ := http.NewRequest("DELETE", urls, body)
  88124. req.Header = reqHeaders
  88125. googleapi.Expand(req.URL, map[string]string{
  88126. "project": c.project,
  88127. "region": c.region,
  88128. "healthCheck": c.healthCheck,
  88129. })
  88130. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  88131. }
  88132. // Do executes the "compute.regionHealthChecks.delete" call.
  88133. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  88134. // status code is an error. Response headers are in either
  88135. // *Operation.ServerResponse.Header or (if a response was returned at
  88136. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  88137. // to check whether the returned error was because
  88138. // http.StatusNotModified was returned.
  88139. func (c *RegionHealthChecksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  88140. gensupport.SetOptions(c.urlParams_, opts...)
  88141. res, err := c.doRequest("json")
  88142. if res != nil && res.StatusCode == http.StatusNotModified {
  88143. if res.Body != nil {
  88144. res.Body.Close()
  88145. }
  88146. return nil, &googleapi.Error{
  88147. Code: res.StatusCode,
  88148. Header: res.Header,
  88149. }
  88150. }
  88151. if err != nil {
  88152. return nil, err
  88153. }
  88154. defer googleapi.CloseBody(res)
  88155. if err := googleapi.CheckResponse(res); err != nil {
  88156. return nil, err
  88157. }
  88158. ret := &Operation{
  88159. ServerResponse: googleapi.ServerResponse{
  88160. Header: res.Header,
  88161. HTTPStatusCode: res.StatusCode,
  88162. },
  88163. }
  88164. target := &ret
  88165. if err := gensupport.DecodeResponse(target, res); err != nil {
  88166. return nil, err
  88167. }
  88168. return ret, nil
  88169. // {
  88170. // "description": "Deletes the specified HealthCheck resource.",
  88171. // "httpMethod": "DELETE",
  88172. // "id": "compute.regionHealthChecks.delete",
  88173. // "parameterOrder": [
  88174. // "project",
  88175. // "region",
  88176. // "healthCheck"
  88177. // ],
  88178. // "parameters": {
  88179. // "healthCheck": {
  88180. // "description": "Name of the HealthCheck resource to delete.",
  88181. // "location": "path",
  88182. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  88183. // "required": true,
  88184. // "type": "string"
  88185. // },
  88186. // "project": {
  88187. // "description": "Project ID for this request.",
  88188. // "location": "path",
  88189. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  88190. // "required": true,
  88191. // "type": "string"
  88192. // },
  88193. // "region": {
  88194. // "description": "Name of the region scoping this request.",
  88195. // "location": "path",
  88196. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  88197. // "required": true,
  88198. // "type": "string"
  88199. // },
  88200. // "requestId": {
  88201. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  88202. // "location": "query",
  88203. // "type": "string"
  88204. // }
  88205. // },
  88206. // "path": "{project}/regions/{region}/healthChecks/{healthCheck}",
  88207. // "response": {
  88208. // "$ref": "Operation"
  88209. // },
  88210. // "scopes": [
  88211. // "https://www.googleapis.com/auth/cloud-platform",
  88212. // "https://www.googleapis.com/auth/compute"
  88213. // ]
  88214. // }
  88215. }
  88216. // method id "compute.regionHealthChecks.get":
  88217. type RegionHealthChecksGetCall struct {
  88218. s *Service
  88219. project string
  88220. region string
  88221. healthCheck string
  88222. urlParams_ gensupport.URLParams
  88223. ifNoneMatch_ string
  88224. ctx_ context.Context
  88225. header_ http.Header
  88226. }
  88227. // Get: Returns the specified HealthCheck resource. Gets a list of
  88228. // available health checks by making a list() request.
  88229. func (r *RegionHealthChecksService) Get(project string, region string, healthCheck string) *RegionHealthChecksGetCall {
  88230. c := &RegionHealthChecksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  88231. c.project = project
  88232. c.region = region
  88233. c.healthCheck = healthCheck
  88234. return c
  88235. }
  88236. // Fields allows partial responses to be retrieved. See
  88237. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  88238. // for more information.
  88239. func (c *RegionHealthChecksGetCall) Fields(s ...googleapi.Field) *RegionHealthChecksGetCall {
  88240. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  88241. return c
  88242. }
  88243. // IfNoneMatch sets the optional parameter which makes the operation
  88244. // fail if the object's ETag matches the given value. This is useful for
  88245. // getting updates only after the object has changed since the last
  88246. // request. Use googleapi.IsNotModified to check whether the response
  88247. // error from Do is the result of In-None-Match.
  88248. func (c *RegionHealthChecksGetCall) IfNoneMatch(entityTag string) *RegionHealthChecksGetCall {
  88249. c.ifNoneMatch_ = entityTag
  88250. return c
  88251. }
  88252. // Context sets the context to be used in this call's Do method. Any
  88253. // pending HTTP request will be aborted if the provided context is
  88254. // canceled.
  88255. func (c *RegionHealthChecksGetCall) Context(ctx context.Context) *RegionHealthChecksGetCall {
  88256. c.ctx_ = ctx
  88257. return c
  88258. }
  88259. // Header returns an http.Header that can be modified by the caller to
  88260. // add HTTP headers to the request.
  88261. func (c *RegionHealthChecksGetCall) Header() http.Header {
  88262. if c.header_ == nil {
  88263. c.header_ = make(http.Header)
  88264. }
  88265. return c.header_
  88266. }
  88267. func (c *RegionHealthChecksGetCall) doRequest(alt string) (*http.Response, error) {
  88268. reqHeaders := make(http.Header)
  88269. for k, v := range c.header_ {
  88270. reqHeaders[k] = v
  88271. }
  88272. reqHeaders.Set("User-Agent", c.s.userAgent())
  88273. if c.ifNoneMatch_ != "" {
  88274. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  88275. }
  88276. var body io.Reader = nil
  88277. c.urlParams_.Set("alt", alt)
  88278. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/healthChecks/{healthCheck}")
  88279. urls += "?" + c.urlParams_.Encode()
  88280. req, _ := http.NewRequest("GET", urls, body)
  88281. req.Header = reqHeaders
  88282. googleapi.Expand(req.URL, map[string]string{
  88283. "project": c.project,
  88284. "region": c.region,
  88285. "healthCheck": c.healthCheck,
  88286. })
  88287. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  88288. }
  88289. // Do executes the "compute.regionHealthChecks.get" call.
  88290. // Exactly one of *HealthCheck or error will be non-nil. Any non-2xx
  88291. // status code is an error. Response headers are in either
  88292. // *HealthCheck.ServerResponse.Header or (if a response was returned at
  88293. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  88294. // to check whether the returned error was because
  88295. // http.StatusNotModified was returned.
  88296. func (c *RegionHealthChecksGetCall) Do(opts ...googleapi.CallOption) (*HealthCheck, error) {
  88297. gensupport.SetOptions(c.urlParams_, opts...)
  88298. res, err := c.doRequest("json")
  88299. if res != nil && res.StatusCode == http.StatusNotModified {
  88300. if res.Body != nil {
  88301. res.Body.Close()
  88302. }
  88303. return nil, &googleapi.Error{
  88304. Code: res.StatusCode,
  88305. Header: res.Header,
  88306. }
  88307. }
  88308. if err != nil {
  88309. return nil, err
  88310. }
  88311. defer googleapi.CloseBody(res)
  88312. if err := googleapi.CheckResponse(res); err != nil {
  88313. return nil, err
  88314. }
  88315. ret := &HealthCheck{
  88316. ServerResponse: googleapi.ServerResponse{
  88317. Header: res.Header,
  88318. HTTPStatusCode: res.StatusCode,
  88319. },
  88320. }
  88321. target := &ret
  88322. if err := gensupport.DecodeResponse(target, res); err != nil {
  88323. return nil, err
  88324. }
  88325. return ret, nil
  88326. // {
  88327. // "description": "Returns the specified HealthCheck resource. Gets a list of available health checks by making a list() request.",
  88328. // "httpMethod": "GET",
  88329. // "id": "compute.regionHealthChecks.get",
  88330. // "parameterOrder": [
  88331. // "project",
  88332. // "region",
  88333. // "healthCheck"
  88334. // ],
  88335. // "parameters": {
  88336. // "healthCheck": {
  88337. // "description": "Name of the HealthCheck resource to return.",
  88338. // "location": "path",
  88339. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  88340. // "required": true,
  88341. // "type": "string"
  88342. // },
  88343. // "project": {
  88344. // "description": "Project ID for this request.",
  88345. // "location": "path",
  88346. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  88347. // "required": true,
  88348. // "type": "string"
  88349. // },
  88350. // "region": {
  88351. // "description": "Name of the region scoping this request.",
  88352. // "location": "path",
  88353. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  88354. // "required": true,
  88355. // "type": "string"
  88356. // }
  88357. // },
  88358. // "path": "{project}/regions/{region}/healthChecks/{healthCheck}",
  88359. // "response": {
  88360. // "$ref": "HealthCheck"
  88361. // },
  88362. // "scopes": [
  88363. // "https://www.googleapis.com/auth/cloud-platform",
  88364. // "https://www.googleapis.com/auth/compute",
  88365. // "https://www.googleapis.com/auth/compute.readonly"
  88366. // ]
  88367. // }
  88368. }
  88369. // method id "compute.regionHealthChecks.insert":
  88370. type RegionHealthChecksInsertCall struct {
  88371. s *Service
  88372. project string
  88373. region string
  88374. healthcheck *HealthCheck
  88375. urlParams_ gensupport.URLParams
  88376. ctx_ context.Context
  88377. header_ http.Header
  88378. }
  88379. // Insert: Creates a HealthCheck resource in the specified project using
  88380. // the data included in the request.
  88381. func (r *RegionHealthChecksService) Insert(project string, region string, healthcheck *HealthCheck) *RegionHealthChecksInsertCall {
  88382. c := &RegionHealthChecksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  88383. c.project = project
  88384. c.region = region
  88385. c.healthcheck = healthcheck
  88386. return c
  88387. }
  88388. // RequestId sets the optional parameter "requestId": An optional
  88389. // request ID to identify requests. Specify a unique request ID so that
  88390. // if you must retry your request, the server will know to ignore the
  88391. // request if it has already been completed.
  88392. //
  88393. // For example, consider a situation where you make an initial request
  88394. // and the request times out. If you make the request again with the
  88395. // same request ID, the server can check if original operation with the
  88396. // same request ID was received, and if so, will ignore the second
  88397. // request. This prevents clients from accidentally creating duplicate
  88398. // commitments.
  88399. //
  88400. // The request ID must be a valid UUID with the exception that zero UUID
  88401. // is not supported (00000000-0000-0000-0000-000000000000).
  88402. func (c *RegionHealthChecksInsertCall) RequestId(requestId string) *RegionHealthChecksInsertCall {
  88403. c.urlParams_.Set("requestId", requestId)
  88404. return c
  88405. }
  88406. // Fields allows partial responses to be retrieved. See
  88407. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  88408. // for more information.
  88409. func (c *RegionHealthChecksInsertCall) Fields(s ...googleapi.Field) *RegionHealthChecksInsertCall {
  88410. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  88411. return c
  88412. }
  88413. // Context sets the context to be used in this call's Do method. Any
  88414. // pending HTTP request will be aborted if the provided context is
  88415. // canceled.
  88416. func (c *RegionHealthChecksInsertCall) Context(ctx context.Context) *RegionHealthChecksInsertCall {
  88417. c.ctx_ = ctx
  88418. return c
  88419. }
  88420. // Header returns an http.Header that can be modified by the caller to
  88421. // add HTTP headers to the request.
  88422. func (c *RegionHealthChecksInsertCall) Header() http.Header {
  88423. if c.header_ == nil {
  88424. c.header_ = make(http.Header)
  88425. }
  88426. return c.header_
  88427. }
  88428. func (c *RegionHealthChecksInsertCall) doRequest(alt string) (*http.Response, error) {
  88429. reqHeaders := make(http.Header)
  88430. for k, v := range c.header_ {
  88431. reqHeaders[k] = v
  88432. }
  88433. reqHeaders.Set("User-Agent", c.s.userAgent())
  88434. var body io.Reader = nil
  88435. body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck)
  88436. if err != nil {
  88437. return nil, err
  88438. }
  88439. reqHeaders.Set("Content-Type", "application/json")
  88440. c.urlParams_.Set("alt", alt)
  88441. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/healthChecks")
  88442. urls += "?" + c.urlParams_.Encode()
  88443. req, _ := http.NewRequest("POST", urls, body)
  88444. req.Header = reqHeaders
  88445. googleapi.Expand(req.URL, map[string]string{
  88446. "project": c.project,
  88447. "region": c.region,
  88448. })
  88449. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  88450. }
  88451. // Do executes the "compute.regionHealthChecks.insert" call.
  88452. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  88453. // status code is an error. Response headers are in either
  88454. // *Operation.ServerResponse.Header or (if a response was returned at
  88455. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  88456. // to check whether the returned error was because
  88457. // http.StatusNotModified was returned.
  88458. func (c *RegionHealthChecksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  88459. gensupport.SetOptions(c.urlParams_, opts...)
  88460. res, err := c.doRequest("json")
  88461. if res != nil && res.StatusCode == http.StatusNotModified {
  88462. if res.Body != nil {
  88463. res.Body.Close()
  88464. }
  88465. return nil, &googleapi.Error{
  88466. Code: res.StatusCode,
  88467. Header: res.Header,
  88468. }
  88469. }
  88470. if err != nil {
  88471. return nil, err
  88472. }
  88473. defer googleapi.CloseBody(res)
  88474. if err := googleapi.CheckResponse(res); err != nil {
  88475. return nil, err
  88476. }
  88477. ret := &Operation{
  88478. ServerResponse: googleapi.ServerResponse{
  88479. Header: res.Header,
  88480. HTTPStatusCode: res.StatusCode,
  88481. },
  88482. }
  88483. target := &ret
  88484. if err := gensupport.DecodeResponse(target, res); err != nil {
  88485. return nil, err
  88486. }
  88487. return ret, nil
  88488. // {
  88489. // "description": "Creates a HealthCheck resource in the specified project using the data included in the request.",
  88490. // "httpMethod": "POST",
  88491. // "id": "compute.regionHealthChecks.insert",
  88492. // "parameterOrder": [
  88493. // "project",
  88494. // "region"
  88495. // ],
  88496. // "parameters": {
  88497. // "project": {
  88498. // "description": "Project ID for this request.",
  88499. // "location": "path",
  88500. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  88501. // "required": true,
  88502. // "type": "string"
  88503. // },
  88504. // "region": {
  88505. // "description": "Name of the region scoping this request.",
  88506. // "location": "path",
  88507. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  88508. // "required": true,
  88509. // "type": "string"
  88510. // },
  88511. // "requestId": {
  88512. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  88513. // "location": "query",
  88514. // "type": "string"
  88515. // }
  88516. // },
  88517. // "path": "{project}/regions/{region}/healthChecks",
  88518. // "request": {
  88519. // "$ref": "HealthCheck"
  88520. // },
  88521. // "response": {
  88522. // "$ref": "Operation"
  88523. // },
  88524. // "scopes": [
  88525. // "https://www.googleapis.com/auth/cloud-platform",
  88526. // "https://www.googleapis.com/auth/compute"
  88527. // ]
  88528. // }
  88529. }
  88530. // method id "compute.regionHealthChecks.list":
  88531. type RegionHealthChecksListCall struct {
  88532. s *Service
  88533. project string
  88534. region string
  88535. urlParams_ gensupport.URLParams
  88536. ifNoneMatch_ string
  88537. ctx_ context.Context
  88538. header_ http.Header
  88539. }
  88540. // List: Retrieves the list of HealthCheck resources available to the
  88541. // specified project.
  88542. func (r *RegionHealthChecksService) List(project string, region string) *RegionHealthChecksListCall {
  88543. c := &RegionHealthChecksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  88544. c.project = project
  88545. c.region = region
  88546. return c
  88547. }
  88548. // Filter sets the optional parameter "filter": A filter expression that
  88549. // filters resources listed in the response. The expression must specify
  88550. // the field name, a comparison operator, and the value that you want to
  88551. // use for filtering. The value must be a string, a number, or a
  88552. // boolean. The comparison operator must be either =, !=, >, or <.
  88553. //
  88554. // For example, if you are filtering Compute Engine instances, you can
  88555. // exclude instances named example-instance by specifying name !=
  88556. // example-instance.
  88557. //
  88558. // You can also filter nested fields. For example, you could specify
  88559. // scheduling.automaticRestart = false to include instances only if they
  88560. // are not scheduled for automatic restarts. You can use filtering on
  88561. // nested fields to filter based on resource labels.
  88562. //
  88563. // To filter on multiple expressions, provide each separate expression
  88564. // within parentheses. For example, (scheduling.automaticRestart = true)
  88565. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  88566. // AND expression. However, you can include AND and OR expressions
  88567. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  88568. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  88569. // true).
  88570. func (c *RegionHealthChecksListCall) Filter(filter string) *RegionHealthChecksListCall {
  88571. c.urlParams_.Set("filter", filter)
  88572. return c
  88573. }
  88574. // MaxResults sets the optional parameter "maxResults": The maximum
  88575. // number of results per page that should be returned. If the number of
  88576. // available results is larger than maxResults, Compute Engine returns a
  88577. // nextPageToken that can be used to get the next page of results in
  88578. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  88579. // (Default: 500)
  88580. func (c *RegionHealthChecksListCall) MaxResults(maxResults int64) *RegionHealthChecksListCall {
  88581. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  88582. return c
  88583. }
  88584. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  88585. // a certain order. By default, results are returned in alphanumerical
  88586. // order based on the resource name.
  88587. //
  88588. // You can also sort results in descending order based on the creation
  88589. // timestamp using orderBy="creationTimestamp desc". This sorts results
  88590. // based on the creationTimestamp field in reverse chronological order
  88591. // (newest result first). Use this to sort resources like operations so
  88592. // that the newest operation is returned first.
  88593. //
  88594. // Currently, only sorting by name or creationTimestamp desc is
  88595. // supported.
  88596. func (c *RegionHealthChecksListCall) OrderBy(orderBy string) *RegionHealthChecksListCall {
  88597. c.urlParams_.Set("orderBy", orderBy)
  88598. return c
  88599. }
  88600. // PageToken sets the optional parameter "pageToken": Specifies a page
  88601. // token to use. Set pageToken to the nextPageToken returned by a
  88602. // previous list request to get the next page of results.
  88603. func (c *RegionHealthChecksListCall) PageToken(pageToken string) *RegionHealthChecksListCall {
  88604. c.urlParams_.Set("pageToken", pageToken)
  88605. return c
  88606. }
  88607. // Fields allows partial responses to be retrieved. See
  88608. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  88609. // for more information.
  88610. func (c *RegionHealthChecksListCall) Fields(s ...googleapi.Field) *RegionHealthChecksListCall {
  88611. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  88612. return c
  88613. }
  88614. // IfNoneMatch sets the optional parameter which makes the operation
  88615. // fail if the object's ETag matches the given value. This is useful for
  88616. // getting updates only after the object has changed since the last
  88617. // request. Use googleapi.IsNotModified to check whether the response
  88618. // error from Do is the result of In-None-Match.
  88619. func (c *RegionHealthChecksListCall) IfNoneMatch(entityTag string) *RegionHealthChecksListCall {
  88620. c.ifNoneMatch_ = entityTag
  88621. return c
  88622. }
  88623. // Context sets the context to be used in this call's Do method. Any
  88624. // pending HTTP request will be aborted if the provided context is
  88625. // canceled.
  88626. func (c *RegionHealthChecksListCall) Context(ctx context.Context) *RegionHealthChecksListCall {
  88627. c.ctx_ = ctx
  88628. return c
  88629. }
  88630. // Header returns an http.Header that can be modified by the caller to
  88631. // add HTTP headers to the request.
  88632. func (c *RegionHealthChecksListCall) Header() http.Header {
  88633. if c.header_ == nil {
  88634. c.header_ = make(http.Header)
  88635. }
  88636. return c.header_
  88637. }
  88638. func (c *RegionHealthChecksListCall) doRequest(alt string) (*http.Response, error) {
  88639. reqHeaders := make(http.Header)
  88640. for k, v := range c.header_ {
  88641. reqHeaders[k] = v
  88642. }
  88643. reqHeaders.Set("User-Agent", c.s.userAgent())
  88644. if c.ifNoneMatch_ != "" {
  88645. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  88646. }
  88647. var body io.Reader = nil
  88648. c.urlParams_.Set("alt", alt)
  88649. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/healthChecks")
  88650. urls += "?" + c.urlParams_.Encode()
  88651. req, _ := http.NewRequest("GET", urls, body)
  88652. req.Header = reqHeaders
  88653. googleapi.Expand(req.URL, map[string]string{
  88654. "project": c.project,
  88655. "region": c.region,
  88656. })
  88657. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  88658. }
  88659. // Do executes the "compute.regionHealthChecks.list" call.
  88660. // Exactly one of *HealthCheckList or error will be non-nil. Any non-2xx
  88661. // status code is an error. Response headers are in either
  88662. // *HealthCheckList.ServerResponse.Header or (if a response was returned
  88663. // at all) in error.(*googleapi.Error).Header. Use
  88664. // googleapi.IsNotModified to check whether the returned error was
  88665. // because http.StatusNotModified was returned.
  88666. func (c *RegionHealthChecksListCall) Do(opts ...googleapi.CallOption) (*HealthCheckList, error) {
  88667. gensupport.SetOptions(c.urlParams_, opts...)
  88668. res, err := c.doRequest("json")
  88669. if res != nil && res.StatusCode == http.StatusNotModified {
  88670. if res.Body != nil {
  88671. res.Body.Close()
  88672. }
  88673. return nil, &googleapi.Error{
  88674. Code: res.StatusCode,
  88675. Header: res.Header,
  88676. }
  88677. }
  88678. if err != nil {
  88679. return nil, err
  88680. }
  88681. defer googleapi.CloseBody(res)
  88682. if err := googleapi.CheckResponse(res); err != nil {
  88683. return nil, err
  88684. }
  88685. ret := &HealthCheckList{
  88686. ServerResponse: googleapi.ServerResponse{
  88687. Header: res.Header,
  88688. HTTPStatusCode: res.StatusCode,
  88689. },
  88690. }
  88691. target := &ret
  88692. if err := gensupport.DecodeResponse(target, res); err != nil {
  88693. return nil, err
  88694. }
  88695. return ret, nil
  88696. // {
  88697. // "description": "Retrieves the list of HealthCheck resources available to the specified project.",
  88698. // "httpMethod": "GET",
  88699. // "id": "compute.regionHealthChecks.list",
  88700. // "parameterOrder": [
  88701. // "project",
  88702. // "region"
  88703. // ],
  88704. // "parameters": {
  88705. // "filter": {
  88706. // "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).",
  88707. // "location": "query",
  88708. // "type": "string"
  88709. // },
  88710. // "maxResults": {
  88711. // "default": "500",
  88712. // "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)",
  88713. // "format": "uint32",
  88714. // "location": "query",
  88715. // "minimum": "0",
  88716. // "type": "integer"
  88717. // },
  88718. // "orderBy": {
  88719. // "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.",
  88720. // "location": "query",
  88721. // "type": "string"
  88722. // },
  88723. // "pageToken": {
  88724. // "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.",
  88725. // "location": "query",
  88726. // "type": "string"
  88727. // },
  88728. // "project": {
  88729. // "description": "Project ID for this request.",
  88730. // "location": "path",
  88731. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  88732. // "required": true,
  88733. // "type": "string"
  88734. // },
  88735. // "region": {
  88736. // "description": "Name of the region scoping this request.",
  88737. // "location": "path",
  88738. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  88739. // "required": true,
  88740. // "type": "string"
  88741. // }
  88742. // },
  88743. // "path": "{project}/regions/{region}/healthChecks",
  88744. // "response": {
  88745. // "$ref": "HealthCheckList"
  88746. // },
  88747. // "scopes": [
  88748. // "https://www.googleapis.com/auth/cloud-platform",
  88749. // "https://www.googleapis.com/auth/compute",
  88750. // "https://www.googleapis.com/auth/compute.readonly"
  88751. // ]
  88752. // }
  88753. }
  88754. // Pages invokes f for each page of results.
  88755. // A non-nil error returned from f will halt the iteration.
  88756. // The provided context supersedes any context provided to the Context method.
  88757. func (c *RegionHealthChecksListCall) Pages(ctx context.Context, f func(*HealthCheckList) error) error {
  88758. c.ctx_ = ctx
  88759. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  88760. for {
  88761. x, err := c.Do()
  88762. if err != nil {
  88763. return err
  88764. }
  88765. if err := f(x); err != nil {
  88766. return err
  88767. }
  88768. if x.NextPageToken == "" {
  88769. return nil
  88770. }
  88771. c.PageToken(x.NextPageToken)
  88772. }
  88773. }
  88774. // method id "compute.regionHealthChecks.patch":
  88775. type RegionHealthChecksPatchCall struct {
  88776. s *Service
  88777. project string
  88778. region string
  88779. healthCheck string
  88780. healthcheck *HealthCheck
  88781. urlParams_ gensupport.URLParams
  88782. ctx_ context.Context
  88783. header_ http.Header
  88784. }
  88785. // Patch: Updates a HealthCheck resource in the specified project using
  88786. // the data included in the request. This method supports PATCH
  88787. // semantics and uses the JSON merge patch format and processing rules.
  88788. func (r *RegionHealthChecksService) Patch(project string, region string, healthCheck string, healthcheck *HealthCheck) *RegionHealthChecksPatchCall {
  88789. c := &RegionHealthChecksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  88790. c.project = project
  88791. c.region = region
  88792. c.healthCheck = healthCheck
  88793. c.healthcheck = healthcheck
  88794. return c
  88795. }
  88796. // RequestId sets the optional parameter "requestId": An optional
  88797. // request ID to identify requests. Specify a unique request ID so that
  88798. // if you must retry your request, the server will know to ignore the
  88799. // request if it has already been completed.
  88800. //
  88801. // For example, consider a situation where you make an initial request
  88802. // and the request times out. If you make the request again with the
  88803. // same request ID, the server can check if original operation with the
  88804. // same request ID was received, and if so, will ignore the second
  88805. // request. This prevents clients from accidentally creating duplicate
  88806. // commitments.
  88807. //
  88808. // The request ID must be a valid UUID with the exception that zero UUID
  88809. // is not supported (00000000-0000-0000-0000-000000000000).
  88810. func (c *RegionHealthChecksPatchCall) RequestId(requestId string) *RegionHealthChecksPatchCall {
  88811. c.urlParams_.Set("requestId", requestId)
  88812. return c
  88813. }
  88814. // Fields allows partial responses to be retrieved. See
  88815. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  88816. // for more information.
  88817. func (c *RegionHealthChecksPatchCall) Fields(s ...googleapi.Field) *RegionHealthChecksPatchCall {
  88818. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  88819. return c
  88820. }
  88821. // Context sets the context to be used in this call's Do method. Any
  88822. // pending HTTP request will be aborted if the provided context is
  88823. // canceled.
  88824. func (c *RegionHealthChecksPatchCall) Context(ctx context.Context) *RegionHealthChecksPatchCall {
  88825. c.ctx_ = ctx
  88826. return c
  88827. }
  88828. // Header returns an http.Header that can be modified by the caller to
  88829. // add HTTP headers to the request.
  88830. func (c *RegionHealthChecksPatchCall) Header() http.Header {
  88831. if c.header_ == nil {
  88832. c.header_ = make(http.Header)
  88833. }
  88834. return c.header_
  88835. }
  88836. func (c *RegionHealthChecksPatchCall) doRequest(alt string) (*http.Response, error) {
  88837. reqHeaders := make(http.Header)
  88838. for k, v := range c.header_ {
  88839. reqHeaders[k] = v
  88840. }
  88841. reqHeaders.Set("User-Agent", c.s.userAgent())
  88842. var body io.Reader = nil
  88843. body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck)
  88844. if err != nil {
  88845. return nil, err
  88846. }
  88847. reqHeaders.Set("Content-Type", "application/json")
  88848. c.urlParams_.Set("alt", alt)
  88849. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/healthChecks/{healthCheck}")
  88850. urls += "?" + c.urlParams_.Encode()
  88851. req, _ := http.NewRequest("PATCH", urls, body)
  88852. req.Header = reqHeaders
  88853. googleapi.Expand(req.URL, map[string]string{
  88854. "project": c.project,
  88855. "region": c.region,
  88856. "healthCheck": c.healthCheck,
  88857. })
  88858. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  88859. }
  88860. // Do executes the "compute.regionHealthChecks.patch" call.
  88861. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  88862. // status code is an error. Response headers are in either
  88863. // *Operation.ServerResponse.Header or (if a response was returned at
  88864. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  88865. // to check whether the returned error was because
  88866. // http.StatusNotModified was returned.
  88867. func (c *RegionHealthChecksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  88868. gensupport.SetOptions(c.urlParams_, opts...)
  88869. res, err := c.doRequest("json")
  88870. if res != nil && res.StatusCode == http.StatusNotModified {
  88871. if res.Body != nil {
  88872. res.Body.Close()
  88873. }
  88874. return nil, &googleapi.Error{
  88875. Code: res.StatusCode,
  88876. Header: res.Header,
  88877. }
  88878. }
  88879. if err != nil {
  88880. return nil, err
  88881. }
  88882. defer googleapi.CloseBody(res)
  88883. if err := googleapi.CheckResponse(res); err != nil {
  88884. return nil, err
  88885. }
  88886. ret := &Operation{
  88887. ServerResponse: googleapi.ServerResponse{
  88888. Header: res.Header,
  88889. HTTPStatusCode: res.StatusCode,
  88890. },
  88891. }
  88892. target := &ret
  88893. if err := gensupport.DecodeResponse(target, res); err != nil {
  88894. return nil, err
  88895. }
  88896. return ret, nil
  88897. // {
  88898. // "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.",
  88899. // "httpMethod": "PATCH",
  88900. // "id": "compute.regionHealthChecks.patch",
  88901. // "parameterOrder": [
  88902. // "project",
  88903. // "region",
  88904. // "healthCheck"
  88905. // ],
  88906. // "parameters": {
  88907. // "healthCheck": {
  88908. // "description": "Name of the HealthCheck resource to patch.",
  88909. // "location": "path",
  88910. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  88911. // "required": true,
  88912. // "type": "string"
  88913. // },
  88914. // "project": {
  88915. // "description": "Project ID for this request.",
  88916. // "location": "path",
  88917. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  88918. // "required": true,
  88919. // "type": "string"
  88920. // },
  88921. // "region": {
  88922. // "description": "Name of the region scoping this request.",
  88923. // "location": "path",
  88924. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  88925. // "required": true,
  88926. // "type": "string"
  88927. // },
  88928. // "requestId": {
  88929. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  88930. // "location": "query",
  88931. // "type": "string"
  88932. // }
  88933. // },
  88934. // "path": "{project}/regions/{region}/healthChecks/{healthCheck}",
  88935. // "request": {
  88936. // "$ref": "HealthCheck"
  88937. // },
  88938. // "response": {
  88939. // "$ref": "Operation"
  88940. // },
  88941. // "scopes": [
  88942. // "https://www.googleapis.com/auth/cloud-platform",
  88943. // "https://www.googleapis.com/auth/compute"
  88944. // ]
  88945. // }
  88946. }
  88947. // method id "compute.regionHealthChecks.testIamPermissions":
  88948. type RegionHealthChecksTestIamPermissionsCall struct {
  88949. s *Service
  88950. project string
  88951. region string
  88952. resource string
  88953. testpermissionsrequest *TestPermissionsRequest
  88954. urlParams_ gensupport.URLParams
  88955. ctx_ context.Context
  88956. header_ http.Header
  88957. }
  88958. // TestIamPermissions: Returns permissions that a caller has on the
  88959. // specified resource.
  88960. func (r *RegionHealthChecksService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionHealthChecksTestIamPermissionsCall {
  88961. c := &RegionHealthChecksTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  88962. c.project = project
  88963. c.region = region
  88964. c.resource = resource
  88965. c.testpermissionsrequest = testpermissionsrequest
  88966. return c
  88967. }
  88968. // Fields allows partial responses to be retrieved. See
  88969. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  88970. // for more information.
  88971. func (c *RegionHealthChecksTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionHealthChecksTestIamPermissionsCall {
  88972. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  88973. return c
  88974. }
  88975. // Context sets the context to be used in this call's Do method. Any
  88976. // pending HTTP request will be aborted if the provided context is
  88977. // canceled.
  88978. func (c *RegionHealthChecksTestIamPermissionsCall) Context(ctx context.Context) *RegionHealthChecksTestIamPermissionsCall {
  88979. c.ctx_ = ctx
  88980. return c
  88981. }
  88982. // Header returns an http.Header that can be modified by the caller to
  88983. // add HTTP headers to the request.
  88984. func (c *RegionHealthChecksTestIamPermissionsCall) Header() http.Header {
  88985. if c.header_ == nil {
  88986. c.header_ = make(http.Header)
  88987. }
  88988. return c.header_
  88989. }
  88990. func (c *RegionHealthChecksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  88991. reqHeaders := make(http.Header)
  88992. for k, v := range c.header_ {
  88993. reqHeaders[k] = v
  88994. }
  88995. reqHeaders.Set("User-Agent", c.s.userAgent())
  88996. var body io.Reader = nil
  88997. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  88998. if err != nil {
  88999. return nil, err
  89000. }
  89001. reqHeaders.Set("Content-Type", "application/json")
  89002. c.urlParams_.Set("alt", alt)
  89003. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/healthChecks/{resource}/testIamPermissions")
  89004. urls += "?" + c.urlParams_.Encode()
  89005. req, _ := http.NewRequest("POST", urls, body)
  89006. req.Header = reqHeaders
  89007. googleapi.Expand(req.URL, map[string]string{
  89008. "project": c.project,
  89009. "region": c.region,
  89010. "resource": c.resource,
  89011. })
  89012. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  89013. }
  89014. // Do executes the "compute.regionHealthChecks.testIamPermissions" call.
  89015. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  89016. // non-2xx status code is an error. Response headers are in either
  89017. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  89018. // returned at all) in error.(*googleapi.Error).Header. Use
  89019. // googleapi.IsNotModified to check whether the returned error was
  89020. // because http.StatusNotModified was returned.
  89021. func (c *RegionHealthChecksTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  89022. gensupport.SetOptions(c.urlParams_, opts...)
  89023. res, err := c.doRequest("json")
  89024. if res != nil && res.StatusCode == http.StatusNotModified {
  89025. if res.Body != nil {
  89026. res.Body.Close()
  89027. }
  89028. return nil, &googleapi.Error{
  89029. Code: res.StatusCode,
  89030. Header: res.Header,
  89031. }
  89032. }
  89033. if err != nil {
  89034. return nil, err
  89035. }
  89036. defer googleapi.CloseBody(res)
  89037. if err := googleapi.CheckResponse(res); err != nil {
  89038. return nil, err
  89039. }
  89040. ret := &TestPermissionsResponse{
  89041. ServerResponse: googleapi.ServerResponse{
  89042. Header: res.Header,
  89043. HTTPStatusCode: res.StatusCode,
  89044. },
  89045. }
  89046. target := &ret
  89047. if err := gensupport.DecodeResponse(target, res); err != nil {
  89048. return nil, err
  89049. }
  89050. return ret, nil
  89051. // {
  89052. // "description": "Returns permissions that a caller has on the specified resource.",
  89053. // "httpMethod": "POST",
  89054. // "id": "compute.regionHealthChecks.testIamPermissions",
  89055. // "parameterOrder": [
  89056. // "project",
  89057. // "region",
  89058. // "resource"
  89059. // ],
  89060. // "parameters": {
  89061. // "project": {
  89062. // "description": "Project ID for this request.",
  89063. // "location": "path",
  89064. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  89065. // "required": true,
  89066. // "type": "string"
  89067. // },
  89068. // "region": {
  89069. // "description": "The name of the region for this request.",
  89070. // "location": "path",
  89071. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  89072. // "required": true,
  89073. // "type": "string"
  89074. // },
  89075. // "resource": {
  89076. // "description": "Name of the resource for this request.",
  89077. // "location": "path",
  89078. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  89079. // "required": true,
  89080. // "type": "string"
  89081. // }
  89082. // },
  89083. // "path": "{project}/regions/{region}/healthChecks/{resource}/testIamPermissions",
  89084. // "request": {
  89085. // "$ref": "TestPermissionsRequest"
  89086. // },
  89087. // "response": {
  89088. // "$ref": "TestPermissionsResponse"
  89089. // },
  89090. // "scopes": [
  89091. // "https://www.googleapis.com/auth/cloud-platform",
  89092. // "https://www.googleapis.com/auth/compute",
  89093. // "https://www.googleapis.com/auth/compute.readonly"
  89094. // ]
  89095. // }
  89096. }
  89097. // method id "compute.regionHealthChecks.update":
  89098. type RegionHealthChecksUpdateCall struct {
  89099. s *Service
  89100. project string
  89101. region string
  89102. healthCheck string
  89103. healthcheck *HealthCheck
  89104. urlParams_ gensupport.URLParams
  89105. ctx_ context.Context
  89106. header_ http.Header
  89107. }
  89108. // Update: Updates a HealthCheck resource in the specified project using
  89109. // the data included in the request.
  89110. func (r *RegionHealthChecksService) Update(project string, region string, healthCheck string, healthcheck *HealthCheck) *RegionHealthChecksUpdateCall {
  89111. c := &RegionHealthChecksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  89112. c.project = project
  89113. c.region = region
  89114. c.healthCheck = healthCheck
  89115. c.healthcheck = healthcheck
  89116. return c
  89117. }
  89118. // RequestId sets the optional parameter "requestId": An optional
  89119. // request ID to identify requests. Specify a unique request ID so that
  89120. // if you must retry your request, the server will know to ignore the
  89121. // request if it has already been completed.
  89122. //
  89123. // For example, consider a situation where you make an initial request
  89124. // and the request times out. If you make the request again with the
  89125. // same request ID, the server can check if original operation with the
  89126. // same request ID was received, and if so, will ignore the second
  89127. // request. This prevents clients from accidentally creating duplicate
  89128. // commitments.
  89129. //
  89130. // The request ID must be a valid UUID with the exception that zero UUID
  89131. // is not supported (00000000-0000-0000-0000-000000000000).
  89132. func (c *RegionHealthChecksUpdateCall) RequestId(requestId string) *RegionHealthChecksUpdateCall {
  89133. c.urlParams_.Set("requestId", requestId)
  89134. return c
  89135. }
  89136. // Fields allows partial responses to be retrieved. See
  89137. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  89138. // for more information.
  89139. func (c *RegionHealthChecksUpdateCall) Fields(s ...googleapi.Field) *RegionHealthChecksUpdateCall {
  89140. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  89141. return c
  89142. }
  89143. // Context sets the context to be used in this call's Do method. Any
  89144. // pending HTTP request will be aborted if the provided context is
  89145. // canceled.
  89146. func (c *RegionHealthChecksUpdateCall) Context(ctx context.Context) *RegionHealthChecksUpdateCall {
  89147. c.ctx_ = ctx
  89148. return c
  89149. }
  89150. // Header returns an http.Header that can be modified by the caller to
  89151. // add HTTP headers to the request.
  89152. func (c *RegionHealthChecksUpdateCall) Header() http.Header {
  89153. if c.header_ == nil {
  89154. c.header_ = make(http.Header)
  89155. }
  89156. return c.header_
  89157. }
  89158. func (c *RegionHealthChecksUpdateCall) doRequest(alt string) (*http.Response, error) {
  89159. reqHeaders := make(http.Header)
  89160. for k, v := range c.header_ {
  89161. reqHeaders[k] = v
  89162. }
  89163. reqHeaders.Set("User-Agent", c.s.userAgent())
  89164. var body io.Reader = nil
  89165. body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck)
  89166. if err != nil {
  89167. return nil, err
  89168. }
  89169. reqHeaders.Set("Content-Type", "application/json")
  89170. c.urlParams_.Set("alt", alt)
  89171. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/healthChecks/{healthCheck}")
  89172. urls += "?" + c.urlParams_.Encode()
  89173. req, _ := http.NewRequest("PUT", urls, body)
  89174. req.Header = reqHeaders
  89175. googleapi.Expand(req.URL, map[string]string{
  89176. "project": c.project,
  89177. "region": c.region,
  89178. "healthCheck": c.healthCheck,
  89179. })
  89180. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  89181. }
  89182. // Do executes the "compute.regionHealthChecks.update" call.
  89183. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  89184. // status code is an error. Response headers are in either
  89185. // *Operation.ServerResponse.Header or (if a response was returned at
  89186. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  89187. // to check whether the returned error was because
  89188. // http.StatusNotModified was returned.
  89189. func (c *RegionHealthChecksUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  89190. gensupport.SetOptions(c.urlParams_, opts...)
  89191. res, err := c.doRequest("json")
  89192. if res != nil && res.StatusCode == http.StatusNotModified {
  89193. if res.Body != nil {
  89194. res.Body.Close()
  89195. }
  89196. return nil, &googleapi.Error{
  89197. Code: res.StatusCode,
  89198. Header: res.Header,
  89199. }
  89200. }
  89201. if err != nil {
  89202. return nil, err
  89203. }
  89204. defer googleapi.CloseBody(res)
  89205. if err := googleapi.CheckResponse(res); err != nil {
  89206. return nil, err
  89207. }
  89208. ret := &Operation{
  89209. ServerResponse: googleapi.ServerResponse{
  89210. Header: res.Header,
  89211. HTTPStatusCode: res.StatusCode,
  89212. },
  89213. }
  89214. target := &ret
  89215. if err := gensupport.DecodeResponse(target, res); err != nil {
  89216. return nil, err
  89217. }
  89218. return ret, nil
  89219. // {
  89220. // "description": "Updates a HealthCheck resource in the specified project using the data included in the request.",
  89221. // "httpMethod": "PUT",
  89222. // "id": "compute.regionHealthChecks.update",
  89223. // "parameterOrder": [
  89224. // "project",
  89225. // "region",
  89226. // "healthCheck"
  89227. // ],
  89228. // "parameters": {
  89229. // "healthCheck": {
  89230. // "description": "Name of the HealthCheck resource to update.",
  89231. // "location": "path",
  89232. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  89233. // "required": true,
  89234. // "type": "string"
  89235. // },
  89236. // "project": {
  89237. // "description": "Project ID for this request.",
  89238. // "location": "path",
  89239. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  89240. // "required": true,
  89241. // "type": "string"
  89242. // },
  89243. // "region": {
  89244. // "description": "Name of the region scoping this request.",
  89245. // "location": "path",
  89246. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  89247. // "required": true,
  89248. // "type": "string"
  89249. // },
  89250. // "requestId": {
  89251. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  89252. // "location": "query",
  89253. // "type": "string"
  89254. // }
  89255. // },
  89256. // "path": "{project}/regions/{region}/healthChecks/{healthCheck}",
  89257. // "request": {
  89258. // "$ref": "HealthCheck"
  89259. // },
  89260. // "response": {
  89261. // "$ref": "Operation"
  89262. // },
  89263. // "scopes": [
  89264. // "https://www.googleapis.com/auth/cloud-platform",
  89265. // "https://www.googleapis.com/auth/compute"
  89266. // ]
  89267. // }
  89268. }
  89269. // method id "compute.regionInstanceGroupManagers.abandonInstances":
  89270. type RegionInstanceGroupManagersAbandonInstancesCall struct {
  89271. s *Service
  89272. project string
  89273. region string
  89274. instanceGroupManager string
  89275. regioninstancegroupmanagersabandoninstancesrequest *RegionInstanceGroupManagersAbandonInstancesRequest
  89276. urlParams_ gensupport.URLParams
  89277. ctx_ context.Context
  89278. header_ http.Header
  89279. }
  89280. // AbandonInstances: Schedules a group action to remove the specified
  89281. // instances from the managed instance group. Abandoning an instance
  89282. // does not delete the instance, but it does remove the instance from
  89283. // any target pools that are applied by the managed instance group. This
  89284. // method reduces the targetSize of the managed instance group by the
  89285. // number of instances that you abandon. This operation is marked as
  89286. // DONE when the action is scheduled even if the instances have not yet
  89287. // been removed from the group. You must separately verify the status of
  89288. // the abandoning action with the listmanagedinstances method.
  89289. //
  89290. // If the group is part of a backend service that has enabled connection
  89291. // draining, it can take up to 60 seconds after the connection draining
  89292. // duration has elapsed before the VM instance is removed or
  89293. // deleted.
  89294. //
  89295. // You can specify a maximum of 1000 instances with this method per
  89296. // request.
  89297. func (r *RegionInstanceGroupManagersService) AbandonInstances(project string, region string, instanceGroupManager string, regioninstancegroupmanagersabandoninstancesrequest *RegionInstanceGroupManagersAbandonInstancesRequest) *RegionInstanceGroupManagersAbandonInstancesCall {
  89298. c := &RegionInstanceGroupManagersAbandonInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  89299. c.project = project
  89300. c.region = region
  89301. c.instanceGroupManager = instanceGroupManager
  89302. c.regioninstancegroupmanagersabandoninstancesrequest = regioninstancegroupmanagersabandoninstancesrequest
  89303. return c
  89304. }
  89305. // RequestId sets the optional parameter "requestId": An optional
  89306. // request ID to identify requests. Specify a unique request ID so that
  89307. // if you must retry your request, the server will know to ignore the
  89308. // request if it has already been completed.
  89309. //
  89310. // For example, consider a situation where you make an initial request
  89311. // and the request times out. If you make the request again with the
  89312. // same request ID, the server can check if original operation with the
  89313. // same request ID was received, and if so, will ignore the second
  89314. // request. This prevents clients from accidentally creating duplicate
  89315. // commitments.
  89316. //
  89317. // The request ID must be a valid UUID with the exception that zero UUID
  89318. // is not supported (00000000-0000-0000-0000-000000000000).
  89319. func (c *RegionInstanceGroupManagersAbandonInstancesCall) RequestId(requestId string) *RegionInstanceGroupManagersAbandonInstancesCall {
  89320. c.urlParams_.Set("requestId", requestId)
  89321. return c
  89322. }
  89323. // Fields allows partial responses to be retrieved. See
  89324. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  89325. // for more information.
  89326. func (c *RegionInstanceGroupManagersAbandonInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersAbandonInstancesCall {
  89327. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  89328. return c
  89329. }
  89330. // Context sets the context to be used in this call's Do method. Any
  89331. // pending HTTP request will be aborted if the provided context is
  89332. // canceled.
  89333. func (c *RegionInstanceGroupManagersAbandonInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersAbandonInstancesCall {
  89334. c.ctx_ = ctx
  89335. return c
  89336. }
  89337. // Header returns an http.Header that can be modified by the caller to
  89338. // add HTTP headers to the request.
  89339. func (c *RegionInstanceGroupManagersAbandonInstancesCall) Header() http.Header {
  89340. if c.header_ == nil {
  89341. c.header_ = make(http.Header)
  89342. }
  89343. return c.header_
  89344. }
  89345. func (c *RegionInstanceGroupManagersAbandonInstancesCall) doRequest(alt string) (*http.Response, error) {
  89346. reqHeaders := make(http.Header)
  89347. for k, v := range c.header_ {
  89348. reqHeaders[k] = v
  89349. }
  89350. reqHeaders.Set("User-Agent", c.s.userAgent())
  89351. var body io.Reader = nil
  89352. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersabandoninstancesrequest)
  89353. if err != nil {
  89354. return nil, err
  89355. }
  89356. reqHeaders.Set("Content-Type", "application/json")
  89357. c.urlParams_.Set("alt", alt)
  89358. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/abandonInstances")
  89359. urls += "?" + c.urlParams_.Encode()
  89360. req, _ := http.NewRequest("POST", urls, body)
  89361. req.Header = reqHeaders
  89362. googleapi.Expand(req.URL, map[string]string{
  89363. "project": c.project,
  89364. "region": c.region,
  89365. "instanceGroupManager": c.instanceGroupManager,
  89366. })
  89367. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  89368. }
  89369. // Do executes the "compute.regionInstanceGroupManagers.abandonInstances" call.
  89370. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  89371. // status code is an error. Response headers are in either
  89372. // *Operation.ServerResponse.Header or (if a response was returned at
  89373. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  89374. // to check whether the returned error was because
  89375. // http.StatusNotModified was returned.
  89376. func (c *RegionInstanceGroupManagersAbandonInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  89377. gensupport.SetOptions(c.urlParams_, opts...)
  89378. res, err := c.doRequest("json")
  89379. if res != nil && res.StatusCode == http.StatusNotModified {
  89380. if res.Body != nil {
  89381. res.Body.Close()
  89382. }
  89383. return nil, &googleapi.Error{
  89384. Code: res.StatusCode,
  89385. Header: res.Header,
  89386. }
  89387. }
  89388. if err != nil {
  89389. return nil, err
  89390. }
  89391. defer googleapi.CloseBody(res)
  89392. if err := googleapi.CheckResponse(res); err != nil {
  89393. return nil, err
  89394. }
  89395. ret := &Operation{
  89396. ServerResponse: googleapi.ServerResponse{
  89397. Header: res.Header,
  89398. HTTPStatusCode: res.StatusCode,
  89399. },
  89400. }
  89401. target := &ret
  89402. if err := gensupport.DecodeResponse(target, res); err != nil {
  89403. return nil, err
  89404. }
  89405. return ret, nil
  89406. // {
  89407. // "description": "Schedules a group action to remove the specified instances from the managed instance group. Abandoning an instance does not delete the instance, but it does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method.\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.",
  89408. // "httpMethod": "POST",
  89409. // "id": "compute.regionInstanceGroupManagers.abandonInstances",
  89410. // "parameterOrder": [
  89411. // "project",
  89412. // "region",
  89413. // "instanceGroupManager"
  89414. // ],
  89415. // "parameters": {
  89416. // "instanceGroupManager": {
  89417. // "description": "Name of the managed instance group.",
  89418. // "location": "path",
  89419. // "required": true,
  89420. // "type": "string"
  89421. // },
  89422. // "project": {
  89423. // "description": "Project ID for this request.",
  89424. // "location": "path",
  89425. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  89426. // "required": true,
  89427. // "type": "string"
  89428. // },
  89429. // "region": {
  89430. // "description": "Name of the region scoping this request.",
  89431. // "location": "path",
  89432. // "required": true,
  89433. // "type": "string"
  89434. // },
  89435. // "requestId": {
  89436. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  89437. // "location": "query",
  89438. // "type": "string"
  89439. // }
  89440. // },
  89441. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/abandonInstances",
  89442. // "request": {
  89443. // "$ref": "RegionInstanceGroupManagersAbandonInstancesRequest"
  89444. // },
  89445. // "response": {
  89446. // "$ref": "Operation"
  89447. // },
  89448. // "scopes": [
  89449. // "https://www.googleapis.com/auth/cloud-platform",
  89450. // "https://www.googleapis.com/auth/compute"
  89451. // ]
  89452. // }
  89453. }
  89454. // method id "compute.regionInstanceGroupManagers.applyUpdatesToInstances":
  89455. type RegionInstanceGroupManagersApplyUpdatesToInstancesCall struct {
  89456. s *Service
  89457. project string
  89458. region string
  89459. instanceGroupManager string
  89460. regioninstancegroupmanagersapplyupdatesrequest *RegionInstanceGroupManagersApplyUpdatesRequest
  89461. urlParams_ gensupport.URLParams
  89462. ctx_ context.Context
  89463. header_ http.Header
  89464. }
  89465. // ApplyUpdatesToInstances: Apply updates to selected instances the
  89466. // managed instance group.
  89467. func (r *RegionInstanceGroupManagersService) ApplyUpdatesToInstances(project string, region string, instanceGroupManager string, regioninstancegroupmanagersapplyupdatesrequest *RegionInstanceGroupManagersApplyUpdatesRequest) *RegionInstanceGroupManagersApplyUpdatesToInstancesCall {
  89468. c := &RegionInstanceGroupManagersApplyUpdatesToInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  89469. c.project = project
  89470. c.region = region
  89471. c.instanceGroupManager = instanceGroupManager
  89472. c.regioninstancegroupmanagersapplyupdatesrequest = regioninstancegroupmanagersapplyupdatesrequest
  89473. return c
  89474. }
  89475. // Fields allows partial responses to be retrieved. See
  89476. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  89477. // for more information.
  89478. func (c *RegionInstanceGroupManagersApplyUpdatesToInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersApplyUpdatesToInstancesCall {
  89479. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  89480. return c
  89481. }
  89482. // Context sets the context to be used in this call's Do method. Any
  89483. // pending HTTP request will be aborted if the provided context is
  89484. // canceled.
  89485. func (c *RegionInstanceGroupManagersApplyUpdatesToInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersApplyUpdatesToInstancesCall {
  89486. c.ctx_ = ctx
  89487. return c
  89488. }
  89489. // Header returns an http.Header that can be modified by the caller to
  89490. // add HTTP headers to the request.
  89491. func (c *RegionInstanceGroupManagersApplyUpdatesToInstancesCall) Header() http.Header {
  89492. if c.header_ == nil {
  89493. c.header_ = make(http.Header)
  89494. }
  89495. return c.header_
  89496. }
  89497. func (c *RegionInstanceGroupManagersApplyUpdatesToInstancesCall) doRequest(alt string) (*http.Response, error) {
  89498. reqHeaders := make(http.Header)
  89499. for k, v := range c.header_ {
  89500. reqHeaders[k] = v
  89501. }
  89502. reqHeaders.Set("User-Agent", c.s.userAgent())
  89503. var body io.Reader = nil
  89504. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersapplyupdatesrequest)
  89505. if err != nil {
  89506. return nil, err
  89507. }
  89508. reqHeaders.Set("Content-Type", "application/json")
  89509. c.urlParams_.Set("alt", alt)
  89510. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/applyUpdatesToInstances")
  89511. urls += "?" + c.urlParams_.Encode()
  89512. req, _ := http.NewRequest("POST", urls, body)
  89513. req.Header = reqHeaders
  89514. googleapi.Expand(req.URL, map[string]string{
  89515. "project": c.project,
  89516. "region": c.region,
  89517. "instanceGroupManager": c.instanceGroupManager,
  89518. })
  89519. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  89520. }
  89521. // Do executes the "compute.regionInstanceGroupManagers.applyUpdatesToInstances" call.
  89522. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  89523. // status code is an error. Response headers are in either
  89524. // *Operation.ServerResponse.Header or (if a response was returned at
  89525. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  89526. // to check whether the returned error was because
  89527. // http.StatusNotModified was returned.
  89528. func (c *RegionInstanceGroupManagersApplyUpdatesToInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  89529. gensupport.SetOptions(c.urlParams_, opts...)
  89530. res, err := c.doRequest("json")
  89531. if res != nil && res.StatusCode == http.StatusNotModified {
  89532. if res.Body != nil {
  89533. res.Body.Close()
  89534. }
  89535. return nil, &googleapi.Error{
  89536. Code: res.StatusCode,
  89537. Header: res.Header,
  89538. }
  89539. }
  89540. if err != nil {
  89541. return nil, err
  89542. }
  89543. defer googleapi.CloseBody(res)
  89544. if err := googleapi.CheckResponse(res); err != nil {
  89545. return nil, err
  89546. }
  89547. ret := &Operation{
  89548. ServerResponse: googleapi.ServerResponse{
  89549. Header: res.Header,
  89550. HTTPStatusCode: res.StatusCode,
  89551. },
  89552. }
  89553. target := &ret
  89554. if err := gensupport.DecodeResponse(target, res); err != nil {
  89555. return nil, err
  89556. }
  89557. return ret, nil
  89558. // {
  89559. // "description": "Apply updates to selected instances the managed instance group.",
  89560. // "httpMethod": "POST",
  89561. // "id": "compute.regionInstanceGroupManagers.applyUpdatesToInstances",
  89562. // "parameterOrder": [
  89563. // "project",
  89564. // "region",
  89565. // "instanceGroupManager"
  89566. // ],
  89567. // "parameters": {
  89568. // "instanceGroupManager": {
  89569. // "description": "The name of the managed instance group, should conform to RFC1035.",
  89570. // "location": "path",
  89571. // "required": true,
  89572. // "type": "string"
  89573. // },
  89574. // "project": {
  89575. // "description": "Project ID for this request.",
  89576. // "location": "path",
  89577. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  89578. // "required": true,
  89579. // "type": "string"
  89580. // },
  89581. // "region": {
  89582. // "description": "Name of the region scoping this request, should conform to RFC1035.",
  89583. // "location": "path",
  89584. // "required": true,
  89585. // "type": "string"
  89586. // }
  89587. // },
  89588. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/applyUpdatesToInstances",
  89589. // "request": {
  89590. // "$ref": "RegionInstanceGroupManagersApplyUpdatesRequest"
  89591. // },
  89592. // "response": {
  89593. // "$ref": "Operation"
  89594. // },
  89595. // "scopes": [
  89596. // "https://www.googleapis.com/auth/cloud-platform",
  89597. // "https://www.googleapis.com/auth/compute"
  89598. // ]
  89599. // }
  89600. }
  89601. // method id "compute.regionInstanceGroupManagers.delete":
  89602. type RegionInstanceGroupManagersDeleteCall struct {
  89603. s *Service
  89604. project string
  89605. region string
  89606. instanceGroupManager string
  89607. urlParams_ gensupport.URLParams
  89608. ctx_ context.Context
  89609. header_ http.Header
  89610. }
  89611. // Delete: Deletes the specified managed instance group and all of the
  89612. // instances in that group.
  89613. func (r *RegionInstanceGroupManagersService) Delete(project string, region string, instanceGroupManager string) *RegionInstanceGroupManagersDeleteCall {
  89614. c := &RegionInstanceGroupManagersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  89615. c.project = project
  89616. c.region = region
  89617. c.instanceGroupManager = instanceGroupManager
  89618. return c
  89619. }
  89620. // RequestId sets the optional parameter "requestId": An optional
  89621. // request ID to identify requests. Specify a unique request ID so that
  89622. // if you must retry your request, the server will know to ignore the
  89623. // request if it has already been completed.
  89624. //
  89625. // For example, consider a situation where you make an initial request
  89626. // and the request times out. If you make the request again with the
  89627. // same request ID, the server can check if original operation with the
  89628. // same request ID was received, and if so, will ignore the second
  89629. // request. This prevents clients from accidentally creating duplicate
  89630. // commitments.
  89631. //
  89632. // The request ID must be a valid UUID with the exception that zero UUID
  89633. // is not supported (00000000-0000-0000-0000-000000000000).
  89634. func (c *RegionInstanceGroupManagersDeleteCall) RequestId(requestId string) *RegionInstanceGroupManagersDeleteCall {
  89635. c.urlParams_.Set("requestId", requestId)
  89636. return c
  89637. }
  89638. // Fields allows partial responses to be retrieved. See
  89639. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  89640. // for more information.
  89641. func (c *RegionInstanceGroupManagersDeleteCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersDeleteCall {
  89642. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  89643. return c
  89644. }
  89645. // Context sets the context to be used in this call's Do method. Any
  89646. // pending HTTP request will be aborted if the provided context is
  89647. // canceled.
  89648. func (c *RegionInstanceGroupManagersDeleteCall) Context(ctx context.Context) *RegionInstanceGroupManagersDeleteCall {
  89649. c.ctx_ = ctx
  89650. return c
  89651. }
  89652. // Header returns an http.Header that can be modified by the caller to
  89653. // add HTTP headers to the request.
  89654. func (c *RegionInstanceGroupManagersDeleteCall) Header() http.Header {
  89655. if c.header_ == nil {
  89656. c.header_ = make(http.Header)
  89657. }
  89658. return c.header_
  89659. }
  89660. func (c *RegionInstanceGroupManagersDeleteCall) doRequest(alt string) (*http.Response, error) {
  89661. reqHeaders := make(http.Header)
  89662. for k, v := range c.header_ {
  89663. reqHeaders[k] = v
  89664. }
  89665. reqHeaders.Set("User-Agent", c.s.userAgent())
  89666. var body io.Reader = nil
  89667. c.urlParams_.Set("alt", alt)
  89668. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}")
  89669. urls += "?" + c.urlParams_.Encode()
  89670. req, _ := http.NewRequest("DELETE", urls, body)
  89671. req.Header = reqHeaders
  89672. googleapi.Expand(req.URL, map[string]string{
  89673. "project": c.project,
  89674. "region": c.region,
  89675. "instanceGroupManager": c.instanceGroupManager,
  89676. })
  89677. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  89678. }
  89679. // Do executes the "compute.regionInstanceGroupManagers.delete" call.
  89680. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  89681. // status code is an error. Response headers are in either
  89682. // *Operation.ServerResponse.Header or (if a response was returned at
  89683. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  89684. // to check whether the returned error was because
  89685. // http.StatusNotModified was returned.
  89686. func (c *RegionInstanceGroupManagersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  89687. gensupport.SetOptions(c.urlParams_, opts...)
  89688. res, err := c.doRequest("json")
  89689. if res != nil && res.StatusCode == http.StatusNotModified {
  89690. if res.Body != nil {
  89691. res.Body.Close()
  89692. }
  89693. return nil, &googleapi.Error{
  89694. Code: res.StatusCode,
  89695. Header: res.Header,
  89696. }
  89697. }
  89698. if err != nil {
  89699. return nil, err
  89700. }
  89701. defer googleapi.CloseBody(res)
  89702. if err := googleapi.CheckResponse(res); err != nil {
  89703. return nil, err
  89704. }
  89705. ret := &Operation{
  89706. ServerResponse: googleapi.ServerResponse{
  89707. Header: res.Header,
  89708. HTTPStatusCode: res.StatusCode,
  89709. },
  89710. }
  89711. target := &ret
  89712. if err := gensupport.DecodeResponse(target, res); err != nil {
  89713. return nil, err
  89714. }
  89715. return ret, nil
  89716. // {
  89717. // "description": "Deletes the specified managed instance group and all of the instances in that group.",
  89718. // "httpMethod": "DELETE",
  89719. // "id": "compute.regionInstanceGroupManagers.delete",
  89720. // "parameterOrder": [
  89721. // "project",
  89722. // "region",
  89723. // "instanceGroupManager"
  89724. // ],
  89725. // "parameters": {
  89726. // "instanceGroupManager": {
  89727. // "description": "Name of the managed instance group to delete.",
  89728. // "location": "path",
  89729. // "required": true,
  89730. // "type": "string"
  89731. // },
  89732. // "project": {
  89733. // "description": "Project ID for this request.",
  89734. // "location": "path",
  89735. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  89736. // "required": true,
  89737. // "type": "string"
  89738. // },
  89739. // "region": {
  89740. // "description": "Name of the region scoping this request.",
  89741. // "location": "path",
  89742. // "required": true,
  89743. // "type": "string"
  89744. // },
  89745. // "requestId": {
  89746. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  89747. // "location": "query",
  89748. // "type": "string"
  89749. // }
  89750. // },
  89751. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}",
  89752. // "response": {
  89753. // "$ref": "Operation"
  89754. // },
  89755. // "scopes": [
  89756. // "https://www.googleapis.com/auth/cloud-platform",
  89757. // "https://www.googleapis.com/auth/compute"
  89758. // ]
  89759. // }
  89760. }
  89761. // method id "compute.regionInstanceGroupManagers.deleteInstances":
  89762. type RegionInstanceGroupManagersDeleteInstancesCall struct {
  89763. s *Service
  89764. project string
  89765. region string
  89766. instanceGroupManager string
  89767. regioninstancegroupmanagersdeleteinstancesrequest *RegionInstanceGroupManagersDeleteInstancesRequest
  89768. urlParams_ gensupport.URLParams
  89769. ctx_ context.Context
  89770. header_ http.Header
  89771. }
  89772. // DeleteInstances: Schedules a group action to delete the specified
  89773. // instances in the managed instance group. The instances are also
  89774. // removed from any target pools of which they were a member. This
  89775. // method reduces the targetSize of the managed instance group by the
  89776. // number of instances that you delete. This operation is marked as DONE
  89777. // when the action is scheduled even if the instances are still being
  89778. // deleted. You must separately verify the status of the deleting action
  89779. // with the listmanagedinstances method.
  89780. //
  89781. // If the group is part of a backend service that has enabled connection
  89782. // draining, it can take up to 60 seconds after the connection draining
  89783. // duration has elapsed before the VM instance is removed or
  89784. // deleted.
  89785. //
  89786. // You can specify a maximum of 1000 instances with this method per
  89787. // request.
  89788. func (r *RegionInstanceGroupManagersService) DeleteInstances(project string, region string, instanceGroupManager string, regioninstancegroupmanagersdeleteinstancesrequest *RegionInstanceGroupManagersDeleteInstancesRequest) *RegionInstanceGroupManagersDeleteInstancesCall {
  89789. c := &RegionInstanceGroupManagersDeleteInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  89790. c.project = project
  89791. c.region = region
  89792. c.instanceGroupManager = instanceGroupManager
  89793. c.regioninstancegroupmanagersdeleteinstancesrequest = regioninstancegroupmanagersdeleteinstancesrequest
  89794. return c
  89795. }
  89796. // RequestId sets the optional parameter "requestId": An optional
  89797. // request ID to identify requests. Specify a unique request ID so that
  89798. // if you must retry your request, the server will know to ignore the
  89799. // request if it has already been completed.
  89800. //
  89801. // For example, consider a situation where you make an initial request
  89802. // and the request times out. If you make the request again with the
  89803. // same request ID, the server can check if original operation with the
  89804. // same request ID was received, and if so, will ignore the second
  89805. // request. This prevents clients from accidentally creating duplicate
  89806. // commitments.
  89807. //
  89808. // The request ID must be a valid UUID with the exception that zero UUID
  89809. // is not supported (00000000-0000-0000-0000-000000000000).
  89810. func (c *RegionInstanceGroupManagersDeleteInstancesCall) RequestId(requestId string) *RegionInstanceGroupManagersDeleteInstancesCall {
  89811. c.urlParams_.Set("requestId", requestId)
  89812. return c
  89813. }
  89814. // Fields allows partial responses to be retrieved. See
  89815. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  89816. // for more information.
  89817. func (c *RegionInstanceGroupManagersDeleteInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersDeleteInstancesCall {
  89818. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  89819. return c
  89820. }
  89821. // Context sets the context to be used in this call's Do method. Any
  89822. // pending HTTP request will be aborted if the provided context is
  89823. // canceled.
  89824. func (c *RegionInstanceGroupManagersDeleteInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersDeleteInstancesCall {
  89825. c.ctx_ = ctx
  89826. return c
  89827. }
  89828. // Header returns an http.Header that can be modified by the caller to
  89829. // add HTTP headers to the request.
  89830. func (c *RegionInstanceGroupManagersDeleteInstancesCall) Header() http.Header {
  89831. if c.header_ == nil {
  89832. c.header_ = make(http.Header)
  89833. }
  89834. return c.header_
  89835. }
  89836. func (c *RegionInstanceGroupManagersDeleteInstancesCall) doRequest(alt string) (*http.Response, error) {
  89837. reqHeaders := make(http.Header)
  89838. for k, v := range c.header_ {
  89839. reqHeaders[k] = v
  89840. }
  89841. reqHeaders.Set("User-Agent", c.s.userAgent())
  89842. var body io.Reader = nil
  89843. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersdeleteinstancesrequest)
  89844. if err != nil {
  89845. return nil, err
  89846. }
  89847. reqHeaders.Set("Content-Type", "application/json")
  89848. c.urlParams_.Set("alt", alt)
  89849. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/deleteInstances")
  89850. urls += "?" + c.urlParams_.Encode()
  89851. req, _ := http.NewRequest("POST", urls, body)
  89852. req.Header = reqHeaders
  89853. googleapi.Expand(req.URL, map[string]string{
  89854. "project": c.project,
  89855. "region": c.region,
  89856. "instanceGroupManager": c.instanceGroupManager,
  89857. })
  89858. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  89859. }
  89860. // Do executes the "compute.regionInstanceGroupManagers.deleteInstances" call.
  89861. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  89862. // status code is an error. Response headers are in either
  89863. // *Operation.ServerResponse.Header or (if a response was returned at
  89864. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  89865. // to check whether the returned error was because
  89866. // http.StatusNotModified was returned.
  89867. func (c *RegionInstanceGroupManagersDeleteInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  89868. gensupport.SetOptions(c.urlParams_, opts...)
  89869. res, err := c.doRequest("json")
  89870. if res != nil && res.StatusCode == http.StatusNotModified {
  89871. if res.Body != nil {
  89872. res.Body.Close()
  89873. }
  89874. return nil, &googleapi.Error{
  89875. Code: res.StatusCode,
  89876. Header: res.Header,
  89877. }
  89878. }
  89879. if err != nil {
  89880. return nil, err
  89881. }
  89882. defer googleapi.CloseBody(res)
  89883. if err := googleapi.CheckResponse(res); err != nil {
  89884. return nil, err
  89885. }
  89886. ret := &Operation{
  89887. ServerResponse: googleapi.ServerResponse{
  89888. Header: res.Header,
  89889. HTTPStatusCode: res.StatusCode,
  89890. },
  89891. }
  89892. target := &ret
  89893. if err := gensupport.DecodeResponse(target, res); err != nil {
  89894. return nil, err
  89895. }
  89896. return ret, nil
  89897. // {
  89898. // "description": "Schedules a group action to delete the specified instances in the managed instance group. The instances are also removed from any target pools of which they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. This operation is marked as DONE when the action is scheduled even if the instances are still being deleted. You must separately verify the status of the deleting action with the listmanagedinstances method.\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.",
  89899. // "httpMethod": "POST",
  89900. // "id": "compute.regionInstanceGroupManagers.deleteInstances",
  89901. // "parameterOrder": [
  89902. // "project",
  89903. // "region",
  89904. // "instanceGroupManager"
  89905. // ],
  89906. // "parameters": {
  89907. // "instanceGroupManager": {
  89908. // "description": "Name of the managed instance group.",
  89909. // "location": "path",
  89910. // "required": true,
  89911. // "type": "string"
  89912. // },
  89913. // "project": {
  89914. // "description": "Project ID for this request.",
  89915. // "location": "path",
  89916. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  89917. // "required": true,
  89918. // "type": "string"
  89919. // },
  89920. // "region": {
  89921. // "description": "Name of the region scoping this request.",
  89922. // "location": "path",
  89923. // "required": true,
  89924. // "type": "string"
  89925. // },
  89926. // "requestId": {
  89927. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  89928. // "location": "query",
  89929. // "type": "string"
  89930. // }
  89931. // },
  89932. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/deleteInstances",
  89933. // "request": {
  89934. // "$ref": "RegionInstanceGroupManagersDeleteInstancesRequest"
  89935. // },
  89936. // "response": {
  89937. // "$ref": "Operation"
  89938. // },
  89939. // "scopes": [
  89940. // "https://www.googleapis.com/auth/cloud-platform",
  89941. // "https://www.googleapis.com/auth/compute"
  89942. // ]
  89943. // }
  89944. }
  89945. // method id "compute.regionInstanceGroupManagers.deletePerInstanceConfigs":
  89946. type RegionInstanceGroupManagersDeletePerInstanceConfigsCall struct {
  89947. s *Service
  89948. project string
  89949. region string
  89950. instanceGroupManager string
  89951. regioninstancegroupmanagerdeleteinstanceconfigreq *RegionInstanceGroupManagerDeleteInstanceConfigReq
  89952. urlParams_ gensupport.URLParams
  89953. ctx_ context.Context
  89954. header_ http.Header
  89955. }
  89956. // DeletePerInstanceConfigs: Deletes selected per-instance configs for
  89957. // the managed instance group.
  89958. func (r *RegionInstanceGroupManagersService) DeletePerInstanceConfigs(project string, region string, instanceGroupManager string, regioninstancegroupmanagerdeleteinstanceconfigreq *RegionInstanceGroupManagerDeleteInstanceConfigReq) *RegionInstanceGroupManagersDeletePerInstanceConfigsCall {
  89959. c := &RegionInstanceGroupManagersDeletePerInstanceConfigsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  89960. c.project = project
  89961. c.region = region
  89962. c.instanceGroupManager = instanceGroupManager
  89963. c.regioninstancegroupmanagerdeleteinstanceconfigreq = regioninstancegroupmanagerdeleteinstanceconfigreq
  89964. return c
  89965. }
  89966. // Fields allows partial responses to be retrieved. See
  89967. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  89968. // for more information.
  89969. func (c *RegionInstanceGroupManagersDeletePerInstanceConfigsCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersDeletePerInstanceConfigsCall {
  89970. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  89971. return c
  89972. }
  89973. // Context sets the context to be used in this call's Do method. Any
  89974. // pending HTTP request will be aborted if the provided context is
  89975. // canceled.
  89976. func (c *RegionInstanceGroupManagersDeletePerInstanceConfigsCall) Context(ctx context.Context) *RegionInstanceGroupManagersDeletePerInstanceConfigsCall {
  89977. c.ctx_ = ctx
  89978. return c
  89979. }
  89980. // Header returns an http.Header that can be modified by the caller to
  89981. // add HTTP headers to the request.
  89982. func (c *RegionInstanceGroupManagersDeletePerInstanceConfigsCall) Header() http.Header {
  89983. if c.header_ == nil {
  89984. c.header_ = make(http.Header)
  89985. }
  89986. return c.header_
  89987. }
  89988. func (c *RegionInstanceGroupManagersDeletePerInstanceConfigsCall) doRequest(alt string) (*http.Response, error) {
  89989. reqHeaders := make(http.Header)
  89990. for k, v := range c.header_ {
  89991. reqHeaders[k] = v
  89992. }
  89993. reqHeaders.Set("User-Agent", c.s.userAgent())
  89994. var body io.Reader = nil
  89995. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerdeleteinstanceconfigreq)
  89996. if err != nil {
  89997. return nil, err
  89998. }
  89999. reqHeaders.Set("Content-Type", "application/json")
  90000. c.urlParams_.Set("alt", alt)
  90001. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/deletePerInstanceConfigs")
  90002. urls += "?" + c.urlParams_.Encode()
  90003. req, _ := http.NewRequest("POST", urls, body)
  90004. req.Header = reqHeaders
  90005. googleapi.Expand(req.URL, map[string]string{
  90006. "project": c.project,
  90007. "region": c.region,
  90008. "instanceGroupManager": c.instanceGroupManager,
  90009. })
  90010. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  90011. }
  90012. // Do executes the "compute.regionInstanceGroupManagers.deletePerInstanceConfigs" call.
  90013. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  90014. // status code is an error. Response headers are in either
  90015. // *Operation.ServerResponse.Header or (if a response was returned at
  90016. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  90017. // to check whether the returned error was because
  90018. // http.StatusNotModified was returned.
  90019. func (c *RegionInstanceGroupManagersDeletePerInstanceConfigsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  90020. gensupport.SetOptions(c.urlParams_, opts...)
  90021. res, err := c.doRequest("json")
  90022. if res != nil && res.StatusCode == http.StatusNotModified {
  90023. if res.Body != nil {
  90024. res.Body.Close()
  90025. }
  90026. return nil, &googleapi.Error{
  90027. Code: res.StatusCode,
  90028. Header: res.Header,
  90029. }
  90030. }
  90031. if err != nil {
  90032. return nil, err
  90033. }
  90034. defer googleapi.CloseBody(res)
  90035. if err := googleapi.CheckResponse(res); err != nil {
  90036. return nil, err
  90037. }
  90038. ret := &Operation{
  90039. ServerResponse: googleapi.ServerResponse{
  90040. Header: res.Header,
  90041. HTTPStatusCode: res.StatusCode,
  90042. },
  90043. }
  90044. target := &ret
  90045. if err := gensupport.DecodeResponse(target, res); err != nil {
  90046. return nil, err
  90047. }
  90048. return ret, nil
  90049. // {
  90050. // "description": "Deletes selected per-instance configs for the managed instance group.",
  90051. // "httpMethod": "POST",
  90052. // "id": "compute.regionInstanceGroupManagers.deletePerInstanceConfigs",
  90053. // "parameterOrder": [
  90054. // "project",
  90055. // "region",
  90056. // "instanceGroupManager"
  90057. // ],
  90058. // "parameters": {
  90059. // "instanceGroupManager": {
  90060. // "description": "The name of the managed instance group. It should conform to RFC1035.",
  90061. // "location": "path",
  90062. // "required": true,
  90063. // "type": "string"
  90064. // },
  90065. // "project": {
  90066. // "description": "Project ID for this request.",
  90067. // "location": "path",
  90068. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  90069. // "required": true,
  90070. // "type": "string"
  90071. // },
  90072. // "region": {
  90073. // "description": "Name of the region scoping this request, should conform to RFC1035.",
  90074. // "location": "path",
  90075. // "required": true,
  90076. // "type": "string"
  90077. // }
  90078. // },
  90079. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/deletePerInstanceConfigs",
  90080. // "request": {
  90081. // "$ref": "RegionInstanceGroupManagerDeleteInstanceConfigReq"
  90082. // },
  90083. // "response": {
  90084. // "$ref": "Operation"
  90085. // },
  90086. // "scopes": [
  90087. // "https://www.googleapis.com/auth/cloud-platform",
  90088. // "https://www.googleapis.com/auth/compute"
  90089. // ]
  90090. // }
  90091. }
  90092. // method id "compute.regionInstanceGroupManagers.get":
  90093. type RegionInstanceGroupManagersGetCall struct {
  90094. s *Service
  90095. project string
  90096. region string
  90097. instanceGroupManager string
  90098. urlParams_ gensupport.URLParams
  90099. ifNoneMatch_ string
  90100. ctx_ context.Context
  90101. header_ http.Header
  90102. }
  90103. // Get: Returns all of the details about the specified managed instance
  90104. // group.
  90105. func (r *RegionInstanceGroupManagersService) Get(project string, region string, instanceGroupManager string) *RegionInstanceGroupManagersGetCall {
  90106. c := &RegionInstanceGroupManagersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  90107. c.project = project
  90108. c.region = region
  90109. c.instanceGroupManager = instanceGroupManager
  90110. return c
  90111. }
  90112. // Fields allows partial responses to be retrieved. See
  90113. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  90114. // for more information.
  90115. func (c *RegionInstanceGroupManagersGetCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersGetCall {
  90116. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  90117. return c
  90118. }
  90119. // IfNoneMatch sets the optional parameter which makes the operation
  90120. // fail if the object's ETag matches the given value. This is useful for
  90121. // getting updates only after the object has changed since the last
  90122. // request. Use googleapi.IsNotModified to check whether the response
  90123. // error from Do is the result of In-None-Match.
  90124. func (c *RegionInstanceGroupManagersGetCall) IfNoneMatch(entityTag string) *RegionInstanceGroupManagersGetCall {
  90125. c.ifNoneMatch_ = entityTag
  90126. return c
  90127. }
  90128. // Context sets the context to be used in this call's Do method. Any
  90129. // pending HTTP request will be aborted if the provided context is
  90130. // canceled.
  90131. func (c *RegionInstanceGroupManagersGetCall) Context(ctx context.Context) *RegionInstanceGroupManagersGetCall {
  90132. c.ctx_ = ctx
  90133. return c
  90134. }
  90135. // Header returns an http.Header that can be modified by the caller to
  90136. // add HTTP headers to the request.
  90137. func (c *RegionInstanceGroupManagersGetCall) Header() http.Header {
  90138. if c.header_ == nil {
  90139. c.header_ = make(http.Header)
  90140. }
  90141. return c.header_
  90142. }
  90143. func (c *RegionInstanceGroupManagersGetCall) doRequest(alt string) (*http.Response, error) {
  90144. reqHeaders := make(http.Header)
  90145. for k, v := range c.header_ {
  90146. reqHeaders[k] = v
  90147. }
  90148. reqHeaders.Set("User-Agent", c.s.userAgent())
  90149. if c.ifNoneMatch_ != "" {
  90150. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  90151. }
  90152. var body io.Reader = nil
  90153. c.urlParams_.Set("alt", alt)
  90154. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}")
  90155. urls += "?" + c.urlParams_.Encode()
  90156. req, _ := http.NewRequest("GET", urls, body)
  90157. req.Header = reqHeaders
  90158. googleapi.Expand(req.URL, map[string]string{
  90159. "project": c.project,
  90160. "region": c.region,
  90161. "instanceGroupManager": c.instanceGroupManager,
  90162. })
  90163. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  90164. }
  90165. // Do executes the "compute.regionInstanceGroupManagers.get" call.
  90166. // Exactly one of *InstanceGroupManager or error will be non-nil. Any
  90167. // non-2xx status code is an error. Response headers are in either
  90168. // *InstanceGroupManager.ServerResponse.Header or (if a response was
  90169. // returned at all) in error.(*googleapi.Error).Header. Use
  90170. // googleapi.IsNotModified to check whether the returned error was
  90171. // because http.StatusNotModified was returned.
  90172. func (c *RegionInstanceGroupManagersGetCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManager, error) {
  90173. gensupport.SetOptions(c.urlParams_, opts...)
  90174. res, err := c.doRequest("json")
  90175. if res != nil && res.StatusCode == http.StatusNotModified {
  90176. if res.Body != nil {
  90177. res.Body.Close()
  90178. }
  90179. return nil, &googleapi.Error{
  90180. Code: res.StatusCode,
  90181. Header: res.Header,
  90182. }
  90183. }
  90184. if err != nil {
  90185. return nil, err
  90186. }
  90187. defer googleapi.CloseBody(res)
  90188. if err := googleapi.CheckResponse(res); err != nil {
  90189. return nil, err
  90190. }
  90191. ret := &InstanceGroupManager{
  90192. ServerResponse: googleapi.ServerResponse{
  90193. Header: res.Header,
  90194. HTTPStatusCode: res.StatusCode,
  90195. },
  90196. }
  90197. target := &ret
  90198. if err := gensupport.DecodeResponse(target, res); err != nil {
  90199. return nil, err
  90200. }
  90201. return ret, nil
  90202. // {
  90203. // "description": "Returns all of the details about the specified managed instance group.",
  90204. // "httpMethod": "GET",
  90205. // "id": "compute.regionInstanceGroupManagers.get",
  90206. // "parameterOrder": [
  90207. // "project",
  90208. // "region",
  90209. // "instanceGroupManager"
  90210. // ],
  90211. // "parameters": {
  90212. // "instanceGroupManager": {
  90213. // "description": "Name of the managed instance group to return.",
  90214. // "location": "path",
  90215. // "required": true,
  90216. // "type": "string"
  90217. // },
  90218. // "project": {
  90219. // "description": "Project ID for this request.",
  90220. // "location": "path",
  90221. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  90222. // "required": true,
  90223. // "type": "string"
  90224. // },
  90225. // "region": {
  90226. // "description": "Name of the region scoping this request.",
  90227. // "location": "path",
  90228. // "required": true,
  90229. // "type": "string"
  90230. // }
  90231. // },
  90232. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}",
  90233. // "response": {
  90234. // "$ref": "InstanceGroupManager"
  90235. // },
  90236. // "scopes": [
  90237. // "https://www.googleapis.com/auth/cloud-platform",
  90238. // "https://www.googleapis.com/auth/compute",
  90239. // "https://www.googleapis.com/auth/compute.readonly"
  90240. // ]
  90241. // }
  90242. }
  90243. // method id "compute.regionInstanceGroupManagers.insert":
  90244. type RegionInstanceGroupManagersInsertCall struct {
  90245. s *Service
  90246. project string
  90247. region string
  90248. instancegroupmanager *InstanceGroupManager
  90249. urlParams_ gensupport.URLParams
  90250. ctx_ context.Context
  90251. header_ http.Header
  90252. }
  90253. // Insert: Creates a managed instance group using the information that
  90254. // you specify in the request. After the group is created, it schedules
  90255. // an action to create instances in the group using the specified
  90256. // instance template. This operation is marked as DONE when the group is
  90257. // created even if the instances in the group have not yet been created.
  90258. // You must separately verify the status of the individual instances
  90259. // with the listmanagedinstances method.
  90260. //
  90261. // A regional managed instance group can contain up to 2000 instances.
  90262. func (r *RegionInstanceGroupManagersService) Insert(project string, region string, instancegroupmanager *InstanceGroupManager) *RegionInstanceGroupManagersInsertCall {
  90263. c := &RegionInstanceGroupManagersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  90264. c.project = project
  90265. c.region = region
  90266. c.instancegroupmanager = instancegroupmanager
  90267. return c
  90268. }
  90269. // RequestId sets the optional parameter "requestId": An optional
  90270. // request ID to identify requests. Specify a unique request ID so that
  90271. // if you must retry your request, the server will know to ignore the
  90272. // request if it has already been completed.
  90273. //
  90274. // For example, consider a situation where you make an initial request
  90275. // and the request times out. If you make the request again with the
  90276. // same request ID, the server can check if original operation with the
  90277. // same request ID was received, and if so, will ignore the second
  90278. // request. This prevents clients from accidentally creating duplicate
  90279. // commitments.
  90280. //
  90281. // The request ID must be a valid UUID with the exception that zero UUID
  90282. // is not supported (00000000-0000-0000-0000-000000000000).
  90283. func (c *RegionInstanceGroupManagersInsertCall) RequestId(requestId string) *RegionInstanceGroupManagersInsertCall {
  90284. c.urlParams_.Set("requestId", requestId)
  90285. return c
  90286. }
  90287. // Fields allows partial responses to be retrieved. See
  90288. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  90289. // for more information.
  90290. func (c *RegionInstanceGroupManagersInsertCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersInsertCall {
  90291. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  90292. return c
  90293. }
  90294. // Context sets the context to be used in this call's Do method. Any
  90295. // pending HTTP request will be aborted if the provided context is
  90296. // canceled.
  90297. func (c *RegionInstanceGroupManagersInsertCall) Context(ctx context.Context) *RegionInstanceGroupManagersInsertCall {
  90298. c.ctx_ = ctx
  90299. return c
  90300. }
  90301. // Header returns an http.Header that can be modified by the caller to
  90302. // add HTTP headers to the request.
  90303. func (c *RegionInstanceGroupManagersInsertCall) Header() http.Header {
  90304. if c.header_ == nil {
  90305. c.header_ = make(http.Header)
  90306. }
  90307. return c.header_
  90308. }
  90309. func (c *RegionInstanceGroupManagersInsertCall) doRequest(alt string) (*http.Response, error) {
  90310. reqHeaders := make(http.Header)
  90311. for k, v := range c.header_ {
  90312. reqHeaders[k] = v
  90313. }
  90314. reqHeaders.Set("User-Agent", c.s.userAgent())
  90315. var body io.Reader = nil
  90316. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager)
  90317. if err != nil {
  90318. return nil, err
  90319. }
  90320. reqHeaders.Set("Content-Type", "application/json")
  90321. c.urlParams_.Set("alt", alt)
  90322. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers")
  90323. urls += "?" + c.urlParams_.Encode()
  90324. req, _ := http.NewRequest("POST", urls, body)
  90325. req.Header = reqHeaders
  90326. googleapi.Expand(req.URL, map[string]string{
  90327. "project": c.project,
  90328. "region": c.region,
  90329. })
  90330. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  90331. }
  90332. // Do executes the "compute.regionInstanceGroupManagers.insert" call.
  90333. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  90334. // status code is an error. Response headers are in either
  90335. // *Operation.ServerResponse.Header or (if a response was returned at
  90336. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  90337. // to check whether the returned error was because
  90338. // http.StatusNotModified was returned.
  90339. func (c *RegionInstanceGroupManagersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  90340. gensupport.SetOptions(c.urlParams_, opts...)
  90341. res, err := c.doRequest("json")
  90342. if res != nil && res.StatusCode == http.StatusNotModified {
  90343. if res.Body != nil {
  90344. res.Body.Close()
  90345. }
  90346. return nil, &googleapi.Error{
  90347. Code: res.StatusCode,
  90348. Header: res.Header,
  90349. }
  90350. }
  90351. if err != nil {
  90352. return nil, err
  90353. }
  90354. defer googleapi.CloseBody(res)
  90355. if err := googleapi.CheckResponse(res); err != nil {
  90356. return nil, err
  90357. }
  90358. ret := &Operation{
  90359. ServerResponse: googleapi.ServerResponse{
  90360. Header: res.Header,
  90361. HTTPStatusCode: res.StatusCode,
  90362. },
  90363. }
  90364. target := &ret
  90365. if err := gensupport.DecodeResponse(target, res); err != nil {
  90366. return nil, err
  90367. }
  90368. return ret, nil
  90369. // {
  90370. // "description": "Creates a managed instance group using the information that you specify in the request. After the group is created, it schedules an action to create instances in the group using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the group have not yet been created. You must separately verify the status of the individual instances with the listmanagedinstances method.\n\nA regional managed instance group can contain up to 2000 instances.",
  90371. // "httpMethod": "POST",
  90372. // "id": "compute.regionInstanceGroupManagers.insert",
  90373. // "parameterOrder": [
  90374. // "project",
  90375. // "region"
  90376. // ],
  90377. // "parameters": {
  90378. // "project": {
  90379. // "description": "Project ID for this request.",
  90380. // "location": "path",
  90381. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  90382. // "required": true,
  90383. // "type": "string"
  90384. // },
  90385. // "region": {
  90386. // "description": "Name of the region scoping this request.",
  90387. // "location": "path",
  90388. // "required": true,
  90389. // "type": "string"
  90390. // },
  90391. // "requestId": {
  90392. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  90393. // "location": "query",
  90394. // "type": "string"
  90395. // }
  90396. // },
  90397. // "path": "{project}/regions/{region}/instanceGroupManagers",
  90398. // "request": {
  90399. // "$ref": "InstanceGroupManager"
  90400. // },
  90401. // "response": {
  90402. // "$ref": "Operation"
  90403. // },
  90404. // "scopes": [
  90405. // "https://www.googleapis.com/auth/cloud-platform",
  90406. // "https://www.googleapis.com/auth/compute"
  90407. // ]
  90408. // }
  90409. }
  90410. // method id "compute.regionInstanceGroupManagers.list":
  90411. type RegionInstanceGroupManagersListCall struct {
  90412. s *Service
  90413. project string
  90414. region string
  90415. urlParams_ gensupport.URLParams
  90416. ifNoneMatch_ string
  90417. ctx_ context.Context
  90418. header_ http.Header
  90419. }
  90420. // List: Retrieves the list of managed instance groups that are
  90421. // contained within the specified region.
  90422. func (r *RegionInstanceGroupManagersService) List(project string, region string) *RegionInstanceGroupManagersListCall {
  90423. c := &RegionInstanceGroupManagersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  90424. c.project = project
  90425. c.region = region
  90426. return c
  90427. }
  90428. // Filter sets the optional parameter "filter": A filter expression that
  90429. // filters resources listed in the response. The expression must specify
  90430. // the field name, a comparison operator, and the value that you want to
  90431. // use for filtering. The value must be a string, a number, or a
  90432. // boolean. The comparison operator must be either =, !=, >, or <.
  90433. //
  90434. // For example, if you are filtering Compute Engine instances, you can
  90435. // exclude instances named example-instance by specifying name !=
  90436. // example-instance.
  90437. //
  90438. // You can also filter nested fields. For example, you could specify
  90439. // scheduling.automaticRestart = false to include instances only if they
  90440. // are not scheduled for automatic restarts. You can use filtering on
  90441. // nested fields to filter based on resource labels.
  90442. //
  90443. // To filter on multiple expressions, provide each separate expression
  90444. // within parentheses. For example, (scheduling.automaticRestart = true)
  90445. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  90446. // AND expression. However, you can include AND and OR expressions
  90447. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  90448. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  90449. // true).
  90450. func (c *RegionInstanceGroupManagersListCall) Filter(filter string) *RegionInstanceGroupManagersListCall {
  90451. c.urlParams_.Set("filter", filter)
  90452. return c
  90453. }
  90454. // MaxResults sets the optional parameter "maxResults": The maximum
  90455. // number of results per page that should be returned. If the number of
  90456. // available results is larger than maxResults, Compute Engine returns a
  90457. // nextPageToken that can be used to get the next page of results in
  90458. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  90459. // (Default: 500)
  90460. func (c *RegionInstanceGroupManagersListCall) MaxResults(maxResults int64) *RegionInstanceGroupManagersListCall {
  90461. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  90462. return c
  90463. }
  90464. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  90465. // a certain order. By default, results are returned in alphanumerical
  90466. // order based on the resource name.
  90467. //
  90468. // You can also sort results in descending order based on the creation
  90469. // timestamp using orderBy="creationTimestamp desc". This sorts results
  90470. // based on the creationTimestamp field in reverse chronological order
  90471. // (newest result first). Use this to sort resources like operations so
  90472. // that the newest operation is returned first.
  90473. //
  90474. // Currently, only sorting by name or creationTimestamp desc is
  90475. // supported.
  90476. func (c *RegionInstanceGroupManagersListCall) OrderBy(orderBy string) *RegionInstanceGroupManagersListCall {
  90477. c.urlParams_.Set("orderBy", orderBy)
  90478. return c
  90479. }
  90480. // PageToken sets the optional parameter "pageToken": Specifies a page
  90481. // token to use. Set pageToken to the nextPageToken returned by a
  90482. // previous list request to get the next page of results.
  90483. func (c *RegionInstanceGroupManagersListCall) PageToken(pageToken string) *RegionInstanceGroupManagersListCall {
  90484. c.urlParams_.Set("pageToken", pageToken)
  90485. return c
  90486. }
  90487. // Fields allows partial responses to be retrieved. See
  90488. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  90489. // for more information.
  90490. func (c *RegionInstanceGroupManagersListCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersListCall {
  90491. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  90492. return c
  90493. }
  90494. // IfNoneMatch sets the optional parameter which makes the operation
  90495. // fail if the object's ETag matches the given value. This is useful for
  90496. // getting updates only after the object has changed since the last
  90497. // request. Use googleapi.IsNotModified to check whether the response
  90498. // error from Do is the result of In-None-Match.
  90499. func (c *RegionInstanceGroupManagersListCall) IfNoneMatch(entityTag string) *RegionInstanceGroupManagersListCall {
  90500. c.ifNoneMatch_ = entityTag
  90501. return c
  90502. }
  90503. // Context sets the context to be used in this call's Do method. Any
  90504. // pending HTTP request will be aborted if the provided context is
  90505. // canceled.
  90506. func (c *RegionInstanceGroupManagersListCall) Context(ctx context.Context) *RegionInstanceGroupManagersListCall {
  90507. c.ctx_ = ctx
  90508. return c
  90509. }
  90510. // Header returns an http.Header that can be modified by the caller to
  90511. // add HTTP headers to the request.
  90512. func (c *RegionInstanceGroupManagersListCall) Header() http.Header {
  90513. if c.header_ == nil {
  90514. c.header_ = make(http.Header)
  90515. }
  90516. return c.header_
  90517. }
  90518. func (c *RegionInstanceGroupManagersListCall) doRequest(alt string) (*http.Response, error) {
  90519. reqHeaders := make(http.Header)
  90520. for k, v := range c.header_ {
  90521. reqHeaders[k] = v
  90522. }
  90523. reqHeaders.Set("User-Agent", c.s.userAgent())
  90524. if c.ifNoneMatch_ != "" {
  90525. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  90526. }
  90527. var body io.Reader = nil
  90528. c.urlParams_.Set("alt", alt)
  90529. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers")
  90530. urls += "?" + c.urlParams_.Encode()
  90531. req, _ := http.NewRequest("GET", urls, body)
  90532. req.Header = reqHeaders
  90533. googleapi.Expand(req.URL, map[string]string{
  90534. "project": c.project,
  90535. "region": c.region,
  90536. })
  90537. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  90538. }
  90539. // Do executes the "compute.regionInstanceGroupManagers.list" call.
  90540. // Exactly one of *RegionInstanceGroupManagerList or error will be
  90541. // non-nil. Any non-2xx status code is an error. Response headers are in
  90542. // either *RegionInstanceGroupManagerList.ServerResponse.Header or (if a
  90543. // response was returned at all) in error.(*googleapi.Error).Header. Use
  90544. // googleapi.IsNotModified to check whether the returned error was
  90545. // because http.StatusNotModified was returned.
  90546. func (c *RegionInstanceGroupManagersListCall) Do(opts ...googleapi.CallOption) (*RegionInstanceGroupManagerList, error) {
  90547. gensupport.SetOptions(c.urlParams_, opts...)
  90548. res, err := c.doRequest("json")
  90549. if res != nil && res.StatusCode == http.StatusNotModified {
  90550. if res.Body != nil {
  90551. res.Body.Close()
  90552. }
  90553. return nil, &googleapi.Error{
  90554. Code: res.StatusCode,
  90555. Header: res.Header,
  90556. }
  90557. }
  90558. if err != nil {
  90559. return nil, err
  90560. }
  90561. defer googleapi.CloseBody(res)
  90562. if err := googleapi.CheckResponse(res); err != nil {
  90563. return nil, err
  90564. }
  90565. ret := &RegionInstanceGroupManagerList{
  90566. ServerResponse: googleapi.ServerResponse{
  90567. Header: res.Header,
  90568. HTTPStatusCode: res.StatusCode,
  90569. },
  90570. }
  90571. target := &ret
  90572. if err := gensupport.DecodeResponse(target, res); err != nil {
  90573. return nil, err
  90574. }
  90575. return ret, nil
  90576. // {
  90577. // "description": "Retrieves the list of managed instance groups that are contained within the specified region.",
  90578. // "httpMethod": "GET",
  90579. // "id": "compute.regionInstanceGroupManagers.list",
  90580. // "parameterOrder": [
  90581. // "project",
  90582. // "region"
  90583. // ],
  90584. // "parameters": {
  90585. // "filter": {
  90586. // "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).",
  90587. // "location": "query",
  90588. // "type": "string"
  90589. // },
  90590. // "maxResults": {
  90591. // "default": "500",
  90592. // "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)",
  90593. // "format": "uint32",
  90594. // "location": "query",
  90595. // "minimum": "0",
  90596. // "type": "integer"
  90597. // },
  90598. // "orderBy": {
  90599. // "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.",
  90600. // "location": "query",
  90601. // "type": "string"
  90602. // },
  90603. // "pageToken": {
  90604. // "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.",
  90605. // "location": "query",
  90606. // "type": "string"
  90607. // },
  90608. // "project": {
  90609. // "description": "Project ID for this request.",
  90610. // "location": "path",
  90611. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  90612. // "required": true,
  90613. // "type": "string"
  90614. // },
  90615. // "region": {
  90616. // "description": "Name of the region scoping this request.",
  90617. // "location": "path",
  90618. // "required": true,
  90619. // "type": "string"
  90620. // }
  90621. // },
  90622. // "path": "{project}/regions/{region}/instanceGroupManagers",
  90623. // "response": {
  90624. // "$ref": "RegionInstanceGroupManagerList"
  90625. // },
  90626. // "scopes": [
  90627. // "https://www.googleapis.com/auth/cloud-platform",
  90628. // "https://www.googleapis.com/auth/compute",
  90629. // "https://www.googleapis.com/auth/compute.readonly"
  90630. // ]
  90631. // }
  90632. }
  90633. // Pages invokes f for each page of results.
  90634. // A non-nil error returned from f will halt the iteration.
  90635. // The provided context supersedes any context provided to the Context method.
  90636. func (c *RegionInstanceGroupManagersListCall) Pages(ctx context.Context, f func(*RegionInstanceGroupManagerList) error) error {
  90637. c.ctx_ = ctx
  90638. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  90639. for {
  90640. x, err := c.Do()
  90641. if err != nil {
  90642. return err
  90643. }
  90644. if err := f(x); err != nil {
  90645. return err
  90646. }
  90647. if x.NextPageToken == "" {
  90648. return nil
  90649. }
  90650. c.PageToken(x.NextPageToken)
  90651. }
  90652. }
  90653. // method id "compute.regionInstanceGroupManagers.listManagedInstances":
  90654. type RegionInstanceGroupManagersListManagedInstancesCall struct {
  90655. s *Service
  90656. project string
  90657. region string
  90658. instanceGroupManager string
  90659. urlParams_ gensupport.URLParams
  90660. ctx_ context.Context
  90661. header_ http.Header
  90662. }
  90663. // ListManagedInstances: Lists the instances in the managed instance
  90664. // group and instances that are scheduled to be created. The list
  90665. // includes any current actions that the group has scheduled for its
  90666. // instances.
  90667. func (r *RegionInstanceGroupManagersService) ListManagedInstances(project string, region string, instanceGroupManager string) *RegionInstanceGroupManagersListManagedInstancesCall {
  90668. c := &RegionInstanceGroupManagersListManagedInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  90669. c.project = project
  90670. c.region = region
  90671. c.instanceGroupManager = instanceGroupManager
  90672. return c
  90673. }
  90674. // Filter sets the optional parameter "filter":
  90675. func (c *RegionInstanceGroupManagersListManagedInstancesCall) Filter(filter string) *RegionInstanceGroupManagersListManagedInstancesCall {
  90676. c.urlParams_.Set("filter", filter)
  90677. return c
  90678. }
  90679. // MaxResults sets the optional parameter "maxResults":
  90680. func (c *RegionInstanceGroupManagersListManagedInstancesCall) MaxResults(maxResults int64) *RegionInstanceGroupManagersListManagedInstancesCall {
  90681. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  90682. return c
  90683. }
  90684. // OrderBy sets the optional parameter "order_by":
  90685. func (c *RegionInstanceGroupManagersListManagedInstancesCall) OrderBy(orderBy string) *RegionInstanceGroupManagersListManagedInstancesCall {
  90686. c.urlParams_.Set("order_by", orderBy)
  90687. return c
  90688. }
  90689. // PageToken sets the optional parameter "pageToken":
  90690. func (c *RegionInstanceGroupManagersListManagedInstancesCall) PageToken(pageToken string) *RegionInstanceGroupManagersListManagedInstancesCall {
  90691. c.urlParams_.Set("pageToken", pageToken)
  90692. return c
  90693. }
  90694. // Fields allows partial responses to be retrieved. See
  90695. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  90696. // for more information.
  90697. func (c *RegionInstanceGroupManagersListManagedInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersListManagedInstancesCall {
  90698. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  90699. return c
  90700. }
  90701. // Context sets the context to be used in this call's Do method. Any
  90702. // pending HTTP request will be aborted if the provided context is
  90703. // canceled.
  90704. func (c *RegionInstanceGroupManagersListManagedInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersListManagedInstancesCall {
  90705. c.ctx_ = ctx
  90706. return c
  90707. }
  90708. // Header returns an http.Header that can be modified by the caller to
  90709. // add HTTP headers to the request.
  90710. func (c *RegionInstanceGroupManagersListManagedInstancesCall) Header() http.Header {
  90711. if c.header_ == nil {
  90712. c.header_ = make(http.Header)
  90713. }
  90714. return c.header_
  90715. }
  90716. func (c *RegionInstanceGroupManagersListManagedInstancesCall) doRequest(alt string) (*http.Response, error) {
  90717. reqHeaders := make(http.Header)
  90718. for k, v := range c.header_ {
  90719. reqHeaders[k] = v
  90720. }
  90721. reqHeaders.Set("User-Agent", c.s.userAgent())
  90722. var body io.Reader = nil
  90723. c.urlParams_.Set("alt", alt)
  90724. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances")
  90725. urls += "?" + c.urlParams_.Encode()
  90726. req, _ := http.NewRequest("POST", urls, body)
  90727. req.Header = reqHeaders
  90728. googleapi.Expand(req.URL, map[string]string{
  90729. "project": c.project,
  90730. "region": c.region,
  90731. "instanceGroupManager": c.instanceGroupManager,
  90732. })
  90733. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  90734. }
  90735. // Do executes the "compute.regionInstanceGroupManagers.listManagedInstances" call.
  90736. // Exactly one of *RegionInstanceGroupManagersListInstancesResponse or
  90737. // error will be non-nil. Any non-2xx status code is an error. Response
  90738. // headers are in either
  90739. // *RegionInstanceGroupManagersListInstancesResponse.ServerResponse.Heade
  90740. // r or (if a response was returned at all) in
  90741. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  90742. // whether the returned error was because http.StatusNotModified was
  90743. // returned.
  90744. func (c *RegionInstanceGroupManagersListManagedInstancesCall) Do(opts ...googleapi.CallOption) (*RegionInstanceGroupManagersListInstancesResponse, error) {
  90745. gensupport.SetOptions(c.urlParams_, opts...)
  90746. res, err := c.doRequest("json")
  90747. if res != nil && res.StatusCode == http.StatusNotModified {
  90748. if res.Body != nil {
  90749. res.Body.Close()
  90750. }
  90751. return nil, &googleapi.Error{
  90752. Code: res.StatusCode,
  90753. Header: res.Header,
  90754. }
  90755. }
  90756. if err != nil {
  90757. return nil, err
  90758. }
  90759. defer googleapi.CloseBody(res)
  90760. if err := googleapi.CheckResponse(res); err != nil {
  90761. return nil, err
  90762. }
  90763. ret := &RegionInstanceGroupManagersListInstancesResponse{
  90764. ServerResponse: googleapi.ServerResponse{
  90765. Header: res.Header,
  90766. HTTPStatusCode: res.StatusCode,
  90767. },
  90768. }
  90769. target := &ret
  90770. if err := gensupport.DecodeResponse(target, res); err != nil {
  90771. return nil, err
  90772. }
  90773. return ret, nil
  90774. // {
  90775. // "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.",
  90776. // "httpMethod": "POST",
  90777. // "id": "compute.regionInstanceGroupManagers.listManagedInstances",
  90778. // "parameterOrder": [
  90779. // "project",
  90780. // "region",
  90781. // "instanceGroupManager"
  90782. // ],
  90783. // "parameters": {
  90784. // "filter": {
  90785. // "location": "query",
  90786. // "type": "string"
  90787. // },
  90788. // "instanceGroupManager": {
  90789. // "description": "The name of the managed instance group.",
  90790. // "location": "path",
  90791. // "required": true,
  90792. // "type": "string"
  90793. // },
  90794. // "maxResults": {
  90795. // "default": "500",
  90796. // "format": "uint32",
  90797. // "location": "query",
  90798. // "minimum": "0",
  90799. // "type": "integer"
  90800. // },
  90801. // "order_by": {
  90802. // "location": "query",
  90803. // "type": "string"
  90804. // },
  90805. // "pageToken": {
  90806. // "location": "query",
  90807. // "type": "string"
  90808. // },
  90809. // "project": {
  90810. // "description": "Project ID for this request.",
  90811. // "location": "path",
  90812. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  90813. // "required": true,
  90814. // "type": "string"
  90815. // },
  90816. // "region": {
  90817. // "description": "Name of the region scoping this request.",
  90818. // "location": "path",
  90819. // "required": true,
  90820. // "type": "string"
  90821. // }
  90822. // },
  90823. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances",
  90824. // "response": {
  90825. // "$ref": "RegionInstanceGroupManagersListInstancesResponse"
  90826. // },
  90827. // "scopes": [
  90828. // "https://www.googleapis.com/auth/cloud-platform",
  90829. // "https://www.googleapis.com/auth/compute",
  90830. // "https://www.googleapis.com/auth/compute.readonly"
  90831. // ]
  90832. // }
  90833. }
  90834. // Pages invokes f for each page of results.
  90835. // A non-nil error returned from f will halt the iteration.
  90836. // The provided context supersedes any context provided to the Context method.
  90837. func (c *RegionInstanceGroupManagersListManagedInstancesCall) Pages(ctx context.Context, f func(*RegionInstanceGroupManagersListInstancesResponse) error) error {
  90838. c.ctx_ = ctx
  90839. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  90840. for {
  90841. x, err := c.Do()
  90842. if err != nil {
  90843. return err
  90844. }
  90845. if err := f(x); err != nil {
  90846. return err
  90847. }
  90848. if x.NextPageToken == "" {
  90849. return nil
  90850. }
  90851. c.PageToken(x.NextPageToken)
  90852. }
  90853. }
  90854. // method id "compute.regionInstanceGroupManagers.listPerInstanceConfigs":
  90855. type RegionInstanceGroupManagersListPerInstanceConfigsCall struct {
  90856. s *Service
  90857. project string
  90858. region string
  90859. instanceGroupManager string
  90860. urlParams_ gensupport.URLParams
  90861. ctx_ context.Context
  90862. header_ http.Header
  90863. }
  90864. // ListPerInstanceConfigs: Lists all of the per-instance configs defined
  90865. // for the managed instance group.
  90866. func (r *RegionInstanceGroupManagersService) ListPerInstanceConfigs(project string, region string, instanceGroupManager string) *RegionInstanceGroupManagersListPerInstanceConfigsCall {
  90867. c := &RegionInstanceGroupManagersListPerInstanceConfigsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  90868. c.project = project
  90869. c.region = region
  90870. c.instanceGroupManager = instanceGroupManager
  90871. return c
  90872. }
  90873. // Filter sets the optional parameter "filter": A filter expression that
  90874. // filters resources listed in the response. The expression must specify
  90875. // the field name, a comparison operator, and the value that you want to
  90876. // use for filtering. The value must be a string, a number, or a
  90877. // boolean. The comparison operator must be either =, !=, >, or <.
  90878. //
  90879. // For example, if you are filtering Compute Engine instances, you can
  90880. // exclude instances named example-instance by specifying name !=
  90881. // example-instance.
  90882. //
  90883. // You can also filter nested fields. For example, you could specify
  90884. // scheduling.automaticRestart = false to include instances only if they
  90885. // are not scheduled for automatic restarts. You can use filtering on
  90886. // nested fields to filter based on resource labels.
  90887. //
  90888. // To filter on multiple expressions, provide each separate expression
  90889. // within parentheses. For example, (scheduling.automaticRestart = true)
  90890. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  90891. // AND expression. However, you can include AND and OR expressions
  90892. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  90893. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  90894. // true).
  90895. func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) Filter(filter string) *RegionInstanceGroupManagersListPerInstanceConfigsCall {
  90896. c.urlParams_.Set("filter", filter)
  90897. return c
  90898. }
  90899. // MaxResults sets the optional parameter "maxResults": The maximum
  90900. // number of results per page that should be returned. If the number of
  90901. // available results is larger than maxResults, Compute Engine returns a
  90902. // nextPageToken that can be used to get the next page of results in
  90903. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  90904. // (Default: 500)
  90905. func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) MaxResults(maxResults int64) *RegionInstanceGroupManagersListPerInstanceConfigsCall {
  90906. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  90907. return c
  90908. }
  90909. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  90910. // a certain order. By default, results are returned in alphanumerical
  90911. // order based on the resource name.
  90912. //
  90913. // You can also sort results in descending order based on the creation
  90914. // timestamp using orderBy="creationTimestamp desc". This sorts results
  90915. // based on the creationTimestamp field in reverse chronological order
  90916. // (newest result first). Use this to sort resources like operations so
  90917. // that the newest operation is returned first.
  90918. //
  90919. // Currently, only sorting by name or creationTimestamp desc is
  90920. // supported.
  90921. func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) OrderBy(orderBy string) *RegionInstanceGroupManagersListPerInstanceConfigsCall {
  90922. c.urlParams_.Set("orderBy", orderBy)
  90923. return c
  90924. }
  90925. // PageToken sets the optional parameter "pageToken": Specifies a page
  90926. // token to use. Set pageToken to the nextPageToken returned by a
  90927. // previous list request to get the next page of results.
  90928. func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) PageToken(pageToken string) *RegionInstanceGroupManagersListPerInstanceConfigsCall {
  90929. c.urlParams_.Set("pageToken", pageToken)
  90930. return c
  90931. }
  90932. // Fields allows partial responses to be retrieved. See
  90933. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  90934. // for more information.
  90935. func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersListPerInstanceConfigsCall {
  90936. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  90937. return c
  90938. }
  90939. // Context sets the context to be used in this call's Do method. Any
  90940. // pending HTTP request will be aborted if the provided context is
  90941. // canceled.
  90942. func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) Context(ctx context.Context) *RegionInstanceGroupManagersListPerInstanceConfigsCall {
  90943. c.ctx_ = ctx
  90944. return c
  90945. }
  90946. // Header returns an http.Header that can be modified by the caller to
  90947. // add HTTP headers to the request.
  90948. func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) Header() http.Header {
  90949. if c.header_ == nil {
  90950. c.header_ = make(http.Header)
  90951. }
  90952. return c.header_
  90953. }
  90954. func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) doRequest(alt string) (*http.Response, error) {
  90955. reqHeaders := make(http.Header)
  90956. for k, v := range c.header_ {
  90957. reqHeaders[k] = v
  90958. }
  90959. reqHeaders.Set("User-Agent", c.s.userAgent())
  90960. var body io.Reader = nil
  90961. c.urlParams_.Set("alt", alt)
  90962. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listPerInstanceConfigs")
  90963. urls += "?" + c.urlParams_.Encode()
  90964. req, _ := http.NewRequest("POST", urls, body)
  90965. req.Header = reqHeaders
  90966. googleapi.Expand(req.URL, map[string]string{
  90967. "project": c.project,
  90968. "region": c.region,
  90969. "instanceGroupManager": c.instanceGroupManager,
  90970. })
  90971. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  90972. }
  90973. // Do executes the "compute.regionInstanceGroupManagers.listPerInstanceConfigs" call.
  90974. // Exactly one of *RegionInstanceGroupManagersListInstanceConfigsResp or
  90975. // error will be non-nil. Any non-2xx status code is an error. Response
  90976. // headers are in either
  90977. // *RegionInstanceGroupManagersListInstanceConfigsResp.ServerResponse.Hea
  90978. // der or (if a response was returned at all) in
  90979. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  90980. // whether the returned error was because http.StatusNotModified was
  90981. // returned.
  90982. func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) Do(opts ...googleapi.CallOption) (*RegionInstanceGroupManagersListInstanceConfigsResp, error) {
  90983. gensupport.SetOptions(c.urlParams_, opts...)
  90984. res, err := c.doRequest("json")
  90985. if res != nil && res.StatusCode == http.StatusNotModified {
  90986. if res.Body != nil {
  90987. res.Body.Close()
  90988. }
  90989. return nil, &googleapi.Error{
  90990. Code: res.StatusCode,
  90991. Header: res.Header,
  90992. }
  90993. }
  90994. if err != nil {
  90995. return nil, err
  90996. }
  90997. defer googleapi.CloseBody(res)
  90998. if err := googleapi.CheckResponse(res); err != nil {
  90999. return nil, err
  91000. }
  91001. ret := &RegionInstanceGroupManagersListInstanceConfigsResp{
  91002. ServerResponse: googleapi.ServerResponse{
  91003. Header: res.Header,
  91004. HTTPStatusCode: res.StatusCode,
  91005. },
  91006. }
  91007. target := &ret
  91008. if err := gensupport.DecodeResponse(target, res); err != nil {
  91009. return nil, err
  91010. }
  91011. return ret, nil
  91012. // {
  91013. // "description": "Lists all of the per-instance configs defined for the managed instance group.",
  91014. // "httpMethod": "POST",
  91015. // "id": "compute.regionInstanceGroupManagers.listPerInstanceConfigs",
  91016. // "parameterOrder": [
  91017. // "project",
  91018. // "region",
  91019. // "instanceGroupManager"
  91020. // ],
  91021. // "parameters": {
  91022. // "filter": {
  91023. // "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).",
  91024. // "location": "query",
  91025. // "type": "string"
  91026. // },
  91027. // "instanceGroupManager": {
  91028. // "description": "The name of the managed instance group. It should conform to RFC1035.",
  91029. // "location": "path",
  91030. // "required": true,
  91031. // "type": "string"
  91032. // },
  91033. // "maxResults": {
  91034. // "default": "500",
  91035. // "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)",
  91036. // "format": "uint32",
  91037. // "location": "query",
  91038. // "minimum": "0",
  91039. // "type": "integer"
  91040. // },
  91041. // "orderBy": {
  91042. // "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.",
  91043. // "location": "query",
  91044. // "type": "string"
  91045. // },
  91046. // "pageToken": {
  91047. // "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.",
  91048. // "location": "query",
  91049. // "type": "string"
  91050. // },
  91051. // "project": {
  91052. // "description": "Project ID for this request.",
  91053. // "location": "path",
  91054. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  91055. // "required": true,
  91056. // "type": "string"
  91057. // },
  91058. // "region": {
  91059. // "description": "Name of the region scoping this request, should conform to RFC1035.",
  91060. // "location": "path",
  91061. // "required": true,
  91062. // "type": "string"
  91063. // }
  91064. // },
  91065. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listPerInstanceConfigs",
  91066. // "response": {
  91067. // "$ref": "RegionInstanceGroupManagersListInstanceConfigsResp"
  91068. // },
  91069. // "scopes": [
  91070. // "https://www.googleapis.com/auth/cloud-platform",
  91071. // "https://www.googleapis.com/auth/compute",
  91072. // "https://www.googleapis.com/auth/compute.readonly"
  91073. // ]
  91074. // }
  91075. }
  91076. // Pages invokes f for each page of results.
  91077. // A non-nil error returned from f will halt the iteration.
  91078. // The provided context supersedes any context provided to the Context method.
  91079. func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) Pages(ctx context.Context, f func(*RegionInstanceGroupManagersListInstanceConfigsResp) error) error {
  91080. c.ctx_ = ctx
  91081. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  91082. for {
  91083. x, err := c.Do()
  91084. if err != nil {
  91085. return err
  91086. }
  91087. if err := f(x); err != nil {
  91088. return err
  91089. }
  91090. if x.NextPageToken == "" {
  91091. return nil
  91092. }
  91093. c.PageToken(x.NextPageToken)
  91094. }
  91095. }
  91096. // method id "compute.regionInstanceGroupManagers.patch":
  91097. type RegionInstanceGroupManagersPatchCall struct {
  91098. s *Service
  91099. project string
  91100. region string
  91101. instanceGroupManager string
  91102. instancegroupmanager *InstanceGroupManager
  91103. urlParams_ gensupport.URLParams
  91104. ctx_ context.Context
  91105. header_ http.Header
  91106. }
  91107. // Patch: Updates a managed instance group using the information that
  91108. // you specify in the request. This operation is marked as DONE when the
  91109. // group is patched even if the instances in the group are still in the
  91110. // process of being patched. You must separately verify the status of
  91111. // the individual instances with the listmanagedinstances method. This
  91112. // method supports PATCH semantics and uses the JSON merge patch format
  91113. // and processing rules.
  91114. func (r *RegionInstanceGroupManagersService) Patch(project string, region string, instanceGroupManager string, instancegroupmanager *InstanceGroupManager) *RegionInstanceGroupManagersPatchCall {
  91115. c := &RegionInstanceGroupManagersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  91116. c.project = project
  91117. c.region = region
  91118. c.instanceGroupManager = instanceGroupManager
  91119. c.instancegroupmanager = instancegroupmanager
  91120. return c
  91121. }
  91122. // RequestId sets the optional parameter "requestId": An optional
  91123. // request ID to identify requests. Specify a unique request ID so that
  91124. // if you must retry your request, the server will know to ignore the
  91125. // request if it has already been completed.
  91126. //
  91127. // For example, consider a situation where you make an initial request
  91128. // and the request times out. If you make the request again with the
  91129. // same request ID, the server can check if original operation with the
  91130. // same request ID was received, and if so, will ignore the second
  91131. // request. This prevents clients from accidentally creating duplicate
  91132. // commitments.
  91133. //
  91134. // The request ID must be a valid UUID with the exception that zero UUID
  91135. // is not supported (00000000-0000-0000-0000-000000000000).
  91136. func (c *RegionInstanceGroupManagersPatchCall) RequestId(requestId string) *RegionInstanceGroupManagersPatchCall {
  91137. c.urlParams_.Set("requestId", requestId)
  91138. return c
  91139. }
  91140. // Fields allows partial responses to be retrieved. See
  91141. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  91142. // for more information.
  91143. func (c *RegionInstanceGroupManagersPatchCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersPatchCall {
  91144. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  91145. return c
  91146. }
  91147. // Context sets the context to be used in this call's Do method. Any
  91148. // pending HTTP request will be aborted if the provided context is
  91149. // canceled.
  91150. func (c *RegionInstanceGroupManagersPatchCall) Context(ctx context.Context) *RegionInstanceGroupManagersPatchCall {
  91151. c.ctx_ = ctx
  91152. return c
  91153. }
  91154. // Header returns an http.Header that can be modified by the caller to
  91155. // add HTTP headers to the request.
  91156. func (c *RegionInstanceGroupManagersPatchCall) Header() http.Header {
  91157. if c.header_ == nil {
  91158. c.header_ = make(http.Header)
  91159. }
  91160. return c.header_
  91161. }
  91162. func (c *RegionInstanceGroupManagersPatchCall) doRequest(alt string) (*http.Response, error) {
  91163. reqHeaders := make(http.Header)
  91164. for k, v := range c.header_ {
  91165. reqHeaders[k] = v
  91166. }
  91167. reqHeaders.Set("User-Agent", c.s.userAgent())
  91168. var body io.Reader = nil
  91169. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager)
  91170. if err != nil {
  91171. return nil, err
  91172. }
  91173. reqHeaders.Set("Content-Type", "application/json")
  91174. c.urlParams_.Set("alt", alt)
  91175. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}")
  91176. urls += "?" + c.urlParams_.Encode()
  91177. req, _ := http.NewRequest("PATCH", urls, body)
  91178. req.Header = reqHeaders
  91179. googleapi.Expand(req.URL, map[string]string{
  91180. "project": c.project,
  91181. "region": c.region,
  91182. "instanceGroupManager": c.instanceGroupManager,
  91183. })
  91184. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  91185. }
  91186. // Do executes the "compute.regionInstanceGroupManagers.patch" call.
  91187. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  91188. // status code is an error. Response headers are in either
  91189. // *Operation.ServerResponse.Header or (if a response was returned at
  91190. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  91191. // to check whether the returned error was because
  91192. // http.StatusNotModified was returned.
  91193. func (c *RegionInstanceGroupManagersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  91194. gensupport.SetOptions(c.urlParams_, opts...)
  91195. res, err := c.doRequest("json")
  91196. if res != nil && res.StatusCode == http.StatusNotModified {
  91197. if res.Body != nil {
  91198. res.Body.Close()
  91199. }
  91200. return nil, &googleapi.Error{
  91201. Code: res.StatusCode,
  91202. Header: res.Header,
  91203. }
  91204. }
  91205. if err != nil {
  91206. return nil, err
  91207. }
  91208. defer googleapi.CloseBody(res)
  91209. if err := googleapi.CheckResponse(res); err != nil {
  91210. return nil, err
  91211. }
  91212. ret := &Operation{
  91213. ServerResponse: googleapi.ServerResponse{
  91214. Header: res.Header,
  91215. HTTPStatusCode: res.StatusCode,
  91216. },
  91217. }
  91218. target := &ret
  91219. if err := gensupport.DecodeResponse(target, res); err != nil {
  91220. return nil, err
  91221. }
  91222. return ret, nil
  91223. // {
  91224. // "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.",
  91225. // "httpMethod": "PATCH",
  91226. // "id": "compute.regionInstanceGroupManagers.patch",
  91227. // "parameterOrder": [
  91228. // "project",
  91229. // "region",
  91230. // "instanceGroupManager"
  91231. // ],
  91232. // "parameters": {
  91233. // "instanceGroupManager": {
  91234. // "description": "The name of the instance group manager.",
  91235. // "location": "path",
  91236. // "required": true,
  91237. // "type": "string"
  91238. // },
  91239. // "project": {
  91240. // "description": "Project ID for this request.",
  91241. // "location": "path",
  91242. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  91243. // "required": true,
  91244. // "type": "string"
  91245. // },
  91246. // "region": {
  91247. // "description": "Name of the region scoping this request.",
  91248. // "location": "path",
  91249. // "required": true,
  91250. // "type": "string"
  91251. // },
  91252. // "requestId": {
  91253. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  91254. // "location": "query",
  91255. // "type": "string"
  91256. // }
  91257. // },
  91258. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}",
  91259. // "request": {
  91260. // "$ref": "InstanceGroupManager"
  91261. // },
  91262. // "response": {
  91263. // "$ref": "Operation"
  91264. // },
  91265. // "scopes": [
  91266. // "https://www.googleapis.com/auth/cloud-platform",
  91267. // "https://www.googleapis.com/auth/compute"
  91268. // ]
  91269. // }
  91270. }
  91271. // method id "compute.regionInstanceGroupManagers.recreateInstances":
  91272. type RegionInstanceGroupManagersRecreateInstancesCall struct {
  91273. s *Service
  91274. project string
  91275. region string
  91276. instanceGroupManager string
  91277. regioninstancegroupmanagersrecreaterequest *RegionInstanceGroupManagersRecreateRequest
  91278. urlParams_ gensupport.URLParams
  91279. ctx_ context.Context
  91280. header_ http.Header
  91281. }
  91282. // RecreateInstances: Schedules a group action to recreate the specified
  91283. // instances in the managed instance group. The instances are deleted
  91284. // and recreated using the current instance template for the managed
  91285. // instance group. This operation is marked as DONE when the action is
  91286. // scheduled even if the instances have not yet been recreated. You must
  91287. // separately verify the status of the recreating action with the
  91288. // listmanagedinstances method.
  91289. //
  91290. // If the group is part of a backend service that has enabled connection
  91291. // draining, it can take up to 60 seconds after the connection draining
  91292. // duration has elapsed before the VM instance is removed or
  91293. // deleted.
  91294. //
  91295. // You can specify a maximum of 1000 instances with this method per
  91296. // request.
  91297. func (r *RegionInstanceGroupManagersService) RecreateInstances(project string, region string, instanceGroupManager string, regioninstancegroupmanagersrecreaterequest *RegionInstanceGroupManagersRecreateRequest) *RegionInstanceGroupManagersRecreateInstancesCall {
  91298. c := &RegionInstanceGroupManagersRecreateInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  91299. c.project = project
  91300. c.region = region
  91301. c.instanceGroupManager = instanceGroupManager
  91302. c.regioninstancegroupmanagersrecreaterequest = regioninstancegroupmanagersrecreaterequest
  91303. return c
  91304. }
  91305. // RequestId sets the optional parameter "requestId": An optional
  91306. // request ID to identify requests. Specify a unique request ID so that
  91307. // if you must retry your request, the server will know to ignore the
  91308. // request if it has already been completed.
  91309. //
  91310. // For example, consider a situation where you make an initial request
  91311. // and the request times out. If you make the request again with the
  91312. // same request ID, the server can check if original operation with the
  91313. // same request ID was received, and if so, will ignore the second
  91314. // request. This prevents clients from accidentally creating duplicate
  91315. // commitments.
  91316. //
  91317. // The request ID must be a valid UUID with the exception that zero UUID
  91318. // is not supported (00000000-0000-0000-0000-000000000000).
  91319. func (c *RegionInstanceGroupManagersRecreateInstancesCall) RequestId(requestId string) *RegionInstanceGroupManagersRecreateInstancesCall {
  91320. c.urlParams_.Set("requestId", requestId)
  91321. return c
  91322. }
  91323. // Fields allows partial responses to be retrieved. See
  91324. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  91325. // for more information.
  91326. func (c *RegionInstanceGroupManagersRecreateInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersRecreateInstancesCall {
  91327. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  91328. return c
  91329. }
  91330. // Context sets the context to be used in this call's Do method. Any
  91331. // pending HTTP request will be aborted if the provided context is
  91332. // canceled.
  91333. func (c *RegionInstanceGroupManagersRecreateInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersRecreateInstancesCall {
  91334. c.ctx_ = ctx
  91335. return c
  91336. }
  91337. // Header returns an http.Header that can be modified by the caller to
  91338. // add HTTP headers to the request.
  91339. func (c *RegionInstanceGroupManagersRecreateInstancesCall) Header() http.Header {
  91340. if c.header_ == nil {
  91341. c.header_ = make(http.Header)
  91342. }
  91343. return c.header_
  91344. }
  91345. func (c *RegionInstanceGroupManagersRecreateInstancesCall) doRequest(alt string) (*http.Response, error) {
  91346. reqHeaders := make(http.Header)
  91347. for k, v := range c.header_ {
  91348. reqHeaders[k] = v
  91349. }
  91350. reqHeaders.Set("User-Agent", c.s.userAgent())
  91351. var body io.Reader = nil
  91352. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersrecreaterequest)
  91353. if err != nil {
  91354. return nil, err
  91355. }
  91356. reqHeaders.Set("Content-Type", "application/json")
  91357. c.urlParams_.Set("alt", alt)
  91358. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/recreateInstances")
  91359. urls += "?" + c.urlParams_.Encode()
  91360. req, _ := http.NewRequest("POST", urls, body)
  91361. req.Header = reqHeaders
  91362. googleapi.Expand(req.URL, map[string]string{
  91363. "project": c.project,
  91364. "region": c.region,
  91365. "instanceGroupManager": c.instanceGroupManager,
  91366. })
  91367. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  91368. }
  91369. // Do executes the "compute.regionInstanceGroupManagers.recreateInstances" call.
  91370. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  91371. // status code is an error. Response headers are in either
  91372. // *Operation.ServerResponse.Header or (if a response was returned at
  91373. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  91374. // to check whether the returned error was because
  91375. // http.StatusNotModified was returned.
  91376. func (c *RegionInstanceGroupManagersRecreateInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  91377. gensupport.SetOptions(c.urlParams_, opts...)
  91378. res, err := c.doRequest("json")
  91379. if res != nil && res.StatusCode == http.StatusNotModified {
  91380. if res.Body != nil {
  91381. res.Body.Close()
  91382. }
  91383. return nil, &googleapi.Error{
  91384. Code: res.StatusCode,
  91385. Header: res.Header,
  91386. }
  91387. }
  91388. if err != nil {
  91389. return nil, err
  91390. }
  91391. defer googleapi.CloseBody(res)
  91392. if err := googleapi.CheckResponse(res); err != nil {
  91393. return nil, err
  91394. }
  91395. ret := &Operation{
  91396. ServerResponse: googleapi.ServerResponse{
  91397. Header: res.Header,
  91398. HTTPStatusCode: res.StatusCode,
  91399. },
  91400. }
  91401. target := &ret
  91402. if err := gensupport.DecodeResponse(target, res); err != nil {
  91403. return nil, err
  91404. }
  91405. return ret, nil
  91406. // {
  91407. // "description": "Schedules a group action to recreate the specified instances in the managed instance group. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the action is scheduled even if the instances have not yet been recreated. You must separately verify the status of the recreating action with the listmanagedinstances method.\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.",
  91408. // "httpMethod": "POST",
  91409. // "id": "compute.regionInstanceGroupManagers.recreateInstances",
  91410. // "parameterOrder": [
  91411. // "project",
  91412. // "region",
  91413. // "instanceGroupManager"
  91414. // ],
  91415. // "parameters": {
  91416. // "instanceGroupManager": {
  91417. // "description": "Name of the managed instance group.",
  91418. // "location": "path",
  91419. // "required": true,
  91420. // "type": "string"
  91421. // },
  91422. // "project": {
  91423. // "description": "Project ID for this request.",
  91424. // "location": "path",
  91425. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  91426. // "required": true,
  91427. // "type": "string"
  91428. // },
  91429. // "region": {
  91430. // "description": "Name of the region scoping this request.",
  91431. // "location": "path",
  91432. // "required": true,
  91433. // "type": "string"
  91434. // },
  91435. // "requestId": {
  91436. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  91437. // "location": "query",
  91438. // "type": "string"
  91439. // }
  91440. // },
  91441. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/recreateInstances",
  91442. // "request": {
  91443. // "$ref": "RegionInstanceGroupManagersRecreateRequest"
  91444. // },
  91445. // "response": {
  91446. // "$ref": "Operation"
  91447. // },
  91448. // "scopes": [
  91449. // "https://www.googleapis.com/auth/cloud-platform",
  91450. // "https://www.googleapis.com/auth/compute"
  91451. // ]
  91452. // }
  91453. }
  91454. // method id "compute.regionInstanceGroupManagers.resize":
  91455. type RegionInstanceGroupManagersResizeCall struct {
  91456. s *Service
  91457. project string
  91458. region string
  91459. instanceGroupManager string
  91460. urlParams_ gensupport.URLParams
  91461. ctx_ context.Context
  91462. header_ http.Header
  91463. }
  91464. // Resize: Changes the intended size for the managed instance group. If
  91465. // you increase the size, the group schedules actions to create new
  91466. // instances using the current instance template. If you decrease the
  91467. // size, the group schedules delete actions on one or more instances.
  91468. // The resize operation is marked DONE when the resize actions are
  91469. // scheduled even if the group has not yet added or deleted any
  91470. // instances. You must separately verify the status of the creating or
  91471. // deleting actions with the listmanagedinstances method.
  91472. //
  91473. // If the group is part of a backend service that has enabled connection
  91474. // draining, it can take up to 60 seconds after the connection draining
  91475. // duration has elapsed before the VM instance is removed or deleted.
  91476. func (r *RegionInstanceGroupManagersService) Resize(project string, region string, instanceGroupManager string, size int64) *RegionInstanceGroupManagersResizeCall {
  91477. c := &RegionInstanceGroupManagersResizeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  91478. c.project = project
  91479. c.region = region
  91480. c.instanceGroupManager = instanceGroupManager
  91481. c.urlParams_.Set("size", fmt.Sprint(size))
  91482. return c
  91483. }
  91484. // RequestId sets the optional parameter "requestId": An optional
  91485. // request ID to identify requests. Specify a unique request ID so that
  91486. // if you must retry your request, the server will know to ignore the
  91487. // request if it has already been completed.
  91488. //
  91489. // For example, consider a situation where you make an initial request
  91490. // and the request times out. If you make the request again with the
  91491. // same request ID, the server can check if original operation with the
  91492. // same request ID was received, and if so, will ignore the second
  91493. // request. This prevents clients from accidentally creating duplicate
  91494. // commitments.
  91495. //
  91496. // The request ID must be a valid UUID with the exception that zero UUID
  91497. // is not supported (00000000-0000-0000-0000-000000000000).
  91498. func (c *RegionInstanceGroupManagersResizeCall) RequestId(requestId string) *RegionInstanceGroupManagersResizeCall {
  91499. c.urlParams_.Set("requestId", requestId)
  91500. return c
  91501. }
  91502. // Fields allows partial responses to be retrieved. See
  91503. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  91504. // for more information.
  91505. func (c *RegionInstanceGroupManagersResizeCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersResizeCall {
  91506. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  91507. return c
  91508. }
  91509. // Context sets the context to be used in this call's Do method. Any
  91510. // pending HTTP request will be aborted if the provided context is
  91511. // canceled.
  91512. func (c *RegionInstanceGroupManagersResizeCall) Context(ctx context.Context) *RegionInstanceGroupManagersResizeCall {
  91513. c.ctx_ = ctx
  91514. return c
  91515. }
  91516. // Header returns an http.Header that can be modified by the caller to
  91517. // add HTTP headers to the request.
  91518. func (c *RegionInstanceGroupManagersResizeCall) Header() http.Header {
  91519. if c.header_ == nil {
  91520. c.header_ = make(http.Header)
  91521. }
  91522. return c.header_
  91523. }
  91524. func (c *RegionInstanceGroupManagersResizeCall) doRequest(alt string) (*http.Response, error) {
  91525. reqHeaders := make(http.Header)
  91526. for k, v := range c.header_ {
  91527. reqHeaders[k] = v
  91528. }
  91529. reqHeaders.Set("User-Agent", c.s.userAgent())
  91530. var body io.Reader = nil
  91531. c.urlParams_.Set("alt", alt)
  91532. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/resize")
  91533. urls += "?" + c.urlParams_.Encode()
  91534. req, _ := http.NewRequest("POST", urls, body)
  91535. req.Header = reqHeaders
  91536. googleapi.Expand(req.URL, map[string]string{
  91537. "project": c.project,
  91538. "region": c.region,
  91539. "instanceGroupManager": c.instanceGroupManager,
  91540. })
  91541. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  91542. }
  91543. // Do executes the "compute.regionInstanceGroupManagers.resize" call.
  91544. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  91545. // status code is an error. Response headers are in either
  91546. // *Operation.ServerResponse.Header or (if a response was returned at
  91547. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  91548. // to check whether the returned error was because
  91549. // http.StatusNotModified was returned.
  91550. func (c *RegionInstanceGroupManagersResizeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  91551. gensupport.SetOptions(c.urlParams_, opts...)
  91552. res, err := c.doRequest("json")
  91553. if res != nil && res.StatusCode == http.StatusNotModified {
  91554. if res.Body != nil {
  91555. res.Body.Close()
  91556. }
  91557. return nil, &googleapi.Error{
  91558. Code: res.StatusCode,
  91559. Header: res.Header,
  91560. }
  91561. }
  91562. if err != nil {
  91563. return nil, err
  91564. }
  91565. defer googleapi.CloseBody(res)
  91566. if err := googleapi.CheckResponse(res); err != nil {
  91567. return nil, err
  91568. }
  91569. ret := &Operation{
  91570. ServerResponse: googleapi.ServerResponse{
  91571. Header: res.Header,
  91572. HTTPStatusCode: res.StatusCode,
  91573. },
  91574. }
  91575. target := &ret
  91576. if err := gensupport.DecodeResponse(target, res); err != nil {
  91577. return nil, err
  91578. }
  91579. return ret, nil
  91580. // {
  91581. // "description": "Changes the intended size for the managed instance group. If you increase the size, the group schedules actions to create new instances using the current instance template. If you decrease the size, the group schedules delete actions on one or more 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\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.",
  91582. // "httpMethod": "POST",
  91583. // "id": "compute.regionInstanceGroupManagers.resize",
  91584. // "parameterOrder": [
  91585. // "project",
  91586. // "region",
  91587. // "instanceGroupManager",
  91588. // "size"
  91589. // ],
  91590. // "parameters": {
  91591. // "instanceGroupManager": {
  91592. // "description": "Name of the managed instance group.",
  91593. // "location": "path",
  91594. // "required": true,
  91595. // "type": "string"
  91596. // },
  91597. // "project": {
  91598. // "description": "Project ID for this request.",
  91599. // "location": "path",
  91600. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  91601. // "required": true,
  91602. // "type": "string"
  91603. // },
  91604. // "region": {
  91605. // "description": "Name of the region scoping this request.",
  91606. // "location": "path",
  91607. // "required": true,
  91608. // "type": "string"
  91609. // },
  91610. // "requestId": {
  91611. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  91612. // "location": "query",
  91613. // "type": "string"
  91614. // },
  91615. // "size": {
  91616. // "description": "Number of instances that should exist in this instance group manager.",
  91617. // "format": "int32",
  91618. // "location": "query",
  91619. // "minimum": "0",
  91620. // "required": true,
  91621. // "type": "integer"
  91622. // }
  91623. // },
  91624. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/resize",
  91625. // "response": {
  91626. // "$ref": "Operation"
  91627. // },
  91628. // "scopes": [
  91629. // "https://www.googleapis.com/auth/cloud-platform",
  91630. // "https://www.googleapis.com/auth/compute"
  91631. // ]
  91632. // }
  91633. }
  91634. // method id "compute.regionInstanceGroupManagers.setAutoHealingPolicies":
  91635. type RegionInstanceGroupManagersSetAutoHealingPoliciesCall struct {
  91636. s *Service
  91637. project string
  91638. region string
  91639. instanceGroupManager string
  91640. regioninstancegroupmanagerssetautohealingrequest *RegionInstanceGroupManagersSetAutoHealingRequest
  91641. urlParams_ gensupport.URLParams
  91642. ctx_ context.Context
  91643. header_ http.Header
  91644. }
  91645. // SetAutoHealingPolicies: Modifies the autohealing policy for the
  91646. // instances in this managed instance group.
  91647. func (r *RegionInstanceGroupManagersService) SetAutoHealingPolicies(project string, region string, instanceGroupManager string, regioninstancegroupmanagerssetautohealingrequest *RegionInstanceGroupManagersSetAutoHealingRequest) *RegionInstanceGroupManagersSetAutoHealingPoliciesCall {
  91648. c := &RegionInstanceGroupManagersSetAutoHealingPoliciesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  91649. c.project = project
  91650. c.region = region
  91651. c.instanceGroupManager = instanceGroupManager
  91652. c.regioninstancegroupmanagerssetautohealingrequest = regioninstancegroupmanagerssetautohealingrequest
  91653. return c
  91654. }
  91655. // RequestId sets the optional parameter "requestId": An optional
  91656. // request ID to identify requests. Specify a unique request ID so that
  91657. // if you must retry your request, the server will know to ignore the
  91658. // request if it has already been completed.
  91659. //
  91660. // For example, consider a situation where you make an initial request
  91661. // and the request times out. If you make the request again with the
  91662. // same request ID, the server can check if original operation with the
  91663. // same request ID was received, and if so, will ignore the second
  91664. // request. This prevents clients from accidentally creating duplicate
  91665. // commitments.
  91666. //
  91667. // The request ID must be a valid UUID with the exception that zero UUID
  91668. // is not supported (00000000-0000-0000-0000-000000000000).
  91669. func (c *RegionInstanceGroupManagersSetAutoHealingPoliciesCall) RequestId(requestId string) *RegionInstanceGroupManagersSetAutoHealingPoliciesCall {
  91670. c.urlParams_.Set("requestId", requestId)
  91671. return c
  91672. }
  91673. // Fields allows partial responses to be retrieved. See
  91674. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  91675. // for more information.
  91676. func (c *RegionInstanceGroupManagersSetAutoHealingPoliciesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersSetAutoHealingPoliciesCall {
  91677. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  91678. return c
  91679. }
  91680. // Context sets the context to be used in this call's Do method. Any
  91681. // pending HTTP request will be aborted if the provided context is
  91682. // canceled.
  91683. func (c *RegionInstanceGroupManagersSetAutoHealingPoliciesCall) Context(ctx context.Context) *RegionInstanceGroupManagersSetAutoHealingPoliciesCall {
  91684. c.ctx_ = ctx
  91685. return c
  91686. }
  91687. // Header returns an http.Header that can be modified by the caller to
  91688. // add HTTP headers to the request.
  91689. func (c *RegionInstanceGroupManagersSetAutoHealingPoliciesCall) Header() http.Header {
  91690. if c.header_ == nil {
  91691. c.header_ = make(http.Header)
  91692. }
  91693. return c.header_
  91694. }
  91695. func (c *RegionInstanceGroupManagersSetAutoHealingPoliciesCall) doRequest(alt string) (*http.Response, error) {
  91696. reqHeaders := make(http.Header)
  91697. for k, v := range c.header_ {
  91698. reqHeaders[k] = v
  91699. }
  91700. reqHeaders.Set("User-Agent", c.s.userAgent())
  91701. var body io.Reader = nil
  91702. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerssetautohealingrequest)
  91703. if err != nil {
  91704. return nil, err
  91705. }
  91706. reqHeaders.Set("Content-Type", "application/json")
  91707. c.urlParams_.Set("alt", alt)
  91708. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setAutoHealingPolicies")
  91709. urls += "?" + c.urlParams_.Encode()
  91710. req, _ := http.NewRequest("POST", urls, body)
  91711. req.Header = reqHeaders
  91712. googleapi.Expand(req.URL, map[string]string{
  91713. "project": c.project,
  91714. "region": c.region,
  91715. "instanceGroupManager": c.instanceGroupManager,
  91716. })
  91717. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  91718. }
  91719. // Do executes the "compute.regionInstanceGroupManagers.setAutoHealingPolicies" call.
  91720. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  91721. // status code is an error. Response headers are in either
  91722. // *Operation.ServerResponse.Header or (if a response was returned at
  91723. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  91724. // to check whether the returned error was because
  91725. // http.StatusNotModified was returned.
  91726. func (c *RegionInstanceGroupManagersSetAutoHealingPoliciesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  91727. gensupport.SetOptions(c.urlParams_, opts...)
  91728. res, err := c.doRequest("json")
  91729. if res != nil && res.StatusCode == http.StatusNotModified {
  91730. if res.Body != nil {
  91731. res.Body.Close()
  91732. }
  91733. return nil, &googleapi.Error{
  91734. Code: res.StatusCode,
  91735. Header: res.Header,
  91736. }
  91737. }
  91738. if err != nil {
  91739. return nil, err
  91740. }
  91741. defer googleapi.CloseBody(res)
  91742. if err := googleapi.CheckResponse(res); err != nil {
  91743. return nil, err
  91744. }
  91745. ret := &Operation{
  91746. ServerResponse: googleapi.ServerResponse{
  91747. Header: res.Header,
  91748. HTTPStatusCode: res.StatusCode,
  91749. },
  91750. }
  91751. target := &ret
  91752. if err := gensupport.DecodeResponse(target, res); err != nil {
  91753. return nil, err
  91754. }
  91755. return ret, nil
  91756. // {
  91757. // "description": "Modifies the autohealing policy for the instances in this managed instance group.",
  91758. // "httpMethod": "POST",
  91759. // "id": "compute.regionInstanceGroupManagers.setAutoHealingPolicies",
  91760. // "parameterOrder": [
  91761. // "project",
  91762. // "region",
  91763. // "instanceGroupManager"
  91764. // ],
  91765. // "parameters": {
  91766. // "instanceGroupManager": {
  91767. // "description": "Name of the managed instance group.",
  91768. // "location": "path",
  91769. // "required": true,
  91770. // "type": "string"
  91771. // },
  91772. // "project": {
  91773. // "description": "Project ID for this request.",
  91774. // "location": "path",
  91775. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  91776. // "required": true,
  91777. // "type": "string"
  91778. // },
  91779. // "region": {
  91780. // "description": "Name of the region scoping this request.",
  91781. // "location": "path",
  91782. // "required": true,
  91783. // "type": "string"
  91784. // },
  91785. // "requestId": {
  91786. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  91787. // "location": "query",
  91788. // "type": "string"
  91789. // }
  91790. // },
  91791. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setAutoHealingPolicies",
  91792. // "request": {
  91793. // "$ref": "RegionInstanceGroupManagersSetAutoHealingRequest"
  91794. // },
  91795. // "response": {
  91796. // "$ref": "Operation"
  91797. // },
  91798. // "scopes": [
  91799. // "https://www.googleapis.com/auth/cloud-platform",
  91800. // "https://www.googleapis.com/auth/compute"
  91801. // ]
  91802. // }
  91803. }
  91804. // method id "compute.regionInstanceGroupManagers.setInstanceTemplate":
  91805. type RegionInstanceGroupManagersSetInstanceTemplateCall struct {
  91806. s *Service
  91807. project string
  91808. region string
  91809. instanceGroupManager string
  91810. regioninstancegroupmanagerssettemplaterequest *RegionInstanceGroupManagersSetTemplateRequest
  91811. urlParams_ gensupport.URLParams
  91812. ctx_ context.Context
  91813. header_ http.Header
  91814. }
  91815. // SetInstanceTemplate: Sets the instance template to use when creating
  91816. // new instances or recreating instances in this group. Existing
  91817. // instances are not affected.
  91818. func (r *RegionInstanceGroupManagersService) SetInstanceTemplate(project string, region string, instanceGroupManager string, regioninstancegroupmanagerssettemplaterequest *RegionInstanceGroupManagersSetTemplateRequest) *RegionInstanceGroupManagersSetInstanceTemplateCall {
  91819. c := &RegionInstanceGroupManagersSetInstanceTemplateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  91820. c.project = project
  91821. c.region = region
  91822. c.instanceGroupManager = instanceGroupManager
  91823. c.regioninstancegroupmanagerssettemplaterequest = regioninstancegroupmanagerssettemplaterequest
  91824. return c
  91825. }
  91826. // RequestId sets the optional parameter "requestId": An optional
  91827. // request ID to identify requests. Specify a unique request ID so that
  91828. // if you must retry your request, the server will know to ignore the
  91829. // request if it has already been completed.
  91830. //
  91831. // For example, consider a situation where you make an initial request
  91832. // and the request times out. If you make the request again with the
  91833. // same request ID, the server can check if original operation with the
  91834. // same request ID was received, and if so, will ignore the second
  91835. // request. This prevents clients from accidentally creating duplicate
  91836. // commitments.
  91837. //
  91838. // The request ID must be a valid UUID with the exception that zero UUID
  91839. // is not supported (00000000-0000-0000-0000-000000000000).
  91840. func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) RequestId(requestId string) *RegionInstanceGroupManagersSetInstanceTemplateCall {
  91841. c.urlParams_.Set("requestId", requestId)
  91842. return c
  91843. }
  91844. // Fields allows partial responses to be retrieved. See
  91845. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  91846. // for more information.
  91847. func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersSetInstanceTemplateCall {
  91848. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  91849. return c
  91850. }
  91851. // Context sets the context to be used in this call's Do method. Any
  91852. // pending HTTP request will be aborted if the provided context is
  91853. // canceled.
  91854. func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) Context(ctx context.Context) *RegionInstanceGroupManagersSetInstanceTemplateCall {
  91855. c.ctx_ = ctx
  91856. return c
  91857. }
  91858. // Header returns an http.Header that can be modified by the caller to
  91859. // add HTTP headers to the request.
  91860. func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) Header() http.Header {
  91861. if c.header_ == nil {
  91862. c.header_ = make(http.Header)
  91863. }
  91864. return c.header_
  91865. }
  91866. func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) doRequest(alt string) (*http.Response, error) {
  91867. reqHeaders := make(http.Header)
  91868. for k, v := range c.header_ {
  91869. reqHeaders[k] = v
  91870. }
  91871. reqHeaders.Set("User-Agent", c.s.userAgent())
  91872. var body io.Reader = nil
  91873. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerssettemplaterequest)
  91874. if err != nil {
  91875. return nil, err
  91876. }
  91877. reqHeaders.Set("Content-Type", "application/json")
  91878. c.urlParams_.Set("alt", alt)
  91879. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate")
  91880. urls += "?" + c.urlParams_.Encode()
  91881. req, _ := http.NewRequest("POST", urls, body)
  91882. req.Header = reqHeaders
  91883. googleapi.Expand(req.URL, map[string]string{
  91884. "project": c.project,
  91885. "region": c.region,
  91886. "instanceGroupManager": c.instanceGroupManager,
  91887. })
  91888. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  91889. }
  91890. // Do executes the "compute.regionInstanceGroupManagers.setInstanceTemplate" call.
  91891. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  91892. // status code is an error. Response headers are in either
  91893. // *Operation.ServerResponse.Header or (if a response was returned at
  91894. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  91895. // to check whether the returned error was because
  91896. // http.StatusNotModified was returned.
  91897. func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  91898. gensupport.SetOptions(c.urlParams_, opts...)
  91899. res, err := c.doRequest("json")
  91900. if res != nil && res.StatusCode == http.StatusNotModified {
  91901. if res.Body != nil {
  91902. res.Body.Close()
  91903. }
  91904. return nil, &googleapi.Error{
  91905. Code: res.StatusCode,
  91906. Header: res.Header,
  91907. }
  91908. }
  91909. if err != nil {
  91910. return nil, err
  91911. }
  91912. defer googleapi.CloseBody(res)
  91913. if err := googleapi.CheckResponse(res); err != nil {
  91914. return nil, err
  91915. }
  91916. ret := &Operation{
  91917. ServerResponse: googleapi.ServerResponse{
  91918. Header: res.Header,
  91919. HTTPStatusCode: res.StatusCode,
  91920. },
  91921. }
  91922. target := &ret
  91923. if err := gensupport.DecodeResponse(target, res); err != nil {
  91924. return nil, err
  91925. }
  91926. return ret, nil
  91927. // {
  91928. // "description": "Sets the instance template to use when creating new instances or recreating instances in this group. Existing instances are not affected.",
  91929. // "httpMethod": "POST",
  91930. // "id": "compute.regionInstanceGroupManagers.setInstanceTemplate",
  91931. // "parameterOrder": [
  91932. // "project",
  91933. // "region",
  91934. // "instanceGroupManager"
  91935. // ],
  91936. // "parameters": {
  91937. // "instanceGroupManager": {
  91938. // "description": "The name of the managed instance group.",
  91939. // "location": "path",
  91940. // "required": true,
  91941. // "type": "string"
  91942. // },
  91943. // "project": {
  91944. // "description": "Project ID for this request.",
  91945. // "location": "path",
  91946. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  91947. // "required": true,
  91948. // "type": "string"
  91949. // },
  91950. // "region": {
  91951. // "description": "Name of the region scoping this request.",
  91952. // "location": "path",
  91953. // "required": true,
  91954. // "type": "string"
  91955. // },
  91956. // "requestId": {
  91957. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  91958. // "location": "query",
  91959. // "type": "string"
  91960. // }
  91961. // },
  91962. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate",
  91963. // "request": {
  91964. // "$ref": "RegionInstanceGroupManagersSetTemplateRequest"
  91965. // },
  91966. // "response": {
  91967. // "$ref": "Operation"
  91968. // },
  91969. // "scopes": [
  91970. // "https://www.googleapis.com/auth/cloud-platform",
  91971. // "https://www.googleapis.com/auth/compute"
  91972. // ]
  91973. // }
  91974. }
  91975. // method id "compute.regionInstanceGroupManagers.setTargetPools":
  91976. type RegionInstanceGroupManagersSetTargetPoolsCall struct {
  91977. s *Service
  91978. project string
  91979. region string
  91980. instanceGroupManager string
  91981. regioninstancegroupmanagerssettargetpoolsrequest *RegionInstanceGroupManagersSetTargetPoolsRequest
  91982. urlParams_ gensupport.URLParams
  91983. ctx_ context.Context
  91984. header_ http.Header
  91985. }
  91986. // SetTargetPools: Modifies the target pools to which all new instances
  91987. // in this group are assigned. Existing instances in the group are not
  91988. // affected.
  91989. func (r *RegionInstanceGroupManagersService) SetTargetPools(project string, region string, instanceGroupManager string, regioninstancegroupmanagerssettargetpoolsrequest *RegionInstanceGroupManagersSetTargetPoolsRequest) *RegionInstanceGroupManagersSetTargetPoolsCall {
  91990. c := &RegionInstanceGroupManagersSetTargetPoolsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  91991. c.project = project
  91992. c.region = region
  91993. c.instanceGroupManager = instanceGroupManager
  91994. c.regioninstancegroupmanagerssettargetpoolsrequest = regioninstancegroupmanagerssettargetpoolsrequest
  91995. return c
  91996. }
  91997. // RequestId sets the optional parameter "requestId": An optional
  91998. // request ID to identify requests. Specify a unique request ID so that
  91999. // if you must retry your request, the server will know to ignore the
  92000. // request if it has already been completed.
  92001. //
  92002. // For example, consider a situation where you make an initial request
  92003. // and the request times out. If you make the request again with the
  92004. // same request ID, the server can check if original operation with the
  92005. // same request ID was received, and if so, will ignore the second
  92006. // request. This prevents clients from accidentally creating duplicate
  92007. // commitments.
  92008. //
  92009. // The request ID must be a valid UUID with the exception that zero UUID
  92010. // is not supported (00000000-0000-0000-0000-000000000000).
  92011. func (c *RegionInstanceGroupManagersSetTargetPoolsCall) RequestId(requestId string) *RegionInstanceGroupManagersSetTargetPoolsCall {
  92012. c.urlParams_.Set("requestId", requestId)
  92013. return c
  92014. }
  92015. // Fields allows partial responses to be retrieved. See
  92016. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  92017. // for more information.
  92018. func (c *RegionInstanceGroupManagersSetTargetPoolsCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersSetTargetPoolsCall {
  92019. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  92020. return c
  92021. }
  92022. // Context sets the context to be used in this call's Do method. Any
  92023. // pending HTTP request will be aborted if the provided context is
  92024. // canceled.
  92025. func (c *RegionInstanceGroupManagersSetTargetPoolsCall) Context(ctx context.Context) *RegionInstanceGroupManagersSetTargetPoolsCall {
  92026. c.ctx_ = ctx
  92027. return c
  92028. }
  92029. // Header returns an http.Header that can be modified by the caller to
  92030. // add HTTP headers to the request.
  92031. func (c *RegionInstanceGroupManagersSetTargetPoolsCall) Header() http.Header {
  92032. if c.header_ == nil {
  92033. c.header_ = make(http.Header)
  92034. }
  92035. return c.header_
  92036. }
  92037. func (c *RegionInstanceGroupManagersSetTargetPoolsCall) doRequest(alt string) (*http.Response, error) {
  92038. reqHeaders := make(http.Header)
  92039. for k, v := range c.header_ {
  92040. reqHeaders[k] = v
  92041. }
  92042. reqHeaders.Set("User-Agent", c.s.userAgent())
  92043. var body io.Reader = nil
  92044. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerssettargetpoolsrequest)
  92045. if err != nil {
  92046. return nil, err
  92047. }
  92048. reqHeaders.Set("Content-Type", "application/json")
  92049. c.urlParams_.Set("alt", alt)
  92050. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setTargetPools")
  92051. urls += "?" + c.urlParams_.Encode()
  92052. req, _ := http.NewRequest("POST", urls, body)
  92053. req.Header = reqHeaders
  92054. googleapi.Expand(req.URL, map[string]string{
  92055. "project": c.project,
  92056. "region": c.region,
  92057. "instanceGroupManager": c.instanceGroupManager,
  92058. })
  92059. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  92060. }
  92061. // Do executes the "compute.regionInstanceGroupManagers.setTargetPools" call.
  92062. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  92063. // status code is an error. Response headers are in either
  92064. // *Operation.ServerResponse.Header or (if a response was returned at
  92065. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  92066. // to check whether the returned error was because
  92067. // http.StatusNotModified was returned.
  92068. func (c *RegionInstanceGroupManagersSetTargetPoolsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  92069. gensupport.SetOptions(c.urlParams_, opts...)
  92070. res, err := c.doRequest("json")
  92071. if res != nil && res.StatusCode == http.StatusNotModified {
  92072. if res.Body != nil {
  92073. res.Body.Close()
  92074. }
  92075. return nil, &googleapi.Error{
  92076. Code: res.StatusCode,
  92077. Header: res.Header,
  92078. }
  92079. }
  92080. if err != nil {
  92081. return nil, err
  92082. }
  92083. defer googleapi.CloseBody(res)
  92084. if err := googleapi.CheckResponse(res); err != nil {
  92085. return nil, err
  92086. }
  92087. ret := &Operation{
  92088. ServerResponse: googleapi.ServerResponse{
  92089. Header: res.Header,
  92090. HTTPStatusCode: res.StatusCode,
  92091. },
  92092. }
  92093. target := &ret
  92094. if err := gensupport.DecodeResponse(target, res); err != nil {
  92095. return nil, err
  92096. }
  92097. return ret, nil
  92098. // {
  92099. // "description": "Modifies the target pools to which all new instances in this group are assigned. Existing instances in the group are not affected.",
  92100. // "httpMethod": "POST",
  92101. // "id": "compute.regionInstanceGroupManagers.setTargetPools",
  92102. // "parameterOrder": [
  92103. // "project",
  92104. // "region",
  92105. // "instanceGroupManager"
  92106. // ],
  92107. // "parameters": {
  92108. // "instanceGroupManager": {
  92109. // "description": "Name of the managed instance group.",
  92110. // "location": "path",
  92111. // "required": true,
  92112. // "type": "string"
  92113. // },
  92114. // "project": {
  92115. // "description": "Project ID for this request.",
  92116. // "location": "path",
  92117. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  92118. // "required": true,
  92119. // "type": "string"
  92120. // },
  92121. // "region": {
  92122. // "description": "Name of the region scoping this request.",
  92123. // "location": "path",
  92124. // "required": true,
  92125. // "type": "string"
  92126. // },
  92127. // "requestId": {
  92128. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  92129. // "location": "query",
  92130. // "type": "string"
  92131. // }
  92132. // },
  92133. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setTargetPools",
  92134. // "request": {
  92135. // "$ref": "RegionInstanceGroupManagersSetTargetPoolsRequest"
  92136. // },
  92137. // "response": {
  92138. // "$ref": "Operation"
  92139. // },
  92140. // "scopes": [
  92141. // "https://www.googleapis.com/auth/cloud-platform",
  92142. // "https://www.googleapis.com/auth/compute"
  92143. // ]
  92144. // }
  92145. }
  92146. // method id "compute.regionInstanceGroupManagers.testIamPermissions":
  92147. type RegionInstanceGroupManagersTestIamPermissionsCall struct {
  92148. s *Service
  92149. project string
  92150. region string
  92151. resource string
  92152. testpermissionsrequest *TestPermissionsRequest
  92153. urlParams_ gensupport.URLParams
  92154. ctx_ context.Context
  92155. header_ http.Header
  92156. }
  92157. // TestIamPermissions: Returns permissions that a caller has on the
  92158. // specified resource.
  92159. func (r *RegionInstanceGroupManagersService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionInstanceGroupManagersTestIamPermissionsCall {
  92160. c := &RegionInstanceGroupManagersTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  92161. c.project = project
  92162. c.region = region
  92163. c.resource = resource
  92164. c.testpermissionsrequest = testpermissionsrequest
  92165. return c
  92166. }
  92167. // Fields allows partial responses to be retrieved. See
  92168. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  92169. // for more information.
  92170. func (c *RegionInstanceGroupManagersTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersTestIamPermissionsCall {
  92171. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  92172. return c
  92173. }
  92174. // Context sets the context to be used in this call's Do method. Any
  92175. // pending HTTP request will be aborted if the provided context is
  92176. // canceled.
  92177. func (c *RegionInstanceGroupManagersTestIamPermissionsCall) Context(ctx context.Context) *RegionInstanceGroupManagersTestIamPermissionsCall {
  92178. c.ctx_ = ctx
  92179. return c
  92180. }
  92181. // Header returns an http.Header that can be modified by the caller to
  92182. // add HTTP headers to the request.
  92183. func (c *RegionInstanceGroupManagersTestIamPermissionsCall) Header() http.Header {
  92184. if c.header_ == nil {
  92185. c.header_ = make(http.Header)
  92186. }
  92187. return c.header_
  92188. }
  92189. func (c *RegionInstanceGroupManagersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  92190. reqHeaders := make(http.Header)
  92191. for k, v := range c.header_ {
  92192. reqHeaders[k] = v
  92193. }
  92194. reqHeaders.Set("User-Agent", c.s.userAgent())
  92195. var body io.Reader = nil
  92196. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  92197. if err != nil {
  92198. return nil, err
  92199. }
  92200. reqHeaders.Set("Content-Type", "application/json")
  92201. c.urlParams_.Set("alt", alt)
  92202. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{resource}/testIamPermissions")
  92203. urls += "?" + c.urlParams_.Encode()
  92204. req, _ := http.NewRequest("POST", urls, body)
  92205. req.Header = reqHeaders
  92206. googleapi.Expand(req.URL, map[string]string{
  92207. "project": c.project,
  92208. "region": c.region,
  92209. "resource": c.resource,
  92210. })
  92211. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  92212. }
  92213. // Do executes the "compute.regionInstanceGroupManagers.testIamPermissions" call.
  92214. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  92215. // non-2xx status code is an error. Response headers are in either
  92216. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  92217. // returned at all) in error.(*googleapi.Error).Header. Use
  92218. // googleapi.IsNotModified to check whether the returned error was
  92219. // because http.StatusNotModified was returned.
  92220. func (c *RegionInstanceGroupManagersTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  92221. gensupport.SetOptions(c.urlParams_, opts...)
  92222. res, err := c.doRequest("json")
  92223. if res != nil && res.StatusCode == http.StatusNotModified {
  92224. if res.Body != nil {
  92225. res.Body.Close()
  92226. }
  92227. return nil, &googleapi.Error{
  92228. Code: res.StatusCode,
  92229. Header: res.Header,
  92230. }
  92231. }
  92232. if err != nil {
  92233. return nil, err
  92234. }
  92235. defer googleapi.CloseBody(res)
  92236. if err := googleapi.CheckResponse(res); err != nil {
  92237. return nil, err
  92238. }
  92239. ret := &TestPermissionsResponse{
  92240. ServerResponse: googleapi.ServerResponse{
  92241. Header: res.Header,
  92242. HTTPStatusCode: res.StatusCode,
  92243. },
  92244. }
  92245. target := &ret
  92246. if err := gensupport.DecodeResponse(target, res); err != nil {
  92247. return nil, err
  92248. }
  92249. return ret, nil
  92250. // {
  92251. // "description": "Returns permissions that a caller has on the specified resource.",
  92252. // "httpMethod": "POST",
  92253. // "id": "compute.regionInstanceGroupManagers.testIamPermissions",
  92254. // "parameterOrder": [
  92255. // "project",
  92256. // "region",
  92257. // "resource"
  92258. // ],
  92259. // "parameters": {
  92260. // "project": {
  92261. // "description": "Project ID for this request.",
  92262. // "location": "path",
  92263. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  92264. // "required": true,
  92265. // "type": "string"
  92266. // },
  92267. // "region": {
  92268. // "description": "The name of the region for this request.",
  92269. // "location": "path",
  92270. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  92271. // "required": true,
  92272. // "type": "string"
  92273. // },
  92274. // "resource": {
  92275. // "description": "Name of the resource for this request.",
  92276. // "location": "path",
  92277. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  92278. // "required": true,
  92279. // "type": "string"
  92280. // }
  92281. // },
  92282. // "path": "{project}/regions/{region}/instanceGroupManagers/{resource}/testIamPermissions",
  92283. // "request": {
  92284. // "$ref": "TestPermissionsRequest"
  92285. // },
  92286. // "response": {
  92287. // "$ref": "TestPermissionsResponse"
  92288. // },
  92289. // "scopes": [
  92290. // "https://www.googleapis.com/auth/cloud-platform",
  92291. // "https://www.googleapis.com/auth/compute",
  92292. // "https://www.googleapis.com/auth/compute.readonly"
  92293. // ]
  92294. // }
  92295. }
  92296. // method id "compute.regionInstanceGroupManagers.update":
  92297. type RegionInstanceGroupManagersUpdateCall struct {
  92298. s *Service
  92299. project string
  92300. region string
  92301. instanceGroupManager string
  92302. instancegroupmanager *InstanceGroupManager
  92303. urlParams_ gensupport.URLParams
  92304. ctx_ context.Context
  92305. header_ http.Header
  92306. }
  92307. // Update: Updates a managed instance group using the information that
  92308. // you specify in the request. This operation is marked as DONE when the
  92309. // group is updated even if the instances in the group have not yet been
  92310. // updated. You must separately verify the status of the individual
  92311. // instances with the listmanagedinstances method.
  92312. func (r *RegionInstanceGroupManagersService) Update(project string, region string, instanceGroupManager string, instancegroupmanager *InstanceGroupManager) *RegionInstanceGroupManagersUpdateCall {
  92313. c := &RegionInstanceGroupManagersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  92314. c.project = project
  92315. c.region = region
  92316. c.instanceGroupManager = instanceGroupManager
  92317. c.instancegroupmanager = instancegroupmanager
  92318. return c
  92319. }
  92320. // RequestId sets the optional parameter "requestId": An optional
  92321. // request ID to identify requests. Specify a unique request ID so that
  92322. // if you must retry your request, the server will know to ignore the
  92323. // request if it has already been completed.
  92324. //
  92325. // For example, consider a situation where you make an initial request
  92326. // and the request times out. If you make the request again with the
  92327. // same request ID, the server can check if original operation with the
  92328. // same request ID was received, and if so, will ignore the second
  92329. // request. This prevents clients from accidentally creating duplicate
  92330. // commitments.
  92331. //
  92332. // The request ID must be a valid UUID with the exception that zero UUID
  92333. // is not supported (00000000-0000-0000-0000-000000000000).
  92334. func (c *RegionInstanceGroupManagersUpdateCall) RequestId(requestId string) *RegionInstanceGroupManagersUpdateCall {
  92335. c.urlParams_.Set("requestId", requestId)
  92336. return c
  92337. }
  92338. // Fields allows partial responses to be retrieved. See
  92339. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  92340. // for more information.
  92341. func (c *RegionInstanceGroupManagersUpdateCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersUpdateCall {
  92342. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  92343. return c
  92344. }
  92345. // Context sets the context to be used in this call's Do method. Any
  92346. // pending HTTP request will be aborted if the provided context is
  92347. // canceled.
  92348. func (c *RegionInstanceGroupManagersUpdateCall) Context(ctx context.Context) *RegionInstanceGroupManagersUpdateCall {
  92349. c.ctx_ = ctx
  92350. return c
  92351. }
  92352. // Header returns an http.Header that can be modified by the caller to
  92353. // add HTTP headers to the request.
  92354. func (c *RegionInstanceGroupManagersUpdateCall) Header() http.Header {
  92355. if c.header_ == nil {
  92356. c.header_ = make(http.Header)
  92357. }
  92358. return c.header_
  92359. }
  92360. func (c *RegionInstanceGroupManagersUpdateCall) doRequest(alt string) (*http.Response, error) {
  92361. reqHeaders := make(http.Header)
  92362. for k, v := range c.header_ {
  92363. reqHeaders[k] = v
  92364. }
  92365. reqHeaders.Set("User-Agent", c.s.userAgent())
  92366. var body io.Reader = nil
  92367. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager)
  92368. if err != nil {
  92369. return nil, err
  92370. }
  92371. reqHeaders.Set("Content-Type", "application/json")
  92372. c.urlParams_.Set("alt", alt)
  92373. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}")
  92374. urls += "?" + c.urlParams_.Encode()
  92375. req, _ := http.NewRequest("PUT", urls, body)
  92376. req.Header = reqHeaders
  92377. googleapi.Expand(req.URL, map[string]string{
  92378. "project": c.project,
  92379. "region": c.region,
  92380. "instanceGroupManager": c.instanceGroupManager,
  92381. })
  92382. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  92383. }
  92384. // Do executes the "compute.regionInstanceGroupManagers.update" call.
  92385. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  92386. // status code is an error. Response headers are in either
  92387. // *Operation.ServerResponse.Header or (if a response was returned at
  92388. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  92389. // to check whether the returned error was because
  92390. // http.StatusNotModified was returned.
  92391. func (c *RegionInstanceGroupManagersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  92392. gensupport.SetOptions(c.urlParams_, opts...)
  92393. res, err := c.doRequest("json")
  92394. if res != nil && res.StatusCode == http.StatusNotModified {
  92395. if res.Body != nil {
  92396. res.Body.Close()
  92397. }
  92398. return nil, &googleapi.Error{
  92399. Code: res.StatusCode,
  92400. Header: res.Header,
  92401. }
  92402. }
  92403. if err != nil {
  92404. return nil, err
  92405. }
  92406. defer googleapi.CloseBody(res)
  92407. if err := googleapi.CheckResponse(res); err != nil {
  92408. return nil, err
  92409. }
  92410. ret := &Operation{
  92411. ServerResponse: googleapi.ServerResponse{
  92412. Header: res.Header,
  92413. HTTPStatusCode: res.StatusCode,
  92414. },
  92415. }
  92416. target := &ret
  92417. if err := gensupport.DecodeResponse(target, res); err != nil {
  92418. return nil, err
  92419. }
  92420. return ret, nil
  92421. // {
  92422. // "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.",
  92423. // "httpMethod": "PUT",
  92424. // "id": "compute.regionInstanceGroupManagers.update",
  92425. // "parameterOrder": [
  92426. // "project",
  92427. // "region",
  92428. // "instanceGroupManager"
  92429. // ],
  92430. // "parameters": {
  92431. // "instanceGroupManager": {
  92432. // "description": "The name of the instance group manager.",
  92433. // "location": "path",
  92434. // "required": true,
  92435. // "type": "string"
  92436. // },
  92437. // "project": {
  92438. // "description": "Project ID for this request.",
  92439. // "location": "path",
  92440. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  92441. // "required": true,
  92442. // "type": "string"
  92443. // },
  92444. // "region": {
  92445. // "description": "Name of the region scoping this request.",
  92446. // "location": "path",
  92447. // "required": true,
  92448. // "type": "string"
  92449. // },
  92450. // "requestId": {
  92451. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  92452. // "location": "query",
  92453. // "type": "string"
  92454. // }
  92455. // },
  92456. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}",
  92457. // "request": {
  92458. // "$ref": "InstanceGroupManager"
  92459. // },
  92460. // "response": {
  92461. // "$ref": "Operation"
  92462. // },
  92463. // "scopes": [
  92464. // "https://www.googleapis.com/auth/cloud-platform",
  92465. // "https://www.googleapis.com/auth/compute"
  92466. // ]
  92467. // }
  92468. }
  92469. // method id "compute.regionInstanceGroupManagers.updatePerInstanceConfigs":
  92470. type RegionInstanceGroupManagersUpdatePerInstanceConfigsCall struct {
  92471. s *Service
  92472. project string
  92473. region string
  92474. instanceGroupManager string
  92475. regioninstancegroupmanagerupdateinstanceconfigreq *RegionInstanceGroupManagerUpdateInstanceConfigReq
  92476. urlParams_ gensupport.URLParams
  92477. ctx_ context.Context
  92478. header_ http.Header
  92479. }
  92480. // UpdatePerInstanceConfigs: Insert or patch (for the ones that already
  92481. // exist) per-instance configs for the managed instance group.
  92482. // perInstanceConfig.instance serves as a key used to distinguish
  92483. // whether to perform insert or patch.
  92484. func (r *RegionInstanceGroupManagersService) UpdatePerInstanceConfigs(project string, region string, instanceGroupManager string, regioninstancegroupmanagerupdateinstanceconfigreq *RegionInstanceGroupManagerUpdateInstanceConfigReq) *RegionInstanceGroupManagersUpdatePerInstanceConfigsCall {
  92485. c := &RegionInstanceGroupManagersUpdatePerInstanceConfigsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  92486. c.project = project
  92487. c.region = region
  92488. c.instanceGroupManager = instanceGroupManager
  92489. c.regioninstancegroupmanagerupdateinstanceconfigreq = regioninstancegroupmanagerupdateinstanceconfigreq
  92490. return c
  92491. }
  92492. // Fields allows partial responses to be retrieved. See
  92493. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  92494. // for more information.
  92495. func (c *RegionInstanceGroupManagersUpdatePerInstanceConfigsCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersUpdatePerInstanceConfigsCall {
  92496. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  92497. return c
  92498. }
  92499. // Context sets the context to be used in this call's Do method. Any
  92500. // pending HTTP request will be aborted if the provided context is
  92501. // canceled.
  92502. func (c *RegionInstanceGroupManagersUpdatePerInstanceConfigsCall) Context(ctx context.Context) *RegionInstanceGroupManagersUpdatePerInstanceConfigsCall {
  92503. c.ctx_ = ctx
  92504. return c
  92505. }
  92506. // Header returns an http.Header that can be modified by the caller to
  92507. // add HTTP headers to the request.
  92508. func (c *RegionInstanceGroupManagersUpdatePerInstanceConfigsCall) Header() http.Header {
  92509. if c.header_ == nil {
  92510. c.header_ = make(http.Header)
  92511. }
  92512. return c.header_
  92513. }
  92514. func (c *RegionInstanceGroupManagersUpdatePerInstanceConfigsCall) doRequest(alt string) (*http.Response, error) {
  92515. reqHeaders := make(http.Header)
  92516. for k, v := range c.header_ {
  92517. reqHeaders[k] = v
  92518. }
  92519. reqHeaders.Set("User-Agent", c.s.userAgent())
  92520. var body io.Reader = nil
  92521. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerupdateinstanceconfigreq)
  92522. if err != nil {
  92523. return nil, err
  92524. }
  92525. reqHeaders.Set("Content-Type", "application/json")
  92526. c.urlParams_.Set("alt", alt)
  92527. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/updatePerInstanceConfigs")
  92528. urls += "?" + c.urlParams_.Encode()
  92529. req, _ := http.NewRequest("POST", urls, body)
  92530. req.Header = reqHeaders
  92531. googleapi.Expand(req.URL, map[string]string{
  92532. "project": c.project,
  92533. "region": c.region,
  92534. "instanceGroupManager": c.instanceGroupManager,
  92535. })
  92536. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  92537. }
  92538. // Do executes the "compute.regionInstanceGroupManagers.updatePerInstanceConfigs" call.
  92539. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  92540. // status code is an error. Response headers are in either
  92541. // *Operation.ServerResponse.Header or (if a response was returned at
  92542. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  92543. // to check whether the returned error was because
  92544. // http.StatusNotModified was returned.
  92545. func (c *RegionInstanceGroupManagersUpdatePerInstanceConfigsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  92546. gensupport.SetOptions(c.urlParams_, opts...)
  92547. res, err := c.doRequest("json")
  92548. if res != nil && res.StatusCode == http.StatusNotModified {
  92549. if res.Body != nil {
  92550. res.Body.Close()
  92551. }
  92552. return nil, &googleapi.Error{
  92553. Code: res.StatusCode,
  92554. Header: res.Header,
  92555. }
  92556. }
  92557. if err != nil {
  92558. return nil, err
  92559. }
  92560. defer googleapi.CloseBody(res)
  92561. if err := googleapi.CheckResponse(res); err != nil {
  92562. return nil, err
  92563. }
  92564. ret := &Operation{
  92565. ServerResponse: googleapi.ServerResponse{
  92566. Header: res.Header,
  92567. HTTPStatusCode: res.StatusCode,
  92568. },
  92569. }
  92570. target := &ret
  92571. if err := gensupport.DecodeResponse(target, res); err != nil {
  92572. return nil, err
  92573. }
  92574. return ret, nil
  92575. // {
  92576. // "description": "Insert or patch (for the ones that already exist) per-instance configs for the managed instance group. perInstanceConfig.instance serves as a key used to distinguish whether to perform insert or patch.",
  92577. // "httpMethod": "POST",
  92578. // "id": "compute.regionInstanceGroupManagers.updatePerInstanceConfigs",
  92579. // "parameterOrder": [
  92580. // "project",
  92581. // "region",
  92582. // "instanceGroupManager"
  92583. // ],
  92584. // "parameters": {
  92585. // "instanceGroupManager": {
  92586. // "description": "The name of the managed instance group. It should conform to RFC1035.",
  92587. // "location": "path",
  92588. // "required": true,
  92589. // "type": "string"
  92590. // },
  92591. // "project": {
  92592. // "description": "Project ID for this request.",
  92593. // "location": "path",
  92594. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  92595. // "required": true,
  92596. // "type": "string"
  92597. // },
  92598. // "region": {
  92599. // "description": "Name of the region scoping this request, should conform to RFC1035.",
  92600. // "location": "path",
  92601. // "required": true,
  92602. // "type": "string"
  92603. // }
  92604. // },
  92605. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/updatePerInstanceConfigs",
  92606. // "request": {
  92607. // "$ref": "RegionInstanceGroupManagerUpdateInstanceConfigReq"
  92608. // },
  92609. // "response": {
  92610. // "$ref": "Operation"
  92611. // },
  92612. // "scopes": [
  92613. // "https://www.googleapis.com/auth/cloud-platform",
  92614. // "https://www.googleapis.com/auth/compute"
  92615. // ]
  92616. // }
  92617. }
  92618. // method id "compute.regionInstanceGroups.get":
  92619. type RegionInstanceGroupsGetCall struct {
  92620. s *Service
  92621. project string
  92622. region string
  92623. instanceGroup string
  92624. urlParams_ gensupport.URLParams
  92625. ifNoneMatch_ string
  92626. ctx_ context.Context
  92627. header_ http.Header
  92628. }
  92629. // Get: Returns the specified instance group resource.
  92630. func (r *RegionInstanceGroupsService) Get(project string, region string, instanceGroup string) *RegionInstanceGroupsGetCall {
  92631. c := &RegionInstanceGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  92632. c.project = project
  92633. c.region = region
  92634. c.instanceGroup = instanceGroup
  92635. return c
  92636. }
  92637. // Fields allows partial responses to be retrieved. See
  92638. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  92639. // for more information.
  92640. func (c *RegionInstanceGroupsGetCall) Fields(s ...googleapi.Field) *RegionInstanceGroupsGetCall {
  92641. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  92642. return c
  92643. }
  92644. // IfNoneMatch sets the optional parameter which makes the operation
  92645. // fail if the object's ETag matches the given value. This is useful for
  92646. // getting updates only after the object has changed since the last
  92647. // request. Use googleapi.IsNotModified to check whether the response
  92648. // error from Do is the result of In-None-Match.
  92649. func (c *RegionInstanceGroupsGetCall) IfNoneMatch(entityTag string) *RegionInstanceGroupsGetCall {
  92650. c.ifNoneMatch_ = entityTag
  92651. return c
  92652. }
  92653. // Context sets the context to be used in this call's Do method. Any
  92654. // pending HTTP request will be aborted if the provided context is
  92655. // canceled.
  92656. func (c *RegionInstanceGroupsGetCall) Context(ctx context.Context) *RegionInstanceGroupsGetCall {
  92657. c.ctx_ = ctx
  92658. return c
  92659. }
  92660. // Header returns an http.Header that can be modified by the caller to
  92661. // add HTTP headers to the request.
  92662. func (c *RegionInstanceGroupsGetCall) Header() http.Header {
  92663. if c.header_ == nil {
  92664. c.header_ = make(http.Header)
  92665. }
  92666. return c.header_
  92667. }
  92668. func (c *RegionInstanceGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  92669. reqHeaders := make(http.Header)
  92670. for k, v := range c.header_ {
  92671. reqHeaders[k] = v
  92672. }
  92673. reqHeaders.Set("User-Agent", c.s.userAgent())
  92674. if c.ifNoneMatch_ != "" {
  92675. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  92676. }
  92677. var body io.Reader = nil
  92678. c.urlParams_.Set("alt", alt)
  92679. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroups/{instanceGroup}")
  92680. urls += "?" + c.urlParams_.Encode()
  92681. req, _ := http.NewRequest("GET", urls, body)
  92682. req.Header = reqHeaders
  92683. googleapi.Expand(req.URL, map[string]string{
  92684. "project": c.project,
  92685. "region": c.region,
  92686. "instanceGroup": c.instanceGroup,
  92687. })
  92688. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  92689. }
  92690. // Do executes the "compute.regionInstanceGroups.get" call.
  92691. // Exactly one of *InstanceGroup or error will be non-nil. Any non-2xx
  92692. // status code is an error. Response headers are in either
  92693. // *InstanceGroup.ServerResponse.Header or (if a response was returned
  92694. // at all) in error.(*googleapi.Error).Header. Use
  92695. // googleapi.IsNotModified to check whether the returned error was
  92696. // because http.StatusNotModified was returned.
  92697. func (c *RegionInstanceGroupsGetCall) Do(opts ...googleapi.CallOption) (*InstanceGroup, error) {
  92698. gensupport.SetOptions(c.urlParams_, opts...)
  92699. res, err := c.doRequest("json")
  92700. if res != nil && res.StatusCode == http.StatusNotModified {
  92701. if res.Body != nil {
  92702. res.Body.Close()
  92703. }
  92704. return nil, &googleapi.Error{
  92705. Code: res.StatusCode,
  92706. Header: res.Header,
  92707. }
  92708. }
  92709. if err != nil {
  92710. return nil, err
  92711. }
  92712. defer googleapi.CloseBody(res)
  92713. if err := googleapi.CheckResponse(res); err != nil {
  92714. return nil, err
  92715. }
  92716. ret := &InstanceGroup{
  92717. ServerResponse: googleapi.ServerResponse{
  92718. Header: res.Header,
  92719. HTTPStatusCode: res.StatusCode,
  92720. },
  92721. }
  92722. target := &ret
  92723. if err := gensupport.DecodeResponse(target, res); err != nil {
  92724. return nil, err
  92725. }
  92726. return ret, nil
  92727. // {
  92728. // "description": "Returns the specified instance group resource.",
  92729. // "httpMethod": "GET",
  92730. // "id": "compute.regionInstanceGroups.get",
  92731. // "parameterOrder": [
  92732. // "project",
  92733. // "region",
  92734. // "instanceGroup"
  92735. // ],
  92736. // "parameters": {
  92737. // "instanceGroup": {
  92738. // "description": "Name of the instance group resource to return.",
  92739. // "location": "path",
  92740. // "required": true,
  92741. // "type": "string"
  92742. // },
  92743. // "project": {
  92744. // "description": "Project ID for this request.",
  92745. // "location": "path",
  92746. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  92747. // "required": true,
  92748. // "type": "string"
  92749. // },
  92750. // "region": {
  92751. // "description": "Name of the region scoping this request.",
  92752. // "location": "path",
  92753. // "required": true,
  92754. // "type": "string"
  92755. // }
  92756. // },
  92757. // "path": "{project}/regions/{region}/instanceGroups/{instanceGroup}",
  92758. // "response": {
  92759. // "$ref": "InstanceGroup"
  92760. // },
  92761. // "scopes": [
  92762. // "https://www.googleapis.com/auth/cloud-platform",
  92763. // "https://www.googleapis.com/auth/compute",
  92764. // "https://www.googleapis.com/auth/compute.readonly"
  92765. // ]
  92766. // }
  92767. }
  92768. // method id "compute.regionInstanceGroups.list":
  92769. type RegionInstanceGroupsListCall struct {
  92770. s *Service
  92771. project string
  92772. region string
  92773. urlParams_ gensupport.URLParams
  92774. ifNoneMatch_ string
  92775. ctx_ context.Context
  92776. header_ http.Header
  92777. }
  92778. // List: Retrieves the list of instance group resources contained within
  92779. // the specified region.
  92780. func (r *RegionInstanceGroupsService) List(project string, region string) *RegionInstanceGroupsListCall {
  92781. c := &RegionInstanceGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  92782. c.project = project
  92783. c.region = region
  92784. return c
  92785. }
  92786. // Filter sets the optional parameter "filter": A filter expression that
  92787. // filters resources listed in the response. The expression must specify
  92788. // the field name, a comparison operator, and the value that you want to
  92789. // use for filtering. The value must be a string, a number, or a
  92790. // boolean. The comparison operator must be either =, !=, >, or <.
  92791. //
  92792. // For example, if you are filtering Compute Engine instances, you can
  92793. // exclude instances named example-instance by specifying name !=
  92794. // example-instance.
  92795. //
  92796. // You can also filter nested fields. For example, you could specify
  92797. // scheduling.automaticRestart = false to include instances only if they
  92798. // are not scheduled for automatic restarts. You can use filtering on
  92799. // nested fields to filter based on resource labels.
  92800. //
  92801. // To filter on multiple expressions, provide each separate expression
  92802. // within parentheses. For example, (scheduling.automaticRestart = true)
  92803. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  92804. // AND expression. However, you can include AND and OR expressions
  92805. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  92806. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  92807. // true).
  92808. func (c *RegionInstanceGroupsListCall) Filter(filter string) *RegionInstanceGroupsListCall {
  92809. c.urlParams_.Set("filter", filter)
  92810. return c
  92811. }
  92812. // MaxResults sets the optional parameter "maxResults": The maximum
  92813. // number of results per page that should be returned. If the number of
  92814. // available results is larger than maxResults, Compute Engine returns a
  92815. // nextPageToken that can be used to get the next page of results in
  92816. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  92817. // (Default: 500)
  92818. func (c *RegionInstanceGroupsListCall) MaxResults(maxResults int64) *RegionInstanceGroupsListCall {
  92819. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  92820. return c
  92821. }
  92822. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  92823. // a certain order. By default, results are returned in alphanumerical
  92824. // order based on the resource name.
  92825. //
  92826. // You can also sort results in descending order based on the creation
  92827. // timestamp using orderBy="creationTimestamp desc". This sorts results
  92828. // based on the creationTimestamp field in reverse chronological order
  92829. // (newest result first). Use this to sort resources like operations so
  92830. // that the newest operation is returned first.
  92831. //
  92832. // Currently, only sorting by name or creationTimestamp desc is
  92833. // supported.
  92834. func (c *RegionInstanceGroupsListCall) OrderBy(orderBy string) *RegionInstanceGroupsListCall {
  92835. c.urlParams_.Set("orderBy", orderBy)
  92836. return c
  92837. }
  92838. // PageToken sets the optional parameter "pageToken": Specifies a page
  92839. // token to use. Set pageToken to the nextPageToken returned by a
  92840. // previous list request to get the next page of results.
  92841. func (c *RegionInstanceGroupsListCall) PageToken(pageToken string) *RegionInstanceGroupsListCall {
  92842. c.urlParams_.Set("pageToken", pageToken)
  92843. return c
  92844. }
  92845. // Fields allows partial responses to be retrieved. See
  92846. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  92847. // for more information.
  92848. func (c *RegionInstanceGroupsListCall) Fields(s ...googleapi.Field) *RegionInstanceGroupsListCall {
  92849. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  92850. return c
  92851. }
  92852. // IfNoneMatch sets the optional parameter which makes the operation
  92853. // fail if the object's ETag matches the given value. This is useful for
  92854. // getting updates only after the object has changed since the last
  92855. // request. Use googleapi.IsNotModified to check whether the response
  92856. // error from Do is the result of In-None-Match.
  92857. func (c *RegionInstanceGroupsListCall) IfNoneMatch(entityTag string) *RegionInstanceGroupsListCall {
  92858. c.ifNoneMatch_ = entityTag
  92859. return c
  92860. }
  92861. // Context sets the context to be used in this call's Do method. Any
  92862. // pending HTTP request will be aborted if the provided context is
  92863. // canceled.
  92864. func (c *RegionInstanceGroupsListCall) Context(ctx context.Context) *RegionInstanceGroupsListCall {
  92865. c.ctx_ = ctx
  92866. return c
  92867. }
  92868. // Header returns an http.Header that can be modified by the caller to
  92869. // add HTTP headers to the request.
  92870. func (c *RegionInstanceGroupsListCall) Header() http.Header {
  92871. if c.header_ == nil {
  92872. c.header_ = make(http.Header)
  92873. }
  92874. return c.header_
  92875. }
  92876. func (c *RegionInstanceGroupsListCall) doRequest(alt string) (*http.Response, error) {
  92877. reqHeaders := make(http.Header)
  92878. for k, v := range c.header_ {
  92879. reqHeaders[k] = v
  92880. }
  92881. reqHeaders.Set("User-Agent", c.s.userAgent())
  92882. if c.ifNoneMatch_ != "" {
  92883. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  92884. }
  92885. var body io.Reader = nil
  92886. c.urlParams_.Set("alt", alt)
  92887. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroups")
  92888. urls += "?" + c.urlParams_.Encode()
  92889. req, _ := http.NewRequest("GET", urls, body)
  92890. req.Header = reqHeaders
  92891. googleapi.Expand(req.URL, map[string]string{
  92892. "project": c.project,
  92893. "region": c.region,
  92894. })
  92895. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  92896. }
  92897. // Do executes the "compute.regionInstanceGroups.list" call.
  92898. // Exactly one of *RegionInstanceGroupList or error will be non-nil. Any
  92899. // non-2xx status code is an error. Response headers are in either
  92900. // *RegionInstanceGroupList.ServerResponse.Header or (if a response was
  92901. // returned at all) in error.(*googleapi.Error).Header. Use
  92902. // googleapi.IsNotModified to check whether the returned error was
  92903. // because http.StatusNotModified was returned.
  92904. func (c *RegionInstanceGroupsListCall) Do(opts ...googleapi.CallOption) (*RegionInstanceGroupList, error) {
  92905. gensupport.SetOptions(c.urlParams_, opts...)
  92906. res, err := c.doRequest("json")
  92907. if res != nil && res.StatusCode == http.StatusNotModified {
  92908. if res.Body != nil {
  92909. res.Body.Close()
  92910. }
  92911. return nil, &googleapi.Error{
  92912. Code: res.StatusCode,
  92913. Header: res.Header,
  92914. }
  92915. }
  92916. if err != nil {
  92917. return nil, err
  92918. }
  92919. defer googleapi.CloseBody(res)
  92920. if err := googleapi.CheckResponse(res); err != nil {
  92921. return nil, err
  92922. }
  92923. ret := &RegionInstanceGroupList{
  92924. ServerResponse: googleapi.ServerResponse{
  92925. Header: res.Header,
  92926. HTTPStatusCode: res.StatusCode,
  92927. },
  92928. }
  92929. target := &ret
  92930. if err := gensupport.DecodeResponse(target, res); err != nil {
  92931. return nil, err
  92932. }
  92933. return ret, nil
  92934. // {
  92935. // "description": "Retrieves the list of instance group resources contained within the specified region.",
  92936. // "httpMethod": "GET",
  92937. // "id": "compute.regionInstanceGroups.list",
  92938. // "parameterOrder": [
  92939. // "project",
  92940. // "region"
  92941. // ],
  92942. // "parameters": {
  92943. // "filter": {
  92944. // "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).",
  92945. // "location": "query",
  92946. // "type": "string"
  92947. // },
  92948. // "maxResults": {
  92949. // "default": "500",
  92950. // "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)",
  92951. // "format": "uint32",
  92952. // "location": "query",
  92953. // "minimum": "0",
  92954. // "type": "integer"
  92955. // },
  92956. // "orderBy": {
  92957. // "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.",
  92958. // "location": "query",
  92959. // "type": "string"
  92960. // },
  92961. // "pageToken": {
  92962. // "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.",
  92963. // "location": "query",
  92964. // "type": "string"
  92965. // },
  92966. // "project": {
  92967. // "description": "Project ID for this request.",
  92968. // "location": "path",
  92969. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  92970. // "required": true,
  92971. // "type": "string"
  92972. // },
  92973. // "region": {
  92974. // "description": "Name of the region scoping this request.",
  92975. // "location": "path",
  92976. // "required": true,
  92977. // "type": "string"
  92978. // }
  92979. // },
  92980. // "path": "{project}/regions/{region}/instanceGroups",
  92981. // "response": {
  92982. // "$ref": "RegionInstanceGroupList"
  92983. // },
  92984. // "scopes": [
  92985. // "https://www.googleapis.com/auth/cloud-platform",
  92986. // "https://www.googleapis.com/auth/compute",
  92987. // "https://www.googleapis.com/auth/compute.readonly"
  92988. // ]
  92989. // }
  92990. }
  92991. // Pages invokes f for each page of results.
  92992. // A non-nil error returned from f will halt the iteration.
  92993. // The provided context supersedes any context provided to the Context method.
  92994. func (c *RegionInstanceGroupsListCall) Pages(ctx context.Context, f func(*RegionInstanceGroupList) error) error {
  92995. c.ctx_ = ctx
  92996. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  92997. for {
  92998. x, err := c.Do()
  92999. if err != nil {
  93000. return err
  93001. }
  93002. if err := f(x); err != nil {
  93003. return err
  93004. }
  93005. if x.NextPageToken == "" {
  93006. return nil
  93007. }
  93008. c.PageToken(x.NextPageToken)
  93009. }
  93010. }
  93011. // method id "compute.regionInstanceGroups.listInstances":
  93012. type RegionInstanceGroupsListInstancesCall struct {
  93013. s *Service
  93014. project string
  93015. region string
  93016. instanceGroup string
  93017. regioninstancegroupslistinstancesrequest *RegionInstanceGroupsListInstancesRequest
  93018. urlParams_ gensupport.URLParams
  93019. ctx_ context.Context
  93020. header_ http.Header
  93021. }
  93022. // ListInstances: Lists the instances in the specified instance group
  93023. // and displays information about the named ports. Depending on the
  93024. // specified options, this method can list all instances or only the
  93025. // instances that are running.
  93026. func (r *RegionInstanceGroupsService) ListInstances(project string, region string, instanceGroup string, regioninstancegroupslistinstancesrequest *RegionInstanceGroupsListInstancesRequest) *RegionInstanceGroupsListInstancesCall {
  93027. c := &RegionInstanceGroupsListInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  93028. c.project = project
  93029. c.region = region
  93030. c.instanceGroup = instanceGroup
  93031. c.regioninstancegroupslistinstancesrequest = regioninstancegroupslistinstancesrequest
  93032. return c
  93033. }
  93034. // Filter sets the optional parameter "filter": A filter expression that
  93035. // filters resources listed in the response. The expression must specify
  93036. // the field name, a comparison operator, and the value that you want to
  93037. // use for filtering. The value must be a string, a number, or a
  93038. // boolean. The comparison operator must be either =, !=, >, or <.
  93039. //
  93040. // For example, if you are filtering Compute Engine instances, you can
  93041. // exclude instances named example-instance by specifying name !=
  93042. // example-instance.
  93043. //
  93044. // You can also filter nested fields. For example, you could specify
  93045. // scheduling.automaticRestart = false to include instances only if they
  93046. // are not scheduled for automatic restarts. You can use filtering on
  93047. // nested fields to filter based on resource labels.
  93048. //
  93049. // To filter on multiple expressions, provide each separate expression
  93050. // within parentheses. For example, (scheduling.automaticRestart = true)
  93051. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  93052. // AND expression. However, you can include AND and OR expressions
  93053. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  93054. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  93055. // true).
  93056. func (c *RegionInstanceGroupsListInstancesCall) Filter(filter string) *RegionInstanceGroupsListInstancesCall {
  93057. c.urlParams_.Set("filter", filter)
  93058. return c
  93059. }
  93060. // MaxResults sets the optional parameter "maxResults": The maximum
  93061. // number of results per page that should be returned. If the number of
  93062. // available results is larger than maxResults, Compute Engine returns a
  93063. // nextPageToken that can be used to get the next page of results in
  93064. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  93065. // (Default: 500)
  93066. func (c *RegionInstanceGroupsListInstancesCall) MaxResults(maxResults int64) *RegionInstanceGroupsListInstancesCall {
  93067. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  93068. return c
  93069. }
  93070. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  93071. // a certain order. By default, results are returned in alphanumerical
  93072. // order based on the resource name.
  93073. //
  93074. // You can also sort results in descending order based on the creation
  93075. // timestamp using orderBy="creationTimestamp desc". This sorts results
  93076. // based on the creationTimestamp field in reverse chronological order
  93077. // (newest result first). Use this to sort resources like operations so
  93078. // that the newest operation is returned first.
  93079. //
  93080. // Currently, only sorting by name or creationTimestamp desc is
  93081. // supported.
  93082. func (c *RegionInstanceGroupsListInstancesCall) OrderBy(orderBy string) *RegionInstanceGroupsListInstancesCall {
  93083. c.urlParams_.Set("orderBy", orderBy)
  93084. return c
  93085. }
  93086. // PageToken sets the optional parameter "pageToken": Specifies a page
  93087. // token to use. Set pageToken to the nextPageToken returned by a
  93088. // previous list request to get the next page of results.
  93089. func (c *RegionInstanceGroupsListInstancesCall) PageToken(pageToken string) *RegionInstanceGroupsListInstancesCall {
  93090. c.urlParams_.Set("pageToken", pageToken)
  93091. return c
  93092. }
  93093. // Fields allows partial responses to be retrieved. See
  93094. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  93095. // for more information.
  93096. func (c *RegionInstanceGroupsListInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupsListInstancesCall {
  93097. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  93098. return c
  93099. }
  93100. // Context sets the context to be used in this call's Do method. Any
  93101. // pending HTTP request will be aborted if the provided context is
  93102. // canceled.
  93103. func (c *RegionInstanceGroupsListInstancesCall) Context(ctx context.Context) *RegionInstanceGroupsListInstancesCall {
  93104. c.ctx_ = ctx
  93105. return c
  93106. }
  93107. // Header returns an http.Header that can be modified by the caller to
  93108. // add HTTP headers to the request.
  93109. func (c *RegionInstanceGroupsListInstancesCall) Header() http.Header {
  93110. if c.header_ == nil {
  93111. c.header_ = make(http.Header)
  93112. }
  93113. return c.header_
  93114. }
  93115. func (c *RegionInstanceGroupsListInstancesCall) doRequest(alt string) (*http.Response, error) {
  93116. reqHeaders := make(http.Header)
  93117. for k, v := range c.header_ {
  93118. reqHeaders[k] = v
  93119. }
  93120. reqHeaders.Set("User-Agent", c.s.userAgent())
  93121. var body io.Reader = nil
  93122. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupslistinstancesrequest)
  93123. if err != nil {
  93124. return nil, err
  93125. }
  93126. reqHeaders.Set("Content-Type", "application/json")
  93127. c.urlParams_.Set("alt", alt)
  93128. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroups/{instanceGroup}/listInstances")
  93129. urls += "?" + c.urlParams_.Encode()
  93130. req, _ := http.NewRequest("POST", urls, body)
  93131. req.Header = reqHeaders
  93132. googleapi.Expand(req.URL, map[string]string{
  93133. "project": c.project,
  93134. "region": c.region,
  93135. "instanceGroup": c.instanceGroup,
  93136. })
  93137. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  93138. }
  93139. // Do executes the "compute.regionInstanceGroups.listInstances" call.
  93140. // Exactly one of *RegionInstanceGroupsListInstances or error will be
  93141. // non-nil. Any non-2xx status code is an error. Response headers are in
  93142. // either *RegionInstanceGroupsListInstances.ServerResponse.Header or
  93143. // (if a response was returned at all) in
  93144. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  93145. // whether the returned error was because http.StatusNotModified was
  93146. // returned.
  93147. func (c *RegionInstanceGroupsListInstancesCall) Do(opts ...googleapi.CallOption) (*RegionInstanceGroupsListInstances, error) {
  93148. gensupport.SetOptions(c.urlParams_, opts...)
  93149. res, err := c.doRequest("json")
  93150. if res != nil && res.StatusCode == http.StatusNotModified {
  93151. if res.Body != nil {
  93152. res.Body.Close()
  93153. }
  93154. return nil, &googleapi.Error{
  93155. Code: res.StatusCode,
  93156. Header: res.Header,
  93157. }
  93158. }
  93159. if err != nil {
  93160. return nil, err
  93161. }
  93162. defer googleapi.CloseBody(res)
  93163. if err := googleapi.CheckResponse(res); err != nil {
  93164. return nil, err
  93165. }
  93166. ret := &RegionInstanceGroupsListInstances{
  93167. ServerResponse: googleapi.ServerResponse{
  93168. Header: res.Header,
  93169. HTTPStatusCode: res.StatusCode,
  93170. },
  93171. }
  93172. target := &ret
  93173. if err := gensupport.DecodeResponse(target, res); err != nil {
  93174. return nil, err
  93175. }
  93176. return ret, nil
  93177. // {
  93178. // "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.",
  93179. // "httpMethod": "POST",
  93180. // "id": "compute.regionInstanceGroups.listInstances",
  93181. // "parameterOrder": [
  93182. // "project",
  93183. // "region",
  93184. // "instanceGroup"
  93185. // ],
  93186. // "parameters": {
  93187. // "filter": {
  93188. // "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).",
  93189. // "location": "query",
  93190. // "type": "string"
  93191. // },
  93192. // "instanceGroup": {
  93193. // "description": "Name of the regional instance group for which we want to list the instances.",
  93194. // "location": "path",
  93195. // "required": true,
  93196. // "type": "string"
  93197. // },
  93198. // "maxResults": {
  93199. // "default": "500",
  93200. // "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)",
  93201. // "format": "uint32",
  93202. // "location": "query",
  93203. // "minimum": "0",
  93204. // "type": "integer"
  93205. // },
  93206. // "orderBy": {
  93207. // "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.",
  93208. // "location": "query",
  93209. // "type": "string"
  93210. // },
  93211. // "pageToken": {
  93212. // "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.",
  93213. // "location": "query",
  93214. // "type": "string"
  93215. // },
  93216. // "project": {
  93217. // "description": "Project ID for this request.",
  93218. // "location": "path",
  93219. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  93220. // "required": true,
  93221. // "type": "string"
  93222. // },
  93223. // "region": {
  93224. // "description": "Name of the region scoping this request.",
  93225. // "location": "path",
  93226. // "required": true,
  93227. // "type": "string"
  93228. // }
  93229. // },
  93230. // "path": "{project}/regions/{region}/instanceGroups/{instanceGroup}/listInstances",
  93231. // "request": {
  93232. // "$ref": "RegionInstanceGroupsListInstancesRequest"
  93233. // },
  93234. // "response": {
  93235. // "$ref": "RegionInstanceGroupsListInstances"
  93236. // },
  93237. // "scopes": [
  93238. // "https://www.googleapis.com/auth/cloud-platform",
  93239. // "https://www.googleapis.com/auth/compute",
  93240. // "https://www.googleapis.com/auth/compute.readonly"
  93241. // ]
  93242. // }
  93243. }
  93244. // Pages invokes f for each page of results.
  93245. // A non-nil error returned from f will halt the iteration.
  93246. // The provided context supersedes any context provided to the Context method.
  93247. func (c *RegionInstanceGroupsListInstancesCall) Pages(ctx context.Context, f func(*RegionInstanceGroupsListInstances) error) error {
  93248. c.ctx_ = ctx
  93249. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  93250. for {
  93251. x, err := c.Do()
  93252. if err != nil {
  93253. return err
  93254. }
  93255. if err := f(x); err != nil {
  93256. return err
  93257. }
  93258. if x.NextPageToken == "" {
  93259. return nil
  93260. }
  93261. c.PageToken(x.NextPageToken)
  93262. }
  93263. }
  93264. // method id "compute.regionInstanceGroups.setNamedPorts":
  93265. type RegionInstanceGroupsSetNamedPortsCall struct {
  93266. s *Service
  93267. project string
  93268. region string
  93269. instanceGroup string
  93270. regioninstancegroupssetnamedportsrequest *RegionInstanceGroupsSetNamedPortsRequest
  93271. urlParams_ gensupport.URLParams
  93272. ctx_ context.Context
  93273. header_ http.Header
  93274. }
  93275. // SetNamedPorts: Sets the named ports for the specified regional
  93276. // instance group.
  93277. func (r *RegionInstanceGroupsService) SetNamedPorts(project string, region string, instanceGroup string, regioninstancegroupssetnamedportsrequest *RegionInstanceGroupsSetNamedPortsRequest) *RegionInstanceGroupsSetNamedPortsCall {
  93278. c := &RegionInstanceGroupsSetNamedPortsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  93279. c.project = project
  93280. c.region = region
  93281. c.instanceGroup = instanceGroup
  93282. c.regioninstancegroupssetnamedportsrequest = regioninstancegroupssetnamedportsrequest
  93283. return c
  93284. }
  93285. // RequestId sets the optional parameter "requestId": An optional
  93286. // request ID to identify requests. Specify a unique request ID so that
  93287. // if you must retry your request, the server will know to ignore the
  93288. // request if it has already been completed.
  93289. //
  93290. // For example, consider a situation where you make an initial request
  93291. // and the request times out. If you make the request again with the
  93292. // same request ID, the server can check if original operation with the
  93293. // same request ID was received, and if so, will ignore the second
  93294. // request. This prevents clients from accidentally creating duplicate
  93295. // commitments.
  93296. //
  93297. // The request ID must be a valid UUID with the exception that zero UUID
  93298. // is not supported (00000000-0000-0000-0000-000000000000).
  93299. func (c *RegionInstanceGroupsSetNamedPortsCall) RequestId(requestId string) *RegionInstanceGroupsSetNamedPortsCall {
  93300. c.urlParams_.Set("requestId", requestId)
  93301. return c
  93302. }
  93303. // Fields allows partial responses to be retrieved. See
  93304. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  93305. // for more information.
  93306. func (c *RegionInstanceGroupsSetNamedPortsCall) Fields(s ...googleapi.Field) *RegionInstanceGroupsSetNamedPortsCall {
  93307. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  93308. return c
  93309. }
  93310. // Context sets the context to be used in this call's Do method. Any
  93311. // pending HTTP request will be aborted if the provided context is
  93312. // canceled.
  93313. func (c *RegionInstanceGroupsSetNamedPortsCall) Context(ctx context.Context) *RegionInstanceGroupsSetNamedPortsCall {
  93314. c.ctx_ = ctx
  93315. return c
  93316. }
  93317. // Header returns an http.Header that can be modified by the caller to
  93318. // add HTTP headers to the request.
  93319. func (c *RegionInstanceGroupsSetNamedPortsCall) Header() http.Header {
  93320. if c.header_ == nil {
  93321. c.header_ = make(http.Header)
  93322. }
  93323. return c.header_
  93324. }
  93325. func (c *RegionInstanceGroupsSetNamedPortsCall) doRequest(alt string) (*http.Response, error) {
  93326. reqHeaders := make(http.Header)
  93327. for k, v := range c.header_ {
  93328. reqHeaders[k] = v
  93329. }
  93330. reqHeaders.Set("User-Agent", c.s.userAgent())
  93331. var body io.Reader = nil
  93332. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupssetnamedportsrequest)
  93333. if err != nil {
  93334. return nil, err
  93335. }
  93336. reqHeaders.Set("Content-Type", "application/json")
  93337. c.urlParams_.Set("alt", alt)
  93338. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroups/{instanceGroup}/setNamedPorts")
  93339. urls += "?" + c.urlParams_.Encode()
  93340. req, _ := http.NewRequest("POST", urls, body)
  93341. req.Header = reqHeaders
  93342. googleapi.Expand(req.URL, map[string]string{
  93343. "project": c.project,
  93344. "region": c.region,
  93345. "instanceGroup": c.instanceGroup,
  93346. })
  93347. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  93348. }
  93349. // Do executes the "compute.regionInstanceGroups.setNamedPorts" call.
  93350. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  93351. // status code is an error. Response headers are in either
  93352. // *Operation.ServerResponse.Header or (if a response was returned at
  93353. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  93354. // to check whether the returned error was because
  93355. // http.StatusNotModified was returned.
  93356. func (c *RegionInstanceGroupsSetNamedPortsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  93357. gensupport.SetOptions(c.urlParams_, opts...)
  93358. res, err := c.doRequest("json")
  93359. if res != nil && res.StatusCode == http.StatusNotModified {
  93360. if res.Body != nil {
  93361. res.Body.Close()
  93362. }
  93363. return nil, &googleapi.Error{
  93364. Code: res.StatusCode,
  93365. Header: res.Header,
  93366. }
  93367. }
  93368. if err != nil {
  93369. return nil, err
  93370. }
  93371. defer googleapi.CloseBody(res)
  93372. if err := googleapi.CheckResponse(res); err != nil {
  93373. return nil, err
  93374. }
  93375. ret := &Operation{
  93376. ServerResponse: googleapi.ServerResponse{
  93377. Header: res.Header,
  93378. HTTPStatusCode: res.StatusCode,
  93379. },
  93380. }
  93381. target := &ret
  93382. if err := gensupport.DecodeResponse(target, res); err != nil {
  93383. return nil, err
  93384. }
  93385. return ret, nil
  93386. // {
  93387. // "description": "Sets the named ports for the specified regional instance group.",
  93388. // "httpMethod": "POST",
  93389. // "id": "compute.regionInstanceGroups.setNamedPorts",
  93390. // "parameterOrder": [
  93391. // "project",
  93392. // "region",
  93393. // "instanceGroup"
  93394. // ],
  93395. // "parameters": {
  93396. // "instanceGroup": {
  93397. // "description": "The name of the regional instance group where the named ports are updated.",
  93398. // "location": "path",
  93399. // "required": true,
  93400. // "type": "string"
  93401. // },
  93402. // "project": {
  93403. // "description": "Project ID for this request.",
  93404. // "location": "path",
  93405. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  93406. // "required": true,
  93407. // "type": "string"
  93408. // },
  93409. // "region": {
  93410. // "description": "Name of the region scoping this request.",
  93411. // "location": "path",
  93412. // "required": true,
  93413. // "type": "string"
  93414. // },
  93415. // "requestId": {
  93416. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  93417. // "location": "query",
  93418. // "type": "string"
  93419. // }
  93420. // },
  93421. // "path": "{project}/regions/{region}/instanceGroups/{instanceGroup}/setNamedPorts",
  93422. // "request": {
  93423. // "$ref": "RegionInstanceGroupsSetNamedPortsRequest"
  93424. // },
  93425. // "response": {
  93426. // "$ref": "Operation"
  93427. // },
  93428. // "scopes": [
  93429. // "https://www.googleapis.com/auth/cloud-platform",
  93430. // "https://www.googleapis.com/auth/compute"
  93431. // ]
  93432. // }
  93433. }
  93434. // method id "compute.regionInstanceGroups.testIamPermissions":
  93435. type RegionInstanceGroupsTestIamPermissionsCall struct {
  93436. s *Service
  93437. project string
  93438. region string
  93439. resource string
  93440. testpermissionsrequest *TestPermissionsRequest
  93441. urlParams_ gensupport.URLParams
  93442. ctx_ context.Context
  93443. header_ http.Header
  93444. }
  93445. // TestIamPermissions: Returns permissions that a caller has on the
  93446. // specified resource.
  93447. func (r *RegionInstanceGroupsService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionInstanceGroupsTestIamPermissionsCall {
  93448. c := &RegionInstanceGroupsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  93449. c.project = project
  93450. c.region = region
  93451. c.resource = resource
  93452. c.testpermissionsrequest = testpermissionsrequest
  93453. return c
  93454. }
  93455. // Fields allows partial responses to be retrieved. See
  93456. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  93457. // for more information.
  93458. func (c *RegionInstanceGroupsTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionInstanceGroupsTestIamPermissionsCall {
  93459. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  93460. return c
  93461. }
  93462. // Context sets the context to be used in this call's Do method. Any
  93463. // pending HTTP request will be aborted if the provided context is
  93464. // canceled.
  93465. func (c *RegionInstanceGroupsTestIamPermissionsCall) Context(ctx context.Context) *RegionInstanceGroupsTestIamPermissionsCall {
  93466. c.ctx_ = ctx
  93467. return c
  93468. }
  93469. // Header returns an http.Header that can be modified by the caller to
  93470. // add HTTP headers to the request.
  93471. func (c *RegionInstanceGroupsTestIamPermissionsCall) Header() http.Header {
  93472. if c.header_ == nil {
  93473. c.header_ = make(http.Header)
  93474. }
  93475. return c.header_
  93476. }
  93477. func (c *RegionInstanceGroupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  93478. reqHeaders := make(http.Header)
  93479. for k, v := range c.header_ {
  93480. reqHeaders[k] = v
  93481. }
  93482. reqHeaders.Set("User-Agent", c.s.userAgent())
  93483. var body io.Reader = nil
  93484. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  93485. if err != nil {
  93486. return nil, err
  93487. }
  93488. reqHeaders.Set("Content-Type", "application/json")
  93489. c.urlParams_.Set("alt", alt)
  93490. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroups/{resource}/testIamPermissions")
  93491. urls += "?" + c.urlParams_.Encode()
  93492. req, _ := http.NewRequest("POST", urls, body)
  93493. req.Header = reqHeaders
  93494. googleapi.Expand(req.URL, map[string]string{
  93495. "project": c.project,
  93496. "region": c.region,
  93497. "resource": c.resource,
  93498. })
  93499. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  93500. }
  93501. // Do executes the "compute.regionInstanceGroups.testIamPermissions" call.
  93502. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  93503. // non-2xx status code is an error. Response headers are in either
  93504. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  93505. // returned at all) in error.(*googleapi.Error).Header. Use
  93506. // googleapi.IsNotModified to check whether the returned error was
  93507. // because http.StatusNotModified was returned.
  93508. func (c *RegionInstanceGroupsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  93509. gensupport.SetOptions(c.urlParams_, opts...)
  93510. res, err := c.doRequest("json")
  93511. if res != nil && res.StatusCode == http.StatusNotModified {
  93512. if res.Body != nil {
  93513. res.Body.Close()
  93514. }
  93515. return nil, &googleapi.Error{
  93516. Code: res.StatusCode,
  93517. Header: res.Header,
  93518. }
  93519. }
  93520. if err != nil {
  93521. return nil, err
  93522. }
  93523. defer googleapi.CloseBody(res)
  93524. if err := googleapi.CheckResponse(res); err != nil {
  93525. return nil, err
  93526. }
  93527. ret := &TestPermissionsResponse{
  93528. ServerResponse: googleapi.ServerResponse{
  93529. Header: res.Header,
  93530. HTTPStatusCode: res.StatusCode,
  93531. },
  93532. }
  93533. target := &ret
  93534. if err := gensupport.DecodeResponse(target, res); err != nil {
  93535. return nil, err
  93536. }
  93537. return ret, nil
  93538. // {
  93539. // "description": "Returns permissions that a caller has on the specified resource.",
  93540. // "httpMethod": "POST",
  93541. // "id": "compute.regionInstanceGroups.testIamPermissions",
  93542. // "parameterOrder": [
  93543. // "project",
  93544. // "region",
  93545. // "resource"
  93546. // ],
  93547. // "parameters": {
  93548. // "project": {
  93549. // "description": "Project ID for this request.",
  93550. // "location": "path",
  93551. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  93552. // "required": true,
  93553. // "type": "string"
  93554. // },
  93555. // "region": {
  93556. // "description": "The name of the region for this request.",
  93557. // "location": "path",
  93558. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  93559. // "required": true,
  93560. // "type": "string"
  93561. // },
  93562. // "resource": {
  93563. // "description": "Name of the resource for this request.",
  93564. // "location": "path",
  93565. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  93566. // "required": true,
  93567. // "type": "string"
  93568. // }
  93569. // },
  93570. // "path": "{project}/regions/{region}/instanceGroups/{resource}/testIamPermissions",
  93571. // "request": {
  93572. // "$ref": "TestPermissionsRequest"
  93573. // },
  93574. // "response": {
  93575. // "$ref": "TestPermissionsResponse"
  93576. // },
  93577. // "scopes": [
  93578. // "https://www.googleapis.com/auth/cloud-platform",
  93579. // "https://www.googleapis.com/auth/compute",
  93580. // "https://www.googleapis.com/auth/compute.readonly"
  93581. // ]
  93582. // }
  93583. }
  93584. // method id "compute.regionOperations.delete":
  93585. type RegionOperationsDeleteCall struct {
  93586. s *Service
  93587. project string
  93588. region string
  93589. operation string
  93590. urlParams_ gensupport.URLParams
  93591. ctx_ context.Context
  93592. header_ http.Header
  93593. }
  93594. // Delete: Deletes the specified region-specific Operations resource.
  93595. // For details, see https://cloud.google.com/compute/docs/reference/latest/regionOperations/delete
  93596. func (r *RegionOperationsService) Delete(project string, region string, operation string) *RegionOperationsDeleteCall {
  93597. c := &RegionOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  93598. c.project = project
  93599. c.region = region
  93600. c.operation = operation
  93601. return c
  93602. }
  93603. // Fields allows partial responses to be retrieved. See
  93604. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  93605. // for more information.
  93606. func (c *RegionOperationsDeleteCall) Fields(s ...googleapi.Field) *RegionOperationsDeleteCall {
  93607. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  93608. return c
  93609. }
  93610. // Context sets the context to be used in this call's Do method. Any
  93611. // pending HTTP request will be aborted if the provided context is
  93612. // canceled.
  93613. func (c *RegionOperationsDeleteCall) Context(ctx context.Context) *RegionOperationsDeleteCall {
  93614. c.ctx_ = ctx
  93615. return c
  93616. }
  93617. // Header returns an http.Header that can be modified by the caller to
  93618. // add HTTP headers to the request.
  93619. func (c *RegionOperationsDeleteCall) Header() http.Header {
  93620. if c.header_ == nil {
  93621. c.header_ = make(http.Header)
  93622. }
  93623. return c.header_
  93624. }
  93625. func (c *RegionOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  93626. reqHeaders := make(http.Header)
  93627. for k, v := range c.header_ {
  93628. reqHeaders[k] = v
  93629. }
  93630. reqHeaders.Set("User-Agent", c.s.userAgent())
  93631. var body io.Reader = nil
  93632. c.urlParams_.Set("alt", alt)
  93633. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/operations/{operation}")
  93634. urls += "?" + c.urlParams_.Encode()
  93635. req, _ := http.NewRequest("DELETE", urls, body)
  93636. req.Header = reqHeaders
  93637. googleapi.Expand(req.URL, map[string]string{
  93638. "project": c.project,
  93639. "region": c.region,
  93640. "operation": c.operation,
  93641. })
  93642. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  93643. }
  93644. // Do executes the "compute.regionOperations.delete" call.
  93645. func (c *RegionOperationsDeleteCall) Do(opts ...googleapi.CallOption) error {
  93646. gensupport.SetOptions(c.urlParams_, opts...)
  93647. res, err := c.doRequest("json")
  93648. if err != nil {
  93649. return err
  93650. }
  93651. defer googleapi.CloseBody(res)
  93652. if err := googleapi.CheckResponse(res); err != nil {
  93653. return err
  93654. }
  93655. return nil
  93656. // {
  93657. // "description": "Deletes the specified region-specific Operations resource.",
  93658. // "httpMethod": "DELETE",
  93659. // "id": "compute.regionOperations.delete",
  93660. // "parameterOrder": [
  93661. // "project",
  93662. // "region",
  93663. // "operation"
  93664. // ],
  93665. // "parameters": {
  93666. // "operation": {
  93667. // "description": "Name of the Operations resource to delete.",
  93668. // "location": "path",
  93669. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  93670. // "required": true,
  93671. // "type": "string"
  93672. // },
  93673. // "project": {
  93674. // "description": "Project ID for this request.",
  93675. // "location": "path",
  93676. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  93677. // "required": true,
  93678. // "type": "string"
  93679. // },
  93680. // "region": {
  93681. // "description": "Name of the region for this request.",
  93682. // "location": "path",
  93683. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  93684. // "required": true,
  93685. // "type": "string"
  93686. // }
  93687. // },
  93688. // "path": "{project}/regions/{region}/operations/{operation}",
  93689. // "scopes": [
  93690. // "https://www.googleapis.com/auth/cloud-platform",
  93691. // "https://www.googleapis.com/auth/compute"
  93692. // ]
  93693. // }
  93694. }
  93695. // method id "compute.regionOperations.get":
  93696. type RegionOperationsGetCall struct {
  93697. s *Service
  93698. project string
  93699. region string
  93700. operation string
  93701. urlParams_ gensupport.URLParams
  93702. ifNoneMatch_ string
  93703. ctx_ context.Context
  93704. header_ http.Header
  93705. }
  93706. // Get: Retrieves the specified region-specific Operations resource.
  93707. // For details, see https://cloud.google.com/compute/docs/reference/latest/regionOperations/get
  93708. func (r *RegionOperationsService) Get(project string, region string, operation string) *RegionOperationsGetCall {
  93709. c := &RegionOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  93710. c.project = project
  93711. c.region = region
  93712. c.operation = operation
  93713. return c
  93714. }
  93715. // Fields allows partial responses to be retrieved. See
  93716. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  93717. // for more information.
  93718. func (c *RegionOperationsGetCall) Fields(s ...googleapi.Field) *RegionOperationsGetCall {
  93719. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  93720. return c
  93721. }
  93722. // IfNoneMatch sets the optional parameter which makes the operation
  93723. // fail if the object's ETag matches the given value. This is useful for
  93724. // getting updates only after the object has changed since the last
  93725. // request. Use googleapi.IsNotModified to check whether the response
  93726. // error from Do is the result of In-None-Match.
  93727. func (c *RegionOperationsGetCall) IfNoneMatch(entityTag string) *RegionOperationsGetCall {
  93728. c.ifNoneMatch_ = entityTag
  93729. return c
  93730. }
  93731. // Context sets the context to be used in this call's Do method. Any
  93732. // pending HTTP request will be aborted if the provided context is
  93733. // canceled.
  93734. func (c *RegionOperationsGetCall) Context(ctx context.Context) *RegionOperationsGetCall {
  93735. c.ctx_ = ctx
  93736. return c
  93737. }
  93738. // Header returns an http.Header that can be modified by the caller to
  93739. // add HTTP headers to the request.
  93740. func (c *RegionOperationsGetCall) Header() http.Header {
  93741. if c.header_ == nil {
  93742. c.header_ = make(http.Header)
  93743. }
  93744. return c.header_
  93745. }
  93746. func (c *RegionOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  93747. reqHeaders := make(http.Header)
  93748. for k, v := range c.header_ {
  93749. reqHeaders[k] = v
  93750. }
  93751. reqHeaders.Set("User-Agent", c.s.userAgent())
  93752. if c.ifNoneMatch_ != "" {
  93753. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  93754. }
  93755. var body io.Reader = nil
  93756. c.urlParams_.Set("alt", alt)
  93757. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/operations/{operation}")
  93758. urls += "?" + c.urlParams_.Encode()
  93759. req, _ := http.NewRequest("GET", urls, body)
  93760. req.Header = reqHeaders
  93761. googleapi.Expand(req.URL, map[string]string{
  93762. "project": c.project,
  93763. "region": c.region,
  93764. "operation": c.operation,
  93765. })
  93766. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  93767. }
  93768. // Do executes the "compute.regionOperations.get" call.
  93769. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  93770. // status code is an error. Response headers are in either
  93771. // *Operation.ServerResponse.Header or (if a response was returned at
  93772. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  93773. // to check whether the returned error was because
  93774. // http.StatusNotModified was returned.
  93775. func (c *RegionOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  93776. gensupport.SetOptions(c.urlParams_, opts...)
  93777. res, err := c.doRequest("json")
  93778. if res != nil && res.StatusCode == http.StatusNotModified {
  93779. if res.Body != nil {
  93780. res.Body.Close()
  93781. }
  93782. return nil, &googleapi.Error{
  93783. Code: res.StatusCode,
  93784. Header: res.Header,
  93785. }
  93786. }
  93787. if err != nil {
  93788. return nil, err
  93789. }
  93790. defer googleapi.CloseBody(res)
  93791. if err := googleapi.CheckResponse(res); err != nil {
  93792. return nil, err
  93793. }
  93794. ret := &Operation{
  93795. ServerResponse: googleapi.ServerResponse{
  93796. Header: res.Header,
  93797. HTTPStatusCode: res.StatusCode,
  93798. },
  93799. }
  93800. target := &ret
  93801. if err := gensupport.DecodeResponse(target, res); err != nil {
  93802. return nil, err
  93803. }
  93804. return ret, nil
  93805. // {
  93806. // "description": "Retrieves the specified region-specific Operations resource.",
  93807. // "httpMethod": "GET",
  93808. // "id": "compute.regionOperations.get",
  93809. // "parameterOrder": [
  93810. // "project",
  93811. // "region",
  93812. // "operation"
  93813. // ],
  93814. // "parameters": {
  93815. // "operation": {
  93816. // "description": "Name of the Operations resource to return.",
  93817. // "location": "path",
  93818. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  93819. // "required": true,
  93820. // "type": "string"
  93821. // },
  93822. // "project": {
  93823. // "description": "Project ID for this request.",
  93824. // "location": "path",
  93825. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  93826. // "required": true,
  93827. // "type": "string"
  93828. // },
  93829. // "region": {
  93830. // "description": "Name of the region for this request.",
  93831. // "location": "path",
  93832. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  93833. // "required": true,
  93834. // "type": "string"
  93835. // }
  93836. // },
  93837. // "path": "{project}/regions/{region}/operations/{operation}",
  93838. // "response": {
  93839. // "$ref": "Operation"
  93840. // },
  93841. // "scopes": [
  93842. // "https://www.googleapis.com/auth/cloud-platform",
  93843. // "https://www.googleapis.com/auth/compute",
  93844. // "https://www.googleapis.com/auth/compute.readonly"
  93845. // ]
  93846. // }
  93847. }
  93848. // method id "compute.regionOperations.list":
  93849. type RegionOperationsListCall struct {
  93850. s *Service
  93851. project string
  93852. region string
  93853. urlParams_ gensupport.URLParams
  93854. ifNoneMatch_ string
  93855. ctx_ context.Context
  93856. header_ http.Header
  93857. }
  93858. // List: Retrieves a list of Operation resources contained within the
  93859. // specified region.
  93860. // For details, see https://cloud.google.com/compute/docs/reference/latest/regionOperations/list
  93861. func (r *RegionOperationsService) List(project string, region string) *RegionOperationsListCall {
  93862. c := &RegionOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  93863. c.project = project
  93864. c.region = region
  93865. return c
  93866. }
  93867. // Filter sets the optional parameter "filter": A filter expression that
  93868. // filters resources listed in the response. The expression must specify
  93869. // the field name, a comparison operator, and the value that you want to
  93870. // use for filtering. The value must be a string, a number, or a
  93871. // boolean. The comparison operator must be either =, !=, >, or <.
  93872. //
  93873. // For example, if you are filtering Compute Engine instances, you can
  93874. // exclude instances named example-instance by specifying name !=
  93875. // example-instance.
  93876. //
  93877. // You can also filter nested fields. For example, you could specify
  93878. // scheduling.automaticRestart = false to include instances only if they
  93879. // are not scheduled for automatic restarts. You can use filtering on
  93880. // nested fields to filter based on resource labels.
  93881. //
  93882. // To filter on multiple expressions, provide each separate expression
  93883. // within parentheses. For example, (scheduling.automaticRestart = true)
  93884. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  93885. // AND expression. However, you can include AND and OR expressions
  93886. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  93887. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  93888. // true).
  93889. func (c *RegionOperationsListCall) Filter(filter string) *RegionOperationsListCall {
  93890. c.urlParams_.Set("filter", filter)
  93891. return c
  93892. }
  93893. // MaxResults sets the optional parameter "maxResults": The maximum
  93894. // number of results per page that should be returned. If the number of
  93895. // available results is larger than maxResults, Compute Engine returns a
  93896. // nextPageToken that can be used to get the next page of results in
  93897. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  93898. // (Default: 500)
  93899. func (c *RegionOperationsListCall) MaxResults(maxResults int64) *RegionOperationsListCall {
  93900. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  93901. return c
  93902. }
  93903. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  93904. // a certain order. By default, results are returned in alphanumerical
  93905. // order based on the resource name.
  93906. //
  93907. // You can also sort results in descending order based on the creation
  93908. // timestamp using orderBy="creationTimestamp desc". This sorts results
  93909. // based on the creationTimestamp field in reverse chronological order
  93910. // (newest result first). Use this to sort resources like operations so
  93911. // that the newest operation is returned first.
  93912. //
  93913. // Currently, only sorting by name or creationTimestamp desc is
  93914. // supported.
  93915. func (c *RegionOperationsListCall) OrderBy(orderBy string) *RegionOperationsListCall {
  93916. c.urlParams_.Set("orderBy", orderBy)
  93917. return c
  93918. }
  93919. // PageToken sets the optional parameter "pageToken": Specifies a page
  93920. // token to use. Set pageToken to the nextPageToken returned by a
  93921. // previous list request to get the next page of results.
  93922. func (c *RegionOperationsListCall) PageToken(pageToken string) *RegionOperationsListCall {
  93923. c.urlParams_.Set("pageToken", pageToken)
  93924. return c
  93925. }
  93926. // Fields allows partial responses to be retrieved. See
  93927. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  93928. // for more information.
  93929. func (c *RegionOperationsListCall) Fields(s ...googleapi.Field) *RegionOperationsListCall {
  93930. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  93931. return c
  93932. }
  93933. // IfNoneMatch sets the optional parameter which makes the operation
  93934. // fail if the object's ETag matches the given value. This is useful for
  93935. // getting updates only after the object has changed since the last
  93936. // request. Use googleapi.IsNotModified to check whether the response
  93937. // error from Do is the result of In-None-Match.
  93938. func (c *RegionOperationsListCall) IfNoneMatch(entityTag string) *RegionOperationsListCall {
  93939. c.ifNoneMatch_ = entityTag
  93940. return c
  93941. }
  93942. // Context sets the context to be used in this call's Do method. Any
  93943. // pending HTTP request will be aborted if the provided context is
  93944. // canceled.
  93945. func (c *RegionOperationsListCall) Context(ctx context.Context) *RegionOperationsListCall {
  93946. c.ctx_ = ctx
  93947. return c
  93948. }
  93949. // Header returns an http.Header that can be modified by the caller to
  93950. // add HTTP headers to the request.
  93951. func (c *RegionOperationsListCall) Header() http.Header {
  93952. if c.header_ == nil {
  93953. c.header_ = make(http.Header)
  93954. }
  93955. return c.header_
  93956. }
  93957. func (c *RegionOperationsListCall) doRequest(alt string) (*http.Response, error) {
  93958. reqHeaders := make(http.Header)
  93959. for k, v := range c.header_ {
  93960. reqHeaders[k] = v
  93961. }
  93962. reqHeaders.Set("User-Agent", c.s.userAgent())
  93963. if c.ifNoneMatch_ != "" {
  93964. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  93965. }
  93966. var body io.Reader = nil
  93967. c.urlParams_.Set("alt", alt)
  93968. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/operations")
  93969. urls += "?" + c.urlParams_.Encode()
  93970. req, _ := http.NewRequest("GET", urls, body)
  93971. req.Header = reqHeaders
  93972. googleapi.Expand(req.URL, map[string]string{
  93973. "project": c.project,
  93974. "region": c.region,
  93975. })
  93976. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  93977. }
  93978. // Do executes the "compute.regionOperations.list" call.
  93979. // Exactly one of *OperationList or error will be non-nil. Any non-2xx
  93980. // status code is an error. Response headers are in either
  93981. // *OperationList.ServerResponse.Header or (if a response was returned
  93982. // at all) in error.(*googleapi.Error).Header. Use
  93983. // googleapi.IsNotModified to check whether the returned error was
  93984. // because http.StatusNotModified was returned.
  93985. func (c *RegionOperationsListCall) Do(opts ...googleapi.CallOption) (*OperationList, error) {
  93986. gensupport.SetOptions(c.urlParams_, opts...)
  93987. res, err := c.doRequest("json")
  93988. if res != nil && res.StatusCode == http.StatusNotModified {
  93989. if res.Body != nil {
  93990. res.Body.Close()
  93991. }
  93992. return nil, &googleapi.Error{
  93993. Code: res.StatusCode,
  93994. Header: res.Header,
  93995. }
  93996. }
  93997. if err != nil {
  93998. return nil, err
  93999. }
  94000. defer googleapi.CloseBody(res)
  94001. if err := googleapi.CheckResponse(res); err != nil {
  94002. return nil, err
  94003. }
  94004. ret := &OperationList{
  94005. ServerResponse: googleapi.ServerResponse{
  94006. Header: res.Header,
  94007. HTTPStatusCode: res.StatusCode,
  94008. },
  94009. }
  94010. target := &ret
  94011. if err := gensupport.DecodeResponse(target, res); err != nil {
  94012. return nil, err
  94013. }
  94014. return ret, nil
  94015. // {
  94016. // "description": "Retrieves a list of Operation resources contained within the specified region.",
  94017. // "httpMethod": "GET",
  94018. // "id": "compute.regionOperations.list",
  94019. // "parameterOrder": [
  94020. // "project",
  94021. // "region"
  94022. // ],
  94023. // "parameters": {
  94024. // "filter": {
  94025. // "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).",
  94026. // "location": "query",
  94027. // "type": "string"
  94028. // },
  94029. // "maxResults": {
  94030. // "default": "500",
  94031. // "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)",
  94032. // "format": "uint32",
  94033. // "location": "query",
  94034. // "minimum": "0",
  94035. // "type": "integer"
  94036. // },
  94037. // "orderBy": {
  94038. // "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.",
  94039. // "location": "query",
  94040. // "type": "string"
  94041. // },
  94042. // "pageToken": {
  94043. // "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.",
  94044. // "location": "query",
  94045. // "type": "string"
  94046. // },
  94047. // "project": {
  94048. // "description": "Project ID for this request.",
  94049. // "location": "path",
  94050. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  94051. // "required": true,
  94052. // "type": "string"
  94053. // },
  94054. // "region": {
  94055. // "description": "Name of the region for this request.",
  94056. // "location": "path",
  94057. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  94058. // "required": true,
  94059. // "type": "string"
  94060. // }
  94061. // },
  94062. // "path": "{project}/regions/{region}/operations",
  94063. // "response": {
  94064. // "$ref": "OperationList"
  94065. // },
  94066. // "scopes": [
  94067. // "https://www.googleapis.com/auth/cloud-platform",
  94068. // "https://www.googleapis.com/auth/compute",
  94069. // "https://www.googleapis.com/auth/compute.readonly"
  94070. // ]
  94071. // }
  94072. }
  94073. // Pages invokes f for each page of results.
  94074. // A non-nil error returned from f will halt the iteration.
  94075. // The provided context supersedes any context provided to the Context method.
  94076. func (c *RegionOperationsListCall) Pages(ctx context.Context, f func(*OperationList) error) error {
  94077. c.ctx_ = ctx
  94078. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  94079. for {
  94080. x, err := c.Do()
  94081. if err != nil {
  94082. return err
  94083. }
  94084. if err := f(x); err != nil {
  94085. return err
  94086. }
  94087. if x.NextPageToken == "" {
  94088. return nil
  94089. }
  94090. c.PageToken(x.NextPageToken)
  94091. }
  94092. }
  94093. // method id "compute.regionOperations.wait":
  94094. type RegionOperationsWaitCall struct {
  94095. s *Service
  94096. project string
  94097. region string
  94098. operation string
  94099. urlParams_ gensupport.URLParams
  94100. ctx_ context.Context
  94101. header_ http.Header
  94102. }
  94103. // Wait: Waits for the specified region-specific Operations resource
  94104. // until it is done or timeout, and retrieves the specified Operations
  94105. // resource. 1. Immediately returns when the operation is already done.
  94106. // 2. Waits for no more than the default deadline (2 minutes, subject to
  94107. // change) and then returns the current state of the operation, which
  94108. // may be DONE or still in progress. 3. Is best-effort: a. The server
  94109. // can wait less than the default deadline or zero seconds, in overload
  94110. // situations. b. There is no guarantee that the operation is actually
  94111. // done when returns. 4. User should be prepared to retry if the
  94112. // operation is not DONE.
  94113. func (r *RegionOperationsService) Wait(project string, region string, operation string) *RegionOperationsWaitCall {
  94114. c := &RegionOperationsWaitCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  94115. c.project = project
  94116. c.region = region
  94117. c.operation = operation
  94118. return c
  94119. }
  94120. // Fields allows partial responses to be retrieved. See
  94121. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  94122. // for more information.
  94123. func (c *RegionOperationsWaitCall) Fields(s ...googleapi.Field) *RegionOperationsWaitCall {
  94124. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  94125. return c
  94126. }
  94127. // Context sets the context to be used in this call's Do method. Any
  94128. // pending HTTP request will be aborted if the provided context is
  94129. // canceled.
  94130. func (c *RegionOperationsWaitCall) Context(ctx context.Context) *RegionOperationsWaitCall {
  94131. c.ctx_ = ctx
  94132. return c
  94133. }
  94134. // Header returns an http.Header that can be modified by the caller to
  94135. // add HTTP headers to the request.
  94136. func (c *RegionOperationsWaitCall) Header() http.Header {
  94137. if c.header_ == nil {
  94138. c.header_ = make(http.Header)
  94139. }
  94140. return c.header_
  94141. }
  94142. func (c *RegionOperationsWaitCall) doRequest(alt string) (*http.Response, error) {
  94143. reqHeaders := make(http.Header)
  94144. for k, v := range c.header_ {
  94145. reqHeaders[k] = v
  94146. }
  94147. reqHeaders.Set("User-Agent", c.s.userAgent())
  94148. var body io.Reader = nil
  94149. c.urlParams_.Set("alt", alt)
  94150. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/operations/{operation}/wait")
  94151. urls += "?" + c.urlParams_.Encode()
  94152. req, _ := http.NewRequest("POST", urls, body)
  94153. req.Header = reqHeaders
  94154. googleapi.Expand(req.URL, map[string]string{
  94155. "project": c.project,
  94156. "region": c.region,
  94157. "operation": c.operation,
  94158. })
  94159. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  94160. }
  94161. // Do executes the "compute.regionOperations.wait" call.
  94162. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  94163. // status code is an error. Response headers are in either
  94164. // *Operation.ServerResponse.Header or (if a response was returned at
  94165. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  94166. // to check whether the returned error was because
  94167. // http.StatusNotModified was returned.
  94168. func (c *RegionOperationsWaitCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  94169. gensupport.SetOptions(c.urlParams_, opts...)
  94170. res, err := c.doRequest("json")
  94171. if res != nil && res.StatusCode == http.StatusNotModified {
  94172. if res.Body != nil {
  94173. res.Body.Close()
  94174. }
  94175. return nil, &googleapi.Error{
  94176. Code: res.StatusCode,
  94177. Header: res.Header,
  94178. }
  94179. }
  94180. if err != nil {
  94181. return nil, err
  94182. }
  94183. defer googleapi.CloseBody(res)
  94184. if err := googleapi.CheckResponse(res); err != nil {
  94185. return nil, err
  94186. }
  94187. ret := &Operation{
  94188. ServerResponse: googleapi.ServerResponse{
  94189. Header: res.Header,
  94190. HTTPStatusCode: res.StatusCode,
  94191. },
  94192. }
  94193. target := &ret
  94194. if err := gensupport.DecodeResponse(target, res); err != nil {
  94195. return nil, err
  94196. }
  94197. return ret, nil
  94198. // {
  94199. // "description": "Waits for the specified region-specific Operations resource until it is done or timeout, and retrieves the specified Operations resource. 1. Immediately returns when the operation is already done. 2. Waits for no more than the default deadline (2 minutes, subject to change) and then returns the current state of the operation, which may be DONE or still in progress. 3. Is best-effort: a. The server can wait less than the default deadline or zero seconds, in overload situations. b. There is no guarantee that the operation is actually done when returns. 4. User should be prepared to retry if the operation is not DONE.",
  94200. // "httpMethod": "POST",
  94201. // "id": "compute.regionOperations.wait",
  94202. // "parameterOrder": [
  94203. // "project",
  94204. // "region",
  94205. // "operation"
  94206. // ],
  94207. // "parameters": {
  94208. // "operation": {
  94209. // "description": "Name of the Operations resource to return.",
  94210. // "location": "path",
  94211. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  94212. // "required": true,
  94213. // "type": "string"
  94214. // },
  94215. // "project": {
  94216. // "description": "Project ID for this request.",
  94217. // "location": "path",
  94218. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  94219. // "required": true,
  94220. // "type": "string"
  94221. // },
  94222. // "region": {
  94223. // "description": "Name of the region for this request.",
  94224. // "location": "path",
  94225. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  94226. // "required": true,
  94227. // "type": "string"
  94228. // }
  94229. // },
  94230. // "path": "{project}/regions/{region}/operations/{operation}/wait",
  94231. // "response": {
  94232. // "$ref": "Operation"
  94233. // },
  94234. // "scopes": [
  94235. // "https://www.googleapis.com/auth/cloud-platform",
  94236. // "https://www.googleapis.com/auth/compute",
  94237. // "https://www.googleapis.com/auth/compute.readonly"
  94238. // ]
  94239. // }
  94240. }
  94241. // method id "compute.regionTargetHttpProxies.delete":
  94242. type RegionTargetHttpProxiesDeleteCall struct {
  94243. s *Service
  94244. project string
  94245. region string
  94246. targetHttpProxy string
  94247. urlParams_ gensupport.URLParams
  94248. ctx_ context.Context
  94249. header_ http.Header
  94250. }
  94251. // Delete: Deletes the specified TargetHttpProxy resource.
  94252. func (r *RegionTargetHttpProxiesService) Delete(project string, region string, targetHttpProxy string) *RegionTargetHttpProxiesDeleteCall {
  94253. c := &RegionTargetHttpProxiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  94254. c.project = project
  94255. c.region = region
  94256. c.targetHttpProxy = targetHttpProxy
  94257. return c
  94258. }
  94259. // RequestId sets the optional parameter "requestId": An optional
  94260. // request ID to identify requests. Specify a unique request ID so that
  94261. // if you must retry your request, the server will know to ignore the
  94262. // request if it has already been completed.
  94263. //
  94264. // For example, consider a situation where you make an initial request
  94265. // and the request times out. If you make the request again with the
  94266. // same request ID, the server can check if original operation with the
  94267. // same request ID was received, and if so, will ignore the second
  94268. // request. This prevents clients from accidentally creating duplicate
  94269. // commitments.
  94270. //
  94271. // The request ID must be a valid UUID with the exception that zero UUID
  94272. // is not supported (00000000-0000-0000-0000-000000000000).
  94273. func (c *RegionTargetHttpProxiesDeleteCall) RequestId(requestId string) *RegionTargetHttpProxiesDeleteCall {
  94274. c.urlParams_.Set("requestId", requestId)
  94275. return c
  94276. }
  94277. // Fields allows partial responses to be retrieved. See
  94278. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  94279. // for more information.
  94280. func (c *RegionTargetHttpProxiesDeleteCall) Fields(s ...googleapi.Field) *RegionTargetHttpProxiesDeleteCall {
  94281. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  94282. return c
  94283. }
  94284. // Context sets the context to be used in this call's Do method. Any
  94285. // pending HTTP request will be aborted if the provided context is
  94286. // canceled.
  94287. func (c *RegionTargetHttpProxiesDeleteCall) Context(ctx context.Context) *RegionTargetHttpProxiesDeleteCall {
  94288. c.ctx_ = ctx
  94289. return c
  94290. }
  94291. // Header returns an http.Header that can be modified by the caller to
  94292. // add HTTP headers to the request.
  94293. func (c *RegionTargetHttpProxiesDeleteCall) Header() http.Header {
  94294. if c.header_ == nil {
  94295. c.header_ = make(http.Header)
  94296. }
  94297. return c.header_
  94298. }
  94299. func (c *RegionTargetHttpProxiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  94300. reqHeaders := make(http.Header)
  94301. for k, v := range c.header_ {
  94302. reqHeaders[k] = v
  94303. }
  94304. reqHeaders.Set("User-Agent", c.s.userAgent())
  94305. var body io.Reader = nil
  94306. c.urlParams_.Set("alt", alt)
  94307. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetHttpProxies/{targetHttpProxy}")
  94308. urls += "?" + c.urlParams_.Encode()
  94309. req, _ := http.NewRequest("DELETE", urls, body)
  94310. req.Header = reqHeaders
  94311. googleapi.Expand(req.URL, map[string]string{
  94312. "project": c.project,
  94313. "region": c.region,
  94314. "targetHttpProxy": c.targetHttpProxy,
  94315. })
  94316. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  94317. }
  94318. // Do executes the "compute.regionTargetHttpProxies.delete" call.
  94319. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  94320. // status code is an error. Response headers are in either
  94321. // *Operation.ServerResponse.Header or (if a response was returned at
  94322. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  94323. // to check whether the returned error was because
  94324. // http.StatusNotModified was returned.
  94325. func (c *RegionTargetHttpProxiesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  94326. gensupport.SetOptions(c.urlParams_, opts...)
  94327. res, err := c.doRequest("json")
  94328. if res != nil && res.StatusCode == http.StatusNotModified {
  94329. if res.Body != nil {
  94330. res.Body.Close()
  94331. }
  94332. return nil, &googleapi.Error{
  94333. Code: res.StatusCode,
  94334. Header: res.Header,
  94335. }
  94336. }
  94337. if err != nil {
  94338. return nil, err
  94339. }
  94340. defer googleapi.CloseBody(res)
  94341. if err := googleapi.CheckResponse(res); err != nil {
  94342. return nil, err
  94343. }
  94344. ret := &Operation{
  94345. ServerResponse: googleapi.ServerResponse{
  94346. Header: res.Header,
  94347. HTTPStatusCode: res.StatusCode,
  94348. },
  94349. }
  94350. target := &ret
  94351. if err := gensupport.DecodeResponse(target, res); err != nil {
  94352. return nil, err
  94353. }
  94354. return ret, nil
  94355. // {
  94356. // "description": "Deletes the specified TargetHttpProxy resource.",
  94357. // "httpMethod": "DELETE",
  94358. // "id": "compute.regionTargetHttpProxies.delete",
  94359. // "parameterOrder": [
  94360. // "project",
  94361. // "region",
  94362. // "targetHttpProxy"
  94363. // ],
  94364. // "parameters": {
  94365. // "project": {
  94366. // "description": "Project ID for this request.",
  94367. // "location": "path",
  94368. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  94369. // "required": true,
  94370. // "type": "string"
  94371. // },
  94372. // "region": {
  94373. // "description": "Name of the region scoping this request.",
  94374. // "location": "path",
  94375. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  94376. // "required": true,
  94377. // "type": "string"
  94378. // },
  94379. // "requestId": {
  94380. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  94381. // "location": "query",
  94382. // "type": "string"
  94383. // },
  94384. // "targetHttpProxy": {
  94385. // "description": "Name of the TargetHttpProxy resource to delete.",
  94386. // "location": "path",
  94387. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  94388. // "required": true,
  94389. // "type": "string"
  94390. // }
  94391. // },
  94392. // "path": "{project}/regions/{region}/targetHttpProxies/{targetHttpProxy}",
  94393. // "response": {
  94394. // "$ref": "Operation"
  94395. // },
  94396. // "scopes": [
  94397. // "https://www.googleapis.com/auth/cloud-platform",
  94398. // "https://www.googleapis.com/auth/compute"
  94399. // ]
  94400. // }
  94401. }
  94402. // method id "compute.regionTargetHttpProxies.get":
  94403. type RegionTargetHttpProxiesGetCall struct {
  94404. s *Service
  94405. project string
  94406. region string
  94407. targetHttpProxy string
  94408. urlParams_ gensupport.URLParams
  94409. ifNoneMatch_ string
  94410. ctx_ context.Context
  94411. header_ http.Header
  94412. }
  94413. // Get: Returns the specified TargetHttpProxy resource in the specified
  94414. // region. Gets a list of available target HTTP proxies by making a
  94415. // list() request.
  94416. func (r *RegionTargetHttpProxiesService) Get(project string, region string, targetHttpProxy string) *RegionTargetHttpProxiesGetCall {
  94417. c := &RegionTargetHttpProxiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  94418. c.project = project
  94419. c.region = region
  94420. c.targetHttpProxy = targetHttpProxy
  94421. return c
  94422. }
  94423. // Fields allows partial responses to be retrieved. See
  94424. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  94425. // for more information.
  94426. func (c *RegionTargetHttpProxiesGetCall) Fields(s ...googleapi.Field) *RegionTargetHttpProxiesGetCall {
  94427. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  94428. return c
  94429. }
  94430. // IfNoneMatch sets the optional parameter which makes the operation
  94431. // fail if the object's ETag matches the given value. This is useful for
  94432. // getting updates only after the object has changed since the last
  94433. // request. Use googleapi.IsNotModified to check whether the response
  94434. // error from Do is the result of In-None-Match.
  94435. func (c *RegionTargetHttpProxiesGetCall) IfNoneMatch(entityTag string) *RegionTargetHttpProxiesGetCall {
  94436. c.ifNoneMatch_ = entityTag
  94437. return c
  94438. }
  94439. // Context sets the context to be used in this call's Do method. Any
  94440. // pending HTTP request will be aborted if the provided context is
  94441. // canceled.
  94442. func (c *RegionTargetHttpProxiesGetCall) Context(ctx context.Context) *RegionTargetHttpProxiesGetCall {
  94443. c.ctx_ = ctx
  94444. return c
  94445. }
  94446. // Header returns an http.Header that can be modified by the caller to
  94447. // add HTTP headers to the request.
  94448. func (c *RegionTargetHttpProxiesGetCall) Header() http.Header {
  94449. if c.header_ == nil {
  94450. c.header_ = make(http.Header)
  94451. }
  94452. return c.header_
  94453. }
  94454. func (c *RegionTargetHttpProxiesGetCall) doRequest(alt string) (*http.Response, error) {
  94455. reqHeaders := make(http.Header)
  94456. for k, v := range c.header_ {
  94457. reqHeaders[k] = v
  94458. }
  94459. reqHeaders.Set("User-Agent", c.s.userAgent())
  94460. if c.ifNoneMatch_ != "" {
  94461. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  94462. }
  94463. var body io.Reader = nil
  94464. c.urlParams_.Set("alt", alt)
  94465. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetHttpProxies/{targetHttpProxy}")
  94466. urls += "?" + c.urlParams_.Encode()
  94467. req, _ := http.NewRequest("GET", urls, body)
  94468. req.Header = reqHeaders
  94469. googleapi.Expand(req.URL, map[string]string{
  94470. "project": c.project,
  94471. "region": c.region,
  94472. "targetHttpProxy": c.targetHttpProxy,
  94473. })
  94474. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  94475. }
  94476. // Do executes the "compute.regionTargetHttpProxies.get" call.
  94477. // Exactly one of *TargetHttpProxy or error will be non-nil. Any non-2xx
  94478. // status code is an error. Response headers are in either
  94479. // *TargetHttpProxy.ServerResponse.Header or (if a response was returned
  94480. // at all) in error.(*googleapi.Error).Header. Use
  94481. // googleapi.IsNotModified to check whether the returned error was
  94482. // because http.StatusNotModified was returned.
  94483. func (c *RegionTargetHttpProxiesGetCall) Do(opts ...googleapi.CallOption) (*TargetHttpProxy, error) {
  94484. gensupport.SetOptions(c.urlParams_, opts...)
  94485. res, err := c.doRequest("json")
  94486. if res != nil && res.StatusCode == http.StatusNotModified {
  94487. if res.Body != nil {
  94488. res.Body.Close()
  94489. }
  94490. return nil, &googleapi.Error{
  94491. Code: res.StatusCode,
  94492. Header: res.Header,
  94493. }
  94494. }
  94495. if err != nil {
  94496. return nil, err
  94497. }
  94498. defer googleapi.CloseBody(res)
  94499. if err := googleapi.CheckResponse(res); err != nil {
  94500. return nil, err
  94501. }
  94502. ret := &TargetHttpProxy{
  94503. ServerResponse: googleapi.ServerResponse{
  94504. Header: res.Header,
  94505. HTTPStatusCode: res.StatusCode,
  94506. },
  94507. }
  94508. target := &ret
  94509. if err := gensupport.DecodeResponse(target, res); err != nil {
  94510. return nil, err
  94511. }
  94512. return ret, nil
  94513. // {
  94514. // "description": "Returns the specified TargetHttpProxy resource in the specified region. Gets a list of available target HTTP proxies by making a list() request.",
  94515. // "httpMethod": "GET",
  94516. // "id": "compute.regionTargetHttpProxies.get",
  94517. // "parameterOrder": [
  94518. // "project",
  94519. // "region",
  94520. // "targetHttpProxy"
  94521. // ],
  94522. // "parameters": {
  94523. // "project": {
  94524. // "description": "Project ID for this request.",
  94525. // "location": "path",
  94526. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  94527. // "required": true,
  94528. // "type": "string"
  94529. // },
  94530. // "region": {
  94531. // "description": "Name of the region scoping this request.",
  94532. // "location": "path",
  94533. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  94534. // "required": true,
  94535. // "type": "string"
  94536. // },
  94537. // "targetHttpProxy": {
  94538. // "description": "Name of the TargetHttpProxy resource to return.",
  94539. // "location": "path",
  94540. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  94541. // "required": true,
  94542. // "type": "string"
  94543. // }
  94544. // },
  94545. // "path": "{project}/regions/{region}/targetHttpProxies/{targetHttpProxy}",
  94546. // "response": {
  94547. // "$ref": "TargetHttpProxy"
  94548. // },
  94549. // "scopes": [
  94550. // "https://www.googleapis.com/auth/cloud-platform",
  94551. // "https://www.googleapis.com/auth/compute",
  94552. // "https://www.googleapis.com/auth/compute.readonly"
  94553. // ]
  94554. // }
  94555. }
  94556. // method id "compute.regionTargetHttpProxies.insert":
  94557. type RegionTargetHttpProxiesInsertCall struct {
  94558. s *Service
  94559. project string
  94560. region string
  94561. targethttpproxy *TargetHttpProxy
  94562. urlParams_ gensupport.URLParams
  94563. ctx_ context.Context
  94564. header_ http.Header
  94565. }
  94566. // Insert: Creates a TargetHttpProxy resource in the specified project
  94567. // and region using the data included in the request.
  94568. func (r *RegionTargetHttpProxiesService) Insert(project string, region string, targethttpproxy *TargetHttpProxy) *RegionTargetHttpProxiesInsertCall {
  94569. c := &RegionTargetHttpProxiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  94570. c.project = project
  94571. c.region = region
  94572. c.targethttpproxy = targethttpproxy
  94573. return c
  94574. }
  94575. // RequestId sets the optional parameter "requestId": An optional
  94576. // request ID to identify requests. Specify a unique request ID so that
  94577. // if you must retry your request, the server will know to ignore the
  94578. // request if it has already been completed.
  94579. //
  94580. // For example, consider a situation where you make an initial request
  94581. // and the request times out. If you make the request again with the
  94582. // same request ID, the server can check if original operation with the
  94583. // same request ID was received, and if so, will ignore the second
  94584. // request. This prevents clients from accidentally creating duplicate
  94585. // commitments.
  94586. //
  94587. // The request ID must be a valid UUID with the exception that zero UUID
  94588. // is not supported (00000000-0000-0000-0000-000000000000).
  94589. func (c *RegionTargetHttpProxiesInsertCall) RequestId(requestId string) *RegionTargetHttpProxiesInsertCall {
  94590. c.urlParams_.Set("requestId", requestId)
  94591. return c
  94592. }
  94593. // Fields allows partial responses to be retrieved. See
  94594. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  94595. // for more information.
  94596. func (c *RegionTargetHttpProxiesInsertCall) Fields(s ...googleapi.Field) *RegionTargetHttpProxiesInsertCall {
  94597. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  94598. return c
  94599. }
  94600. // Context sets the context to be used in this call's Do method. Any
  94601. // pending HTTP request will be aborted if the provided context is
  94602. // canceled.
  94603. func (c *RegionTargetHttpProxiesInsertCall) Context(ctx context.Context) *RegionTargetHttpProxiesInsertCall {
  94604. c.ctx_ = ctx
  94605. return c
  94606. }
  94607. // Header returns an http.Header that can be modified by the caller to
  94608. // add HTTP headers to the request.
  94609. func (c *RegionTargetHttpProxiesInsertCall) Header() http.Header {
  94610. if c.header_ == nil {
  94611. c.header_ = make(http.Header)
  94612. }
  94613. return c.header_
  94614. }
  94615. func (c *RegionTargetHttpProxiesInsertCall) doRequest(alt string) (*http.Response, error) {
  94616. reqHeaders := make(http.Header)
  94617. for k, v := range c.header_ {
  94618. reqHeaders[k] = v
  94619. }
  94620. reqHeaders.Set("User-Agent", c.s.userAgent())
  94621. var body io.Reader = nil
  94622. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpproxy)
  94623. if err != nil {
  94624. return nil, err
  94625. }
  94626. reqHeaders.Set("Content-Type", "application/json")
  94627. c.urlParams_.Set("alt", alt)
  94628. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetHttpProxies")
  94629. urls += "?" + c.urlParams_.Encode()
  94630. req, _ := http.NewRequest("POST", urls, body)
  94631. req.Header = reqHeaders
  94632. googleapi.Expand(req.URL, map[string]string{
  94633. "project": c.project,
  94634. "region": c.region,
  94635. })
  94636. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  94637. }
  94638. // Do executes the "compute.regionTargetHttpProxies.insert" call.
  94639. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  94640. // status code is an error. Response headers are in either
  94641. // *Operation.ServerResponse.Header or (if a response was returned at
  94642. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  94643. // to check whether the returned error was because
  94644. // http.StatusNotModified was returned.
  94645. func (c *RegionTargetHttpProxiesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  94646. gensupport.SetOptions(c.urlParams_, opts...)
  94647. res, err := c.doRequest("json")
  94648. if res != nil && res.StatusCode == http.StatusNotModified {
  94649. if res.Body != nil {
  94650. res.Body.Close()
  94651. }
  94652. return nil, &googleapi.Error{
  94653. Code: res.StatusCode,
  94654. Header: res.Header,
  94655. }
  94656. }
  94657. if err != nil {
  94658. return nil, err
  94659. }
  94660. defer googleapi.CloseBody(res)
  94661. if err := googleapi.CheckResponse(res); err != nil {
  94662. return nil, err
  94663. }
  94664. ret := &Operation{
  94665. ServerResponse: googleapi.ServerResponse{
  94666. Header: res.Header,
  94667. HTTPStatusCode: res.StatusCode,
  94668. },
  94669. }
  94670. target := &ret
  94671. if err := gensupport.DecodeResponse(target, res); err != nil {
  94672. return nil, err
  94673. }
  94674. return ret, nil
  94675. // {
  94676. // "description": "Creates a TargetHttpProxy resource in the specified project and region using the data included in the request.",
  94677. // "httpMethod": "POST",
  94678. // "id": "compute.regionTargetHttpProxies.insert",
  94679. // "parameterOrder": [
  94680. // "project",
  94681. // "region"
  94682. // ],
  94683. // "parameters": {
  94684. // "project": {
  94685. // "description": "Project ID for this request.",
  94686. // "location": "path",
  94687. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  94688. // "required": true,
  94689. // "type": "string"
  94690. // },
  94691. // "region": {
  94692. // "description": "Name of the region scoping this request.",
  94693. // "location": "path",
  94694. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  94695. // "required": true,
  94696. // "type": "string"
  94697. // },
  94698. // "requestId": {
  94699. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  94700. // "location": "query",
  94701. // "type": "string"
  94702. // }
  94703. // },
  94704. // "path": "{project}/regions/{region}/targetHttpProxies",
  94705. // "request": {
  94706. // "$ref": "TargetHttpProxy"
  94707. // },
  94708. // "response": {
  94709. // "$ref": "Operation"
  94710. // },
  94711. // "scopes": [
  94712. // "https://www.googleapis.com/auth/cloud-platform",
  94713. // "https://www.googleapis.com/auth/compute"
  94714. // ]
  94715. // }
  94716. }
  94717. // method id "compute.regionTargetHttpProxies.list":
  94718. type RegionTargetHttpProxiesListCall struct {
  94719. s *Service
  94720. project string
  94721. region string
  94722. urlParams_ gensupport.URLParams
  94723. ifNoneMatch_ string
  94724. ctx_ context.Context
  94725. header_ http.Header
  94726. }
  94727. // List: Retrieves the list of TargetHttpProxy resources available to
  94728. // the specified project in the specified region.
  94729. func (r *RegionTargetHttpProxiesService) List(project string, region string) *RegionTargetHttpProxiesListCall {
  94730. c := &RegionTargetHttpProxiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  94731. c.project = project
  94732. c.region = region
  94733. return c
  94734. }
  94735. // Filter sets the optional parameter "filter": A filter expression that
  94736. // filters resources listed in the response. The expression must specify
  94737. // the field name, a comparison operator, and the value that you want to
  94738. // use for filtering. The value must be a string, a number, or a
  94739. // boolean. The comparison operator must be either =, !=, >, or <.
  94740. //
  94741. // For example, if you are filtering Compute Engine instances, you can
  94742. // exclude instances named example-instance by specifying name !=
  94743. // example-instance.
  94744. //
  94745. // You can also filter nested fields. For example, you could specify
  94746. // scheduling.automaticRestart = false to include instances only if they
  94747. // are not scheduled for automatic restarts. You can use filtering on
  94748. // nested fields to filter based on resource labels.
  94749. //
  94750. // To filter on multiple expressions, provide each separate expression
  94751. // within parentheses. For example, (scheduling.automaticRestart = true)
  94752. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  94753. // AND expression. However, you can include AND and OR expressions
  94754. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  94755. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  94756. // true).
  94757. func (c *RegionTargetHttpProxiesListCall) Filter(filter string) *RegionTargetHttpProxiesListCall {
  94758. c.urlParams_.Set("filter", filter)
  94759. return c
  94760. }
  94761. // MaxResults sets the optional parameter "maxResults": The maximum
  94762. // number of results per page that should be returned. If the number of
  94763. // available results is larger than maxResults, Compute Engine returns a
  94764. // nextPageToken that can be used to get the next page of results in
  94765. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  94766. // (Default: 500)
  94767. func (c *RegionTargetHttpProxiesListCall) MaxResults(maxResults int64) *RegionTargetHttpProxiesListCall {
  94768. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  94769. return c
  94770. }
  94771. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  94772. // a certain order. By default, results are returned in alphanumerical
  94773. // order based on the resource name.
  94774. //
  94775. // You can also sort results in descending order based on the creation
  94776. // timestamp using orderBy="creationTimestamp desc". This sorts results
  94777. // based on the creationTimestamp field in reverse chronological order
  94778. // (newest result first). Use this to sort resources like operations so
  94779. // that the newest operation is returned first.
  94780. //
  94781. // Currently, only sorting by name or creationTimestamp desc is
  94782. // supported.
  94783. func (c *RegionTargetHttpProxiesListCall) OrderBy(orderBy string) *RegionTargetHttpProxiesListCall {
  94784. c.urlParams_.Set("orderBy", orderBy)
  94785. return c
  94786. }
  94787. // PageToken sets the optional parameter "pageToken": Specifies a page
  94788. // token to use. Set pageToken to the nextPageToken returned by a
  94789. // previous list request to get the next page of results.
  94790. func (c *RegionTargetHttpProxiesListCall) PageToken(pageToken string) *RegionTargetHttpProxiesListCall {
  94791. c.urlParams_.Set("pageToken", pageToken)
  94792. return c
  94793. }
  94794. // Fields allows partial responses to be retrieved. See
  94795. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  94796. // for more information.
  94797. func (c *RegionTargetHttpProxiesListCall) Fields(s ...googleapi.Field) *RegionTargetHttpProxiesListCall {
  94798. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  94799. return c
  94800. }
  94801. // IfNoneMatch sets the optional parameter which makes the operation
  94802. // fail if the object's ETag matches the given value. This is useful for
  94803. // getting updates only after the object has changed since the last
  94804. // request. Use googleapi.IsNotModified to check whether the response
  94805. // error from Do is the result of In-None-Match.
  94806. func (c *RegionTargetHttpProxiesListCall) IfNoneMatch(entityTag string) *RegionTargetHttpProxiesListCall {
  94807. c.ifNoneMatch_ = entityTag
  94808. return c
  94809. }
  94810. // Context sets the context to be used in this call's Do method. Any
  94811. // pending HTTP request will be aborted if the provided context is
  94812. // canceled.
  94813. func (c *RegionTargetHttpProxiesListCall) Context(ctx context.Context) *RegionTargetHttpProxiesListCall {
  94814. c.ctx_ = ctx
  94815. return c
  94816. }
  94817. // Header returns an http.Header that can be modified by the caller to
  94818. // add HTTP headers to the request.
  94819. func (c *RegionTargetHttpProxiesListCall) Header() http.Header {
  94820. if c.header_ == nil {
  94821. c.header_ = make(http.Header)
  94822. }
  94823. return c.header_
  94824. }
  94825. func (c *RegionTargetHttpProxiesListCall) doRequest(alt string) (*http.Response, error) {
  94826. reqHeaders := make(http.Header)
  94827. for k, v := range c.header_ {
  94828. reqHeaders[k] = v
  94829. }
  94830. reqHeaders.Set("User-Agent", c.s.userAgent())
  94831. if c.ifNoneMatch_ != "" {
  94832. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  94833. }
  94834. var body io.Reader = nil
  94835. c.urlParams_.Set("alt", alt)
  94836. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetHttpProxies")
  94837. urls += "?" + c.urlParams_.Encode()
  94838. req, _ := http.NewRequest("GET", urls, body)
  94839. req.Header = reqHeaders
  94840. googleapi.Expand(req.URL, map[string]string{
  94841. "project": c.project,
  94842. "region": c.region,
  94843. })
  94844. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  94845. }
  94846. // Do executes the "compute.regionTargetHttpProxies.list" call.
  94847. // Exactly one of *TargetHttpProxyList or error will be non-nil. Any
  94848. // non-2xx status code is an error. Response headers are in either
  94849. // *TargetHttpProxyList.ServerResponse.Header or (if a response was
  94850. // returned at all) in error.(*googleapi.Error).Header. Use
  94851. // googleapi.IsNotModified to check whether the returned error was
  94852. // because http.StatusNotModified was returned.
  94853. func (c *RegionTargetHttpProxiesListCall) Do(opts ...googleapi.CallOption) (*TargetHttpProxyList, error) {
  94854. gensupport.SetOptions(c.urlParams_, opts...)
  94855. res, err := c.doRequest("json")
  94856. if res != nil && res.StatusCode == http.StatusNotModified {
  94857. if res.Body != nil {
  94858. res.Body.Close()
  94859. }
  94860. return nil, &googleapi.Error{
  94861. Code: res.StatusCode,
  94862. Header: res.Header,
  94863. }
  94864. }
  94865. if err != nil {
  94866. return nil, err
  94867. }
  94868. defer googleapi.CloseBody(res)
  94869. if err := googleapi.CheckResponse(res); err != nil {
  94870. return nil, err
  94871. }
  94872. ret := &TargetHttpProxyList{
  94873. ServerResponse: googleapi.ServerResponse{
  94874. Header: res.Header,
  94875. HTTPStatusCode: res.StatusCode,
  94876. },
  94877. }
  94878. target := &ret
  94879. if err := gensupport.DecodeResponse(target, res); err != nil {
  94880. return nil, err
  94881. }
  94882. return ret, nil
  94883. // {
  94884. // "description": "Retrieves the list of TargetHttpProxy resources available to the specified project in the specified region.",
  94885. // "httpMethod": "GET",
  94886. // "id": "compute.regionTargetHttpProxies.list",
  94887. // "parameterOrder": [
  94888. // "project",
  94889. // "region"
  94890. // ],
  94891. // "parameters": {
  94892. // "filter": {
  94893. // "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).",
  94894. // "location": "query",
  94895. // "type": "string"
  94896. // },
  94897. // "maxResults": {
  94898. // "default": "500",
  94899. // "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)",
  94900. // "format": "uint32",
  94901. // "location": "query",
  94902. // "minimum": "0",
  94903. // "type": "integer"
  94904. // },
  94905. // "orderBy": {
  94906. // "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.",
  94907. // "location": "query",
  94908. // "type": "string"
  94909. // },
  94910. // "pageToken": {
  94911. // "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.",
  94912. // "location": "query",
  94913. // "type": "string"
  94914. // },
  94915. // "project": {
  94916. // "description": "Project ID for this request.",
  94917. // "location": "path",
  94918. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  94919. // "required": true,
  94920. // "type": "string"
  94921. // },
  94922. // "region": {
  94923. // "description": "Name of the region scoping this request.",
  94924. // "location": "path",
  94925. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  94926. // "required": true,
  94927. // "type": "string"
  94928. // }
  94929. // },
  94930. // "path": "{project}/regions/{region}/targetHttpProxies",
  94931. // "response": {
  94932. // "$ref": "TargetHttpProxyList"
  94933. // },
  94934. // "scopes": [
  94935. // "https://www.googleapis.com/auth/cloud-platform",
  94936. // "https://www.googleapis.com/auth/compute",
  94937. // "https://www.googleapis.com/auth/compute.readonly"
  94938. // ]
  94939. // }
  94940. }
  94941. // Pages invokes f for each page of results.
  94942. // A non-nil error returned from f will halt the iteration.
  94943. // The provided context supersedes any context provided to the Context method.
  94944. func (c *RegionTargetHttpProxiesListCall) Pages(ctx context.Context, f func(*TargetHttpProxyList) error) error {
  94945. c.ctx_ = ctx
  94946. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  94947. for {
  94948. x, err := c.Do()
  94949. if err != nil {
  94950. return err
  94951. }
  94952. if err := f(x); err != nil {
  94953. return err
  94954. }
  94955. if x.NextPageToken == "" {
  94956. return nil
  94957. }
  94958. c.PageToken(x.NextPageToken)
  94959. }
  94960. }
  94961. // method id "compute.regionTargetHttpProxies.setUrlMap":
  94962. type RegionTargetHttpProxiesSetUrlMapCall struct {
  94963. s *Service
  94964. project string
  94965. region string
  94966. targetHttpProxy string
  94967. urlmapreference *UrlMapReference
  94968. urlParams_ gensupport.URLParams
  94969. ctx_ context.Context
  94970. header_ http.Header
  94971. }
  94972. // SetUrlMap: Changes the URL map for TargetHttpProxy.
  94973. func (r *RegionTargetHttpProxiesService) SetUrlMap(project string, region string, targetHttpProxy string, urlmapreference *UrlMapReference) *RegionTargetHttpProxiesSetUrlMapCall {
  94974. c := &RegionTargetHttpProxiesSetUrlMapCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  94975. c.project = project
  94976. c.region = region
  94977. c.targetHttpProxy = targetHttpProxy
  94978. c.urlmapreference = urlmapreference
  94979. return c
  94980. }
  94981. // RequestId sets the optional parameter "requestId": An optional
  94982. // request ID to identify requests. Specify a unique request ID so that
  94983. // if you must retry your request, the server will know to ignore the
  94984. // request if it has already been completed.
  94985. //
  94986. // For example, consider a situation where you make an initial request
  94987. // and the request times out. If you make the request again with the
  94988. // same request ID, the server can check if original operation with the
  94989. // same request ID was received, and if so, will ignore the second
  94990. // request. This prevents clients from accidentally creating duplicate
  94991. // commitments.
  94992. //
  94993. // The request ID must be a valid UUID with the exception that zero UUID
  94994. // is not supported (00000000-0000-0000-0000-000000000000).
  94995. func (c *RegionTargetHttpProxiesSetUrlMapCall) RequestId(requestId string) *RegionTargetHttpProxiesSetUrlMapCall {
  94996. c.urlParams_.Set("requestId", requestId)
  94997. return c
  94998. }
  94999. // Fields allows partial responses to be retrieved. See
  95000. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  95001. // for more information.
  95002. func (c *RegionTargetHttpProxiesSetUrlMapCall) Fields(s ...googleapi.Field) *RegionTargetHttpProxiesSetUrlMapCall {
  95003. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  95004. return c
  95005. }
  95006. // Context sets the context to be used in this call's Do method. Any
  95007. // pending HTTP request will be aborted if the provided context is
  95008. // canceled.
  95009. func (c *RegionTargetHttpProxiesSetUrlMapCall) Context(ctx context.Context) *RegionTargetHttpProxiesSetUrlMapCall {
  95010. c.ctx_ = ctx
  95011. return c
  95012. }
  95013. // Header returns an http.Header that can be modified by the caller to
  95014. // add HTTP headers to the request.
  95015. func (c *RegionTargetHttpProxiesSetUrlMapCall) Header() http.Header {
  95016. if c.header_ == nil {
  95017. c.header_ = make(http.Header)
  95018. }
  95019. return c.header_
  95020. }
  95021. func (c *RegionTargetHttpProxiesSetUrlMapCall) doRequest(alt string) (*http.Response, error) {
  95022. reqHeaders := make(http.Header)
  95023. for k, v := range c.header_ {
  95024. reqHeaders[k] = v
  95025. }
  95026. reqHeaders.Set("User-Agent", c.s.userAgent())
  95027. var body io.Reader = nil
  95028. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapreference)
  95029. if err != nil {
  95030. return nil, err
  95031. }
  95032. reqHeaders.Set("Content-Type", "application/json")
  95033. c.urlParams_.Set("alt", alt)
  95034. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetHttpProxies/{targetHttpProxy}/setUrlMap")
  95035. urls += "?" + c.urlParams_.Encode()
  95036. req, _ := http.NewRequest("POST", urls, body)
  95037. req.Header = reqHeaders
  95038. googleapi.Expand(req.URL, map[string]string{
  95039. "project": c.project,
  95040. "region": c.region,
  95041. "targetHttpProxy": c.targetHttpProxy,
  95042. })
  95043. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  95044. }
  95045. // Do executes the "compute.regionTargetHttpProxies.setUrlMap" call.
  95046. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  95047. // status code is an error. Response headers are in either
  95048. // *Operation.ServerResponse.Header or (if a response was returned at
  95049. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  95050. // to check whether the returned error was because
  95051. // http.StatusNotModified was returned.
  95052. func (c *RegionTargetHttpProxiesSetUrlMapCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  95053. gensupport.SetOptions(c.urlParams_, opts...)
  95054. res, err := c.doRequest("json")
  95055. if res != nil && res.StatusCode == http.StatusNotModified {
  95056. if res.Body != nil {
  95057. res.Body.Close()
  95058. }
  95059. return nil, &googleapi.Error{
  95060. Code: res.StatusCode,
  95061. Header: res.Header,
  95062. }
  95063. }
  95064. if err != nil {
  95065. return nil, err
  95066. }
  95067. defer googleapi.CloseBody(res)
  95068. if err := googleapi.CheckResponse(res); err != nil {
  95069. return nil, err
  95070. }
  95071. ret := &Operation{
  95072. ServerResponse: googleapi.ServerResponse{
  95073. Header: res.Header,
  95074. HTTPStatusCode: res.StatusCode,
  95075. },
  95076. }
  95077. target := &ret
  95078. if err := gensupport.DecodeResponse(target, res); err != nil {
  95079. return nil, err
  95080. }
  95081. return ret, nil
  95082. // {
  95083. // "description": "Changes the URL map for TargetHttpProxy.",
  95084. // "httpMethod": "POST",
  95085. // "id": "compute.regionTargetHttpProxies.setUrlMap",
  95086. // "parameterOrder": [
  95087. // "project",
  95088. // "region",
  95089. // "targetHttpProxy"
  95090. // ],
  95091. // "parameters": {
  95092. // "project": {
  95093. // "description": "Project ID for this request.",
  95094. // "location": "path",
  95095. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  95096. // "required": true,
  95097. // "type": "string"
  95098. // },
  95099. // "region": {
  95100. // "description": "Name of the region scoping this request.",
  95101. // "location": "path",
  95102. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  95103. // "required": true,
  95104. // "type": "string"
  95105. // },
  95106. // "requestId": {
  95107. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  95108. // "location": "query",
  95109. // "type": "string"
  95110. // },
  95111. // "targetHttpProxy": {
  95112. // "description": "Name of the TargetHttpProxy to set a URL map for.",
  95113. // "location": "path",
  95114. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  95115. // "required": true,
  95116. // "type": "string"
  95117. // }
  95118. // },
  95119. // "path": "{project}/regions/{region}/targetHttpProxies/{targetHttpProxy}/setUrlMap",
  95120. // "request": {
  95121. // "$ref": "UrlMapReference"
  95122. // },
  95123. // "response": {
  95124. // "$ref": "Operation"
  95125. // },
  95126. // "scopes": [
  95127. // "https://www.googleapis.com/auth/cloud-platform",
  95128. // "https://www.googleapis.com/auth/compute"
  95129. // ]
  95130. // }
  95131. }
  95132. // method id "compute.regionTargetHttpProxies.testIamPermissions":
  95133. type RegionTargetHttpProxiesTestIamPermissionsCall struct {
  95134. s *Service
  95135. project string
  95136. region string
  95137. resource string
  95138. testpermissionsrequest *TestPermissionsRequest
  95139. urlParams_ gensupport.URLParams
  95140. ctx_ context.Context
  95141. header_ http.Header
  95142. }
  95143. // TestIamPermissions: Returns permissions that a caller has on the
  95144. // specified resource.
  95145. func (r *RegionTargetHttpProxiesService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionTargetHttpProxiesTestIamPermissionsCall {
  95146. c := &RegionTargetHttpProxiesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  95147. c.project = project
  95148. c.region = region
  95149. c.resource = resource
  95150. c.testpermissionsrequest = testpermissionsrequest
  95151. return c
  95152. }
  95153. // Fields allows partial responses to be retrieved. See
  95154. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  95155. // for more information.
  95156. func (c *RegionTargetHttpProxiesTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionTargetHttpProxiesTestIamPermissionsCall {
  95157. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  95158. return c
  95159. }
  95160. // Context sets the context to be used in this call's Do method. Any
  95161. // pending HTTP request will be aborted if the provided context is
  95162. // canceled.
  95163. func (c *RegionTargetHttpProxiesTestIamPermissionsCall) Context(ctx context.Context) *RegionTargetHttpProxiesTestIamPermissionsCall {
  95164. c.ctx_ = ctx
  95165. return c
  95166. }
  95167. // Header returns an http.Header that can be modified by the caller to
  95168. // add HTTP headers to the request.
  95169. func (c *RegionTargetHttpProxiesTestIamPermissionsCall) Header() http.Header {
  95170. if c.header_ == nil {
  95171. c.header_ = make(http.Header)
  95172. }
  95173. return c.header_
  95174. }
  95175. func (c *RegionTargetHttpProxiesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  95176. reqHeaders := make(http.Header)
  95177. for k, v := range c.header_ {
  95178. reqHeaders[k] = v
  95179. }
  95180. reqHeaders.Set("User-Agent", c.s.userAgent())
  95181. var body io.Reader = nil
  95182. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  95183. if err != nil {
  95184. return nil, err
  95185. }
  95186. reqHeaders.Set("Content-Type", "application/json")
  95187. c.urlParams_.Set("alt", alt)
  95188. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetHttpProxies/{resource}/testIamPermissions")
  95189. urls += "?" + c.urlParams_.Encode()
  95190. req, _ := http.NewRequest("POST", urls, body)
  95191. req.Header = reqHeaders
  95192. googleapi.Expand(req.URL, map[string]string{
  95193. "project": c.project,
  95194. "region": c.region,
  95195. "resource": c.resource,
  95196. })
  95197. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  95198. }
  95199. // Do executes the "compute.regionTargetHttpProxies.testIamPermissions" call.
  95200. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  95201. // non-2xx status code is an error. Response headers are in either
  95202. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  95203. // returned at all) in error.(*googleapi.Error).Header. Use
  95204. // googleapi.IsNotModified to check whether the returned error was
  95205. // because http.StatusNotModified was returned.
  95206. func (c *RegionTargetHttpProxiesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  95207. gensupport.SetOptions(c.urlParams_, opts...)
  95208. res, err := c.doRequest("json")
  95209. if res != nil && res.StatusCode == http.StatusNotModified {
  95210. if res.Body != nil {
  95211. res.Body.Close()
  95212. }
  95213. return nil, &googleapi.Error{
  95214. Code: res.StatusCode,
  95215. Header: res.Header,
  95216. }
  95217. }
  95218. if err != nil {
  95219. return nil, err
  95220. }
  95221. defer googleapi.CloseBody(res)
  95222. if err := googleapi.CheckResponse(res); err != nil {
  95223. return nil, err
  95224. }
  95225. ret := &TestPermissionsResponse{
  95226. ServerResponse: googleapi.ServerResponse{
  95227. Header: res.Header,
  95228. HTTPStatusCode: res.StatusCode,
  95229. },
  95230. }
  95231. target := &ret
  95232. if err := gensupport.DecodeResponse(target, res); err != nil {
  95233. return nil, err
  95234. }
  95235. return ret, nil
  95236. // {
  95237. // "description": "Returns permissions that a caller has on the specified resource.",
  95238. // "httpMethod": "POST",
  95239. // "id": "compute.regionTargetHttpProxies.testIamPermissions",
  95240. // "parameterOrder": [
  95241. // "project",
  95242. // "region",
  95243. // "resource"
  95244. // ],
  95245. // "parameters": {
  95246. // "project": {
  95247. // "description": "Project ID for this request.",
  95248. // "location": "path",
  95249. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  95250. // "required": true,
  95251. // "type": "string"
  95252. // },
  95253. // "region": {
  95254. // "description": "The name of the region for this request.",
  95255. // "location": "path",
  95256. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  95257. // "required": true,
  95258. // "type": "string"
  95259. // },
  95260. // "resource": {
  95261. // "description": "Name of the resource for this request.",
  95262. // "location": "path",
  95263. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  95264. // "required": true,
  95265. // "type": "string"
  95266. // }
  95267. // },
  95268. // "path": "{project}/regions/{region}/targetHttpProxies/{resource}/testIamPermissions",
  95269. // "request": {
  95270. // "$ref": "TestPermissionsRequest"
  95271. // },
  95272. // "response": {
  95273. // "$ref": "TestPermissionsResponse"
  95274. // },
  95275. // "scopes": [
  95276. // "https://www.googleapis.com/auth/cloud-platform",
  95277. // "https://www.googleapis.com/auth/compute",
  95278. // "https://www.googleapis.com/auth/compute.readonly"
  95279. // ]
  95280. // }
  95281. }
  95282. // method id "compute.regionUrlMaps.delete":
  95283. type RegionUrlMapsDeleteCall struct {
  95284. s *Service
  95285. project string
  95286. region string
  95287. urlMap string
  95288. urlParams_ gensupport.URLParams
  95289. ctx_ context.Context
  95290. header_ http.Header
  95291. }
  95292. // Delete: Deletes the specified UrlMap resource.
  95293. func (r *RegionUrlMapsService) Delete(project string, region string, urlMap string) *RegionUrlMapsDeleteCall {
  95294. c := &RegionUrlMapsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  95295. c.project = project
  95296. c.region = region
  95297. c.urlMap = urlMap
  95298. return c
  95299. }
  95300. // RequestId sets the optional parameter "requestId": begin_interface:
  95301. // MixerMutationRequestBuilder Request ID to support idempotency.
  95302. func (c *RegionUrlMapsDeleteCall) RequestId(requestId string) *RegionUrlMapsDeleteCall {
  95303. c.urlParams_.Set("requestId", requestId)
  95304. return c
  95305. }
  95306. // Fields allows partial responses to be retrieved. See
  95307. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  95308. // for more information.
  95309. func (c *RegionUrlMapsDeleteCall) Fields(s ...googleapi.Field) *RegionUrlMapsDeleteCall {
  95310. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  95311. return c
  95312. }
  95313. // Context sets the context to be used in this call's Do method. Any
  95314. // pending HTTP request will be aborted if the provided context is
  95315. // canceled.
  95316. func (c *RegionUrlMapsDeleteCall) Context(ctx context.Context) *RegionUrlMapsDeleteCall {
  95317. c.ctx_ = ctx
  95318. return c
  95319. }
  95320. // Header returns an http.Header that can be modified by the caller to
  95321. // add HTTP headers to the request.
  95322. func (c *RegionUrlMapsDeleteCall) Header() http.Header {
  95323. if c.header_ == nil {
  95324. c.header_ = make(http.Header)
  95325. }
  95326. return c.header_
  95327. }
  95328. func (c *RegionUrlMapsDeleteCall) doRequest(alt string) (*http.Response, error) {
  95329. reqHeaders := make(http.Header)
  95330. for k, v := range c.header_ {
  95331. reqHeaders[k] = v
  95332. }
  95333. reqHeaders.Set("User-Agent", c.s.userAgent())
  95334. var body io.Reader = nil
  95335. c.urlParams_.Set("alt", alt)
  95336. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/urlMaps/{urlMap}")
  95337. urls += "?" + c.urlParams_.Encode()
  95338. req, _ := http.NewRequest("DELETE", urls, body)
  95339. req.Header = reqHeaders
  95340. googleapi.Expand(req.URL, map[string]string{
  95341. "project": c.project,
  95342. "region": c.region,
  95343. "urlMap": c.urlMap,
  95344. })
  95345. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  95346. }
  95347. // Do executes the "compute.regionUrlMaps.delete" call.
  95348. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  95349. // status code is an error. Response headers are in either
  95350. // *Operation.ServerResponse.Header or (if a response was returned at
  95351. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  95352. // to check whether the returned error was because
  95353. // http.StatusNotModified was returned.
  95354. func (c *RegionUrlMapsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  95355. gensupport.SetOptions(c.urlParams_, opts...)
  95356. res, err := c.doRequest("json")
  95357. if res != nil && res.StatusCode == http.StatusNotModified {
  95358. if res.Body != nil {
  95359. res.Body.Close()
  95360. }
  95361. return nil, &googleapi.Error{
  95362. Code: res.StatusCode,
  95363. Header: res.Header,
  95364. }
  95365. }
  95366. if err != nil {
  95367. return nil, err
  95368. }
  95369. defer googleapi.CloseBody(res)
  95370. if err := googleapi.CheckResponse(res); err != nil {
  95371. return nil, err
  95372. }
  95373. ret := &Operation{
  95374. ServerResponse: googleapi.ServerResponse{
  95375. Header: res.Header,
  95376. HTTPStatusCode: res.StatusCode,
  95377. },
  95378. }
  95379. target := &ret
  95380. if err := gensupport.DecodeResponse(target, res); err != nil {
  95381. return nil, err
  95382. }
  95383. return ret, nil
  95384. // {
  95385. // "description": "Deletes the specified UrlMap resource.",
  95386. // "httpMethod": "DELETE",
  95387. // "id": "compute.regionUrlMaps.delete",
  95388. // "parameterOrder": [
  95389. // "project",
  95390. // "region",
  95391. // "urlMap"
  95392. // ],
  95393. // "parameters": {
  95394. // "project": {
  95395. // "description": "Project ID for this request.",
  95396. // "location": "path",
  95397. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  95398. // "required": true,
  95399. // "type": "string"
  95400. // },
  95401. // "region": {
  95402. // "description": "Name of the region scoping this request.",
  95403. // "location": "path",
  95404. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  95405. // "required": true,
  95406. // "type": "string"
  95407. // },
  95408. // "requestId": {
  95409. // "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.",
  95410. // "location": "query",
  95411. // "type": "string"
  95412. // },
  95413. // "urlMap": {
  95414. // "description": "Name of the UrlMap resource to delete.",
  95415. // "location": "path",
  95416. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  95417. // "required": true,
  95418. // "type": "string"
  95419. // }
  95420. // },
  95421. // "path": "{project}/regions/{region}/urlMaps/{urlMap}",
  95422. // "response": {
  95423. // "$ref": "Operation"
  95424. // },
  95425. // "scopes": [
  95426. // "https://www.googleapis.com/auth/cloud-platform",
  95427. // "https://www.googleapis.com/auth/compute"
  95428. // ]
  95429. // }
  95430. }
  95431. // method id "compute.regionUrlMaps.get":
  95432. type RegionUrlMapsGetCall struct {
  95433. s *Service
  95434. project string
  95435. region string
  95436. urlMap string
  95437. urlParams_ gensupport.URLParams
  95438. ifNoneMatch_ string
  95439. ctx_ context.Context
  95440. header_ http.Header
  95441. }
  95442. // Get: Returns the specified UrlMap resource. Gets a list of available
  95443. // URL maps by making a list() request.
  95444. func (r *RegionUrlMapsService) Get(project string, region string, urlMap string) *RegionUrlMapsGetCall {
  95445. c := &RegionUrlMapsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  95446. c.project = project
  95447. c.region = region
  95448. c.urlMap = urlMap
  95449. return c
  95450. }
  95451. // Fields allows partial responses to be retrieved. See
  95452. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  95453. // for more information.
  95454. func (c *RegionUrlMapsGetCall) Fields(s ...googleapi.Field) *RegionUrlMapsGetCall {
  95455. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  95456. return c
  95457. }
  95458. // IfNoneMatch sets the optional parameter which makes the operation
  95459. // fail if the object's ETag matches the given value. This is useful for
  95460. // getting updates only after the object has changed since the last
  95461. // request. Use googleapi.IsNotModified to check whether the response
  95462. // error from Do is the result of In-None-Match.
  95463. func (c *RegionUrlMapsGetCall) IfNoneMatch(entityTag string) *RegionUrlMapsGetCall {
  95464. c.ifNoneMatch_ = entityTag
  95465. return c
  95466. }
  95467. // Context sets the context to be used in this call's Do method. Any
  95468. // pending HTTP request will be aborted if the provided context is
  95469. // canceled.
  95470. func (c *RegionUrlMapsGetCall) Context(ctx context.Context) *RegionUrlMapsGetCall {
  95471. c.ctx_ = ctx
  95472. return c
  95473. }
  95474. // Header returns an http.Header that can be modified by the caller to
  95475. // add HTTP headers to the request.
  95476. func (c *RegionUrlMapsGetCall) Header() http.Header {
  95477. if c.header_ == nil {
  95478. c.header_ = make(http.Header)
  95479. }
  95480. return c.header_
  95481. }
  95482. func (c *RegionUrlMapsGetCall) doRequest(alt string) (*http.Response, error) {
  95483. reqHeaders := make(http.Header)
  95484. for k, v := range c.header_ {
  95485. reqHeaders[k] = v
  95486. }
  95487. reqHeaders.Set("User-Agent", c.s.userAgent())
  95488. if c.ifNoneMatch_ != "" {
  95489. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  95490. }
  95491. var body io.Reader = nil
  95492. c.urlParams_.Set("alt", alt)
  95493. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/urlMaps/{urlMap}")
  95494. urls += "?" + c.urlParams_.Encode()
  95495. req, _ := http.NewRequest("GET", urls, body)
  95496. req.Header = reqHeaders
  95497. googleapi.Expand(req.URL, map[string]string{
  95498. "project": c.project,
  95499. "region": c.region,
  95500. "urlMap": c.urlMap,
  95501. })
  95502. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  95503. }
  95504. // Do executes the "compute.regionUrlMaps.get" call.
  95505. // Exactly one of *UrlMap or error will be non-nil. Any non-2xx status
  95506. // code is an error. Response headers are in either
  95507. // *UrlMap.ServerResponse.Header or (if a response was returned at all)
  95508. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  95509. // check whether the returned error was because http.StatusNotModified
  95510. // was returned.
  95511. func (c *RegionUrlMapsGetCall) Do(opts ...googleapi.CallOption) (*UrlMap, error) {
  95512. gensupport.SetOptions(c.urlParams_, opts...)
  95513. res, err := c.doRequest("json")
  95514. if res != nil && res.StatusCode == http.StatusNotModified {
  95515. if res.Body != nil {
  95516. res.Body.Close()
  95517. }
  95518. return nil, &googleapi.Error{
  95519. Code: res.StatusCode,
  95520. Header: res.Header,
  95521. }
  95522. }
  95523. if err != nil {
  95524. return nil, err
  95525. }
  95526. defer googleapi.CloseBody(res)
  95527. if err := googleapi.CheckResponse(res); err != nil {
  95528. return nil, err
  95529. }
  95530. ret := &UrlMap{
  95531. ServerResponse: googleapi.ServerResponse{
  95532. Header: res.Header,
  95533. HTTPStatusCode: res.StatusCode,
  95534. },
  95535. }
  95536. target := &ret
  95537. if err := gensupport.DecodeResponse(target, res); err != nil {
  95538. return nil, err
  95539. }
  95540. return ret, nil
  95541. // {
  95542. // "description": "Returns the specified UrlMap resource. Gets a list of available URL maps by making a list() request.",
  95543. // "httpMethod": "GET",
  95544. // "id": "compute.regionUrlMaps.get",
  95545. // "parameterOrder": [
  95546. // "project",
  95547. // "region",
  95548. // "urlMap"
  95549. // ],
  95550. // "parameters": {
  95551. // "project": {
  95552. // "description": "Project ID for this request.",
  95553. // "location": "path",
  95554. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  95555. // "required": true,
  95556. // "type": "string"
  95557. // },
  95558. // "region": {
  95559. // "description": "Name of the region scoping this request.",
  95560. // "location": "path",
  95561. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  95562. // "required": true,
  95563. // "type": "string"
  95564. // },
  95565. // "urlMap": {
  95566. // "description": "Name of the UrlMap resource to return.",
  95567. // "location": "path",
  95568. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  95569. // "required": true,
  95570. // "type": "string"
  95571. // }
  95572. // },
  95573. // "path": "{project}/regions/{region}/urlMaps/{urlMap}",
  95574. // "response": {
  95575. // "$ref": "UrlMap"
  95576. // },
  95577. // "scopes": [
  95578. // "https://www.googleapis.com/auth/cloud-platform",
  95579. // "https://www.googleapis.com/auth/compute",
  95580. // "https://www.googleapis.com/auth/compute.readonly"
  95581. // ]
  95582. // }
  95583. }
  95584. // method id "compute.regionUrlMaps.insert":
  95585. type RegionUrlMapsInsertCall struct {
  95586. s *Service
  95587. project string
  95588. region string
  95589. urlmap *UrlMap
  95590. urlParams_ gensupport.URLParams
  95591. ctx_ context.Context
  95592. header_ http.Header
  95593. }
  95594. // Insert: Creates a UrlMap resource in the specified project using the
  95595. // data included in the request.
  95596. func (r *RegionUrlMapsService) Insert(project string, region string, urlmap *UrlMap) *RegionUrlMapsInsertCall {
  95597. c := &RegionUrlMapsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  95598. c.project = project
  95599. c.region = region
  95600. c.urlmap = urlmap
  95601. return c
  95602. }
  95603. // RequestId sets the optional parameter "requestId": begin_interface:
  95604. // MixerMutationRequestBuilder Request ID to support idempotency.
  95605. func (c *RegionUrlMapsInsertCall) RequestId(requestId string) *RegionUrlMapsInsertCall {
  95606. c.urlParams_.Set("requestId", requestId)
  95607. return c
  95608. }
  95609. // Fields allows partial responses to be retrieved. See
  95610. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  95611. // for more information.
  95612. func (c *RegionUrlMapsInsertCall) Fields(s ...googleapi.Field) *RegionUrlMapsInsertCall {
  95613. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  95614. return c
  95615. }
  95616. // Context sets the context to be used in this call's Do method. Any
  95617. // pending HTTP request will be aborted if the provided context is
  95618. // canceled.
  95619. func (c *RegionUrlMapsInsertCall) Context(ctx context.Context) *RegionUrlMapsInsertCall {
  95620. c.ctx_ = ctx
  95621. return c
  95622. }
  95623. // Header returns an http.Header that can be modified by the caller to
  95624. // add HTTP headers to the request.
  95625. func (c *RegionUrlMapsInsertCall) Header() http.Header {
  95626. if c.header_ == nil {
  95627. c.header_ = make(http.Header)
  95628. }
  95629. return c.header_
  95630. }
  95631. func (c *RegionUrlMapsInsertCall) doRequest(alt string) (*http.Response, error) {
  95632. reqHeaders := make(http.Header)
  95633. for k, v := range c.header_ {
  95634. reqHeaders[k] = v
  95635. }
  95636. reqHeaders.Set("User-Agent", c.s.userAgent())
  95637. var body io.Reader = nil
  95638. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap)
  95639. if err != nil {
  95640. return nil, err
  95641. }
  95642. reqHeaders.Set("Content-Type", "application/json")
  95643. c.urlParams_.Set("alt", alt)
  95644. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/urlMaps")
  95645. urls += "?" + c.urlParams_.Encode()
  95646. req, _ := http.NewRequest("POST", urls, body)
  95647. req.Header = reqHeaders
  95648. googleapi.Expand(req.URL, map[string]string{
  95649. "project": c.project,
  95650. "region": c.region,
  95651. })
  95652. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  95653. }
  95654. // Do executes the "compute.regionUrlMaps.insert" call.
  95655. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  95656. // status code is an error. Response headers are in either
  95657. // *Operation.ServerResponse.Header or (if a response was returned at
  95658. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  95659. // to check whether the returned error was because
  95660. // http.StatusNotModified was returned.
  95661. func (c *RegionUrlMapsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  95662. gensupport.SetOptions(c.urlParams_, opts...)
  95663. res, err := c.doRequest("json")
  95664. if res != nil && res.StatusCode == http.StatusNotModified {
  95665. if res.Body != nil {
  95666. res.Body.Close()
  95667. }
  95668. return nil, &googleapi.Error{
  95669. Code: res.StatusCode,
  95670. Header: res.Header,
  95671. }
  95672. }
  95673. if err != nil {
  95674. return nil, err
  95675. }
  95676. defer googleapi.CloseBody(res)
  95677. if err := googleapi.CheckResponse(res); err != nil {
  95678. return nil, err
  95679. }
  95680. ret := &Operation{
  95681. ServerResponse: googleapi.ServerResponse{
  95682. Header: res.Header,
  95683. HTTPStatusCode: res.StatusCode,
  95684. },
  95685. }
  95686. target := &ret
  95687. if err := gensupport.DecodeResponse(target, res); err != nil {
  95688. return nil, err
  95689. }
  95690. return ret, nil
  95691. // {
  95692. // "description": "Creates a UrlMap resource in the specified project using the data included in the request.",
  95693. // "httpMethod": "POST",
  95694. // "id": "compute.regionUrlMaps.insert",
  95695. // "parameterOrder": [
  95696. // "project",
  95697. // "region"
  95698. // ],
  95699. // "parameters": {
  95700. // "project": {
  95701. // "description": "Project ID for this request.",
  95702. // "location": "path",
  95703. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  95704. // "required": true,
  95705. // "type": "string"
  95706. // },
  95707. // "region": {
  95708. // "description": "Name of the region scoping this request.",
  95709. // "location": "path",
  95710. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  95711. // "required": true,
  95712. // "type": "string"
  95713. // },
  95714. // "requestId": {
  95715. // "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.",
  95716. // "location": "query",
  95717. // "type": "string"
  95718. // }
  95719. // },
  95720. // "path": "{project}/regions/{region}/urlMaps",
  95721. // "request": {
  95722. // "$ref": "UrlMap"
  95723. // },
  95724. // "response": {
  95725. // "$ref": "Operation"
  95726. // },
  95727. // "scopes": [
  95728. // "https://www.googleapis.com/auth/cloud-platform",
  95729. // "https://www.googleapis.com/auth/compute"
  95730. // ]
  95731. // }
  95732. }
  95733. // method id "compute.regionUrlMaps.list":
  95734. type RegionUrlMapsListCall struct {
  95735. s *Service
  95736. project string
  95737. region string
  95738. urlParams_ gensupport.URLParams
  95739. ifNoneMatch_ string
  95740. ctx_ context.Context
  95741. header_ http.Header
  95742. }
  95743. // List: Retrieves the list of UrlMap resources available to the
  95744. // specified project in the specified region.
  95745. func (r *RegionUrlMapsService) List(project string, region string) *RegionUrlMapsListCall {
  95746. c := &RegionUrlMapsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  95747. c.project = project
  95748. c.region = region
  95749. return c
  95750. }
  95751. // Filter sets the optional parameter "filter": A filter expression that
  95752. // filters resources listed in the response. The expression must specify
  95753. // the field name, a comparison operator, and the value that you want to
  95754. // use for filtering. The value must be a string, a number, or a
  95755. // boolean. The comparison operator must be either =, !=, >, or <.
  95756. //
  95757. // For example, if you are filtering Compute Engine instances, you can
  95758. // exclude instances named example-instance by specifying name !=
  95759. // example-instance.
  95760. //
  95761. // You can also filter nested fields. For example, you could specify
  95762. // scheduling.automaticRestart = false to include instances only if they
  95763. // are not scheduled for automatic restarts. You can use filtering on
  95764. // nested fields to filter based on resource labels.
  95765. //
  95766. // To filter on multiple expressions, provide each separate expression
  95767. // within parentheses. For example, (scheduling.automaticRestart = true)
  95768. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  95769. // AND expression. However, you can include AND and OR expressions
  95770. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  95771. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  95772. // true).
  95773. func (c *RegionUrlMapsListCall) Filter(filter string) *RegionUrlMapsListCall {
  95774. c.urlParams_.Set("filter", filter)
  95775. return c
  95776. }
  95777. // MaxResults sets the optional parameter "maxResults": The maximum
  95778. // number of results per page that should be returned. If the number of
  95779. // available results is larger than maxResults, Compute Engine returns a
  95780. // nextPageToken that can be used to get the next page of results in
  95781. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  95782. // (Default: 500)
  95783. func (c *RegionUrlMapsListCall) MaxResults(maxResults int64) *RegionUrlMapsListCall {
  95784. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  95785. return c
  95786. }
  95787. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  95788. // a certain order. By default, results are returned in alphanumerical
  95789. // order based on the resource name.
  95790. //
  95791. // You can also sort results in descending order based on the creation
  95792. // timestamp using orderBy="creationTimestamp desc". This sorts results
  95793. // based on the creationTimestamp field in reverse chronological order
  95794. // (newest result first). Use this to sort resources like operations so
  95795. // that the newest operation is returned first.
  95796. //
  95797. // Currently, only sorting by name or creationTimestamp desc is
  95798. // supported.
  95799. func (c *RegionUrlMapsListCall) OrderBy(orderBy string) *RegionUrlMapsListCall {
  95800. c.urlParams_.Set("orderBy", orderBy)
  95801. return c
  95802. }
  95803. // PageToken sets the optional parameter "pageToken": Specifies a page
  95804. // token to use. Set pageToken to the nextPageToken returned by a
  95805. // previous list request to get the next page of results.
  95806. func (c *RegionUrlMapsListCall) PageToken(pageToken string) *RegionUrlMapsListCall {
  95807. c.urlParams_.Set("pageToken", pageToken)
  95808. return c
  95809. }
  95810. // Fields allows partial responses to be retrieved. See
  95811. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  95812. // for more information.
  95813. func (c *RegionUrlMapsListCall) Fields(s ...googleapi.Field) *RegionUrlMapsListCall {
  95814. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  95815. return c
  95816. }
  95817. // IfNoneMatch sets the optional parameter which makes the operation
  95818. // fail if the object's ETag matches the given value. This is useful for
  95819. // getting updates only after the object has changed since the last
  95820. // request. Use googleapi.IsNotModified to check whether the response
  95821. // error from Do is the result of In-None-Match.
  95822. func (c *RegionUrlMapsListCall) IfNoneMatch(entityTag string) *RegionUrlMapsListCall {
  95823. c.ifNoneMatch_ = entityTag
  95824. return c
  95825. }
  95826. // Context sets the context to be used in this call's Do method. Any
  95827. // pending HTTP request will be aborted if the provided context is
  95828. // canceled.
  95829. func (c *RegionUrlMapsListCall) Context(ctx context.Context) *RegionUrlMapsListCall {
  95830. c.ctx_ = ctx
  95831. return c
  95832. }
  95833. // Header returns an http.Header that can be modified by the caller to
  95834. // add HTTP headers to the request.
  95835. func (c *RegionUrlMapsListCall) Header() http.Header {
  95836. if c.header_ == nil {
  95837. c.header_ = make(http.Header)
  95838. }
  95839. return c.header_
  95840. }
  95841. func (c *RegionUrlMapsListCall) doRequest(alt string) (*http.Response, error) {
  95842. reqHeaders := make(http.Header)
  95843. for k, v := range c.header_ {
  95844. reqHeaders[k] = v
  95845. }
  95846. reqHeaders.Set("User-Agent", c.s.userAgent())
  95847. if c.ifNoneMatch_ != "" {
  95848. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  95849. }
  95850. var body io.Reader = nil
  95851. c.urlParams_.Set("alt", alt)
  95852. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/urlMaps")
  95853. urls += "?" + c.urlParams_.Encode()
  95854. req, _ := http.NewRequest("GET", urls, body)
  95855. req.Header = reqHeaders
  95856. googleapi.Expand(req.URL, map[string]string{
  95857. "project": c.project,
  95858. "region": c.region,
  95859. })
  95860. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  95861. }
  95862. // Do executes the "compute.regionUrlMaps.list" call.
  95863. // Exactly one of *UrlMapList or error will be non-nil. Any non-2xx
  95864. // status code is an error. Response headers are in either
  95865. // *UrlMapList.ServerResponse.Header or (if a response was returned at
  95866. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  95867. // to check whether the returned error was because
  95868. // http.StatusNotModified was returned.
  95869. func (c *RegionUrlMapsListCall) Do(opts ...googleapi.CallOption) (*UrlMapList, error) {
  95870. gensupport.SetOptions(c.urlParams_, opts...)
  95871. res, err := c.doRequest("json")
  95872. if res != nil && res.StatusCode == http.StatusNotModified {
  95873. if res.Body != nil {
  95874. res.Body.Close()
  95875. }
  95876. return nil, &googleapi.Error{
  95877. Code: res.StatusCode,
  95878. Header: res.Header,
  95879. }
  95880. }
  95881. if err != nil {
  95882. return nil, err
  95883. }
  95884. defer googleapi.CloseBody(res)
  95885. if err := googleapi.CheckResponse(res); err != nil {
  95886. return nil, err
  95887. }
  95888. ret := &UrlMapList{
  95889. ServerResponse: googleapi.ServerResponse{
  95890. Header: res.Header,
  95891. HTTPStatusCode: res.StatusCode,
  95892. },
  95893. }
  95894. target := &ret
  95895. if err := gensupport.DecodeResponse(target, res); err != nil {
  95896. return nil, err
  95897. }
  95898. return ret, nil
  95899. // {
  95900. // "description": "Retrieves the list of UrlMap resources available to the specified project in the specified region.",
  95901. // "httpMethod": "GET",
  95902. // "id": "compute.regionUrlMaps.list",
  95903. // "parameterOrder": [
  95904. // "project",
  95905. // "region"
  95906. // ],
  95907. // "parameters": {
  95908. // "filter": {
  95909. // "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).",
  95910. // "location": "query",
  95911. // "type": "string"
  95912. // },
  95913. // "maxResults": {
  95914. // "default": "500",
  95915. // "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)",
  95916. // "format": "uint32",
  95917. // "location": "query",
  95918. // "minimum": "0",
  95919. // "type": "integer"
  95920. // },
  95921. // "orderBy": {
  95922. // "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.",
  95923. // "location": "query",
  95924. // "type": "string"
  95925. // },
  95926. // "pageToken": {
  95927. // "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.",
  95928. // "location": "query",
  95929. // "type": "string"
  95930. // },
  95931. // "project": {
  95932. // "description": "Project ID for this request.",
  95933. // "location": "path",
  95934. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  95935. // "required": true,
  95936. // "type": "string"
  95937. // },
  95938. // "region": {
  95939. // "description": "Name of the region scoping this request.",
  95940. // "location": "path",
  95941. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  95942. // "required": true,
  95943. // "type": "string"
  95944. // }
  95945. // },
  95946. // "path": "{project}/regions/{region}/urlMaps",
  95947. // "response": {
  95948. // "$ref": "UrlMapList"
  95949. // },
  95950. // "scopes": [
  95951. // "https://www.googleapis.com/auth/cloud-platform",
  95952. // "https://www.googleapis.com/auth/compute",
  95953. // "https://www.googleapis.com/auth/compute.readonly"
  95954. // ]
  95955. // }
  95956. }
  95957. // Pages invokes f for each page of results.
  95958. // A non-nil error returned from f will halt the iteration.
  95959. // The provided context supersedes any context provided to the Context method.
  95960. func (c *RegionUrlMapsListCall) Pages(ctx context.Context, f func(*UrlMapList) error) error {
  95961. c.ctx_ = ctx
  95962. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  95963. for {
  95964. x, err := c.Do()
  95965. if err != nil {
  95966. return err
  95967. }
  95968. if err := f(x); err != nil {
  95969. return err
  95970. }
  95971. if x.NextPageToken == "" {
  95972. return nil
  95973. }
  95974. c.PageToken(x.NextPageToken)
  95975. }
  95976. }
  95977. // method id "compute.regionUrlMaps.patch":
  95978. type RegionUrlMapsPatchCall struct {
  95979. s *Service
  95980. project string
  95981. region string
  95982. urlMap string
  95983. urlmap *UrlMap
  95984. urlParams_ gensupport.URLParams
  95985. ctx_ context.Context
  95986. header_ http.Header
  95987. }
  95988. // Patch: Patches the specified UrlMap resource with the data included
  95989. // in the request. This method supports PATCH semantics and uses JSON
  95990. // merge patch format and processing rules.
  95991. func (r *RegionUrlMapsService) Patch(project string, region string, urlMap string, urlmap *UrlMap) *RegionUrlMapsPatchCall {
  95992. c := &RegionUrlMapsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  95993. c.project = project
  95994. c.region = region
  95995. c.urlMap = urlMap
  95996. c.urlmap = urlmap
  95997. return c
  95998. }
  95999. // RequestId sets the optional parameter "requestId": begin_interface:
  96000. // MixerMutationRequestBuilder Request ID to support idempotency.
  96001. func (c *RegionUrlMapsPatchCall) RequestId(requestId string) *RegionUrlMapsPatchCall {
  96002. c.urlParams_.Set("requestId", requestId)
  96003. return c
  96004. }
  96005. // Fields allows partial responses to be retrieved. See
  96006. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  96007. // for more information.
  96008. func (c *RegionUrlMapsPatchCall) Fields(s ...googleapi.Field) *RegionUrlMapsPatchCall {
  96009. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  96010. return c
  96011. }
  96012. // Context sets the context to be used in this call's Do method. Any
  96013. // pending HTTP request will be aborted if the provided context is
  96014. // canceled.
  96015. func (c *RegionUrlMapsPatchCall) Context(ctx context.Context) *RegionUrlMapsPatchCall {
  96016. c.ctx_ = ctx
  96017. return c
  96018. }
  96019. // Header returns an http.Header that can be modified by the caller to
  96020. // add HTTP headers to the request.
  96021. func (c *RegionUrlMapsPatchCall) Header() http.Header {
  96022. if c.header_ == nil {
  96023. c.header_ = make(http.Header)
  96024. }
  96025. return c.header_
  96026. }
  96027. func (c *RegionUrlMapsPatchCall) doRequest(alt string) (*http.Response, error) {
  96028. reqHeaders := make(http.Header)
  96029. for k, v := range c.header_ {
  96030. reqHeaders[k] = v
  96031. }
  96032. reqHeaders.Set("User-Agent", c.s.userAgent())
  96033. var body io.Reader = nil
  96034. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap)
  96035. if err != nil {
  96036. return nil, err
  96037. }
  96038. reqHeaders.Set("Content-Type", "application/json")
  96039. c.urlParams_.Set("alt", alt)
  96040. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/urlMaps/{urlMap}")
  96041. urls += "?" + c.urlParams_.Encode()
  96042. req, _ := http.NewRequest("PATCH", urls, body)
  96043. req.Header = reqHeaders
  96044. googleapi.Expand(req.URL, map[string]string{
  96045. "project": c.project,
  96046. "region": c.region,
  96047. "urlMap": c.urlMap,
  96048. })
  96049. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  96050. }
  96051. // Do executes the "compute.regionUrlMaps.patch" call.
  96052. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  96053. // status code is an error. Response headers are in either
  96054. // *Operation.ServerResponse.Header or (if a response was returned at
  96055. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  96056. // to check whether the returned error was because
  96057. // http.StatusNotModified was returned.
  96058. func (c *RegionUrlMapsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  96059. gensupport.SetOptions(c.urlParams_, opts...)
  96060. res, err := c.doRequest("json")
  96061. if res != nil && res.StatusCode == http.StatusNotModified {
  96062. if res.Body != nil {
  96063. res.Body.Close()
  96064. }
  96065. return nil, &googleapi.Error{
  96066. Code: res.StatusCode,
  96067. Header: res.Header,
  96068. }
  96069. }
  96070. if err != nil {
  96071. return nil, err
  96072. }
  96073. defer googleapi.CloseBody(res)
  96074. if err := googleapi.CheckResponse(res); err != nil {
  96075. return nil, err
  96076. }
  96077. ret := &Operation{
  96078. ServerResponse: googleapi.ServerResponse{
  96079. Header: res.Header,
  96080. HTTPStatusCode: res.StatusCode,
  96081. },
  96082. }
  96083. target := &ret
  96084. if err := gensupport.DecodeResponse(target, res); err != nil {
  96085. return nil, err
  96086. }
  96087. return ret, nil
  96088. // {
  96089. // "description": "Patches the specified UrlMap resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules.",
  96090. // "httpMethod": "PATCH",
  96091. // "id": "compute.regionUrlMaps.patch",
  96092. // "parameterOrder": [
  96093. // "project",
  96094. // "region",
  96095. // "urlMap"
  96096. // ],
  96097. // "parameters": {
  96098. // "project": {
  96099. // "description": "Project ID for this request.",
  96100. // "location": "path",
  96101. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  96102. // "required": true,
  96103. // "type": "string"
  96104. // },
  96105. // "region": {
  96106. // "description": "Name of the region scoping this request.",
  96107. // "location": "path",
  96108. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  96109. // "required": true,
  96110. // "type": "string"
  96111. // },
  96112. // "requestId": {
  96113. // "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.",
  96114. // "location": "query",
  96115. // "type": "string"
  96116. // },
  96117. // "urlMap": {
  96118. // "description": "Name of the UrlMap resource to patch.",
  96119. // "location": "path",
  96120. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  96121. // "required": true,
  96122. // "type": "string"
  96123. // }
  96124. // },
  96125. // "path": "{project}/regions/{region}/urlMaps/{urlMap}",
  96126. // "request": {
  96127. // "$ref": "UrlMap"
  96128. // },
  96129. // "response": {
  96130. // "$ref": "Operation"
  96131. // },
  96132. // "scopes": [
  96133. // "https://www.googleapis.com/auth/cloud-platform",
  96134. // "https://www.googleapis.com/auth/compute"
  96135. // ]
  96136. // }
  96137. }
  96138. // method id "compute.regionUrlMaps.testIamPermissions":
  96139. type RegionUrlMapsTestIamPermissionsCall struct {
  96140. s *Service
  96141. project string
  96142. region string
  96143. resource string
  96144. testpermissionsrequest *TestPermissionsRequest
  96145. urlParams_ gensupport.URLParams
  96146. ctx_ context.Context
  96147. header_ http.Header
  96148. }
  96149. // TestIamPermissions: Returns permissions that a caller has on the
  96150. // specified resource.
  96151. func (r *RegionUrlMapsService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionUrlMapsTestIamPermissionsCall {
  96152. c := &RegionUrlMapsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  96153. c.project = project
  96154. c.region = region
  96155. c.resource = resource
  96156. c.testpermissionsrequest = testpermissionsrequest
  96157. return c
  96158. }
  96159. // Fields allows partial responses to be retrieved. See
  96160. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  96161. // for more information.
  96162. func (c *RegionUrlMapsTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionUrlMapsTestIamPermissionsCall {
  96163. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  96164. return c
  96165. }
  96166. // Context sets the context to be used in this call's Do method. Any
  96167. // pending HTTP request will be aborted if the provided context is
  96168. // canceled.
  96169. func (c *RegionUrlMapsTestIamPermissionsCall) Context(ctx context.Context) *RegionUrlMapsTestIamPermissionsCall {
  96170. c.ctx_ = ctx
  96171. return c
  96172. }
  96173. // Header returns an http.Header that can be modified by the caller to
  96174. // add HTTP headers to the request.
  96175. func (c *RegionUrlMapsTestIamPermissionsCall) Header() http.Header {
  96176. if c.header_ == nil {
  96177. c.header_ = make(http.Header)
  96178. }
  96179. return c.header_
  96180. }
  96181. func (c *RegionUrlMapsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  96182. reqHeaders := make(http.Header)
  96183. for k, v := range c.header_ {
  96184. reqHeaders[k] = v
  96185. }
  96186. reqHeaders.Set("User-Agent", c.s.userAgent())
  96187. var body io.Reader = nil
  96188. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  96189. if err != nil {
  96190. return nil, err
  96191. }
  96192. reqHeaders.Set("Content-Type", "application/json")
  96193. c.urlParams_.Set("alt", alt)
  96194. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/urlMaps/{resource}/testIamPermissions")
  96195. urls += "?" + c.urlParams_.Encode()
  96196. req, _ := http.NewRequest("POST", urls, body)
  96197. req.Header = reqHeaders
  96198. googleapi.Expand(req.URL, map[string]string{
  96199. "project": c.project,
  96200. "region": c.region,
  96201. "resource": c.resource,
  96202. })
  96203. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  96204. }
  96205. // Do executes the "compute.regionUrlMaps.testIamPermissions" call.
  96206. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  96207. // non-2xx status code is an error. Response headers are in either
  96208. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  96209. // returned at all) in error.(*googleapi.Error).Header. Use
  96210. // googleapi.IsNotModified to check whether the returned error was
  96211. // because http.StatusNotModified was returned.
  96212. func (c *RegionUrlMapsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  96213. gensupport.SetOptions(c.urlParams_, opts...)
  96214. res, err := c.doRequest("json")
  96215. if res != nil && res.StatusCode == http.StatusNotModified {
  96216. if res.Body != nil {
  96217. res.Body.Close()
  96218. }
  96219. return nil, &googleapi.Error{
  96220. Code: res.StatusCode,
  96221. Header: res.Header,
  96222. }
  96223. }
  96224. if err != nil {
  96225. return nil, err
  96226. }
  96227. defer googleapi.CloseBody(res)
  96228. if err := googleapi.CheckResponse(res); err != nil {
  96229. return nil, err
  96230. }
  96231. ret := &TestPermissionsResponse{
  96232. ServerResponse: googleapi.ServerResponse{
  96233. Header: res.Header,
  96234. HTTPStatusCode: res.StatusCode,
  96235. },
  96236. }
  96237. target := &ret
  96238. if err := gensupport.DecodeResponse(target, res); err != nil {
  96239. return nil, err
  96240. }
  96241. return ret, nil
  96242. // {
  96243. // "description": "Returns permissions that a caller has on the specified resource.",
  96244. // "httpMethod": "POST",
  96245. // "id": "compute.regionUrlMaps.testIamPermissions",
  96246. // "parameterOrder": [
  96247. // "project",
  96248. // "region",
  96249. // "resource"
  96250. // ],
  96251. // "parameters": {
  96252. // "project": {
  96253. // "description": "Project ID for this request.",
  96254. // "location": "path",
  96255. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  96256. // "required": true,
  96257. // "type": "string"
  96258. // },
  96259. // "region": {
  96260. // "description": "The name of the region for this request.",
  96261. // "location": "path",
  96262. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  96263. // "required": true,
  96264. // "type": "string"
  96265. // },
  96266. // "resource": {
  96267. // "description": "Name of the resource for this request.",
  96268. // "location": "path",
  96269. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  96270. // "required": true,
  96271. // "type": "string"
  96272. // }
  96273. // },
  96274. // "path": "{project}/regions/{region}/urlMaps/{resource}/testIamPermissions",
  96275. // "request": {
  96276. // "$ref": "TestPermissionsRequest"
  96277. // },
  96278. // "response": {
  96279. // "$ref": "TestPermissionsResponse"
  96280. // },
  96281. // "scopes": [
  96282. // "https://www.googleapis.com/auth/cloud-platform",
  96283. // "https://www.googleapis.com/auth/compute",
  96284. // "https://www.googleapis.com/auth/compute.readonly"
  96285. // ]
  96286. // }
  96287. }
  96288. // method id "compute.regionUrlMaps.update":
  96289. type RegionUrlMapsUpdateCall struct {
  96290. s *Service
  96291. project string
  96292. region string
  96293. urlMap string
  96294. urlmap *UrlMap
  96295. urlParams_ gensupport.URLParams
  96296. ctx_ context.Context
  96297. header_ http.Header
  96298. }
  96299. // Update: Updates the specified UrlMap resource with the data included
  96300. // in the request.
  96301. func (r *RegionUrlMapsService) Update(project string, region string, urlMap string, urlmap *UrlMap) *RegionUrlMapsUpdateCall {
  96302. c := &RegionUrlMapsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  96303. c.project = project
  96304. c.region = region
  96305. c.urlMap = urlMap
  96306. c.urlmap = urlmap
  96307. return c
  96308. }
  96309. // RequestId sets the optional parameter "requestId": begin_interface:
  96310. // MixerMutationRequestBuilder Request ID to support idempotency.
  96311. func (c *RegionUrlMapsUpdateCall) RequestId(requestId string) *RegionUrlMapsUpdateCall {
  96312. c.urlParams_.Set("requestId", requestId)
  96313. return c
  96314. }
  96315. // Fields allows partial responses to be retrieved. See
  96316. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  96317. // for more information.
  96318. func (c *RegionUrlMapsUpdateCall) Fields(s ...googleapi.Field) *RegionUrlMapsUpdateCall {
  96319. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  96320. return c
  96321. }
  96322. // Context sets the context to be used in this call's Do method. Any
  96323. // pending HTTP request will be aborted if the provided context is
  96324. // canceled.
  96325. func (c *RegionUrlMapsUpdateCall) Context(ctx context.Context) *RegionUrlMapsUpdateCall {
  96326. c.ctx_ = ctx
  96327. return c
  96328. }
  96329. // Header returns an http.Header that can be modified by the caller to
  96330. // add HTTP headers to the request.
  96331. func (c *RegionUrlMapsUpdateCall) Header() http.Header {
  96332. if c.header_ == nil {
  96333. c.header_ = make(http.Header)
  96334. }
  96335. return c.header_
  96336. }
  96337. func (c *RegionUrlMapsUpdateCall) doRequest(alt string) (*http.Response, error) {
  96338. reqHeaders := make(http.Header)
  96339. for k, v := range c.header_ {
  96340. reqHeaders[k] = v
  96341. }
  96342. reqHeaders.Set("User-Agent", c.s.userAgent())
  96343. var body io.Reader = nil
  96344. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap)
  96345. if err != nil {
  96346. return nil, err
  96347. }
  96348. reqHeaders.Set("Content-Type", "application/json")
  96349. c.urlParams_.Set("alt", alt)
  96350. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/urlMaps/{urlMap}")
  96351. urls += "?" + c.urlParams_.Encode()
  96352. req, _ := http.NewRequest("PUT", urls, body)
  96353. req.Header = reqHeaders
  96354. googleapi.Expand(req.URL, map[string]string{
  96355. "project": c.project,
  96356. "region": c.region,
  96357. "urlMap": c.urlMap,
  96358. })
  96359. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  96360. }
  96361. // Do executes the "compute.regionUrlMaps.update" call.
  96362. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  96363. // status code is an error. Response headers are in either
  96364. // *Operation.ServerResponse.Header or (if a response was returned at
  96365. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  96366. // to check whether the returned error was because
  96367. // http.StatusNotModified was returned.
  96368. func (c *RegionUrlMapsUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  96369. gensupport.SetOptions(c.urlParams_, opts...)
  96370. res, err := c.doRequest("json")
  96371. if res != nil && res.StatusCode == http.StatusNotModified {
  96372. if res.Body != nil {
  96373. res.Body.Close()
  96374. }
  96375. return nil, &googleapi.Error{
  96376. Code: res.StatusCode,
  96377. Header: res.Header,
  96378. }
  96379. }
  96380. if err != nil {
  96381. return nil, err
  96382. }
  96383. defer googleapi.CloseBody(res)
  96384. if err := googleapi.CheckResponse(res); err != nil {
  96385. return nil, err
  96386. }
  96387. ret := &Operation{
  96388. ServerResponse: googleapi.ServerResponse{
  96389. Header: res.Header,
  96390. HTTPStatusCode: res.StatusCode,
  96391. },
  96392. }
  96393. target := &ret
  96394. if err := gensupport.DecodeResponse(target, res); err != nil {
  96395. return nil, err
  96396. }
  96397. return ret, nil
  96398. // {
  96399. // "description": "Updates the specified UrlMap resource with the data included in the request.",
  96400. // "httpMethod": "PUT",
  96401. // "id": "compute.regionUrlMaps.update",
  96402. // "parameterOrder": [
  96403. // "project",
  96404. // "region",
  96405. // "urlMap"
  96406. // ],
  96407. // "parameters": {
  96408. // "project": {
  96409. // "description": "Project ID for this request.",
  96410. // "location": "path",
  96411. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  96412. // "required": true,
  96413. // "type": "string"
  96414. // },
  96415. // "region": {
  96416. // "description": "Name of the region scoping this request.",
  96417. // "location": "path",
  96418. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  96419. // "required": true,
  96420. // "type": "string"
  96421. // },
  96422. // "requestId": {
  96423. // "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.",
  96424. // "location": "query",
  96425. // "type": "string"
  96426. // },
  96427. // "urlMap": {
  96428. // "description": "Name of the UrlMap resource to update.",
  96429. // "location": "path",
  96430. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  96431. // "required": true,
  96432. // "type": "string"
  96433. // }
  96434. // },
  96435. // "path": "{project}/regions/{region}/urlMaps/{urlMap}",
  96436. // "request": {
  96437. // "$ref": "UrlMap"
  96438. // },
  96439. // "response": {
  96440. // "$ref": "Operation"
  96441. // },
  96442. // "scopes": [
  96443. // "https://www.googleapis.com/auth/cloud-platform",
  96444. // "https://www.googleapis.com/auth/compute"
  96445. // ]
  96446. // }
  96447. }
  96448. // method id "compute.regionUrlMaps.validate":
  96449. type RegionUrlMapsValidateCall struct {
  96450. s *Service
  96451. project string
  96452. region string
  96453. urlMap string
  96454. regionurlmapsvalidaterequest *RegionUrlMapsValidateRequest
  96455. urlParams_ gensupport.URLParams
  96456. ctx_ context.Context
  96457. header_ http.Header
  96458. }
  96459. // Validate: Runs static validation for the UrlMap. In particular, the
  96460. // tests of the provided UrlMap will be run. Calling this method does
  96461. // NOT create the UrlMap.
  96462. func (r *RegionUrlMapsService) Validate(project string, region string, urlMap string, regionurlmapsvalidaterequest *RegionUrlMapsValidateRequest) *RegionUrlMapsValidateCall {
  96463. c := &RegionUrlMapsValidateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  96464. c.project = project
  96465. c.region = region
  96466. c.urlMap = urlMap
  96467. c.regionurlmapsvalidaterequest = regionurlmapsvalidaterequest
  96468. return c
  96469. }
  96470. // Fields allows partial responses to be retrieved. See
  96471. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  96472. // for more information.
  96473. func (c *RegionUrlMapsValidateCall) Fields(s ...googleapi.Field) *RegionUrlMapsValidateCall {
  96474. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  96475. return c
  96476. }
  96477. // Context sets the context to be used in this call's Do method. Any
  96478. // pending HTTP request will be aborted if the provided context is
  96479. // canceled.
  96480. func (c *RegionUrlMapsValidateCall) Context(ctx context.Context) *RegionUrlMapsValidateCall {
  96481. c.ctx_ = ctx
  96482. return c
  96483. }
  96484. // Header returns an http.Header that can be modified by the caller to
  96485. // add HTTP headers to the request.
  96486. func (c *RegionUrlMapsValidateCall) Header() http.Header {
  96487. if c.header_ == nil {
  96488. c.header_ = make(http.Header)
  96489. }
  96490. return c.header_
  96491. }
  96492. func (c *RegionUrlMapsValidateCall) doRequest(alt string) (*http.Response, error) {
  96493. reqHeaders := make(http.Header)
  96494. for k, v := range c.header_ {
  96495. reqHeaders[k] = v
  96496. }
  96497. reqHeaders.Set("User-Agent", c.s.userAgent())
  96498. var body io.Reader = nil
  96499. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionurlmapsvalidaterequest)
  96500. if err != nil {
  96501. return nil, err
  96502. }
  96503. reqHeaders.Set("Content-Type", "application/json")
  96504. c.urlParams_.Set("alt", alt)
  96505. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/urlMaps/{urlMap}/validate")
  96506. urls += "?" + c.urlParams_.Encode()
  96507. req, _ := http.NewRequest("POST", urls, body)
  96508. req.Header = reqHeaders
  96509. googleapi.Expand(req.URL, map[string]string{
  96510. "project": c.project,
  96511. "region": c.region,
  96512. "urlMap": c.urlMap,
  96513. })
  96514. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  96515. }
  96516. // Do executes the "compute.regionUrlMaps.validate" call.
  96517. // Exactly one of *UrlMapsValidateResponse or error will be non-nil. Any
  96518. // non-2xx status code is an error. Response headers are in either
  96519. // *UrlMapsValidateResponse.ServerResponse.Header or (if a response was
  96520. // returned at all) in error.(*googleapi.Error).Header. Use
  96521. // googleapi.IsNotModified to check whether the returned error was
  96522. // because http.StatusNotModified was returned.
  96523. func (c *RegionUrlMapsValidateCall) Do(opts ...googleapi.CallOption) (*UrlMapsValidateResponse, error) {
  96524. gensupport.SetOptions(c.urlParams_, opts...)
  96525. res, err := c.doRequest("json")
  96526. if res != nil && res.StatusCode == http.StatusNotModified {
  96527. if res.Body != nil {
  96528. res.Body.Close()
  96529. }
  96530. return nil, &googleapi.Error{
  96531. Code: res.StatusCode,
  96532. Header: res.Header,
  96533. }
  96534. }
  96535. if err != nil {
  96536. return nil, err
  96537. }
  96538. defer googleapi.CloseBody(res)
  96539. if err := googleapi.CheckResponse(res); err != nil {
  96540. return nil, err
  96541. }
  96542. ret := &UrlMapsValidateResponse{
  96543. ServerResponse: googleapi.ServerResponse{
  96544. Header: res.Header,
  96545. HTTPStatusCode: res.StatusCode,
  96546. },
  96547. }
  96548. target := &ret
  96549. if err := gensupport.DecodeResponse(target, res); err != nil {
  96550. return nil, err
  96551. }
  96552. return ret, nil
  96553. // {
  96554. // "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.",
  96555. // "httpMethod": "POST",
  96556. // "id": "compute.regionUrlMaps.validate",
  96557. // "parameterOrder": [
  96558. // "project",
  96559. // "region",
  96560. // "urlMap"
  96561. // ],
  96562. // "parameters": {
  96563. // "project": {
  96564. // "description": "Project ID for this request.",
  96565. // "location": "path",
  96566. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  96567. // "required": true,
  96568. // "type": "string"
  96569. // },
  96570. // "region": {
  96571. // "description": "Name of the region scoping this request.",
  96572. // "location": "path",
  96573. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  96574. // "required": true,
  96575. // "type": "string"
  96576. // },
  96577. // "urlMap": {
  96578. // "description": "Name of the UrlMap resource to be validated as.",
  96579. // "location": "path",
  96580. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  96581. // "required": true,
  96582. // "type": "string"
  96583. // }
  96584. // },
  96585. // "path": "{project}/regions/{region}/urlMaps/{urlMap}/validate",
  96586. // "request": {
  96587. // "$ref": "RegionUrlMapsValidateRequest"
  96588. // },
  96589. // "response": {
  96590. // "$ref": "UrlMapsValidateResponse"
  96591. // },
  96592. // "scopes": [
  96593. // "https://www.googleapis.com/auth/cloud-platform",
  96594. // "https://www.googleapis.com/auth/compute"
  96595. // ]
  96596. // }
  96597. }
  96598. // method id "compute.regions.get":
  96599. type RegionsGetCall struct {
  96600. s *Service
  96601. project string
  96602. region string
  96603. urlParams_ gensupport.URLParams
  96604. ifNoneMatch_ string
  96605. ctx_ context.Context
  96606. header_ http.Header
  96607. }
  96608. // Get: Returns the specified Region resource. Gets a list of available
  96609. // regions by making a list() request.
  96610. // For details, see https://cloud.google.com/compute/docs/reference/latest/regions/get
  96611. func (r *RegionsService) Get(project string, region string) *RegionsGetCall {
  96612. c := &RegionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  96613. c.project = project
  96614. c.region = region
  96615. return c
  96616. }
  96617. // Fields allows partial responses to be retrieved. See
  96618. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  96619. // for more information.
  96620. func (c *RegionsGetCall) Fields(s ...googleapi.Field) *RegionsGetCall {
  96621. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  96622. return c
  96623. }
  96624. // IfNoneMatch sets the optional parameter which makes the operation
  96625. // fail if the object's ETag matches the given value. This is useful for
  96626. // getting updates only after the object has changed since the last
  96627. // request. Use googleapi.IsNotModified to check whether the response
  96628. // error from Do is the result of In-None-Match.
  96629. func (c *RegionsGetCall) IfNoneMatch(entityTag string) *RegionsGetCall {
  96630. c.ifNoneMatch_ = entityTag
  96631. return c
  96632. }
  96633. // Context sets the context to be used in this call's Do method. Any
  96634. // pending HTTP request will be aborted if the provided context is
  96635. // canceled.
  96636. func (c *RegionsGetCall) Context(ctx context.Context) *RegionsGetCall {
  96637. c.ctx_ = ctx
  96638. return c
  96639. }
  96640. // Header returns an http.Header that can be modified by the caller to
  96641. // add HTTP headers to the request.
  96642. func (c *RegionsGetCall) Header() http.Header {
  96643. if c.header_ == nil {
  96644. c.header_ = make(http.Header)
  96645. }
  96646. return c.header_
  96647. }
  96648. func (c *RegionsGetCall) doRequest(alt string) (*http.Response, error) {
  96649. reqHeaders := make(http.Header)
  96650. for k, v := range c.header_ {
  96651. reqHeaders[k] = v
  96652. }
  96653. reqHeaders.Set("User-Agent", c.s.userAgent())
  96654. if c.ifNoneMatch_ != "" {
  96655. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  96656. }
  96657. var body io.Reader = nil
  96658. c.urlParams_.Set("alt", alt)
  96659. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}")
  96660. urls += "?" + c.urlParams_.Encode()
  96661. req, _ := http.NewRequest("GET", urls, body)
  96662. req.Header = reqHeaders
  96663. googleapi.Expand(req.URL, map[string]string{
  96664. "project": c.project,
  96665. "region": c.region,
  96666. })
  96667. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  96668. }
  96669. // Do executes the "compute.regions.get" call.
  96670. // Exactly one of *Region or error will be non-nil. Any non-2xx status
  96671. // code is an error. Response headers are in either
  96672. // *Region.ServerResponse.Header or (if a response was returned at all)
  96673. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  96674. // check whether the returned error was because http.StatusNotModified
  96675. // was returned.
  96676. func (c *RegionsGetCall) Do(opts ...googleapi.CallOption) (*Region, error) {
  96677. gensupport.SetOptions(c.urlParams_, opts...)
  96678. res, err := c.doRequest("json")
  96679. if res != nil && res.StatusCode == http.StatusNotModified {
  96680. if res.Body != nil {
  96681. res.Body.Close()
  96682. }
  96683. return nil, &googleapi.Error{
  96684. Code: res.StatusCode,
  96685. Header: res.Header,
  96686. }
  96687. }
  96688. if err != nil {
  96689. return nil, err
  96690. }
  96691. defer googleapi.CloseBody(res)
  96692. if err := googleapi.CheckResponse(res); err != nil {
  96693. return nil, err
  96694. }
  96695. ret := &Region{
  96696. ServerResponse: googleapi.ServerResponse{
  96697. Header: res.Header,
  96698. HTTPStatusCode: res.StatusCode,
  96699. },
  96700. }
  96701. target := &ret
  96702. if err := gensupport.DecodeResponse(target, res); err != nil {
  96703. return nil, err
  96704. }
  96705. return ret, nil
  96706. // {
  96707. // "description": "Returns the specified Region resource. Gets a list of available regions by making a list() request.",
  96708. // "httpMethod": "GET",
  96709. // "id": "compute.regions.get",
  96710. // "parameterOrder": [
  96711. // "project",
  96712. // "region"
  96713. // ],
  96714. // "parameters": {
  96715. // "project": {
  96716. // "description": "Project ID for this request.",
  96717. // "location": "path",
  96718. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  96719. // "required": true,
  96720. // "type": "string"
  96721. // },
  96722. // "region": {
  96723. // "description": "Name of the region resource to return.",
  96724. // "location": "path",
  96725. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  96726. // "required": true,
  96727. // "type": "string"
  96728. // }
  96729. // },
  96730. // "path": "{project}/regions/{region}",
  96731. // "response": {
  96732. // "$ref": "Region"
  96733. // },
  96734. // "scopes": [
  96735. // "https://www.googleapis.com/auth/cloud-platform",
  96736. // "https://www.googleapis.com/auth/compute",
  96737. // "https://www.googleapis.com/auth/compute.readonly"
  96738. // ]
  96739. // }
  96740. }
  96741. // method id "compute.regions.list":
  96742. type RegionsListCall struct {
  96743. s *Service
  96744. project string
  96745. urlParams_ gensupport.URLParams
  96746. ifNoneMatch_ string
  96747. ctx_ context.Context
  96748. header_ http.Header
  96749. }
  96750. // List: Retrieves the list of region resources available to the
  96751. // specified project.
  96752. // For details, see https://cloud.google.com/compute/docs/reference/latest/regions/list
  96753. func (r *RegionsService) List(project string) *RegionsListCall {
  96754. c := &RegionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  96755. c.project = project
  96756. return c
  96757. }
  96758. // Filter sets the optional parameter "filter": A filter expression that
  96759. // filters resources listed in the response. The expression must specify
  96760. // the field name, a comparison operator, and the value that you want to
  96761. // use for filtering. The value must be a string, a number, or a
  96762. // boolean. The comparison operator must be either =, !=, >, or <.
  96763. //
  96764. // For example, if you are filtering Compute Engine instances, you can
  96765. // exclude instances named example-instance by specifying name !=
  96766. // example-instance.
  96767. //
  96768. // You can also filter nested fields. For example, you could specify
  96769. // scheduling.automaticRestart = false to include instances only if they
  96770. // are not scheduled for automatic restarts. You can use filtering on
  96771. // nested fields to filter based on resource labels.
  96772. //
  96773. // To filter on multiple expressions, provide each separate expression
  96774. // within parentheses. For example, (scheduling.automaticRestart = true)
  96775. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  96776. // AND expression. However, you can include AND and OR expressions
  96777. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  96778. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  96779. // true).
  96780. func (c *RegionsListCall) Filter(filter string) *RegionsListCall {
  96781. c.urlParams_.Set("filter", filter)
  96782. return c
  96783. }
  96784. // MaxResults sets the optional parameter "maxResults": The maximum
  96785. // number of results per page that should be returned. If the number of
  96786. // available results is larger than maxResults, Compute Engine returns a
  96787. // nextPageToken that can be used to get the next page of results in
  96788. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  96789. // (Default: 500)
  96790. func (c *RegionsListCall) MaxResults(maxResults int64) *RegionsListCall {
  96791. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  96792. return c
  96793. }
  96794. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  96795. // a certain order. By default, results are returned in alphanumerical
  96796. // order based on the resource name.
  96797. //
  96798. // You can also sort results in descending order based on the creation
  96799. // timestamp using orderBy="creationTimestamp desc". This sorts results
  96800. // based on the creationTimestamp field in reverse chronological order
  96801. // (newest result first). Use this to sort resources like operations so
  96802. // that the newest operation is returned first.
  96803. //
  96804. // Currently, only sorting by name or creationTimestamp desc is
  96805. // supported.
  96806. func (c *RegionsListCall) OrderBy(orderBy string) *RegionsListCall {
  96807. c.urlParams_.Set("orderBy", orderBy)
  96808. return c
  96809. }
  96810. // PageToken sets the optional parameter "pageToken": Specifies a page
  96811. // token to use. Set pageToken to the nextPageToken returned by a
  96812. // previous list request to get the next page of results.
  96813. func (c *RegionsListCall) PageToken(pageToken string) *RegionsListCall {
  96814. c.urlParams_.Set("pageToken", pageToken)
  96815. return c
  96816. }
  96817. // Fields allows partial responses to be retrieved. See
  96818. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  96819. // for more information.
  96820. func (c *RegionsListCall) Fields(s ...googleapi.Field) *RegionsListCall {
  96821. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  96822. return c
  96823. }
  96824. // IfNoneMatch sets the optional parameter which makes the operation
  96825. // fail if the object's ETag matches the given value. This is useful for
  96826. // getting updates only after the object has changed since the last
  96827. // request. Use googleapi.IsNotModified to check whether the response
  96828. // error from Do is the result of In-None-Match.
  96829. func (c *RegionsListCall) IfNoneMatch(entityTag string) *RegionsListCall {
  96830. c.ifNoneMatch_ = entityTag
  96831. return c
  96832. }
  96833. // Context sets the context to be used in this call's Do method. Any
  96834. // pending HTTP request will be aborted if the provided context is
  96835. // canceled.
  96836. func (c *RegionsListCall) Context(ctx context.Context) *RegionsListCall {
  96837. c.ctx_ = ctx
  96838. return c
  96839. }
  96840. // Header returns an http.Header that can be modified by the caller to
  96841. // add HTTP headers to the request.
  96842. func (c *RegionsListCall) Header() http.Header {
  96843. if c.header_ == nil {
  96844. c.header_ = make(http.Header)
  96845. }
  96846. return c.header_
  96847. }
  96848. func (c *RegionsListCall) doRequest(alt string) (*http.Response, error) {
  96849. reqHeaders := make(http.Header)
  96850. for k, v := range c.header_ {
  96851. reqHeaders[k] = v
  96852. }
  96853. reqHeaders.Set("User-Agent", c.s.userAgent())
  96854. if c.ifNoneMatch_ != "" {
  96855. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  96856. }
  96857. var body io.Reader = nil
  96858. c.urlParams_.Set("alt", alt)
  96859. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions")
  96860. urls += "?" + c.urlParams_.Encode()
  96861. req, _ := http.NewRequest("GET", urls, body)
  96862. req.Header = reqHeaders
  96863. googleapi.Expand(req.URL, map[string]string{
  96864. "project": c.project,
  96865. })
  96866. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  96867. }
  96868. // Do executes the "compute.regions.list" call.
  96869. // Exactly one of *RegionList or error will be non-nil. Any non-2xx
  96870. // status code is an error. Response headers are in either
  96871. // *RegionList.ServerResponse.Header or (if a response was returned at
  96872. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  96873. // to check whether the returned error was because
  96874. // http.StatusNotModified was returned.
  96875. func (c *RegionsListCall) Do(opts ...googleapi.CallOption) (*RegionList, error) {
  96876. gensupport.SetOptions(c.urlParams_, opts...)
  96877. res, err := c.doRequest("json")
  96878. if res != nil && res.StatusCode == http.StatusNotModified {
  96879. if res.Body != nil {
  96880. res.Body.Close()
  96881. }
  96882. return nil, &googleapi.Error{
  96883. Code: res.StatusCode,
  96884. Header: res.Header,
  96885. }
  96886. }
  96887. if err != nil {
  96888. return nil, err
  96889. }
  96890. defer googleapi.CloseBody(res)
  96891. if err := googleapi.CheckResponse(res); err != nil {
  96892. return nil, err
  96893. }
  96894. ret := &RegionList{
  96895. ServerResponse: googleapi.ServerResponse{
  96896. Header: res.Header,
  96897. HTTPStatusCode: res.StatusCode,
  96898. },
  96899. }
  96900. target := &ret
  96901. if err := gensupport.DecodeResponse(target, res); err != nil {
  96902. return nil, err
  96903. }
  96904. return ret, nil
  96905. // {
  96906. // "description": "Retrieves the list of region resources available to the specified project.",
  96907. // "httpMethod": "GET",
  96908. // "id": "compute.regions.list",
  96909. // "parameterOrder": [
  96910. // "project"
  96911. // ],
  96912. // "parameters": {
  96913. // "filter": {
  96914. // "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).",
  96915. // "location": "query",
  96916. // "type": "string"
  96917. // },
  96918. // "maxResults": {
  96919. // "default": "500",
  96920. // "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)",
  96921. // "format": "uint32",
  96922. // "location": "query",
  96923. // "minimum": "0",
  96924. // "type": "integer"
  96925. // },
  96926. // "orderBy": {
  96927. // "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.",
  96928. // "location": "query",
  96929. // "type": "string"
  96930. // },
  96931. // "pageToken": {
  96932. // "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.",
  96933. // "location": "query",
  96934. // "type": "string"
  96935. // },
  96936. // "project": {
  96937. // "description": "Project ID for this request.",
  96938. // "location": "path",
  96939. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  96940. // "required": true,
  96941. // "type": "string"
  96942. // }
  96943. // },
  96944. // "path": "{project}/regions",
  96945. // "response": {
  96946. // "$ref": "RegionList"
  96947. // },
  96948. // "scopes": [
  96949. // "https://www.googleapis.com/auth/cloud-platform",
  96950. // "https://www.googleapis.com/auth/compute",
  96951. // "https://www.googleapis.com/auth/compute.readonly"
  96952. // ]
  96953. // }
  96954. }
  96955. // Pages invokes f for each page of results.
  96956. // A non-nil error returned from f will halt the iteration.
  96957. // The provided context supersedes any context provided to the Context method.
  96958. func (c *RegionsListCall) Pages(ctx context.Context, f func(*RegionList) error) error {
  96959. c.ctx_ = ctx
  96960. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  96961. for {
  96962. x, err := c.Do()
  96963. if err != nil {
  96964. return err
  96965. }
  96966. if err := f(x); err != nil {
  96967. return err
  96968. }
  96969. if x.NextPageToken == "" {
  96970. return nil
  96971. }
  96972. c.PageToken(x.NextPageToken)
  96973. }
  96974. }
  96975. // method id "compute.resourcePolicies.aggregatedList":
  96976. type ResourcePoliciesAggregatedListCall struct {
  96977. s *Service
  96978. project string
  96979. urlParams_ gensupport.URLParams
  96980. ifNoneMatch_ string
  96981. ctx_ context.Context
  96982. header_ http.Header
  96983. }
  96984. // AggregatedList: Retrieves an aggregated list of resource policies.
  96985. func (r *ResourcePoliciesService) AggregatedList(project string) *ResourcePoliciesAggregatedListCall {
  96986. c := &ResourcePoliciesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  96987. c.project = project
  96988. return c
  96989. }
  96990. // Filter sets the optional parameter "filter": A filter expression that
  96991. // filters resources listed in the response. The expression must specify
  96992. // the field name, a comparison operator, and the value that you want to
  96993. // use for filtering. The value must be a string, a number, or a
  96994. // boolean. The comparison operator must be either =, !=, >, or <.
  96995. //
  96996. // For example, if you are filtering Compute Engine instances, you can
  96997. // exclude instances named example-instance by specifying name !=
  96998. // example-instance.
  96999. //
  97000. // You can also filter nested fields. For example, you could specify
  97001. // scheduling.automaticRestart = false to include instances only if they
  97002. // are not scheduled for automatic restarts. You can use filtering on
  97003. // nested fields to filter based on resource labels.
  97004. //
  97005. // To filter on multiple expressions, provide each separate expression
  97006. // within parentheses. For example, (scheduling.automaticRestart = true)
  97007. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  97008. // AND expression. However, you can include AND and OR expressions
  97009. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  97010. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  97011. // true).
  97012. func (c *ResourcePoliciesAggregatedListCall) Filter(filter string) *ResourcePoliciesAggregatedListCall {
  97013. c.urlParams_.Set("filter", filter)
  97014. return c
  97015. }
  97016. // MaxResults sets the optional parameter "maxResults": The maximum
  97017. // number of results per page that should be returned. If the number of
  97018. // available results is larger than maxResults, Compute Engine returns a
  97019. // nextPageToken that can be used to get the next page of results in
  97020. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  97021. // (Default: 500)
  97022. func (c *ResourcePoliciesAggregatedListCall) MaxResults(maxResults int64) *ResourcePoliciesAggregatedListCall {
  97023. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  97024. return c
  97025. }
  97026. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  97027. // a certain order. By default, results are returned in alphanumerical
  97028. // order based on the resource name.
  97029. //
  97030. // You can also sort results in descending order based on the creation
  97031. // timestamp using orderBy="creationTimestamp desc". This sorts results
  97032. // based on the creationTimestamp field in reverse chronological order
  97033. // (newest result first). Use this to sort resources like operations so
  97034. // that the newest operation is returned first.
  97035. //
  97036. // Currently, only sorting by name or creationTimestamp desc is
  97037. // supported.
  97038. func (c *ResourcePoliciesAggregatedListCall) OrderBy(orderBy string) *ResourcePoliciesAggregatedListCall {
  97039. c.urlParams_.Set("orderBy", orderBy)
  97040. return c
  97041. }
  97042. // PageToken sets the optional parameter "pageToken": Specifies a page
  97043. // token to use. Set pageToken to the nextPageToken returned by a
  97044. // previous list request to get the next page of results.
  97045. func (c *ResourcePoliciesAggregatedListCall) PageToken(pageToken string) *ResourcePoliciesAggregatedListCall {
  97046. c.urlParams_.Set("pageToken", pageToken)
  97047. return c
  97048. }
  97049. // Fields allows partial responses to be retrieved. See
  97050. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  97051. // for more information.
  97052. func (c *ResourcePoliciesAggregatedListCall) Fields(s ...googleapi.Field) *ResourcePoliciesAggregatedListCall {
  97053. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  97054. return c
  97055. }
  97056. // IfNoneMatch sets the optional parameter which makes the operation
  97057. // fail if the object's ETag matches the given value. This is useful for
  97058. // getting updates only after the object has changed since the last
  97059. // request. Use googleapi.IsNotModified to check whether the response
  97060. // error from Do is the result of In-None-Match.
  97061. func (c *ResourcePoliciesAggregatedListCall) IfNoneMatch(entityTag string) *ResourcePoliciesAggregatedListCall {
  97062. c.ifNoneMatch_ = entityTag
  97063. return c
  97064. }
  97065. // Context sets the context to be used in this call's Do method. Any
  97066. // pending HTTP request will be aborted if the provided context is
  97067. // canceled.
  97068. func (c *ResourcePoliciesAggregatedListCall) Context(ctx context.Context) *ResourcePoliciesAggregatedListCall {
  97069. c.ctx_ = ctx
  97070. return c
  97071. }
  97072. // Header returns an http.Header that can be modified by the caller to
  97073. // add HTTP headers to the request.
  97074. func (c *ResourcePoliciesAggregatedListCall) Header() http.Header {
  97075. if c.header_ == nil {
  97076. c.header_ = make(http.Header)
  97077. }
  97078. return c.header_
  97079. }
  97080. func (c *ResourcePoliciesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  97081. reqHeaders := make(http.Header)
  97082. for k, v := range c.header_ {
  97083. reqHeaders[k] = v
  97084. }
  97085. reqHeaders.Set("User-Agent", c.s.userAgent())
  97086. if c.ifNoneMatch_ != "" {
  97087. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  97088. }
  97089. var body io.Reader = nil
  97090. c.urlParams_.Set("alt", alt)
  97091. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/resourcePolicies")
  97092. urls += "?" + c.urlParams_.Encode()
  97093. req, _ := http.NewRequest("GET", urls, body)
  97094. req.Header = reqHeaders
  97095. googleapi.Expand(req.URL, map[string]string{
  97096. "project": c.project,
  97097. })
  97098. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  97099. }
  97100. // Do executes the "compute.resourcePolicies.aggregatedList" call.
  97101. // Exactly one of *ResourcePolicyAggregatedList or error will be
  97102. // non-nil. Any non-2xx status code is an error. Response headers are in
  97103. // either *ResourcePolicyAggregatedList.ServerResponse.Header or (if a
  97104. // response was returned at all) in error.(*googleapi.Error).Header. Use
  97105. // googleapi.IsNotModified to check whether the returned error was
  97106. // because http.StatusNotModified was returned.
  97107. func (c *ResourcePoliciesAggregatedListCall) Do(opts ...googleapi.CallOption) (*ResourcePolicyAggregatedList, error) {
  97108. gensupport.SetOptions(c.urlParams_, opts...)
  97109. res, err := c.doRequest("json")
  97110. if res != nil && res.StatusCode == http.StatusNotModified {
  97111. if res.Body != nil {
  97112. res.Body.Close()
  97113. }
  97114. return nil, &googleapi.Error{
  97115. Code: res.StatusCode,
  97116. Header: res.Header,
  97117. }
  97118. }
  97119. if err != nil {
  97120. return nil, err
  97121. }
  97122. defer googleapi.CloseBody(res)
  97123. if err := googleapi.CheckResponse(res); err != nil {
  97124. return nil, err
  97125. }
  97126. ret := &ResourcePolicyAggregatedList{
  97127. ServerResponse: googleapi.ServerResponse{
  97128. Header: res.Header,
  97129. HTTPStatusCode: res.StatusCode,
  97130. },
  97131. }
  97132. target := &ret
  97133. if err := gensupport.DecodeResponse(target, res); err != nil {
  97134. return nil, err
  97135. }
  97136. return ret, nil
  97137. // {
  97138. // "description": "Retrieves an aggregated list of resource policies.",
  97139. // "httpMethod": "GET",
  97140. // "id": "compute.resourcePolicies.aggregatedList",
  97141. // "parameterOrder": [
  97142. // "project"
  97143. // ],
  97144. // "parameters": {
  97145. // "filter": {
  97146. // "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).",
  97147. // "location": "query",
  97148. // "type": "string"
  97149. // },
  97150. // "maxResults": {
  97151. // "default": "500",
  97152. // "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)",
  97153. // "format": "uint32",
  97154. // "location": "query",
  97155. // "minimum": "0",
  97156. // "type": "integer"
  97157. // },
  97158. // "orderBy": {
  97159. // "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.",
  97160. // "location": "query",
  97161. // "type": "string"
  97162. // },
  97163. // "pageToken": {
  97164. // "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.",
  97165. // "location": "query",
  97166. // "type": "string"
  97167. // },
  97168. // "project": {
  97169. // "description": "Project ID for this request.",
  97170. // "location": "path",
  97171. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  97172. // "required": true,
  97173. // "type": "string"
  97174. // }
  97175. // },
  97176. // "path": "{project}/aggregated/resourcePolicies",
  97177. // "response": {
  97178. // "$ref": "ResourcePolicyAggregatedList"
  97179. // },
  97180. // "scopes": [
  97181. // "https://www.googleapis.com/auth/cloud-platform",
  97182. // "https://www.googleapis.com/auth/compute",
  97183. // "https://www.googleapis.com/auth/compute.readonly"
  97184. // ]
  97185. // }
  97186. }
  97187. // Pages invokes f for each page of results.
  97188. // A non-nil error returned from f will halt the iteration.
  97189. // The provided context supersedes any context provided to the Context method.
  97190. func (c *ResourcePoliciesAggregatedListCall) Pages(ctx context.Context, f func(*ResourcePolicyAggregatedList) error) error {
  97191. c.ctx_ = ctx
  97192. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  97193. for {
  97194. x, err := c.Do()
  97195. if err != nil {
  97196. return err
  97197. }
  97198. if err := f(x); err != nil {
  97199. return err
  97200. }
  97201. if x.NextPageToken == "" {
  97202. return nil
  97203. }
  97204. c.PageToken(x.NextPageToken)
  97205. }
  97206. }
  97207. // method id "compute.resourcePolicies.delete":
  97208. type ResourcePoliciesDeleteCall struct {
  97209. s *Service
  97210. project string
  97211. region string
  97212. resourcePolicy string
  97213. urlParams_ gensupport.URLParams
  97214. ctx_ context.Context
  97215. header_ http.Header
  97216. }
  97217. // Delete: Deletes the specified resource policy.
  97218. func (r *ResourcePoliciesService) Delete(project string, region string, resourcePolicy string) *ResourcePoliciesDeleteCall {
  97219. c := &ResourcePoliciesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  97220. c.project = project
  97221. c.region = region
  97222. c.resourcePolicy = resourcePolicy
  97223. return c
  97224. }
  97225. // RequestId sets the optional parameter "requestId": An optional
  97226. // request ID to identify requests. Specify a unique request ID so that
  97227. // if you must retry your request, the server will know to ignore the
  97228. // request if it has already been completed.
  97229. //
  97230. // For example, consider a situation where you make an initial request
  97231. // and the request times out. If you make the request again with the
  97232. // same request ID, the server can check if original operation with the
  97233. // same request ID was received, and if so, will ignore the second
  97234. // request. This prevents clients from accidentally creating duplicate
  97235. // commitments.
  97236. //
  97237. // The request ID must be a valid UUID with the exception that zero UUID
  97238. // is not supported (00000000-0000-0000-0000-000000000000).
  97239. func (c *ResourcePoliciesDeleteCall) RequestId(requestId string) *ResourcePoliciesDeleteCall {
  97240. c.urlParams_.Set("requestId", requestId)
  97241. return c
  97242. }
  97243. // Fields allows partial responses to be retrieved. See
  97244. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  97245. // for more information.
  97246. func (c *ResourcePoliciesDeleteCall) Fields(s ...googleapi.Field) *ResourcePoliciesDeleteCall {
  97247. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  97248. return c
  97249. }
  97250. // Context sets the context to be used in this call's Do method. Any
  97251. // pending HTTP request will be aborted if the provided context is
  97252. // canceled.
  97253. func (c *ResourcePoliciesDeleteCall) Context(ctx context.Context) *ResourcePoliciesDeleteCall {
  97254. c.ctx_ = ctx
  97255. return c
  97256. }
  97257. // Header returns an http.Header that can be modified by the caller to
  97258. // add HTTP headers to the request.
  97259. func (c *ResourcePoliciesDeleteCall) Header() http.Header {
  97260. if c.header_ == nil {
  97261. c.header_ = make(http.Header)
  97262. }
  97263. return c.header_
  97264. }
  97265. func (c *ResourcePoliciesDeleteCall) doRequest(alt string) (*http.Response, error) {
  97266. reqHeaders := make(http.Header)
  97267. for k, v := range c.header_ {
  97268. reqHeaders[k] = v
  97269. }
  97270. reqHeaders.Set("User-Agent", c.s.userAgent())
  97271. var body io.Reader = nil
  97272. c.urlParams_.Set("alt", alt)
  97273. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/resourcePolicies/{resourcePolicy}")
  97274. urls += "?" + c.urlParams_.Encode()
  97275. req, _ := http.NewRequest("DELETE", urls, body)
  97276. req.Header = reqHeaders
  97277. googleapi.Expand(req.URL, map[string]string{
  97278. "project": c.project,
  97279. "region": c.region,
  97280. "resourcePolicy": c.resourcePolicy,
  97281. })
  97282. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  97283. }
  97284. // Do executes the "compute.resourcePolicies.delete" call.
  97285. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  97286. // status code is an error. Response headers are in either
  97287. // *Operation.ServerResponse.Header or (if a response was returned at
  97288. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  97289. // to check whether the returned error was because
  97290. // http.StatusNotModified was returned.
  97291. func (c *ResourcePoliciesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  97292. gensupport.SetOptions(c.urlParams_, opts...)
  97293. res, err := c.doRequest("json")
  97294. if res != nil && res.StatusCode == http.StatusNotModified {
  97295. if res.Body != nil {
  97296. res.Body.Close()
  97297. }
  97298. return nil, &googleapi.Error{
  97299. Code: res.StatusCode,
  97300. Header: res.Header,
  97301. }
  97302. }
  97303. if err != nil {
  97304. return nil, err
  97305. }
  97306. defer googleapi.CloseBody(res)
  97307. if err := googleapi.CheckResponse(res); err != nil {
  97308. return nil, err
  97309. }
  97310. ret := &Operation{
  97311. ServerResponse: googleapi.ServerResponse{
  97312. Header: res.Header,
  97313. HTTPStatusCode: res.StatusCode,
  97314. },
  97315. }
  97316. target := &ret
  97317. if err := gensupport.DecodeResponse(target, res); err != nil {
  97318. return nil, err
  97319. }
  97320. return ret, nil
  97321. // {
  97322. // "description": "Deletes the specified resource policy.",
  97323. // "httpMethod": "DELETE",
  97324. // "id": "compute.resourcePolicies.delete",
  97325. // "parameterOrder": [
  97326. // "project",
  97327. // "region",
  97328. // "resourcePolicy"
  97329. // ],
  97330. // "parameters": {
  97331. // "project": {
  97332. // "description": "Project ID for this request.",
  97333. // "location": "path",
  97334. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  97335. // "required": true,
  97336. // "type": "string"
  97337. // },
  97338. // "region": {
  97339. // "description": "Name of the region for this request.",
  97340. // "location": "path",
  97341. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  97342. // "required": true,
  97343. // "type": "string"
  97344. // },
  97345. // "requestId": {
  97346. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  97347. // "location": "query",
  97348. // "type": "string"
  97349. // },
  97350. // "resourcePolicy": {
  97351. // "description": "Name of the resource policy to delete.",
  97352. // "location": "path",
  97353. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  97354. // "required": true,
  97355. // "type": "string"
  97356. // }
  97357. // },
  97358. // "path": "{project}/regions/{region}/resourcePolicies/{resourcePolicy}",
  97359. // "response": {
  97360. // "$ref": "Operation"
  97361. // },
  97362. // "scopes": [
  97363. // "https://www.googleapis.com/auth/cloud-platform",
  97364. // "https://www.googleapis.com/auth/compute"
  97365. // ]
  97366. // }
  97367. }
  97368. // method id "compute.resourcePolicies.get":
  97369. type ResourcePoliciesGetCall struct {
  97370. s *Service
  97371. project string
  97372. region string
  97373. resourcePolicy string
  97374. urlParams_ gensupport.URLParams
  97375. ifNoneMatch_ string
  97376. ctx_ context.Context
  97377. header_ http.Header
  97378. }
  97379. // Get: Retrieves all information of the specified resource policy.
  97380. func (r *ResourcePoliciesService) Get(project string, region string, resourcePolicy string) *ResourcePoliciesGetCall {
  97381. c := &ResourcePoliciesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  97382. c.project = project
  97383. c.region = region
  97384. c.resourcePolicy = resourcePolicy
  97385. return c
  97386. }
  97387. // Fields allows partial responses to be retrieved. See
  97388. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  97389. // for more information.
  97390. func (c *ResourcePoliciesGetCall) Fields(s ...googleapi.Field) *ResourcePoliciesGetCall {
  97391. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  97392. return c
  97393. }
  97394. // IfNoneMatch sets the optional parameter which makes the operation
  97395. // fail if the object's ETag matches the given value. This is useful for
  97396. // getting updates only after the object has changed since the last
  97397. // request. Use googleapi.IsNotModified to check whether the response
  97398. // error from Do is the result of In-None-Match.
  97399. func (c *ResourcePoliciesGetCall) IfNoneMatch(entityTag string) *ResourcePoliciesGetCall {
  97400. c.ifNoneMatch_ = entityTag
  97401. return c
  97402. }
  97403. // Context sets the context to be used in this call's Do method. Any
  97404. // pending HTTP request will be aborted if the provided context is
  97405. // canceled.
  97406. func (c *ResourcePoliciesGetCall) Context(ctx context.Context) *ResourcePoliciesGetCall {
  97407. c.ctx_ = ctx
  97408. return c
  97409. }
  97410. // Header returns an http.Header that can be modified by the caller to
  97411. // add HTTP headers to the request.
  97412. func (c *ResourcePoliciesGetCall) Header() http.Header {
  97413. if c.header_ == nil {
  97414. c.header_ = make(http.Header)
  97415. }
  97416. return c.header_
  97417. }
  97418. func (c *ResourcePoliciesGetCall) doRequest(alt string) (*http.Response, error) {
  97419. reqHeaders := make(http.Header)
  97420. for k, v := range c.header_ {
  97421. reqHeaders[k] = v
  97422. }
  97423. reqHeaders.Set("User-Agent", c.s.userAgent())
  97424. if c.ifNoneMatch_ != "" {
  97425. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  97426. }
  97427. var body io.Reader = nil
  97428. c.urlParams_.Set("alt", alt)
  97429. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/resourcePolicies/{resourcePolicy}")
  97430. urls += "?" + c.urlParams_.Encode()
  97431. req, _ := http.NewRequest("GET", urls, body)
  97432. req.Header = reqHeaders
  97433. googleapi.Expand(req.URL, map[string]string{
  97434. "project": c.project,
  97435. "region": c.region,
  97436. "resourcePolicy": c.resourcePolicy,
  97437. })
  97438. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  97439. }
  97440. // Do executes the "compute.resourcePolicies.get" call.
  97441. // Exactly one of *ResourcePolicy or error will be non-nil. Any non-2xx
  97442. // status code is an error. Response headers are in either
  97443. // *ResourcePolicy.ServerResponse.Header or (if a response was returned
  97444. // at all) in error.(*googleapi.Error).Header. Use
  97445. // googleapi.IsNotModified to check whether the returned error was
  97446. // because http.StatusNotModified was returned.
  97447. func (c *ResourcePoliciesGetCall) Do(opts ...googleapi.CallOption) (*ResourcePolicy, error) {
  97448. gensupport.SetOptions(c.urlParams_, opts...)
  97449. res, err := c.doRequest("json")
  97450. if res != nil && res.StatusCode == http.StatusNotModified {
  97451. if res.Body != nil {
  97452. res.Body.Close()
  97453. }
  97454. return nil, &googleapi.Error{
  97455. Code: res.StatusCode,
  97456. Header: res.Header,
  97457. }
  97458. }
  97459. if err != nil {
  97460. return nil, err
  97461. }
  97462. defer googleapi.CloseBody(res)
  97463. if err := googleapi.CheckResponse(res); err != nil {
  97464. return nil, err
  97465. }
  97466. ret := &ResourcePolicy{
  97467. ServerResponse: googleapi.ServerResponse{
  97468. Header: res.Header,
  97469. HTTPStatusCode: res.StatusCode,
  97470. },
  97471. }
  97472. target := &ret
  97473. if err := gensupport.DecodeResponse(target, res); err != nil {
  97474. return nil, err
  97475. }
  97476. return ret, nil
  97477. // {
  97478. // "description": "Retrieves all information of the specified resource policy.",
  97479. // "httpMethod": "GET",
  97480. // "id": "compute.resourcePolicies.get",
  97481. // "parameterOrder": [
  97482. // "project",
  97483. // "region",
  97484. // "resourcePolicy"
  97485. // ],
  97486. // "parameters": {
  97487. // "project": {
  97488. // "description": "Project ID for this request.",
  97489. // "location": "path",
  97490. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  97491. // "required": true,
  97492. // "type": "string"
  97493. // },
  97494. // "region": {
  97495. // "description": "Name of the region for this request.",
  97496. // "location": "path",
  97497. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  97498. // "required": true,
  97499. // "type": "string"
  97500. // },
  97501. // "resourcePolicy": {
  97502. // "description": "Name of the resource policy to retrieve.",
  97503. // "location": "path",
  97504. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  97505. // "required": true,
  97506. // "type": "string"
  97507. // }
  97508. // },
  97509. // "path": "{project}/regions/{region}/resourcePolicies/{resourcePolicy}",
  97510. // "response": {
  97511. // "$ref": "ResourcePolicy"
  97512. // },
  97513. // "scopes": [
  97514. // "https://www.googleapis.com/auth/cloud-platform",
  97515. // "https://www.googleapis.com/auth/compute",
  97516. // "https://www.googleapis.com/auth/compute.readonly"
  97517. // ]
  97518. // }
  97519. }
  97520. // method id "compute.resourcePolicies.getIamPolicy":
  97521. type ResourcePoliciesGetIamPolicyCall struct {
  97522. s *Service
  97523. project string
  97524. region string
  97525. resource string
  97526. urlParams_ gensupport.URLParams
  97527. ifNoneMatch_ string
  97528. ctx_ context.Context
  97529. header_ http.Header
  97530. }
  97531. // GetIamPolicy: Gets the access control policy for a resource. May be
  97532. // empty if no such policy or resource exists.
  97533. func (r *ResourcePoliciesService) GetIamPolicy(project string, region string, resource string) *ResourcePoliciesGetIamPolicyCall {
  97534. c := &ResourcePoliciesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  97535. c.project = project
  97536. c.region = region
  97537. c.resource = resource
  97538. return c
  97539. }
  97540. // Fields allows partial responses to be retrieved. See
  97541. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  97542. // for more information.
  97543. func (c *ResourcePoliciesGetIamPolicyCall) Fields(s ...googleapi.Field) *ResourcePoliciesGetIamPolicyCall {
  97544. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  97545. return c
  97546. }
  97547. // IfNoneMatch sets the optional parameter which makes the operation
  97548. // fail if the object's ETag matches the given value. This is useful for
  97549. // getting updates only after the object has changed since the last
  97550. // request. Use googleapi.IsNotModified to check whether the response
  97551. // error from Do is the result of In-None-Match.
  97552. func (c *ResourcePoliciesGetIamPolicyCall) IfNoneMatch(entityTag string) *ResourcePoliciesGetIamPolicyCall {
  97553. c.ifNoneMatch_ = entityTag
  97554. return c
  97555. }
  97556. // Context sets the context to be used in this call's Do method. Any
  97557. // pending HTTP request will be aborted if the provided context is
  97558. // canceled.
  97559. func (c *ResourcePoliciesGetIamPolicyCall) Context(ctx context.Context) *ResourcePoliciesGetIamPolicyCall {
  97560. c.ctx_ = ctx
  97561. return c
  97562. }
  97563. // Header returns an http.Header that can be modified by the caller to
  97564. // add HTTP headers to the request.
  97565. func (c *ResourcePoliciesGetIamPolicyCall) Header() http.Header {
  97566. if c.header_ == nil {
  97567. c.header_ = make(http.Header)
  97568. }
  97569. return c.header_
  97570. }
  97571. func (c *ResourcePoliciesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  97572. reqHeaders := make(http.Header)
  97573. for k, v := range c.header_ {
  97574. reqHeaders[k] = v
  97575. }
  97576. reqHeaders.Set("User-Agent", c.s.userAgent())
  97577. if c.ifNoneMatch_ != "" {
  97578. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  97579. }
  97580. var body io.Reader = nil
  97581. c.urlParams_.Set("alt", alt)
  97582. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/resourcePolicies/{resource}/getIamPolicy")
  97583. urls += "?" + c.urlParams_.Encode()
  97584. req, _ := http.NewRequest("GET", urls, body)
  97585. req.Header = reqHeaders
  97586. googleapi.Expand(req.URL, map[string]string{
  97587. "project": c.project,
  97588. "region": c.region,
  97589. "resource": c.resource,
  97590. })
  97591. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  97592. }
  97593. // Do executes the "compute.resourcePolicies.getIamPolicy" call.
  97594. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  97595. // code is an error. Response headers are in either
  97596. // *Policy.ServerResponse.Header or (if a response was returned at all)
  97597. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  97598. // check whether the returned error was because http.StatusNotModified
  97599. // was returned.
  97600. func (c *ResourcePoliciesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  97601. gensupport.SetOptions(c.urlParams_, opts...)
  97602. res, err := c.doRequest("json")
  97603. if res != nil && res.StatusCode == http.StatusNotModified {
  97604. if res.Body != nil {
  97605. res.Body.Close()
  97606. }
  97607. return nil, &googleapi.Error{
  97608. Code: res.StatusCode,
  97609. Header: res.Header,
  97610. }
  97611. }
  97612. if err != nil {
  97613. return nil, err
  97614. }
  97615. defer googleapi.CloseBody(res)
  97616. if err := googleapi.CheckResponse(res); err != nil {
  97617. return nil, err
  97618. }
  97619. ret := &Policy{
  97620. ServerResponse: googleapi.ServerResponse{
  97621. Header: res.Header,
  97622. HTTPStatusCode: res.StatusCode,
  97623. },
  97624. }
  97625. target := &ret
  97626. if err := gensupport.DecodeResponse(target, res); err != nil {
  97627. return nil, err
  97628. }
  97629. return ret, nil
  97630. // {
  97631. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  97632. // "httpMethod": "GET",
  97633. // "id": "compute.resourcePolicies.getIamPolicy",
  97634. // "parameterOrder": [
  97635. // "project",
  97636. // "region",
  97637. // "resource"
  97638. // ],
  97639. // "parameters": {
  97640. // "project": {
  97641. // "description": "Project ID for this request.",
  97642. // "location": "path",
  97643. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  97644. // "required": true,
  97645. // "type": "string"
  97646. // },
  97647. // "region": {
  97648. // "description": "The name of the region for this request.",
  97649. // "location": "path",
  97650. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  97651. // "required": true,
  97652. // "type": "string"
  97653. // },
  97654. // "resource": {
  97655. // "description": "Name of the resource for this request.",
  97656. // "location": "path",
  97657. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  97658. // "required": true,
  97659. // "type": "string"
  97660. // }
  97661. // },
  97662. // "path": "{project}/regions/{region}/resourcePolicies/{resource}/getIamPolicy",
  97663. // "response": {
  97664. // "$ref": "Policy"
  97665. // },
  97666. // "scopes": [
  97667. // "https://www.googleapis.com/auth/cloud-platform",
  97668. // "https://www.googleapis.com/auth/compute",
  97669. // "https://www.googleapis.com/auth/compute.readonly"
  97670. // ]
  97671. // }
  97672. }
  97673. // method id "compute.resourcePolicies.insert":
  97674. type ResourcePoliciesInsertCall struct {
  97675. s *Service
  97676. project string
  97677. region string
  97678. resourcepolicy *ResourcePolicy
  97679. urlParams_ gensupport.URLParams
  97680. ctx_ context.Context
  97681. header_ http.Header
  97682. }
  97683. // Insert: Creates a new resource policy.
  97684. func (r *ResourcePoliciesService) Insert(project string, region string, resourcepolicy *ResourcePolicy) *ResourcePoliciesInsertCall {
  97685. c := &ResourcePoliciesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  97686. c.project = project
  97687. c.region = region
  97688. c.resourcepolicy = resourcepolicy
  97689. return c
  97690. }
  97691. // RequestId sets the optional parameter "requestId": An optional
  97692. // request ID to identify requests. Specify a unique request ID so that
  97693. // if you must retry your request, the server will know to ignore the
  97694. // request if it has already been completed.
  97695. //
  97696. // For example, consider a situation where you make an initial request
  97697. // and the request times out. If you make the request again with the
  97698. // same request ID, the server can check if original operation with the
  97699. // same request ID was received, and if so, will ignore the second
  97700. // request. This prevents clients from accidentally creating duplicate
  97701. // commitments.
  97702. //
  97703. // The request ID must be a valid UUID with the exception that zero UUID
  97704. // is not supported (00000000-0000-0000-0000-000000000000).
  97705. func (c *ResourcePoliciesInsertCall) RequestId(requestId string) *ResourcePoliciesInsertCall {
  97706. c.urlParams_.Set("requestId", requestId)
  97707. return c
  97708. }
  97709. // Fields allows partial responses to be retrieved. See
  97710. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  97711. // for more information.
  97712. func (c *ResourcePoliciesInsertCall) Fields(s ...googleapi.Field) *ResourcePoliciesInsertCall {
  97713. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  97714. return c
  97715. }
  97716. // Context sets the context to be used in this call's Do method. Any
  97717. // pending HTTP request will be aborted if the provided context is
  97718. // canceled.
  97719. func (c *ResourcePoliciesInsertCall) Context(ctx context.Context) *ResourcePoliciesInsertCall {
  97720. c.ctx_ = ctx
  97721. return c
  97722. }
  97723. // Header returns an http.Header that can be modified by the caller to
  97724. // add HTTP headers to the request.
  97725. func (c *ResourcePoliciesInsertCall) Header() http.Header {
  97726. if c.header_ == nil {
  97727. c.header_ = make(http.Header)
  97728. }
  97729. return c.header_
  97730. }
  97731. func (c *ResourcePoliciesInsertCall) doRequest(alt string) (*http.Response, error) {
  97732. reqHeaders := make(http.Header)
  97733. for k, v := range c.header_ {
  97734. reqHeaders[k] = v
  97735. }
  97736. reqHeaders.Set("User-Agent", c.s.userAgent())
  97737. var body io.Reader = nil
  97738. body, err := googleapi.WithoutDataWrapper.JSONReader(c.resourcepolicy)
  97739. if err != nil {
  97740. return nil, err
  97741. }
  97742. reqHeaders.Set("Content-Type", "application/json")
  97743. c.urlParams_.Set("alt", alt)
  97744. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/resourcePolicies")
  97745. urls += "?" + c.urlParams_.Encode()
  97746. req, _ := http.NewRequest("POST", urls, body)
  97747. req.Header = reqHeaders
  97748. googleapi.Expand(req.URL, map[string]string{
  97749. "project": c.project,
  97750. "region": c.region,
  97751. })
  97752. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  97753. }
  97754. // Do executes the "compute.resourcePolicies.insert" call.
  97755. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  97756. // status code is an error. Response headers are in either
  97757. // *Operation.ServerResponse.Header or (if a response was returned at
  97758. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  97759. // to check whether the returned error was because
  97760. // http.StatusNotModified was returned.
  97761. func (c *ResourcePoliciesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  97762. gensupport.SetOptions(c.urlParams_, opts...)
  97763. res, err := c.doRequest("json")
  97764. if res != nil && res.StatusCode == http.StatusNotModified {
  97765. if res.Body != nil {
  97766. res.Body.Close()
  97767. }
  97768. return nil, &googleapi.Error{
  97769. Code: res.StatusCode,
  97770. Header: res.Header,
  97771. }
  97772. }
  97773. if err != nil {
  97774. return nil, err
  97775. }
  97776. defer googleapi.CloseBody(res)
  97777. if err := googleapi.CheckResponse(res); err != nil {
  97778. return nil, err
  97779. }
  97780. ret := &Operation{
  97781. ServerResponse: googleapi.ServerResponse{
  97782. Header: res.Header,
  97783. HTTPStatusCode: res.StatusCode,
  97784. },
  97785. }
  97786. target := &ret
  97787. if err := gensupport.DecodeResponse(target, res); err != nil {
  97788. return nil, err
  97789. }
  97790. return ret, nil
  97791. // {
  97792. // "description": "Creates a new resource policy.",
  97793. // "httpMethod": "POST",
  97794. // "id": "compute.resourcePolicies.insert",
  97795. // "parameterOrder": [
  97796. // "project",
  97797. // "region"
  97798. // ],
  97799. // "parameters": {
  97800. // "project": {
  97801. // "description": "Project ID for this request.",
  97802. // "location": "path",
  97803. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  97804. // "required": true,
  97805. // "type": "string"
  97806. // },
  97807. // "region": {
  97808. // "description": "Name of the region for this request.",
  97809. // "location": "path",
  97810. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  97811. // "required": true,
  97812. // "type": "string"
  97813. // },
  97814. // "requestId": {
  97815. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  97816. // "location": "query",
  97817. // "type": "string"
  97818. // }
  97819. // },
  97820. // "path": "{project}/regions/{region}/resourcePolicies",
  97821. // "request": {
  97822. // "$ref": "ResourcePolicy"
  97823. // },
  97824. // "response": {
  97825. // "$ref": "Operation"
  97826. // },
  97827. // "scopes": [
  97828. // "https://www.googleapis.com/auth/cloud-platform",
  97829. // "https://www.googleapis.com/auth/compute"
  97830. // ]
  97831. // }
  97832. }
  97833. // method id "compute.resourcePolicies.list":
  97834. type ResourcePoliciesListCall struct {
  97835. s *Service
  97836. project string
  97837. region string
  97838. urlParams_ gensupport.URLParams
  97839. ifNoneMatch_ string
  97840. ctx_ context.Context
  97841. header_ http.Header
  97842. }
  97843. // List: A list all the resource policies that have been configured for
  97844. // the specified project in specified region.
  97845. func (r *ResourcePoliciesService) List(project string, region string) *ResourcePoliciesListCall {
  97846. c := &ResourcePoliciesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  97847. c.project = project
  97848. c.region = region
  97849. return c
  97850. }
  97851. // Filter sets the optional parameter "filter": A filter expression that
  97852. // filters resources listed in the response. The expression must specify
  97853. // the field name, a comparison operator, and the value that you want to
  97854. // use for filtering. The value must be a string, a number, or a
  97855. // boolean. The comparison operator must be either =, !=, >, or <.
  97856. //
  97857. // For example, if you are filtering Compute Engine instances, you can
  97858. // exclude instances named example-instance by specifying name !=
  97859. // example-instance.
  97860. //
  97861. // You can also filter nested fields. For example, you could specify
  97862. // scheduling.automaticRestart = false to include instances only if they
  97863. // are not scheduled for automatic restarts. You can use filtering on
  97864. // nested fields to filter based on resource labels.
  97865. //
  97866. // To filter on multiple expressions, provide each separate expression
  97867. // within parentheses. For example, (scheduling.automaticRestart = true)
  97868. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  97869. // AND expression. However, you can include AND and OR expressions
  97870. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  97871. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  97872. // true).
  97873. func (c *ResourcePoliciesListCall) Filter(filter string) *ResourcePoliciesListCall {
  97874. c.urlParams_.Set("filter", filter)
  97875. return c
  97876. }
  97877. // MaxResults sets the optional parameter "maxResults": The maximum
  97878. // number of results per page that should be returned. If the number of
  97879. // available results is larger than maxResults, Compute Engine returns a
  97880. // nextPageToken that can be used to get the next page of results in
  97881. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  97882. // (Default: 500)
  97883. func (c *ResourcePoliciesListCall) MaxResults(maxResults int64) *ResourcePoliciesListCall {
  97884. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  97885. return c
  97886. }
  97887. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  97888. // a certain order. By default, results are returned in alphanumerical
  97889. // order based on the resource name.
  97890. //
  97891. // You can also sort results in descending order based on the creation
  97892. // timestamp using orderBy="creationTimestamp desc". This sorts results
  97893. // based on the creationTimestamp field in reverse chronological order
  97894. // (newest result first). Use this to sort resources like operations so
  97895. // that the newest operation is returned first.
  97896. //
  97897. // Currently, only sorting by name or creationTimestamp desc is
  97898. // supported.
  97899. func (c *ResourcePoliciesListCall) OrderBy(orderBy string) *ResourcePoliciesListCall {
  97900. c.urlParams_.Set("orderBy", orderBy)
  97901. return c
  97902. }
  97903. // PageToken sets the optional parameter "pageToken": Specifies a page
  97904. // token to use. Set pageToken to the nextPageToken returned by a
  97905. // previous list request to get the next page of results.
  97906. func (c *ResourcePoliciesListCall) PageToken(pageToken string) *ResourcePoliciesListCall {
  97907. c.urlParams_.Set("pageToken", pageToken)
  97908. return c
  97909. }
  97910. // Fields allows partial responses to be retrieved. See
  97911. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  97912. // for more information.
  97913. func (c *ResourcePoliciesListCall) Fields(s ...googleapi.Field) *ResourcePoliciesListCall {
  97914. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  97915. return c
  97916. }
  97917. // IfNoneMatch sets the optional parameter which makes the operation
  97918. // fail if the object's ETag matches the given value. This is useful for
  97919. // getting updates only after the object has changed since the last
  97920. // request. Use googleapi.IsNotModified to check whether the response
  97921. // error from Do is the result of In-None-Match.
  97922. func (c *ResourcePoliciesListCall) IfNoneMatch(entityTag string) *ResourcePoliciesListCall {
  97923. c.ifNoneMatch_ = entityTag
  97924. return c
  97925. }
  97926. // Context sets the context to be used in this call's Do method. Any
  97927. // pending HTTP request will be aborted if the provided context is
  97928. // canceled.
  97929. func (c *ResourcePoliciesListCall) Context(ctx context.Context) *ResourcePoliciesListCall {
  97930. c.ctx_ = ctx
  97931. return c
  97932. }
  97933. // Header returns an http.Header that can be modified by the caller to
  97934. // add HTTP headers to the request.
  97935. func (c *ResourcePoliciesListCall) Header() http.Header {
  97936. if c.header_ == nil {
  97937. c.header_ = make(http.Header)
  97938. }
  97939. return c.header_
  97940. }
  97941. func (c *ResourcePoliciesListCall) doRequest(alt string) (*http.Response, error) {
  97942. reqHeaders := make(http.Header)
  97943. for k, v := range c.header_ {
  97944. reqHeaders[k] = v
  97945. }
  97946. reqHeaders.Set("User-Agent", c.s.userAgent())
  97947. if c.ifNoneMatch_ != "" {
  97948. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  97949. }
  97950. var body io.Reader = nil
  97951. c.urlParams_.Set("alt", alt)
  97952. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/resourcePolicies")
  97953. urls += "?" + c.urlParams_.Encode()
  97954. req, _ := http.NewRequest("GET", urls, body)
  97955. req.Header = reqHeaders
  97956. googleapi.Expand(req.URL, map[string]string{
  97957. "project": c.project,
  97958. "region": c.region,
  97959. })
  97960. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  97961. }
  97962. // Do executes the "compute.resourcePolicies.list" call.
  97963. // Exactly one of *ResourcePoliciesList or error will be non-nil. Any
  97964. // non-2xx status code is an error. Response headers are in either
  97965. // *ResourcePoliciesList.ServerResponse.Header or (if a response was
  97966. // returned at all) in error.(*googleapi.Error).Header. Use
  97967. // googleapi.IsNotModified to check whether the returned error was
  97968. // because http.StatusNotModified was returned.
  97969. func (c *ResourcePoliciesListCall) Do(opts ...googleapi.CallOption) (*ResourcePoliciesList, error) {
  97970. gensupport.SetOptions(c.urlParams_, opts...)
  97971. res, err := c.doRequest("json")
  97972. if res != nil && res.StatusCode == http.StatusNotModified {
  97973. if res.Body != nil {
  97974. res.Body.Close()
  97975. }
  97976. return nil, &googleapi.Error{
  97977. Code: res.StatusCode,
  97978. Header: res.Header,
  97979. }
  97980. }
  97981. if err != nil {
  97982. return nil, err
  97983. }
  97984. defer googleapi.CloseBody(res)
  97985. if err := googleapi.CheckResponse(res); err != nil {
  97986. return nil, err
  97987. }
  97988. ret := &ResourcePoliciesList{
  97989. ServerResponse: googleapi.ServerResponse{
  97990. Header: res.Header,
  97991. HTTPStatusCode: res.StatusCode,
  97992. },
  97993. }
  97994. target := &ret
  97995. if err := gensupport.DecodeResponse(target, res); err != nil {
  97996. return nil, err
  97997. }
  97998. return ret, nil
  97999. // {
  98000. // "description": "A list all the resource policies that have been configured for the specified project in specified region.",
  98001. // "httpMethod": "GET",
  98002. // "id": "compute.resourcePolicies.list",
  98003. // "parameterOrder": [
  98004. // "project",
  98005. // "region"
  98006. // ],
  98007. // "parameters": {
  98008. // "filter": {
  98009. // "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).",
  98010. // "location": "query",
  98011. // "type": "string"
  98012. // },
  98013. // "maxResults": {
  98014. // "default": "500",
  98015. // "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)",
  98016. // "format": "uint32",
  98017. // "location": "query",
  98018. // "minimum": "0",
  98019. // "type": "integer"
  98020. // },
  98021. // "orderBy": {
  98022. // "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.",
  98023. // "location": "query",
  98024. // "type": "string"
  98025. // },
  98026. // "pageToken": {
  98027. // "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.",
  98028. // "location": "query",
  98029. // "type": "string"
  98030. // },
  98031. // "project": {
  98032. // "description": "Project ID for this request.",
  98033. // "location": "path",
  98034. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  98035. // "required": true,
  98036. // "type": "string"
  98037. // },
  98038. // "region": {
  98039. // "description": "Name of the region for this request.",
  98040. // "location": "path",
  98041. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  98042. // "required": true,
  98043. // "type": "string"
  98044. // }
  98045. // },
  98046. // "path": "{project}/regions/{region}/resourcePolicies",
  98047. // "response": {
  98048. // "$ref": "ResourcePoliciesList"
  98049. // },
  98050. // "scopes": [
  98051. // "https://www.googleapis.com/auth/cloud-platform",
  98052. // "https://www.googleapis.com/auth/compute",
  98053. // "https://www.googleapis.com/auth/compute.readonly"
  98054. // ]
  98055. // }
  98056. }
  98057. // Pages invokes f for each page of results.
  98058. // A non-nil error returned from f will halt the iteration.
  98059. // The provided context supersedes any context provided to the Context method.
  98060. func (c *ResourcePoliciesListCall) Pages(ctx context.Context, f func(*ResourcePoliciesList) error) error {
  98061. c.ctx_ = ctx
  98062. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  98063. for {
  98064. x, err := c.Do()
  98065. if err != nil {
  98066. return err
  98067. }
  98068. if err := f(x); err != nil {
  98069. return err
  98070. }
  98071. if x.NextPageToken == "" {
  98072. return nil
  98073. }
  98074. c.PageToken(x.NextPageToken)
  98075. }
  98076. }
  98077. // method id "compute.resourcePolicies.setIamPolicy":
  98078. type ResourcePoliciesSetIamPolicyCall struct {
  98079. s *Service
  98080. project string
  98081. region string
  98082. resource string
  98083. regionsetpolicyrequest *RegionSetPolicyRequest
  98084. urlParams_ gensupport.URLParams
  98085. ctx_ context.Context
  98086. header_ http.Header
  98087. }
  98088. // SetIamPolicy: Sets the access control policy on the specified
  98089. // resource. Replaces any existing policy.
  98090. func (r *ResourcePoliciesService) SetIamPolicy(project string, region string, resource string, regionsetpolicyrequest *RegionSetPolicyRequest) *ResourcePoliciesSetIamPolicyCall {
  98091. c := &ResourcePoliciesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  98092. c.project = project
  98093. c.region = region
  98094. c.resource = resource
  98095. c.regionsetpolicyrequest = regionsetpolicyrequest
  98096. return c
  98097. }
  98098. // Fields allows partial responses to be retrieved. See
  98099. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  98100. // for more information.
  98101. func (c *ResourcePoliciesSetIamPolicyCall) Fields(s ...googleapi.Field) *ResourcePoliciesSetIamPolicyCall {
  98102. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  98103. return c
  98104. }
  98105. // Context sets the context to be used in this call's Do method. Any
  98106. // pending HTTP request will be aborted if the provided context is
  98107. // canceled.
  98108. func (c *ResourcePoliciesSetIamPolicyCall) Context(ctx context.Context) *ResourcePoliciesSetIamPolicyCall {
  98109. c.ctx_ = ctx
  98110. return c
  98111. }
  98112. // Header returns an http.Header that can be modified by the caller to
  98113. // add HTTP headers to the request.
  98114. func (c *ResourcePoliciesSetIamPolicyCall) Header() http.Header {
  98115. if c.header_ == nil {
  98116. c.header_ = make(http.Header)
  98117. }
  98118. return c.header_
  98119. }
  98120. func (c *ResourcePoliciesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  98121. reqHeaders := make(http.Header)
  98122. for k, v := range c.header_ {
  98123. reqHeaders[k] = v
  98124. }
  98125. reqHeaders.Set("User-Agent", c.s.userAgent())
  98126. var body io.Reader = nil
  98127. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest)
  98128. if err != nil {
  98129. return nil, err
  98130. }
  98131. reqHeaders.Set("Content-Type", "application/json")
  98132. c.urlParams_.Set("alt", alt)
  98133. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/resourcePolicies/{resource}/setIamPolicy")
  98134. urls += "?" + c.urlParams_.Encode()
  98135. req, _ := http.NewRequest("POST", urls, body)
  98136. req.Header = reqHeaders
  98137. googleapi.Expand(req.URL, map[string]string{
  98138. "project": c.project,
  98139. "region": c.region,
  98140. "resource": c.resource,
  98141. })
  98142. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  98143. }
  98144. // Do executes the "compute.resourcePolicies.setIamPolicy" call.
  98145. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  98146. // code is an error. Response headers are in either
  98147. // *Policy.ServerResponse.Header or (if a response was returned at all)
  98148. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  98149. // check whether the returned error was because http.StatusNotModified
  98150. // was returned.
  98151. func (c *ResourcePoliciesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  98152. gensupport.SetOptions(c.urlParams_, opts...)
  98153. res, err := c.doRequest("json")
  98154. if res != nil && res.StatusCode == http.StatusNotModified {
  98155. if res.Body != nil {
  98156. res.Body.Close()
  98157. }
  98158. return nil, &googleapi.Error{
  98159. Code: res.StatusCode,
  98160. Header: res.Header,
  98161. }
  98162. }
  98163. if err != nil {
  98164. return nil, err
  98165. }
  98166. defer googleapi.CloseBody(res)
  98167. if err := googleapi.CheckResponse(res); err != nil {
  98168. return nil, err
  98169. }
  98170. ret := &Policy{
  98171. ServerResponse: googleapi.ServerResponse{
  98172. Header: res.Header,
  98173. HTTPStatusCode: res.StatusCode,
  98174. },
  98175. }
  98176. target := &ret
  98177. if err := gensupport.DecodeResponse(target, res); err != nil {
  98178. return nil, err
  98179. }
  98180. return ret, nil
  98181. // {
  98182. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  98183. // "httpMethod": "POST",
  98184. // "id": "compute.resourcePolicies.setIamPolicy",
  98185. // "parameterOrder": [
  98186. // "project",
  98187. // "region",
  98188. // "resource"
  98189. // ],
  98190. // "parameters": {
  98191. // "project": {
  98192. // "description": "Project ID for this request.",
  98193. // "location": "path",
  98194. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  98195. // "required": true,
  98196. // "type": "string"
  98197. // },
  98198. // "region": {
  98199. // "description": "The name of the region for this request.",
  98200. // "location": "path",
  98201. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  98202. // "required": true,
  98203. // "type": "string"
  98204. // },
  98205. // "resource": {
  98206. // "description": "Name of the resource for this request.",
  98207. // "location": "path",
  98208. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  98209. // "required": true,
  98210. // "type": "string"
  98211. // }
  98212. // },
  98213. // "path": "{project}/regions/{region}/resourcePolicies/{resource}/setIamPolicy",
  98214. // "request": {
  98215. // "$ref": "RegionSetPolicyRequest"
  98216. // },
  98217. // "response": {
  98218. // "$ref": "Policy"
  98219. // },
  98220. // "scopes": [
  98221. // "https://www.googleapis.com/auth/cloud-platform",
  98222. // "https://www.googleapis.com/auth/compute"
  98223. // ]
  98224. // }
  98225. }
  98226. // method id "compute.resourcePolicies.testIamPermissions":
  98227. type ResourcePoliciesTestIamPermissionsCall struct {
  98228. s *Service
  98229. project string
  98230. region string
  98231. resource string
  98232. testpermissionsrequest *TestPermissionsRequest
  98233. urlParams_ gensupport.URLParams
  98234. ctx_ context.Context
  98235. header_ http.Header
  98236. }
  98237. // TestIamPermissions: Returns permissions that a caller has on the
  98238. // specified resource.
  98239. func (r *ResourcePoliciesService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *ResourcePoliciesTestIamPermissionsCall {
  98240. c := &ResourcePoliciesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  98241. c.project = project
  98242. c.region = region
  98243. c.resource = resource
  98244. c.testpermissionsrequest = testpermissionsrequest
  98245. return c
  98246. }
  98247. // Fields allows partial responses to be retrieved. See
  98248. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  98249. // for more information.
  98250. func (c *ResourcePoliciesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ResourcePoliciesTestIamPermissionsCall {
  98251. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  98252. return c
  98253. }
  98254. // Context sets the context to be used in this call's Do method. Any
  98255. // pending HTTP request will be aborted if the provided context is
  98256. // canceled.
  98257. func (c *ResourcePoliciesTestIamPermissionsCall) Context(ctx context.Context) *ResourcePoliciesTestIamPermissionsCall {
  98258. c.ctx_ = ctx
  98259. return c
  98260. }
  98261. // Header returns an http.Header that can be modified by the caller to
  98262. // add HTTP headers to the request.
  98263. func (c *ResourcePoliciesTestIamPermissionsCall) Header() http.Header {
  98264. if c.header_ == nil {
  98265. c.header_ = make(http.Header)
  98266. }
  98267. return c.header_
  98268. }
  98269. func (c *ResourcePoliciesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  98270. reqHeaders := make(http.Header)
  98271. for k, v := range c.header_ {
  98272. reqHeaders[k] = v
  98273. }
  98274. reqHeaders.Set("User-Agent", c.s.userAgent())
  98275. var body io.Reader = nil
  98276. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  98277. if err != nil {
  98278. return nil, err
  98279. }
  98280. reqHeaders.Set("Content-Type", "application/json")
  98281. c.urlParams_.Set("alt", alt)
  98282. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/resourcePolicies/{resource}/testIamPermissions")
  98283. urls += "?" + c.urlParams_.Encode()
  98284. req, _ := http.NewRequest("POST", urls, body)
  98285. req.Header = reqHeaders
  98286. googleapi.Expand(req.URL, map[string]string{
  98287. "project": c.project,
  98288. "region": c.region,
  98289. "resource": c.resource,
  98290. })
  98291. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  98292. }
  98293. // Do executes the "compute.resourcePolicies.testIamPermissions" call.
  98294. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  98295. // non-2xx status code is an error. Response headers are in either
  98296. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  98297. // returned at all) in error.(*googleapi.Error).Header. Use
  98298. // googleapi.IsNotModified to check whether the returned error was
  98299. // because http.StatusNotModified was returned.
  98300. func (c *ResourcePoliciesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  98301. gensupport.SetOptions(c.urlParams_, opts...)
  98302. res, err := c.doRequest("json")
  98303. if res != nil && res.StatusCode == http.StatusNotModified {
  98304. if res.Body != nil {
  98305. res.Body.Close()
  98306. }
  98307. return nil, &googleapi.Error{
  98308. Code: res.StatusCode,
  98309. Header: res.Header,
  98310. }
  98311. }
  98312. if err != nil {
  98313. return nil, err
  98314. }
  98315. defer googleapi.CloseBody(res)
  98316. if err := googleapi.CheckResponse(res); err != nil {
  98317. return nil, err
  98318. }
  98319. ret := &TestPermissionsResponse{
  98320. ServerResponse: googleapi.ServerResponse{
  98321. Header: res.Header,
  98322. HTTPStatusCode: res.StatusCode,
  98323. },
  98324. }
  98325. target := &ret
  98326. if err := gensupport.DecodeResponse(target, res); err != nil {
  98327. return nil, err
  98328. }
  98329. return ret, nil
  98330. // {
  98331. // "description": "Returns permissions that a caller has on the specified resource.",
  98332. // "httpMethod": "POST",
  98333. // "id": "compute.resourcePolicies.testIamPermissions",
  98334. // "parameterOrder": [
  98335. // "project",
  98336. // "region",
  98337. // "resource"
  98338. // ],
  98339. // "parameters": {
  98340. // "project": {
  98341. // "description": "Project ID for this request.",
  98342. // "location": "path",
  98343. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  98344. // "required": true,
  98345. // "type": "string"
  98346. // },
  98347. // "region": {
  98348. // "description": "The name of the region for this request.",
  98349. // "location": "path",
  98350. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  98351. // "required": true,
  98352. // "type": "string"
  98353. // },
  98354. // "resource": {
  98355. // "description": "Name of the resource for this request.",
  98356. // "location": "path",
  98357. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  98358. // "required": true,
  98359. // "type": "string"
  98360. // }
  98361. // },
  98362. // "path": "{project}/regions/{region}/resourcePolicies/{resource}/testIamPermissions",
  98363. // "request": {
  98364. // "$ref": "TestPermissionsRequest"
  98365. // },
  98366. // "response": {
  98367. // "$ref": "TestPermissionsResponse"
  98368. // },
  98369. // "scopes": [
  98370. // "https://www.googleapis.com/auth/cloud-platform",
  98371. // "https://www.googleapis.com/auth/compute",
  98372. // "https://www.googleapis.com/auth/compute.readonly"
  98373. // ]
  98374. // }
  98375. }
  98376. // method id "compute.routers.aggregatedList":
  98377. type RoutersAggregatedListCall struct {
  98378. s *Service
  98379. project string
  98380. urlParams_ gensupport.URLParams
  98381. ifNoneMatch_ string
  98382. ctx_ context.Context
  98383. header_ http.Header
  98384. }
  98385. // AggregatedList: Retrieves an aggregated list of routers.
  98386. func (r *RoutersService) AggregatedList(project string) *RoutersAggregatedListCall {
  98387. c := &RoutersAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  98388. c.project = project
  98389. return c
  98390. }
  98391. // Filter sets the optional parameter "filter": A filter expression that
  98392. // filters resources listed in the response. The expression must specify
  98393. // the field name, a comparison operator, and the value that you want to
  98394. // use for filtering. The value must be a string, a number, or a
  98395. // boolean. The comparison operator must be either =, !=, >, or <.
  98396. //
  98397. // For example, if you are filtering Compute Engine instances, you can
  98398. // exclude instances named example-instance by specifying name !=
  98399. // example-instance.
  98400. //
  98401. // You can also filter nested fields. For example, you could specify
  98402. // scheduling.automaticRestart = false to include instances only if they
  98403. // are not scheduled for automatic restarts. You can use filtering on
  98404. // nested fields to filter based on resource labels.
  98405. //
  98406. // To filter on multiple expressions, provide each separate expression
  98407. // within parentheses. For example, (scheduling.automaticRestart = true)
  98408. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  98409. // AND expression. However, you can include AND and OR expressions
  98410. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  98411. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  98412. // true).
  98413. func (c *RoutersAggregatedListCall) Filter(filter string) *RoutersAggregatedListCall {
  98414. c.urlParams_.Set("filter", filter)
  98415. return c
  98416. }
  98417. // MaxResults sets the optional parameter "maxResults": The maximum
  98418. // number of results per page that should be returned. If the number of
  98419. // available results is larger than maxResults, Compute Engine returns a
  98420. // nextPageToken that can be used to get the next page of results in
  98421. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  98422. // (Default: 500)
  98423. func (c *RoutersAggregatedListCall) MaxResults(maxResults int64) *RoutersAggregatedListCall {
  98424. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  98425. return c
  98426. }
  98427. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  98428. // a certain order. By default, results are returned in alphanumerical
  98429. // order based on the resource name.
  98430. //
  98431. // You can also sort results in descending order based on the creation
  98432. // timestamp using orderBy="creationTimestamp desc". This sorts results
  98433. // based on the creationTimestamp field in reverse chronological order
  98434. // (newest result first). Use this to sort resources like operations so
  98435. // that the newest operation is returned first.
  98436. //
  98437. // Currently, only sorting by name or creationTimestamp desc is
  98438. // supported.
  98439. func (c *RoutersAggregatedListCall) OrderBy(orderBy string) *RoutersAggregatedListCall {
  98440. c.urlParams_.Set("orderBy", orderBy)
  98441. return c
  98442. }
  98443. // PageToken sets the optional parameter "pageToken": Specifies a page
  98444. // token to use. Set pageToken to the nextPageToken returned by a
  98445. // previous list request to get the next page of results.
  98446. func (c *RoutersAggregatedListCall) PageToken(pageToken string) *RoutersAggregatedListCall {
  98447. c.urlParams_.Set("pageToken", pageToken)
  98448. return c
  98449. }
  98450. // Fields allows partial responses to be retrieved. See
  98451. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  98452. // for more information.
  98453. func (c *RoutersAggregatedListCall) Fields(s ...googleapi.Field) *RoutersAggregatedListCall {
  98454. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  98455. return c
  98456. }
  98457. // IfNoneMatch sets the optional parameter which makes the operation
  98458. // fail if the object's ETag matches the given value. This is useful for
  98459. // getting updates only after the object has changed since the last
  98460. // request. Use googleapi.IsNotModified to check whether the response
  98461. // error from Do is the result of In-None-Match.
  98462. func (c *RoutersAggregatedListCall) IfNoneMatch(entityTag string) *RoutersAggregatedListCall {
  98463. c.ifNoneMatch_ = entityTag
  98464. return c
  98465. }
  98466. // Context sets the context to be used in this call's Do method. Any
  98467. // pending HTTP request will be aborted if the provided context is
  98468. // canceled.
  98469. func (c *RoutersAggregatedListCall) Context(ctx context.Context) *RoutersAggregatedListCall {
  98470. c.ctx_ = ctx
  98471. return c
  98472. }
  98473. // Header returns an http.Header that can be modified by the caller to
  98474. // add HTTP headers to the request.
  98475. func (c *RoutersAggregatedListCall) Header() http.Header {
  98476. if c.header_ == nil {
  98477. c.header_ = make(http.Header)
  98478. }
  98479. return c.header_
  98480. }
  98481. func (c *RoutersAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  98482. reqHeaders := make(http.Header)
  98483. for k, v := range c.header_ {
  98484. reqHeaders[k] = v
  98485. }
  98486. reqHeaders.Set("User-Agent", c.s.userAgent())
  98487. if c.ifNoneMatch_ != "" {
  98488. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  98489. }
  98490. var body io.Reader = nil
  98491. c.urlParams_.Set("alt", alt)
  98492. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/routers")
  98493. urls += "?" + c.urlParams_.Encode()
  98494. req, _ := http.NewRequest("GET", urls, body)
  98495. req.Header = reqHeaders
  98496. googleapi.Expand(req.URL, map[string]string{
  98497. "project": c.project,
  98498. })
  98499. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  98500. }
  98501. // Do executes the "compute.routers.aggregatedList" call.
  98502. // Exactly one of *RouterAggregatedList or error will be non-nil. Any
  98503. // non-2xx status code is an error. Response headers are in either
  98504. // *RouterAggregatedList.ServerResponse.Header or (if a response was
  98505. // returned at all) in error.(*googleapi.Error).Header. Use
  98506. // googleapi.IsNotModified to check whether the returned error was
  98507. // because http.StatusNotModified was returned.
  98508. func (c *RoutersAggregatedListCall) Do(opts ...googleapi.CallOption) (*RouterAggregatedList, error) {
  98509. gensupport.SetOptions(c.urlParams_, opts...)
  98510. res, err := c.doRequest("json")
  98511. if res != nil && res.StatusCode == http.StatusNotModified {
  98512. if res.Body != nil {
  98513. res.Body.Close()
  98514. }
  98515. return nil, &googleapi.Error{
  98516. Code: res.StatusCode,
  98517. Header: res.Header,
  98518. }
  98519. }
  98520. if err != nil {
  98521. return nil, err
  98522. }
  98523. defer googleapi.CloseBody(res)
  98524. if err := googleapi.CheckResponse(res); err != nil {
  98525. return nil, err
  98526. }
  98527. ret := &RouterAggregatedList{
  98528. ServerResponse: googleapi.ServerResponse{
  98529. Header: res.Header,
  98530. HTTPStatusCode: res.StatusCode,
  98531. },
  98532. }
  98533. target := &ret
  98534. if err := gensupport.DecodeResponse(target, res); err != nil {
  98535. return nil, err
  98536. }
  98537. return ret, nil
  98538. // {
  98539. // "description": "Retrieves an aggregated list of routers.",
  98540. // "httpMethod": "GET",
  98541. // "id": "compute.routers.aggregatedList",
  98542. // "parameterOrder": [
  98543. // "project"
  98544. // ],
  98545. // "parameters": {
  98546. // "filter": {
  98547. // "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).",
  98548. // "location": "query",
  98549. // "type": "string"
  98550. // },
  98551. // "maxResults": {
  98552. // "default": "500",
  98553. // "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)",
  98554. // "format": "uint32",
  98555. // "location": "query",
  98556. // "minimum": "0",
  98557. // "type": "integer"
  98558. // },
  98559. // "orderBy": {
  98560. // "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.",
  98561. // "location": "query",
  98562. // "type": "string"
  98563. // },
  98564. // "pageToken": {
  98565. // "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.",
  98566. // "location": "query",
  98567. // "type": "string"
  98568. // },
  98569. // "project": {
  98570. // "description": "Project ID for this request.",
  98571. // "location": "path",
  98572. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  98573. // "required": true,
  98574. // "type": "string"
  98575. // }
  98576. // },
  98577. // "path": "{project}/aggregated/routers",
  98578. // "response": {
  98579. // "$ref": "RouterAggregatedList"
  98580. // },
  98581. // "scopes": [
  98582. // "https://www.googleapis.com/auth/cloud-platform",
  98583. // "https://www.googleapis.com/auth/compute",
  98584. // "https://www.googleapis.com/auth/compute.readonly"
  98585. // ]
  98586. // }
  98587. }
  98588. // Pages invokes f for each page of results.
  98589. // A non-nil error returned from f will halt the iteration.
  98590. // The provided context supersedes any context provided to the Context method.
  98591. func (c *RoutersAggregatedListCall) Pages(ctx context.Context, f func(*RouterAggregatedList) error) error {
  98592. c.ctx_ = ctx
  98593. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  98594. for {
  98595. x, err := c.Do()
  98596. if err != nil {
  98597. return err
  98598. }
  98599. if err := f(x); err != nil {
  98600. return err
  98601. }
  98602. if x.NextPageToken == "" {
  98603. return nil
  98604. }
  98605. c.PageToken(x.NextPageToken)
  98606. }
  98607. }
  98608. // method id "compute.routers.delete":
  98609. type RoutersDeleteCall struct {
  98610. s *Service
  98611. project string
  98612. region string
  98613. router string
  98614. urlParams_ gensupport.URLParams
  98615. ctx_ context.Context
  98616. header_ http.Header
  98617. }
  98618. // Delete: Deletes the specified Router resource.
  98619. func (r *RoutersService) Delete(project string, region string, router string) *RoutersDeleteCall {
  98620. c := &RoutersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  98621. c.project = project
  98622. c.region = region
  98623. c.router = router
  98624. return c
  98625. }
  98626. // RequestId sets the optional parameter "requestId": An optional
  98627. // request ID to identify requests. Specify a unique request ID so that
  98628. // if you must retry your request, the server will know to ignore the
  98629. // request if it has already been completed.
  98630. //
  98631. // For example, consider a situation where you make an initial request
  98632. // and the request times out. If you make the request again with the
  98633. // same request ID, the server can check if original operation with the
  98634. // same request ID was received, and if so, will ignore the second
  98635. // request. This prevents clients from accidentally creating duplicate
  98636. // commitments.
  98637. //
  98638. // The request ID must be a valid UUID with the exception that zero UUID
  98639. // is not supported (00000000-0000-0000-0000-000000000000).
  98640. func (c *RoutersDeleteCall) RequestId(requestId string) *RoutersDeleteCall {
  98641. c.urlParams_.Set("requestId", requestId)
  98642. return c
  98643. }
  98644. // Fields allows partial responses to be retrieved. See
  98645. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  98646. // for more information.
  98647. func (c *RoutersDeleteCall) Fields(s ...googleapi.Field) *RoutersDeleteCall {
  98648. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  98649. return c
  98650. }
  98651. // Context sets the context to be used in this call's Do method. Any
  98652. // pending HTTP request will be aborted if the provided context is
  98653. // canceled.
  98654. func (c *RoutersDeleteCall) Context(ctx context.Context) *RoutersDeleteCall {
  98655. c.ctx_ = ctx
  98656. return c
  98657. }
  98658. // Header returns an http.Header that can be modified by the caller to
  98659. // add HTTP headers to the request.
  98660. func (c *RoutersDeleteCall) Header() http.Header {
  98661. if c.header_ == nil {
  98662. c.header_ = make(http.Header)
  98663. }
  98664. return c.header_
  98665. }
  98666. func (c *RoutersDeleteCall) doRequest(alt string) (*http.Response, error) {
  98667. reqHeaders := make(http.Header)
  98668. for k, v := range c.header_ {
  98669. reqHeaders[k] = v
  98670. }
  98671. reqHeaders.Set("User-Agent", c.s.userAgent())
  98672. var body io.Reader = nil
  98673. c.urlParams_.Set("alt", alt)
  98674. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}")
  98675. urls += "?" + c.urlParams_.Encode()
  98676. req, _ := http.NewRequest("DELETE", urls, body)
  98677. req.Header = reqHeaders
  98678. googleapi.Expand(req.URL, map[string]string{
  98679. "project": c.project,
  98680. "region": c.region,
  98681. "router": c.router,
  98682. })
  98683. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  98684. }
  98685. // Do executes the "compute.routers.delete" call.
  98686. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  98687. // status code is an error. Response headers are in either
  98688. // *Operation.ServerResponse.Header or (if a response was returned at
  98689. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  98690. // to check whether the returned error was because
  98691. // http.StatusNotModified was returned.
  98692. func (c *RoutersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  98693. gensupport.SetOptions(c.urlParams_, opts...)
  98694. res, err := c.doRequest("json")
  98695. if res != nil && res.StatusCode == http.StatusNotModified {
  98696. if res.Body != nil {
  98697. res.Body.Close()
  98698. }
  98699. return nil, &googleapi.Error{
  98700. Code: res.StatusCode,
  98701. Header: res.Header,
  98702. }
  98703. }
  98704. if err != nil {
  98705. return nil, err
  98706. }
  98707. defer googleapi.CloseBody(res)
  98708. if err := googleapi.CheckResponse(res); err != nil {
  98709. return nil, err
  98710. }
  98711. ret := &Operation{
  98712. ServerResponse: googleapi.ServerResponse{
  98713. Header: res.Header,
  98714. HTTPStatusCode: res.StatusCode,
  98715. },
  98716. }
  98717. target := &ret
  98718. if err := gensupport.DecodeResponse(target, res); err != nil {
  98719. return nil, err
  98720. }
  98721. return ret, nil
  98722. // {
  98723. // "description": "Deletes the specified Router resource.",
  98724. // "httpMethod": "DELETE",
  98725. // "id": "compute.routers.delete",
  98726. // "parameterOrder": [
  98727. // "project",
  98728. // "region",
  98729. // "router"
  98730. // ],
  98731. // "parameters": {
  98732. // "project": {
  98733. // "description": "Project ID for this request.",
  98734. // "location": "path",
  98735. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  98736. // "required": true,
  98737. // "type": "string"
  98738. // },
  98739. // "region": {
  98740. // "description": "Name of the region for this request.",
  98741. // "location": "path",
  98742. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  98743. // "required": true,
  98744. // "type": "string"
  98745. // },
  98746. // "requestId": {
  98747. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  98748. // "location": "query",
  98749. // "type": "string"
  98750. // },
  98751. // "router": {
  98752. // "description": "Name of the Router resource to delete.",
  98753. // "location": "path",
  98754. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  98755. // "required": true,
  98756. // "type": "string"
  98757. // }
  98758. // },
  98759. // "path": "{project}/regions/{region}/routers/{router}",
  98760. // "response": {
  98761. // "$ref": "Operation"
  98762. // },
  98763. // "scopes": [
  98764. // "https://www.googleapis.com/auth/cloud-platform",
  98765. // "https://www.googleapis.com/auth/compute"
  98766. // ]
  98767. // }
  98768. }
  98769. // method id "compute.routers.get":
  98770. type RoutersGetCall struct {
  98771. s *Service
  98772. project string
  98773. region string
  98774. router string
  98775. urlParams_ gensupport.URLParams
  98776. ifNoneMatch_ string
  98777. ctx_ context.Context
  98778. header_ http.Header
  98779. }
  98780. // Get: Returns the specified Router resource. Gets a list of available
  98781. // routers by making a list() request.
  98782. func (r *RoutersService) Get(project string, region string, router string) *RoutersGetCall {
  98783. c := &RoutersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  98784. c.project = project
  98785. c.region = region
  98786. c.router = router
  98787. return c
  98788. }
  98789. // Fields allows partial responses to be retrieved. See
  98790. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  98791. // for more information.
  98792. func (c *RoutersGetCall) Fields(s ...googleapi.Field) *RoutersGetCall {
  98793. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  98794. return c
  98795. }
  98796. // IfNoneMatch sets the optional parameter which makes the operation
  98797. // fail if the object's ETag matches the given value. This is useful for
  98798. // getting updates only after the object has changed since the last
  98799. // request. Use googleapi.IsNotModified to check whether the response
  98800. // error from Do is the result of In-None-Match.
  98801. func (c *RoutersGetCall) IfNoneMatch(entityTag string) *RoutersGetCall {
  98802. c.ifNoneMatch_ = entityTag
  98803. return c
  98804. }
  98805. // Context sets the context to be used in this call's Do method. Any
  98806. // pending HTTP request will be aborted if the provided context is
  98807. // canceled.
  98808. func (c *RoutersGetCall) Context(ctx context.Context) *RoutersGetCall {
  98809. c.ctx_ = ctx
  98810. return c
  98811. }
  98812. // Header returns an http.Header that can be modified by the caller to
  98813. // add HTTP headers to the request.
  98814. func (c *RoutersGetCall) Header() http.Header {
  98815. if c.header_ == nil {
  98816. c.header_ = make(http.Header)
  98817. }
  98818. return c.header_
  98819. }
  98820. func (c *RoutersGetCall) doRequest(alt string) (*http.Response, error) {
  98821. reqHeaders := make(http.Header)
  98822. for k, v := range c.header_ {
  98823. reqHeaders[k] = v
  98824. }
  98825. reqHeaders.Set("User-Agent", c.s.userAgent())
  98826. if c.ifNoneMatch_ != "" {
  98827. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  98828. }
  98829. var body io.Reader = nil
  98830. c.urlParams_.Set("alt", alt)
  98831. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}")
  98832. urls += "?" + c.urlParams_.Encode()
  98833. req, _ := http.NewRequest("GET", urls, body)
  98834. req.Header = reqHeaders
  98835. googleapi.Expand(req.URL, map[string]string{
  98836. "project": c.project,
  98837. "region": c.region,
  98838. "router": c.router,
  98839. })
  98840. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  98841. }
  98842. // Do executes the "compute.routers.get" call.
  98843. // Exactly one of *Router or error will be non-nil. Any non-2xx status
  98844. // code is an error. Response headers are in either
  98845. // *Router.ServerResponse.Header or (if a response was returned at all)
  98846. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  98847. // check whether the returned error was because http.StatusNotModified
  98848. // was returned.
  98849. func (c *RoutersGetCall) Do(opts ...googleapi.CallOption) (*Router, error) {
  98850. gensupport.SetOptions(c.urlParams_, opts...)
  98851. res, err := c.doRequest("json")
  98852. if res != nil && res.StatusCode == http.StatusNotModified {
  98853. if res.Body != nil {
  98854. res.Body.Close()
  98855. }
  98856. return nil, &googleapi.Error{
  98857. Code: res.StatusCode,
  98858. Header: res.Header,
  98859. }
  98860. }
  98861. if err != nil {
  98862. return nil, err
  98863. }
  98864. defer googleapi.CloseBody(res)
  98865. if err := googleapi.CheckResponse(res); err != nil {
  98866. return nil, err
  98867. }
  98868. ret := &Router{
  98869. ServerResponse: googleapi.ServerResponse{
  98870. Header: res.Header,
  98871. HTTPStatusCode: res.StatusCode,
  98872. },
  98873. }
  98874. target := &ret
  98875. if err := gensupport.DecodeResponse(target, res); err != nil {
  98876. return nil, err
  98877. }
  98878. return ret, nil
  98879. // {
  98880. // "description": "Returns the specified Router resource. Gets a list of available routers by making a list() request.",
  98881. // "httpMethod": "GET",
  98882. // "id": "compute.routers.get",
  98883. // "parameterOrder": [
  98884. // "project",
  98885. // "region",
  98886. // "router"
  98887. // ],
  98888. // "parameters": {
  98889. // "project": {
  98890. // "description": "Project ID for this request.",
  98891. // "location": "path",
  98892. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  98893. // "required": true,
  98894. // "type": "string"
  98895. // },
  98896. // "region": {
  98897. // "description": "Name of the region for this request.",
  98898. // "location": "path",
  98899. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  98900. // "required": true,
  98901. // "type": "string"
  98902. // },
  98903. // "router": {
  98904. // "description": "Name of the Router resource to return.",
  98905. // "location": "path",
  98906. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  98907. // "required": true,
  98908. // "type": "string"
  98909. // }
  98910. // },
  98911. // "path": "{project}/regions/{region}/routers/{router}",
  98912. // "response": {
  98913. // "$ref": "Router"
  98914. // },
  98915. // "scopes": [
  98916. // "https://www.googleapis.com/auth/cloud-platform",
  98917. // "https://www.googleapis.com/auth/compute",
  98918. // "https://www.googleapis.com/auth/compute.readonly"
  98919. // ]
  98920. // }
  98921. }
  98922. // method id "compute.routers.getRouterStatus":
  98923. type RoutersGetRouterStatusCall struct {
  98924. s *Service
  98925. project string
  98926. region string
  98927. router string
  98928. urlParams_ gensupport.URLParams
  98929. ifNoneMatch_ string
  98930. ctx_ context.Context
  98931. header_ http.Header
  98932. }
  98933. // GetRouterStatus: Retrieves runtime information of the specified
  98934. // router.
  98935. func (r *RoutersService) GetRouterStatus(project string, region string, router string) *RoutersGetRouterStatusCall {
  98936. c := &RoutersGetRouterStatusCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  98937. c.project = project
  98938. c.region = region
  98939. c.router = router
  98940. return c
  98941. }
  98942. // Fields allows partial responses to be retrieved. See
  98943. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  98944. // for more information.
  98945. func (c *RoutersGetRouterStatusCall) Fields(s ...googleapi.Field) *RoutersGetRouterStatusCall {
  98946. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  98947. return c
  98948. }
  98949. // IfNoneMatch sets the optional parameter which makes the operation
  98950. // fail if the object's ETag matches the given value. This is useful for
  98951. // getting updates only after the object has changed since the last
  98952. // request. Use googleapi.IsNotModified to check whether the response
  98953. // error from Do is the result of In-None-Match.
  98954. func (c *RoutersGetRouterStatusCall) IfNoneMatch(entityTag string) *RoutersGetRouterStatusCall {
  98955. c.ifNoneMatch_ = entityTag
  98956. return c
  98957. }
  98958. // Context sets the context to be used in this call's Do method. Any
  98959. // pending HTTP request will be aborted if the provided context is
  98960. // canceled.
  98961. func (c *RoutersGetRouterStatusCall) Context(ctx context.Context) *RoutersGetRouterStatusCall {
  98962. c.ctx_ = ctx
  98963. return c
  98964. }
  98965. // Header returns an http.Header that can be modified by the caller to
  98966. // add HTTP headers to the request.
  98967. func (c *RoutersGetRouterStatusCall) Header() http.Header {
  98968. if c.header_ == nil {
  98969. c.header_ = make(http.Header)
  98970. }
  98971. return c.header_
  98972. }
  98973. func (c *RoutersGetRouterStatusCall) doRequest(alt string) (*http.Response, error) {
  98974. reqHeaders := make(http.Header)
  98975. for k, v := range c.header_ {
  98976. reqHeaders[k] = v
  98977. }
  98978. reqHeaders.Set("User-Agent", c.s.userAgent())
  98979. if c.ifNoneMatch_ != "" {
  98980. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  98981. }
  98982. var body io.Reader = nil
  98983. c.urlParams_.Set("alt", alt)
  98984. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}/getRouterStatus")
  98985. urls += "?" + c.urlParams_.Encode()
  98986. req, _ := http.NewRequest("GET", urls, body)
  98987. req.Header = reqHeaders
  98988. googleapi.Expand(req.URL, map[string]string{
  98989. "project": c.project,
  98990. "region": c.region,
  98991. "router": c.router,
  98992. })
  98993. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  98994. }
  98995. // Do executes the "compute.routers.getRouterStatus" call.
  98996. // Exactly one of *RouterStatusResponse or error will be non-nil. Any
  98997. // non-2xx status code is an error. Response headers are in either
  98998. // *RouterStatusResponse.ServerResponse.Header or (if a response was
  98999. // returned at all) in error.(*googleapi.Error).Header. Use
  99000. // googleapi.IsNotModified to check whether the returned error was
  99001. // because http.StatusNotModified was returned.
  99002. func (c *RoutersGetRouterStatusCall) Do(opts ...googleapi.CallOption) (*RouterStatusResponse, error) {
  99003. gensupport.SetOptions(c.urlParams_, opts...)
  99004. res, err := c.doRequest("json")
  99005. if res != nil && res.StatusCode == http.StatusNotModified {
  99006. if res.Body != nil {
  99007. res.Body.Close()
  99008. }
  99009. return nil, &googleapi.Error{
  99010. Code: res.StatusCode,
  99011. Header: res.Header,
  99012. }
  99013. }
  99014. if err != nil {
  99015. return nil, err
  99016. }
  99017. defer googleapi.CloseBody(res)
  99018. if err := googleapi.CheckResponse(res); err != nil {
  99019. return nil, err
  99020. }
  99021. ret := &RouterStatusResponse{
  99022. ServerResponse: googleapi.ServerResponse{
  99023. Header: res.Header,
  99024. HTTPStatusCode: res.StatusCode,
  99025. },
  99026. }
  99027. target := &ret
  99028. if err := gensupport.DecodeResponse(target, res); err != nil {
  99029. return nil, err
  99030. }
  99031. return ret, nil
  99032. // {
  99033. // "description": "Retrieves runtime information of the specified router.",
  99034. // "httpMethod": "GET",
  99035. // "id": "compute.routers.getRouterStatus",
  99036. // "parameterOrder": [
  99037. // "project",
  99038. // "region",
  99039. // "router"
  99040. // ],
  99041. // "parameters": {
  99042. // "project": {
  99043. // "description": "Project ID for this request.",
  99044. // "location": "path",
  99045. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  99046. // "required": true,
  99047. // "type": "string"
  99048. // },
  99049. // "region": {
  99050. // "description": "Name of the region for this request.",
  99051. // "location": "path",
  99052. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  99053. // "required": true,
  99054. // "type": "string"
  99055. // },
  99056. // "router": {
  99057. // "description": "Name of the Router resource to query.",
  99058. // "location": "path",
  99059. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  99060. // "required": true,
  99061. // "type": "string"
  99062. // }
  99063. // },
  99064. // "path": "{project}/regions/{region}/routers/{router}/getRouterStatus",
  99065. // "response": {
  99066. // "$ref": "RouterStatusResponse"
  99067. // },
  99068. // "scopes": [
  99069. // "https://www.googleapis.com/auth/cloud-platform",
  99070. // "https://www.googleapis.com/auth/compute",
  99071. // "https://www.googleapis.com/auth/compute.readonly"
  99072. // ]
  99073. // }
  99074. }
  99075. // method id "compute.routers.insert":
  99076. type RoutersInsertCall struct {
  99077. s *Service
  99078. project string
  99079. region string
  99080. router *Router
  99081. urlParams_ gensupport.URLParams
  99082. ctx_ context.Context
  99083. header_ http.Header
  99084. }
  99085. // Insert: Creates a Router resource in the specified project and region
  99086. // using the data included in the request.
  99087. func (r *RoutersService) Insert(project string, region string, router *Router) *RoutersInsertCall {
  99088. c := &RoutersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  99089. c.project = project
  99090. c.region = region
  99091. c.router = router
  99092. return c
  99093. }
  99094. // RequestId sets the optional parameter "requestId": An optional
  99095. // request ID to identify requests. Specify a unique request ID so that
  99096. // if you must retry your request, the server will know to ignore the
  99097. // request if it has already been completed.
  99098. //
  99099. // For example, consider a situation where you make an initial request
  99100. // and the request times out. If you make the request again with the
  99101. // same request ID, the server can check if original operation with the
  99102. // same request ID was received, and if so, will ignore the second
  99103. // request. This prevents clients from accidentally creating duplicate
  99104. // commitments.
  99105. //
  99106. // The request ID must be a valid UUID with the exception that zero UUID
  99107. // is not supported (00000000-0000-0000-0000-000000000000).
  99108. func (c *RoutersInsertCall) RequestId(requestId string) *RoutersInsertCall {
  99109. c.urlParams_.Set("requestId", requestId)
  99110. return c
  99111. }
  99112. // Fields allows partial responses to be retrieved. See
  99113. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  99114. // for more information.
  99115. func (c *RoutersInsertCall) Fields(s ...googleapi.Field) *RoutersInsertCall {
  99116. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  99117. return c
  99118. }
  99119. // Context sets the context to be used in this call's Do method. Any
  99120. // pending HTTP request will be aborted if the provided context is
  99121. // canceled.
  99122. func (c *RoutersInsertCall) Context(ctx context.Context) *RoutersInsertCall {
  99123. c.ctx_ = ctx
  99124. return c
  99125. }
  99126. // Header returns an http.Header that can be modified by the caller to
  99127. // add HTTP headers to the request.
  99128. func (c *RoutersInsertCall) Header() http.Header {
  99129. if c.header_ == nil {
  99130. c.header_ = make(http.Header)
  99131. }
  99132. return c.header_
  99133. }
  99134. func (c *RoutersInsertCall) doRequest(alt string) (*http.Response, error) {
  99135. reqHeaders := make(http.Header)
  99136. for k, v := range c.header_ {
  99137. reqHeaders[k] = v
  99138. }
  99139. reqHeaders.Set("User-Agent", c.s.userAgent())
  99140. var body io.Reader = nil
  99141. body, err := googleapi.WithoutDataWrapper.JSONReader(c.router)
  99142. if err != nil {
  99143. return nil, err
  99144. }
  99145. reqHeaders.Set("Content-Type", "application/json")
  99146. c.urlParams_.Set("alt", alt)
  99147. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers")
  99148. urls += "?" + c.urlParams_.Encode()
  99149. req, _ := http.NewRequest("POST", urls, body)
  99150. req.Header = reqHeaders
  99151. googleapi.Expand(req.URL, map[string]string{
  99152. "project": c.project,
  99153. "region": c.region,
  99154. })
  99155. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  99156. }
  99157. // Do executes the "compute.routers.insert" call.
  99158. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  99159. // status code is an error. Response headers are in either
  99160. // *Operation.ServerResponse.Header or (if a response was returned at
  99161. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  99162. // to check whether the returned error was because
  99163. // http.StatusNotModified was returned.
  99164. func (c *RoutersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  99165. gensupport.SetOptions(c.urlParams_, opts...)
  99166. res, err := c.doRequest("json")
  99167. if res != nil && res.StatusCode == http.StatusNotModified {
  99168. if res.Body != nil {
  99169. res.Body.Close()
  99170. }
  99171. return nil, &googleapi.Error{
  99172. Code: res.StatusCode,
  99173. Header: res.Header,
  99174. }
  99175. }
  99176. if err != nil {
  99177. return nil, err
  99178. }
  99179. defer googleapi.CloseBody(res)
  99180. if err := googleapi.CheckResponse(res); err != nil {
  99181. return nil, err
  99182. }
  99183. ret := &Operation{
  99184. ServerResponse: googleapi.ServerResponse{
  99185. Header: res.Header,
  99186. HTTPStatusCode: res.StatusCode,
  99187. },
  99188. }
  99189. target := &ret
  99190. if err := gensupport.DecodeResponse(target, res); err != nil {
  99191. return nil, err
  99192. }
  99193. return ret, nil
  99194. // {
  99195. // "description": "Creates a Router resource in the specified project and region using the data included in the request.",
  99196. // "httpMethod": "POST",
  99197. // "id": "compute.routers.insert",
  99198. // "parameterOrder": [
  99199. // "project",
  99200. // "region"
  99201. // ],
  99202. // "parameters": {
  99203. // "project": {
  99204. // "description": "Project ID for this request.",
  99205. // "location": "path",
  99206. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  99207. // "required": true,
  99208. // "type": "string"
  99209. // },
  99210. // "region": {
  99211. // "description": "Name of the region for this request.",
  99212. // "location": "path",
  99213. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  99214. // "required": true,
  99215. // "type": "string"
  99216. // },
  99217. // "requestId": {
  99218. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  99219. // "location": "query",
  99220. // "type": "string"
  99221. // }
  99222. // },
  99223. // "path": "{project}/regions/{region}/routers",
  99224. // "request": {
  99225. // "$ref": "Router"
  99226. // },
  99227. // "response": {
  99228. // "$ref": "Operation"
  99229. // },
  99230. // "scopes": [
  99231. // "https://www.googleapis.com/auth/cloud-platform",
  99232. // "https://www.googleapis.com/auth/compute"
  99233. // ]
  99234. // }
  99235. }
  99236. // method id "compute.routers.list":
  99237. type RoutersListCall struct {
  99238. s *Service
  99239. project string
  99240. region string
  99241. urlParams_ gensupport.URLParams
  99242. ifNoneMatch_ string
  99243. ctx_ context.Context
  99244. header_ http.Header
  99245. }
  99246. // List: Retrieves a list of Router resources available to the specified
  99247. // project.
  99248. func (r *RoutersService) List(project string, region string) *RoutersListCall {
  99249. c := &RoutersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  99250. c.project = project
  99251. c.region = region
  99252. return c
  99253. }
  99254. // Filter sets the optional parameter "filter": A filter expression that
  99255. // filters resources listed in the response. The expression must specify
  99256. // the field name, a comparison operator, and the value that you want to
  99257. // use for filtering. The value must be a string, a number, or a
  99258. // boolean. The comparison operator must be either =, !=, >, or <.
  99259. //
  99260. // For example, if you are filtering Compute Engine instances, you can
  99261. // exclude instances named example-instance by specifying name !=
  99262. // example-instance.
  99263. //
  99264. // You can also filter nested fields. For example, you could specify
  99265. // scheduling.automaticRestart = false to include instances only if they
  99266. // are not scheduled for automatic restarts. You can use filtering on
  99267. // nested fields to filter based on resource labels.
  99268. //
  99269. // To filter on multiple expressions, provide each separate expression
  99270. // within parentheses. For example, (scheduling.automaticRestart = true)
  99271. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  99272. // AND expression. However, you can include AND and OR expressions
  99273. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  99274. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  99275. // true).
  99276. func (c *RoutersListCall) Filter(filter string) *RoutersListCall {
  99277. c.urlParams_.Set("filter", filter)
  99278. return c
  99279. }
  99280. // MaxResults sets the optional parameter "maxResults": The maximum
  99281. // number of results per page that should be returned. If the number of
  99282. // available results is larger than maxResults, Compute Engine returns a
  99283. // nextPageToken that can be used to get the next page of results in
  99284. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  99285. // (Default: 500)
  99286. func (c *RoutersListCall) MaxResults(maxResults int64) *RoutersListCall {
  99287. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  99288. return c
  99289. }
  99290. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  99291. // a certain order. By default, results are returned in alphanumerical
  99292. // order based on the resource name.
  99293. //
  99294. // You can also sort results in descending order based on the creation
  99295. // timestamp using orderBy="creationTimestamp desc". This sorts results
  99296. // based on the creationTimestamp field in reverse chronological order
  99297. // (newest result first). Use this to sort resources like operations so
  99298. // that the newest operation is returned first.
  99299. //
  99300. // Currently, only sorting by name or creationTimestamp desc is
  99301. // supported.
  99302. func (c *RoutersListCall) OrderBy(orderBy string) *RoutersListCall {
  99303. c.urlParams_.Set("orderBy", orderBy)
  99304. return c
  99305. }
  99306. // PageToken sets the optional parameter "pageToken": Specifies a page
  99307. // token to use. Set pageToken to the nextPageToken returned by a
  99308. // previous list request to get the next page of results.
  99309. func (c *RoutersListCall) PageToken(pageToken string) *RoutersListCall {
  99310. c.urlParams_.Set("pageToken", pageToken)
  99311. return c
  99312. }
  99313. // Fields allows partial responses to be retrieved. See
  99314. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  99315. // for more information.
  99316. func (c *RoutersListCall) Fields(s ...googleapi.Field) *RoutersListCall {
  99317. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  99318. return c
  99319. }
  99320. // IfNoneMatch sets the optional parameter which makes the operation
  99321. // fail if the object's ETag matches the given value. This is useful for
  99322. // getting updates only after the object has changed since the last
  99323. // request. Use googleapi.IsNotModified to check whether the response
  99324. // error from Do is the result of In-None-Match.
  99325. func (c *RoutersListCall) IfNoneMatch(entityTag string) *RoutersListCall {
  99326. c.ifNoneMatch_ = entityTag
  99327. return c
  99328. }
  99329. // Context sets the context to be used in this call's Do method. Any
  99330. // pending HTTP request will be aborted if the provided context is
  99331. // canceled.
  99332. func (c *RoutersListCall) Context(ctx context.Context) *RoutersListCall {
  99333. c.ctx_ = ctx
  99334. return c
  99335. }
  99336. // Header returns an http.Header that can be modified by the caller to
  99337. // add HTTP headers to the request.
  99338. func (c *RoutersListCall) Header() http.Header {
  99339. if c.header_ == nil {
  99340. c.header_ = make(http.Header)
  99341. }
  99342. return c.header_
  99343. }
  99344. func (c *RoutersListCall) doRequest(alt string) (*http.Response, error) {
  99345. reqHeaders := make(http.Header)
  99346. for k, v := range c.header_ {
  99347. reqHeaders[k] = v
  99348. }
  99349. reqHeaders.Set("User-Agent", c.s.userAgent())
  99350. if c.ifNoneMatch_ != "" {
  99351. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  99352. }
  99353. var body io.Reader = nil
  99354. c.urlParams_.Set("alt", alt)
  99355. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers")
  99356. urls += "?" + c.urlParams_.Encode()
  99357. req, _ := http.NewRequest("GET", urls, body)
  99358. req.Header = reqHeaders
  99359. googleapi.Expand(req.URL, map[string]string{
  99360. "project": c.project,
  99361. "region": c.region,
  99362. })
  99363. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  99364. }
  99365. // Do executes the "compute.routers.list" call.
  99366. // Exactly one of *RouterList or error will be non-nil. Any non-2xx
  99367. // status code is an error. Response headers are in either
  99368. // *RouterList.ServerResponse.Header or (if a response was returned at
  99369. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  99370. // to check whether the returned error was because
  99371. // http.StatusNotModified was returned.
  99372. func (c *RoutersListCall) Do(opts ...googleapi.CallOption) (*RouterList, error) {
  99373. gensupport.SetOptions(c.urlParams_, opts...)
  99374. res, err := c.doRequest("json")
  99375. if res != nil && res.StatusCode == http.StatusNotModified {
  99376. if res.Body != nil {
  99377. res.Body.Close()
  99378. }
  99379. return nil, &googleapi.Error{
  99380. Code: res.StatusCode,
  99381. Header: res.Header,
  99382. }
  99383. }
  99384. if err != nil {
  99385. return nil, err
  99386. }
  99387. defer googleapi.CloseBody(res)
  99388. if err := googleapi.CheckResponse(res); err != nil {
  99389. return nil, err
  99390. }
  99391. ret := &RouterList{
  99392. ServerResponse: googleapi.ServerResponse{
  99393. Header: res.Header,
  99394. HTTPStatusCode: res.StatusCode,
  99395. },
  99396. }
  99397. target := &ret
  99398. if err := gensupport.DecodeResponse(target, res); err != nil {
  99399. return nil, err
  99400. }
  99401. return ret, nil
  99402. // {
  99403. // "description": "Retrieves a list of Router resources available to the specified project.",
  99404. // "httpMethod": "GET",
  99405. // "id": "compute.routers.list",
  99406. // "parameterOrder": [
  99407. // "project",
  99408. // "region"
  99409. // ],
  99410. // "parameters": {
  99411. // "filter": {
  99412. // "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).",
  99413. // "location": "query",
  99414. // "type": "string"
  99415. // },
  99416. // "maxResults": {
  99417. // "default": "500",
  99418. // "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)",
  99419. // "format": "uint32",
  99420. // "location": "query",
  99421. // "minimum": "0",
  99422. // "type": "integer"
  99423. // },
  99424. // "orderBy": {
  99425. // "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.",
  99426. // "location": "query",
  99427. // "type": "string"
  99428. // },
  99429. // "pageToken": {
  99430. // "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.",
  99431. // "location": "query",
  99432. // "type": "string"
  99433. // },
  99434. // "project": {
  99435. // "description": "Project ID for this request.",
  99436. // "location": "path",
  99437. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  99438. // "required": true,
  99439. // "type": "string"
  99440. // },
  99441. // "region": {
  99442. // "description": "Name of the region for this request.",
  99443. // "location": "path",
  99444. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  99445. // "required": true,
  99446. // "type": "string"
  99447. // }
  99448. // },
  99449. // "path": "{project}/regions/{region}/routers",
  99450. // "response": {
  99451. // "$ref": "RouterList"
  99452. // },
  99453. // "scopes": [
  99454. // "https://www.googleapis.com/auth/cloud-platform",
  99455. // "https://www.googleapis.com/auth/compute",
  99456. // "https://www.googleapis.com/auth/compute.readonly"
  99457. // ]
  99458. // }
  99459. }
  99460. // Pages invokes f for each page of results.
  99461. // A non-nil error returned from f will halt the iteration.
  99462. // The provided context supersedes any context provided to the Context method.
  99463. func (c *RoutersListCall) Pages(ctx context.Context, f func(*RouterList) error) error {
  99464. c.ctx_ = ctx
  99465. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  99466. for {
  99467. x, err := c.Do()
  99468. if err != nil {
  99469. return err
  99470. }
  99471. if err := f(x); err != nil {
  99472. return err
  99473. }
  99474. if x.NextPageToken == "" {
  99475. return nil
  99476. }
  99477. c.PageToken(x.NextPageToken)
  99478. }
  99479. }
  99480. // method id "compute.routers.patch":
  99481. type RoutersPatchCall struct {
  99482. s *Service
  99483. project string
  99484. region string
  99485. router string
  99486. router2 *Router
  99487. urlParams_ gensupport.URLParams
  99488. ctx_ context.Context
  99489. header_ http.Header
  99490. }
  99491. // Patch: Patches the specified Router resource with the data included
  99492. // in the request. This method supports PATCH semantics and uses JSON
  99493. // merge patch format and processing rules.
  99494. func (r *RoutersService) Patch(project string, region string, router string, router2 *Router) *RoutersPatchCall {
  99495. c := &RoutersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  99496. c.project = project
  99497. c.region = region
  99498. c.router = router
  99499. c.router2 = router2
  99500. return c
  99501. }
  99502. // RequestId sets the optional parameter "requestId": An optional
  99503. // request ID to identify requests. Specify a unique request ID so that
  99504. // if you must retry your request, the server will know to ignore the
  99505. // request if it has already been completed.
  99506. //
  99507. // For example, consider a situation where you make an initial request
  99508. // and the request times out. If you make the request again with the
  99509. // same request ID, the server can check if original operation with the
  99510. // same request ID was received, and if so, will ignore the second
  99511. // request. This prevents clients from accidentally creating duplicate
  99512. // commitments.
  99513. //
  99514. // The request ID must be a valid UUID with the exception that zero UUID
  99515. // is not supported (00000000-0000-0000-0000-000000000000).
  99516. func (c *RoutersPatchCall) RequestId(requestId string) *RoutersPatchCall {
  99517. c.urlParams_.Set("requestId", requestId)
  99518. return c
  99519. }
  99520. // Fields allows partial responses to be retrieved. See
  99521. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  99522. // for more information.
  99523. func (c *RoutersPatchCall) Fields(s ...googleapi.Field) *RoutersPatchCall {
  99524. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  99525. return c
  99526. }
  99527. // Context sets the context to be used in this call's Do method. Any
  99528. // pending HTTP request will be aborted if the provided context is
  99529. // canceled.
  99530. func (c *RoutersPatchCall) Context(ctx context.Context) *RoutersPatchCall {
  99531. c.ctx_ = ctx
  99532. return c
  99533. }
  99534. // Header returns an http.Header that can be modified by the caller to
  99535. // add HTTP headers to the request.
  99536. func (c *RoutersPatchCall) Header() http.Header {
  99537. if c.header_ == nil {
  99538. c.header_ = make(http.Header)
  99539. }
  99540. return c.header_
  99541. }
  99542. func (c *RoutersPatchCall) doRequest(alt string) (*http.Response, error) {
  99543. reqHeaders := make(http.Header)
  99544. for k, v := range c.header_ {
  99545. reqHeaders[k] = v
  99546. }
  99547. reqHeaders.Set("User-Agent", c.s.userAgent())
  99548. var body io.Reader = nil
  99549. body, err := googleapi.WithoutDataWrapper.JSONReader(c.router2)
  99550. if err != nil {
  99551. return nil, err
  99552. }
  99553. reqHeaders.Set("Content-Type", "application/json")
  99554. c.urlParams_.Set("alt", alt)
  99555. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}")
  99556. urls += "?" + c.urlParams_.Encode()
  99557. req, _ := http.NewRequest("PATCH", urls, body)
  99558. req.Header = reqHeaders
  99559. googleapi.Expand(req.URL, map[string]string{
  99560. "project": c.project,
  99561. "region": c.region,
  99562. "router": c.router,
  99563. })
  99564. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  99565. }
  99566. // Do executes the "compute.routers.patch" call.
  99567. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  99568. // status code is an error. Response headers are in either
  99569. // *Operation.ServerResponse.Header or (if a response was returned at
  99570. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  99571. // to check whether the returned error was because
  99572. // http.StatusNotModified was returned.
  99573. func (c *RoutersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  99574. gensupport.SetOptions(c.urlParams_, opts...)
  99575. res, err := c.doRequest("json")
  99576. if res != nil && res.StatusCode == http.StatusNotModified {
  99577. if res.Body != nil {
  99578. res.Body.Close()
  99579. }
  99580. return nil, &googleapi.Error{
  99581. Code: res.StatusCode,
  99582. Header: res.Header,
  99583. }
  99584. }
  99585. if err != nil {
  99586. return nil, err
  99587. }
  99588. defer googleapi.CloseBody(res)
  99589. if err := googleapi.CheckResponse(res); err != nil {
  99590. return nil, err
  99591. }
  99592. ret := &Operation{
  99593. ServerResponse: googleapi.ServerResponse{
  99594. Header: res.Header,
  99595. HTTPStatusCode: res.StatusCode,
  99596. },
  99597. }
  99598. target := &ret
  99599. if err := gensupport.DecodeResponse(target, res); err != nil {
  99600. return nil, err
  99601. }
  99602. return ret, nil
  99603. // {
  99604. // "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.",
  99605. // "httpMethod": "PATCH",
  99606. // "id": "compute.routers.patch",
  99607. // "parameterOrder": [
  99608. // "project",
  99609. // "region",
  99610. // "router"
  99611. // ],
  99612. // "parameters": {
  99613. // "project": {
  99614. // "description": "Project ID for this request.",
  99615. // "location": "path",
  99616. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  99617. // "required": true,
  99618. // "type": "string"
  99619. // },
  99620. // "region": {
  99621. // "description": "Name of the region for this request.",
  99622. // "location": "path",
  99623. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  99624. // "required": true,
  99625. // "type": "string"
  99626. // },
  99627. // "requestId": {
  99628. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  99629. // "location": "query",
  99630. // "type": "string"
  99631. // },
  99632. // "router": {
  99633. // "description": "Name of the Router resource to patch.",
  99634. // "location": "path",
  99635. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  99636. // "required": true,
  99637. // "type": "string"
  99638. // }
  99639. // },
  99640. // "path": "{project}/regions/{region}/routers/{router}",
  99641. // "request": {
  99642. // "$ref": "Router"
  99643. // },
  99644. // "response": {
  99645. // "$ref": "Operation"
  99646. // },
  99647. // "scopes": [
  99648. // "https://www.googleapis.com/auth/cloud-platform",
  99649. // "https://www.googleapis.com/auth/compute"
  99650. // ]
  99651. // }
  99652. }
  99653. // method id "compute.routers.preview":
  99654. type RoutersPreviewCall struct {
  99655. s *Service
  99656. project string
  99657. region string
  99658. router string
  99659. router2 *Router
  99660. urlParams_ gensupport.URLParams
  99661. ctx_ context.Context
  99662. header_ http.Header
  99663. }
  99664. // Preview: Preview fields auto-generated during router create and
  99665. // update operations. Calling this method does NOT create or update the
  99666. // router.
  99667. func (r *RoutersService) Preview(project string, region string, router string, router2 *Router) *RoutersPreviewCall {
  99668. c := &RoutersPreviewCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  99669. c.project = project
  99670. c.region = region
  99671. c.router = router
  99672. c.router2 = router2
  99673. return c
  99674. }
  99675. // Fields allows partial responses to be retrieved. See
  99676. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  99677. // for more information.
  99678. func (c *RoutersPreviewCall) Fields(s ...googleapi.Field) *RoutersPreviewCall {
  99679. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  99680. return c
  99681. }
  99682. // Context sets the context to be used in this call's Do method. Any
  99683. // pending HTTP request will be aborted if the provided context is
  99684. // canceled.
  99685. func (c *RoutersPreviewCall) Context(ctx context.Context) *RoutersPreviewCall {
  99686. c.ctx_ = ctx
  99687. return c
  99688. }
  99689. // Header returns an http.Header that can be modified by the caller to
  99690. // add HTTP headers to the request.
  99691. func (c *RoutersPreviewCall) Header() http.Header {
  99692. if c.header_ == nil {
  99693. c.header_ = make(http.Header)
  99694. }
  99695. return c.header_
  99696. }
  99697. func (c *RoutersPreviewCall) doRequest(alt string) (*http.Response, error) {
  99698. reqHeaders := make(http.Header)
  99699. for k, v := range c.header_ {
  99700. reqHeaders[k] = v
  99701. }
  99702. reqHeaders.Set("User-Agent", c.s.userAgent())
  99703. var body io.Reader = nil
  99704. body, err := googleapi.WithoutDataWrapper.JSONReader(c.router2)
  99705. if err != nil {
  99706. return nil, err
  99707. }
  99708. reqHeaders.Set("Content-Type", "application/json")
  99709. c.urlParams_.Set("alt", alt)
  99710. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}/preview")
  99711. urls += "?" + c.urlParams_.Encode()
  99712. req, _ := http.NewRequest("POST", urls, body)
  99713. req.Header = reqHeaders
  99714. googleapi.Expand(req.URL, map[string]string{
  99715. "project": c.project,
  99716. "region": c.region,
  99717. "router": c.router,
  99718. })
  99719. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  99720. }
  99721. // Do executes the "compute.routers.preview" call.
  99722. // Exactly one of *RoutersPreviewResponse or error will be non-nil. Any
  99723. // non-2xx status code is an error. Response headers are in either
  99724. // *RoutersPreviewResponse.ServerResponse.Header or (if a response was
  99725. // returned at all) in error.(*googleapi.Error).Header. Use
  99726. // googleapi.IsNotModified to check whether the returned error was
  99727. // because http.StatusNotModified was returned.
  99728. func (c *RoutersPreviewCall) Do(opts ...googleapi.CallOption) (*RoutersPreviewResponse, error) {
  99729. gensupport.SetOptions(c.urlParams_, opts...)
  99730. res, err := c.doRequest("json")
  99731. if res != nil && res.StatusCode == http.StatusNotModified {
  99732. if res.Body != nil {
  99733. res.Body.Close()
  99734. }
  99735. return nil, &googleapi.Error{
  99736. Code: res.StatusCode,
  99737. Header: res.Header,
  99738. }
  99739. }
  99740. if err != nil {
  99741. return nil, err
  99742. }
  99743. defer googleapi.CloseBody(res)
  99744. if err := googleapi.CheckResponse(res); err != nil {
  99745. return nil, err
  99746. }
  99747. ret := &RoutersPreviewResponse{
  99748. ServerResponse: googleapi.ServerResponse{
  99749. Header: res.Header,
  99750. HTTPStatusCode: res.StatusCode,
  99751. },
  99752. }
  99753. target := &ret
  99754. if err := gensupport.DecodeResponse(target, res); err != nil {
  99755. return nil, err
  99756. }
  99757. return ret, nil
  99758. // {
  99759. // "description": "Preview fields auto-generated during router create and update operations. Calling this method does NOT create or update the router.",
  99760. // "httpMethod": "POST",
  99761. // "id": "compute.routers.preview",
  99762. // "parameterOrder": [
  99763. // "project",
  99764. // "region",
  99765. // "router"
  99766. // ],
  99767. // "parameters": {
  99768. // "project": {
  99769. // "description": "Project ID for this request.",
  99770. // "location": "path",
  99771. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  99772. // "required": true,
  99773. // "type": "string"
  99774. // },
  99775. // "region": {
  99776. // "description": "Name of the region for this request.",
  99777. // "location": "path",
  99778. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  99779. // "required": true,
  99780. // "type": "string"
  99781. // },
  99782. // "router": {
  99783. // "description": "Name of the Router resource to query.",
  99784. // "location": "path",
  99785. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  99786. // "required": true,
  99787. // "type": "string"
  99788. // }
  99789. // },
  99790. // "path": "{project}/regions/{region}/routers/{router}/preview",
  99791. // "request": {
  99792. // "$ref": "Router"
  99793. // },
  99794. // "response": {
  99795. // "$ref": "RoutersPreviewResponse"
  99796. // },
  99797. // "scopes": [
  99798. // "https://www.googleapis.com/auth/cloud-platform",
  99799. // "https://www.googleapis.com/auth/compute",
  99800. // "https://www.googleapis.com/auth/compute.readonly"
  99801. // ]
  99802. // }
  99803. }
  99804. // method id "compute.routers.testIamPermissions":
  99805. type RoutersTestIamPermissionsCall struct {
  99806. s *Service
  99807. project string
  99808. region string
  99809. resource string
  99810. testpermissionsrequest *TestPermissionsRequest
  99811. urlParams_ gensupport.URLParams
  99812. ctx_ context.Context
  99813. header_ http.Header
  99814. }
  99815. // TestIamPermissions: Returns permissions that a caller has on the
  99816. // specified resource.
  99817. func (r *RoutersService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RoutersTestIamPermissionsCall {
  99818. c := &RoutersTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  99819. c.project = project
  99820. c.region = region
  99821. c.resource = resource
  99822. c.testpermissionsrequest = testpermissionsrequest
  99823. return c
  99824. }
  99825. // Fields allows partial responses to be retrieved. See
  99826. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  99827. // for more information.
  99828. func (c *RoutersTestIamPermissionsCall) Fields(s ...googleapi.Field) *RoutersTestIamPermissionsCall {
  99829. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  99830. return c
  99831. }
  99832. // Context sets the context to be used in this call's Do method. Any
  99833. // pending HTTP request will be aborted if the provided context is
  99834. // canceled.
  99835. func (c *RoutersTestIamPermissionsCall) Context(ctx context.Context) *RoutersTestIamPermissionsCall {
  99836. c.ctx_ = ctx
  99837. return c
  99838. }
  99839. // Header returns an http.Header that can be modified by the caller to
  99840. // add HTTP headers to the request.
  99841. func (c *RoutersTestIamPermissionsCall) Header() http.Header {
  99842. if c.header_ == nil {
  99843. c.header_ = make(http.Header)
  99844. }
  99845. return c.header_
  99846. }
  99847. func (c *RoutersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  99848. reqHeaders := make(http.Header)
  99849. for k, v := range c.header_ {
  99850. reqHeaders[k] = v
  99851. }
  99852. reqHeaders.Set("User-Agent", c.s.userAgent())
  99853. var body io.Reader = nil
  99854. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  99855. if err != nil {
  99856. return nil, err
  99857. }
  99858. reqHeaders.Set("Content-Type", "application/json")
  99859. c.urlParams_.Set("alt", alt)
  99860. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{resource}/testIamPermissions")
  99861. urls += "?" + c.urlParams_.Encode()
  99862. req, _ := http.NewRequest("POST", urls, body)
  99863. req.Header = reqHeaders
  99864. googleapi.Expand(req.URL, map[string]string{
  99865. "project": c.project,
  99866. "region": c.region,
  99867. "resource": c.resource,
  99868. })
  99869. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  99870. }
  99871. // Do executes the "compute.routers.testIamPermissions" call.
  99872. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  99873. // non-2xx status code is an error. Response headers are in either
  99874. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  99875. // returned at all) in error.(*googleapi.Error).Header. Use
  99876. // googleapi.IsNotModified to check whether the returned error was
  99877. // because http.StatusNotModified was returned.
  99878. func (c *RoutersTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  99879. gensupport.SetOptions(c.urlParams_, opts...)
  99880. res, err := c.doRequest("json")
  99881. if res != nil && res.StatusCode == http.StatusNotModified {
  99882. if res.Body != nil {
  99883. res.Body.Close()
  99884. }
  99885. return nil, &googleapi.Error{
  99886. Code: res.StatusCode,
  99887. Header: res.Header,
  99888. }
  99889. }
  99890. if err != nil {
  99891. return nil, err
  99892. }
  99893. defer googleapi.CloseBody(res)
  99894. if err := googleapi.CheckResponse(res); err != nil {
  99895. return nil, err
  99896. }
  99897. ret := &TestPermissionsResponse{
  99898. ServerResponse: googleapi.ServerResponse{
  99899. Header: res.Header,
  99900. HTTPStatusCode: res.StatusCode,
  99901. },
  99902. }
  99903. target := &ret
  99904. if err := gensupport.DecodeResponse(target, res); err != nil {
  99905. return nil, err
  99906. }
  99907. return ret, nil
  99908. // {
  99909. // "description": "Returns permissions that a caller has on the specified resource.",
  99910. // "httpMethod": "POST",
  99911. // "id": "compute.routers.testIamPermissions",
  99912. // "parameterOrder": [
  99913. // "project",
  99914. // "region",
  99915. // "resource"
  99916. // ],
  99917. // "parameters": {
  99918. // "project": {
  99919. // "description": "Project ID for this request.",
  99920. // "location": "path",
  99921. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  99922. // "required": true,
  99923. // "type": "string"
  99924. // },
  99925. // "region": {
  99926. // "description": "The name of the region for this request.",
  99927. // "location": "path",
  99928. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  99929. // "required": true,
  99930. // "type": "string"
  99931. // },
  99932. // "resource": {
  99933. // "description": "Name of the resource for this request.",
  99934. // "location": "path",
  99935. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  99936. // "required": true,
  99937. // "type": "string"
  99938. // }
  99939. // },
  99940. // "path": "{project}/regions/{region}/routers/{resource}/testIamPermissions",
  99941. // "request": {
  99942. // "$ref": "TestPermissionsRequest"
  99943. // },
  99944. // "response": {
  99945. // "$ref": "TestPermissionsResponse"
  99946. // },
  99947. // "scopes": [
  99948. // "https://www.googleapis.com/auth/cloud-platform",
  99949. // "https://www.googleapis.com/auth/compute",
  99950. // "https://www.googleapis.com/auth/compute.readonly"
  99951. // ]
  99952. // }
  99953. }
  99954. // method id "compute.routers.update":
  99955. type RoutersUpdateCall struct {
  99956. s *Service
  99957. project string
  99958. region string
  99959. router string
  99960. router2 *Router
  99961. urlParams_ gensupport.URLParams
  99962. ctx_ context.Context
  99963. header_ http.Header
  99964. }
  99965. // Update: Updates the specified Router resource with the data included
  99966. // in the request.
  99967. func (r *RoutersService) Update(project string, region string, router string, router2 *Router) *RoutersUpdateCall {
  99968. c := &RoutersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  99969. c.project = project
  99970. c.region = region
  99971. c.router = router
  99972. c.router2 = router2
  99973. return c
  99974. }
  99975. // RequestId sets the optional parameter "requestId": An optional
  99976. // request ID to identify requests. Specify a unique request ID so that
  99977. // if you must retry your request, the server will know to ignore the
  99978. // request if it has already been completed.
  99979. //
  99980. // For example, consider a situation where you make an initial request
  99981. // and the request times out. If you make the request again with the
  99982. // same request ID, the server can check if original operation with the
  99983. // same request ID was received, and if so, will ignore the second
  99984. // request. This prevents clients from accidentally creating duplicate
  99985. // commitments.
  99986. //
  99987. // The request ID must be a valid UUID with the exception that zero UUID
  99988. // is not supported (00000000-0000-0000-0000-000000000000).
  99989. func (c *RoutersUpdateCall) RequestId(requestId string) *RoutersUpdateCall {
  99990. c.urlParams_.Set("requestId", requestId)
  99991. return c
  99992. }
  99993. // Fields allows partial responses to be retrieved. See
  99994. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  99995. // for more information.
  99996. func (c *RoutersUpdateCall) Fields(s ...googleapi.Field) *RoutersUpdateCall {
  99997. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  99998. return c
  99999. }
  100000. // Context sets the context to be used in this call's Do method. Any
  100001. // pending HTTP request will be aborted if the provided context is
  100002. // canceled.
  100003. func (c *RoutersUpdateCall) Context(ctx context.Context) *RoutersUpdateCall {
  100004. c.ctx_ = ctx
  100005. return c
  100006. }
  100007. // Header returns an http.Header that can be modified by the caller to
  100008. // add HTTP headers to the request.
  100009. func (c *RoutersUpdateCall) Header() http.Header {
  100010. if c.header_ == nil {
  100011. c.header_ = make(http.Header)
  100012. }
  100013. return c.header_
  100014. }
  100015. func (c *RoutersUpdateCall) doRequest(alt string) (*http.Response, error) {
  100016. reqHeaders := make(http.Header)
  100017. for k, v := range c.header_ {
  100018. reqHeaders[k] = v
  100019. }
  100020. reqHeaders.Set("User-Agent", c.s.userAgent())
  100021. var body io.Reader = nil
  100022. body, err := googleapi.WithoutDataWrapper.JSONReader(c.router2)
  100023. if err != nil {
  100024. return nil, err
  100025. }
  100026. reqHeaders.Set("Content-Type", "application/json")
  100027. c.urlParams_.Set("alt", alt)
  100028. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}")
  100029. urls += "?" + c.urlParams_.Encode()
  100030. req, _ := http.NewRequest("PUT", urls, body)
  100031. req.Header = reqHeaders
  100032. googleapi.Expand(req.URL, map[string]string{
  100033. "project": c.project,
  100034. "region": c.region,
  100035. "router": c.router,
  100036. })
  100037. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  100038. }
  100039. // Do executes the "compute.routers.update" call.
  100040. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  100041. // status code is an error. Response headers are in either
  100042. // *Operation.ServerResponse.Header or (if a response was returned at
  100043. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  100044. // to check whether the returned error was because
  100045. // http.StatusNotModified was returned.
  100046. func (c *RoutersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  100047. gensupport.SetOptions(c.urlParams_, opts...)
  100048. res, err := c.doRequest("json")
  100049. if res != nil && res.StatusCode == http.StatusNotModified {
  100050. if res.Body != nil {
  100051. res.Body.Close()
  100052. }
  100053. return nil, &googleapi.Error{
  100054. Code: res.StatusCode,
  100055. Header: res.Header,
  100056. }
  100057. }
  100058. if err != nil {
  100059. return nil, err
  100060. }
  100061. defer googleapi.CloseBody(res)
  100062. if err := googleapi.CheckResponse(res); err != nil {
  100063. return nil, err
  100064. }
  100065. ret := &Operation{
  100066. ServerResponse: googleapi.ServerResponse{
  100067. Header: res.Header,
  100068. HTTPStatusCode: res.StatusCode,
  100069. },
  100070. }
  100071. target := &ret
  100072. if err := gensupport.DecodeResponse(target, res); err != nil {
  100073. return nil, err
  100074. }
  100075. return ret, nil
  100076. // {
  100077. // "description": "Updates the specified Router resource with the data included in the request.",
  100078. // "httpMethod": "PUT",
  100079. // "id": "compute.routers.update",
  100080. // "parameterOrder": [
  100081. // "project",
  100082. // "region",
  100083. // "router"
  100084. // ],
  100085. // "parameters": {
  100086. // "project": {
  100087. // "description": "Project ID for this request.",
  100088. // "location": "path",
  100089. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  100090. // "required": true,
  100091. // "type": "string"
  100092. // },
  100093. // "region": {
  100094. // "description": "Name of the region for this request.",
  100095. // "location": "path",
  100096. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  100097. // "required": true,
  100098. // "type": "string"
  100099. // },
  100100. // "requestId": {
  100101. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  100102. // "location": "query",
  100103. // "type": "string"
  100104. // },
  100105. // "router": {
  100106. // "description": "Name of the Router resource to update.",
  100107. // "location": "path",
  100108. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  100109. // "required": true,
  100110. // "type": "string"
  100111. // }
  100112. // },
  100113. // "path": "{project}/regions/{region}/routers/{router}",
  100114. // "request": {
  100115. // "$ref": "Router"
  100116. // },
  100117. // "response": {
  100118. // "$ref": "Operation"
  100119. // },
  100120. // "scopes": [
  100121. // "https://www.googleapis.com/auth/cloud-platform",
  100122. // "https://www.googleapis.com/auth/compute"
  100123. // ]
  100124. // }
  100125. }
  100126. // method id "compute.routes.delete":
  100127. type RoutesDeleteCall struct {
  100128. s *Service
  100129. project string
  100130. route string
  100131. urlParams_ gensupport.URLParams
  100132. ctx_ context.Context
  100133. header_ http.Header
  100134. }
  100135. // Delete: Deletes the specified Route resource.
  100136. // For details, see https://cloud.google.com/compute/docs/reference/latest/routes/delete
  100137. func (r *RoutesService) Delete(project string, route string) *RoutesDeleteCall {
  100138. c := &RoutesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  100139. c.project = project
  100140. c.route = route
  100141. return c
  100142. }
  100143. // RequestId sets the optional parameter "requestId": An optional
  100144. // request ID to identify requests. Specify a unique request ID so that
  100145. // if you must retry your request, the server will know to ignore the
  100146. // request if it has already been completed.
  100147. //
  100148. // For example, consider a situation where you make an initial request
  100149. // and the request times out. If you make the request again with the
  100150. // same request ID, the server can check if original operation with the
  100151. // same request ID was received, and if so, will ignore the second
  100152. // request. This prevents clients from accidentally creating duplicate
  100153. // commitments.
  100154. //
  100155. // The request ID must be a valid UUID with the exception that zero UUID
  100156. // is not supported (00000000-0000-0000-0000-000000000000).
  100157. func (c *RoutesDeleteCall) RequestId(requestId string) *RoutesDeleteCall {
  100158. c.urlParams_.Set("requestId", requestId)
  100159. return c
  100160. }
  100161. // Fields allows partial responses to be retrieved. See
  100162. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  100163. // for more information.
  100164. func (c *RoutesDeleteCall) Fields(s ...googleapi.Field) *RoutesDeleteCall {
  100165. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  100166. return c
  100167. }
  100168. // Context sets the context to be used in this call's Do method. Any
  100169. // pending HTTP request will be aborted if the provided context is
  100170. // canceled.
  100171. func (c *RoutesDeleteCall) Context(ctx context.Context) *RoutesDeleteCall {
  100172. c.ctx_ = ctx
  100173. return c
  100174. }
  100175. // Header returns an http.Header that can be modified by the caller to
  100176. // add HTTP headers to the request.
  100177. func (c *RoutesDeleteCall) Header() http.Header {
  100178. if c.header_ == nil {
  100179. c.header_ = make(http.Header)
  100180. }
  100181. return c.header_
  100182. }
  100183. func (c *RoutesDeleteCall) doRequest(alt string) (*http.Response, error) {
  100184. reqHeaders := make(http.Header)
  100185. for k, v := range c.header_ {
  100186. reqHeaders[k] = v
  100187. }
  100188. reqHeaders.Set("User-Agent", c.s.userAgent())
  100189. var body io.Reader = nil
  100190. c.urlParams_.Set("alt", alt)
  100191. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes/{route}")
  100192. urls += "?" + c.urlParams_.Encode()
  100193. req, _ := http.NewRequest("DELETE", urls, body)
  100194. req.Header = reqHeaders
  100195. googleapi.Expand(req.URL, map[string]string{
  100196. "project": c.project,
  100197. "route": c.route,
  100198. })
  100199. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  100200. }
  100201. // Do executes the "compute.routes.delete" call.
  100202. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  100203. // status code is an error. Response headers are in either
  100204. // *Operation.ServerResponse.Header or (if a response was returned at
  100205. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  100206. // to check whether the returned error was because
  100207. // http.StatusNotModified was returned.
  100208. func (c *RoutesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  100209. gensupport.SetOptions(c.urlParams_, opts...)
  100210. res, err := c.doRequest("json")
  100211. if res != nil && res.StatusCode == http.StatusNotModified {
  100212. if res.Body != nil {
  100213. res.Body.Close()
  100214. }
  100215. return nil, &googleapi.Error{
  100216. Code: res.StatusCode,
  100217. Header: res.Header,
  100218. }
  100219. }
  100220. if err != nil {
  100221. return nil, err
  100222. }
  100223. defer googleapi.CloseBody(res)
  100224. if err := googleapi.CheckResponse(res); err != nil {
  100225. return nil, err
  100226. }
  100227. ret := &Operation{
  100228. ServerResponse: googleapi.ServerResponse{
  100229. Header: res.Header,
  100230. HTTPStatusCode: res.StatusCode,
  100231. },
  100232. }
  100233. target := &ret
  100234. if err := gensupport.DecodeResponse(target, res); err != nil {
  100235. return nil, err
  100236. }
  100237. return ret, nil
  100238. // {
  100239. // "description": "Deletes the specified Route resource.",
  100240. // "httpMethod": "DELETE",
  100241. // "id": "compute.routes.delete",
  100242. // "parameterOrder": [
  100243. // "project",
  100244. // "route"
  100245. // ],
  100246. // "parameters": {
  100247. // "project": {
  100248. // "description": "Project ID for this request.",
  100249. // "location": "path",
  100250. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  100251. // "required": true,
  100252. // "type": "string"
  100253. // },
  100254. // "requestId": {
  100255. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  100256. // "location": "query",
  100257. // "type": "string"
  100258. // },
  100259. // "route": {
  100260. // "description": "Name of the Route resource to delete.",
  100261. // "location": "path",
  100262. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  100263. // "required": true,
  100264. // "type": "string"
  100265. // }
  100266. // },
  100267. // "path": "{project}/global/routes/{route}",
  100268. // "response": {
  100269. // "$ref": "Operation"
  100270. // },
  100271. // "scopes": [
  100272. // "https://www.googleapis.com/auth/cloud-platform",
  100273. // "https://www.googleapis.com/auth/compute"
  100274. // ]
  100275. // }
  100276. }
  100277. // method id "compute.routes.get":
  100278. type RoutesGetCall struct {
  100279. s *Service
  100280. project string
  100281. route string
  100282. urlParams_ gensupport.URLParams
  100283. ifNoneMatch_ string
  100284. ctx_ context.Context
  100285. header_ http.Header
  100286. }
  100287. // Get: Returns the specified Route resource. Gets a list of available
  100288. // routes by making a list() request.
  100289. // For details, see https://cloud.google.com/compute/docs/reference/latest/routes/get
  100290. func (r *RoutesService) Get(project string, route string) *RoutesGetCall {
  100291. c := &RoutesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  100292. c.project = project
  100293. c.route = route
  100294. return c
  100295. }
  100296. // Fields allows partial responses to be retrieved. See
  100297. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  100298. // for more information.
  100299. func (c *RoutesGetCall) Fields(s ...googleapi.Field) *RoutesGetCall {
  100300. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  100301. return c
  100302. }
  100303. // IfNoneMatch sets the optional parameter which makes the operation
  100304. // fail if the object's ETag matches the given value. This is useful for
  100305. // getting updates only after the object has changed since the last
  100306. // request. Use googleapi.IsNotModified to check whether the response
  100307. // error from Do is the result of In-None-Match.
  100308. func (c *RoutesGetCall) IfNoneMatch(entityTag string) *RoutesGetCall {
  100309. c.ifNoneMatch_ = entityTag
  100310. return c
  100311. }
  100312. // Context sets the context to be used in this call's Do method. Any
  100313. // pending HTTP request will be aborted if the provided context is
  100314. // canceled.
  100315. func (c *RoutesGetCall) Context(ctx context.Context) *RoutesGetCall {
  100316. c.ctx_ = ctx
  100317. return c
  100318. }
  100319. // Header returns an http.Header that can be modified by the caller to
  100320. // add HTTP headers to the request.
  100321. func (c *RoutesGetCall) Header() http.Header {
  100322. if c.header_ == nil {
  100323. c.header_ = make(http.Header)
  100324. }
  100325. return c.header_
  100326. }
  100327. func (c *RoutesGetCall) doRequest(alt string) (*http.Response, error) {
  100328. reqHeaders := make(http.Header)
  100329. for k, v := range c.header_ {
  100330. reqHeaders[k] = v
  100331. }
  100332. reqHeaders.Set("User-Agent", c.s.userAgent())
  100333. if c.ifNoneMatch_ != "" {
  100334. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  100335. }
  100336. var body io.Reader = nil
  100337. c.urlParams_.Set("alt", alt)
  100338. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes/{route}")
  100339. urls += "?" + c.urlParams_.Encode()
  100340. req, _ := http.NewRequest("GET", urls, body)
  100341. req.Header = reqHeaders
  100342. googleapi.Expand(req.URL, map[string]string{
  100343. "project": c.project,
  100344. "route": c.route,
  100345. })
  100346. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  100347. }
  100348. // Do executes the "compute.routes.get" call.
  100349. // Exactly one of *Route or error will be non-nil. Any non-2xx status
  100350. // code is an error. Response headers are in either
  100351. // *Route.ServerResponse.Header or (if a response was returned at all)
  100352. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  100353. // check whether the returned error was because http.StatusNotModified
  100354. // was returned.
  100355. func (c *RoutesGetCall) Do(opts ...googleapi.CallOption) (*Route, error) {
  100356. gensupport.SetOptions(c.urlParams_, opts...)
  100357. res, err := c.doRequest("json")
  100358. if res != nil && res.StatusCode == http.StatusNotModified {
  100359. if res.Body != nil {
  100360. res.Body.Close()
  100361. }
  100362. return nil, &googleapi.Error{
  100363. Code: res.StatusCode,
  100364. Header: res.Header,
  100365. }
  100366. }
  100367. if err != nil {
  100368. return nil, err
  100369. }
  100370. defer googleapi.CloseBody(res)
  100371. if err := googleapi.CheckResponse(res); err != nil {
  100372. return nil, err
  100373. }
  100374. ret := &Route{
  100375. ServerResponse: googleapi.ServerResponse{
  100376. Header: res.Header,
  100377. HTTPStatusCode: res.StatusCode,
  100378. },
  100379. }
  100380. target := &ret
  100381. if err := gensupport.DecodeResponse(target, res); err != nil {
  100382. return nil, err
  100383. }
  100384. return ret, nil
  100385. // {
  100386. // "description": "Returns the specified Route resource. Gets a list of available routes by making a list() request.",
  100387. // "httpMethod": "GET",
  100388. // "id": "compute.routes.get",
  100389. // "parameterOrder": [
  100390. // "project",
  100391. // "route"
  100392. // ],
  100393. // "parameters": {
  100394. // "project": {
  100395. // "description": "Project ID for this request.",
  100396. // "location": "path",
  100397. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  100398. // "required": true,
  100399. // "type": "string"
  100400. // },
  100401. // "route": {
  100402. // "description": "Name of the Route resource to return.",
  100403. // "location": "path",
  100404. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  100405. // "required": true,
  100406. // "type": "string"
  100407. // }
  100408. // },
  100409. // "path": "{project}/global/routes/{route}",
  100410. // "response": {
  100411. // "$ref": "Route"
  100412. // },
  100413. // "scopes": [
  100414. // "https://www.googleapis.com/auth/cloud-platform",
  100415. // "https://www.googleapis.com/auth/compute",
  100416. // "https://www.googleapis.com/auth/compute.readonly"
  100417. // ]
  100418. // }
  100419. }
  100420. // method id "compute.routes.insert":
  100421. type RoutesInsertCall struct {
  100422. s *Service
  100423. project string
  100424. route *Route
  100425. urlParams_ gensupport.URLParams
  100426. ctx_ context.Context
  100427. header_ http.Header
  100428. }
  100429. // Insert: Creates a Route resource in the specified project using the
  100430. // data included in the request.
  100431. // For details, see https://cloud.google.com/compute/docs/reference/latest/routes/insert
  100432. func (r *RoutesService) Insert(project string, route *Route) *RoutesInsertCall {
  100433. c := &RoutesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  100434. c.project = project
  100435. c.route = route
  100436. return c
  100437. }
  100438. // RequestId sets the optional parameter "requestId": An optional
  100439. // request ID to identify requests. Specify a unique request ID so that
  100440. // if you must retry your request, the server will know to ignore the
  100441. // request if it has already been completed.
  100442. //
  100443. // For example, consider a situation where you make an initial request
  100444. // and the request times out. If you make the request again with the
  100445. // same request ID, the server can check if original operation with the
  100446. // same request ID was received, and if so, will ignore the second
  100447. // request. This prevents clients from accidentally creating duplicate
  100448. // commitments.
  100449. //
  100450. // The request ID must be a valid UUID with the exception that zero UUID
  100451. // is not supported (00000000-0000-0000-0000-000000000000).
  100452. func (c *RoutesInsertCall) RequestId(requestId string) *RoutesInsertCall {
  100453. c.urlParams_.Set("requestId", requestId)
  100454. return c
  100455. }
  100456. // Fields allows partial responses to be retrieved. See
  100457. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  100458. // for more information.
  100459. func (c *RoutesInsertCall) Fields(s ...googleapi.Field) *RoutesInsertCall {
  100460. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  100461. return c
  100462. }
  100463. // Context sets the context to be used in this call's Do method. Any
  100464. // pending HTTP request will be aborted if the provided context is
  100465. // canceled.
  100466. func (c *RoutesInsertCall) Context(ctx context.Context) *RoutesInsertCall {
  100467. c.ctx_ = ctx
  100468. return c
  100469. }
  100470. // Header returns an http.Header that can be modified by the caller to
  100471. // add HTTP headers to the request.
  100472. func (c *RoutesInsertCall) Header() http.Header {
  100473. if c.header_ == nil {
  100474. c.header_ = make(http.Header)
  100475. }
  100476. return c.header_
  100477. }
  100478. func (c *RoutesInsertCall) doRequest(alt string) (*http.Response, error) {
  100479. reqHeaders := make(http.Header)
  100480. for k, v := range c.header_ {
  100481. reqHeaders[k] = v
  100482. }
  100483. reqHeaders.Set("User-Agent", c.s.userAgent())
  100484. var body io.Reader = nil
  100485. body, err := googleapi.WithoutDataWrapper.JSONReader(c.route)
  100486. if err != nil {
  100487. return nil, err
  100488. }
  100489. reqHeaders.Set("Content-Type", "application/json")
  100490. c.urlParams_.Set("alt", alt)
  100491. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes")
  100492. urls += "?" + c.urlParams_.Encode()
  100493. req, _ := http.NewRequest("POST", urls, body)
  100494. req.Header = reqHeaders
  100495. googleapi.Expand(req.URL, map[string]string{
  100496. "project": c.project,
  100497. })
  100498. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  100499. }
  100500. // Do executes the "compute.routes.insert" call.
  100501. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  100502. // status code is an error. Response headers are in either
  100503. // *Operation.ServerResponse.Header or (if a response was returned at
  100504. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  100505. // to check whether the returned error was because
  100506. // http.StatusNotModified was returned.
  100507. func (c *RoutesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  100508. gensupport.SetOptions(c.urlParams_, opts...)
  100509. res, err := c.doRequest("json")
  100510. if res != nil && res.StatusCode == http.StatusNotModified {
  100511. if res.Body != nil {
  100512. res.Body.Close()
  100513. }
  100514. return nil, &googleapi.Error{
  100515. Code: res.StatusCode,
  100516. Header: res.Header,
  100517. }
  100518. }
  100519. if err != nil {
  100520. return nil, err
  100521. }
  100522. defer googleapi.CloseBody(res)
  100523. if err := googleapi.CheckResponse(res); err != nil {
  100524. return nil, err
  100525. }
  100526. ret := &Operation{
  100527. ServerResponse: googleapi.ServerResponse{
  100528. Header: res.Header,
  100529. HTTPStatusCode: res.StatusCode,
  100530. },
  100531. }
  100532. target := &ret
  100533. if err := gensupport.DecodeResponse(target, res); err != nil {
  100534. return nil, err
  100535. }
  100536. return ret, nil
  100537. // {
  100538. // "description": "Creates a Route resource in the specified project using the data included in the request.",
  100539. // "httpMethod": "POST",
  100540. // "id": "compute.routes.insert",
  100541. // "parameterOrder": [
  100542. // "project"
  100543. // ],
  100544. // "parameters": {
  100545. // "project": {
  100546. // "description": "Project ID for this request.",
  100547. // "location": "path",
  100548. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  100549. // "required": true,
  100550. // "type": "string"
  100551. // },
  100552. // "requestId": {
  100553. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  100554. // "location": "query",
  100555. // "type": "string"
  100556. // }
  100557. // },
  100558. // "path": "{project}/global/routes",
  100559. // "request": {
  100560. // "$ref": "Route"
  100561. // },
  100562. // "response": {
  100563. // "$ref": "Operation"
  100564. // },
  100565. // "scopes": [
  100566. // "https://www.googleapis.com/auth/cloud-platform",
  100567. // "https://www.googleapis.com/auth/compute"
  100568. // ]
  100569. // }
  100570. }
  100571. // method id "compute.routes.list":
  100572. type RoutesListCall struct {
  100573. s *Service
  100574. project string
  100575. urlParams_ gensupport.URLParams
  100576. ifNoneMatch_ string
  100577. ctx_ context.Context
  100578. header_ http.Header
  100579. }
  100580. // List: Retrieves the list of Route resources available to the
  100581. // specified project.
  100582. // For details, see https://cloud.google.com/compute/docs/reference/latest/routes/list
  100583. func (r *RoutesService) List(project string) *RoutesListCall {
  100584. c := &RoutesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  100585. c.project = project
  100586. return c
  100587. }
  100588. // Filter sets the optional parameter "filter": A filter expression that
  100589. // filters resources listed in the response. The expression must specify
  100590. // the field name, a comparison operator, and the value that you want to
  100591. // use for filtering. The value must be a string, a number, or a
  100592. // boolean. The comparison operator must be either =, !=, >, or <.
  100593. //
  100594. // For example, if you are filtering Compute Engine instances, you can
  100595. // exclude instances named example-instance by specifying name !=
  100596. // example-instance.
  100597. //
  100598. // You can also filter nested fields. For example, you could specify
  100599. // scheduling.automaticRestart = false to include instances only if they
  100600. // are not scheduled for automatic restarts. You can use filtering on
  100601. // nested fields to filter based on resource labels.
  100602. //
  100603. // To filter on multiple expressions, provide each separate expression
  100604. // within parentheses. For example, (scheduling.automaticRestart = true)
  100605. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  100606. // AND expression. However, you can include AND and OR expressions
  100607. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  100608. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  100609. // true).
  100610. func (c *RoutesListCall) Filter(filter string) *RoutesListCall {
  100611. c.urlParams_.Set("filter", filter)
  100612. return c
  100613. }
  100614. // MaxResults sets the optional parameter "maxResults": The maximum
  100615. // number of results per page that should be returned. If the number of
  100616. // available results is larger than maxResults, Compute Engine returns a
  100617. // nextPageToken that can be used to get the next page of results in
  100618. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  100619. // (Default: 500)
  100620. func (c *RoutesListCall) MaxResults(maxResults int64) *RoutesListCall {
  100621. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  100622. return c
  100623. }
  100624. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  100625. // a certain order. By default, results are returned in alphanumerical
  100626. // order based on the resource name.
  100627. //
  100628. // You can also sort results in descending order based on the creation
  100629. // timestamp using orderBy="creationTimestamp desc". This sorts results
  100630. // based on the creationTimestamp field in reverse chronological order
  100631. // (newest result first). Use this to sort resources like operations so
  100632. // that the newest operation is returned first.
  100633. //
  100634. // Currently, only sorting by name or creationTimestamp desc is
  100635. // supported.
  100636. func (c *RoutesListCall) OrderBy(orderBy string) *RoutesListCall {
  100637. c.urlParams_.Set("orderBy", orderBy)
  100638. return c
  100639. }
  100640. // PageToken sets the optional parameter "pageToken": Specifies a page
  100641. // token to use. Set pageToken to the nextPageToken returned by a
  100642. // previous list request to get the next page of results.
  100643. func (c *RoutesListCall) PageToken(pageToken string) *RoutesListCall {
  100644. c.urlParams_.Set("pageToken", pageToken)
  100645. return c
  100646. }
  100647. // Fields allows partial responses to be retrieved. See
  100648. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  100649. // for more information.
  100650. func (c *RoutesListCall) Fields(s ...googleapi.Field) *RoutesListCall {
  100651. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  100652. return c
  100653. }
  100654. // IfNoneMatch sets the optional parameter which makes the operation
  100655. // fail if the object's ETag matches the given value. This is useful for
  100656. // getting updates only after the object has changed since the last
  100657. // request. Use googleapi.IsNotModified to check whether the response
  100658. // error from Do is the result of In-None-Match.
  100659. func (c *RoutesListCall) IfNoneMatch(entityTag string) *RoutesListCall {
  100660. c.ifNoneMatch_ = entityTag
  100661. return c
  100662. }
  100663. // Context sets the context to be used in this call's Do method. Any
  100664. // pending HTTP request will be aborted if the provided context is
  100665. // canceled.
  100666. func (c *RoutesListCall) Context(ctx context.Context) *RoutesListCall {
  100667. c.ctx_ = ctx
  100668. return c
  100669. }
  100670. // Header returns an http.Header that can be modified by the caller to
  100671. // add HTTP headers to the request.
  100672. func (c *RoutesListCall) Header() http.Header {
  100673. if c.header_ == nil {
  100674. c.header_ = make(http.Header)
  100675. }
  100676. return c.header_
  100677. }
  100678. func (c *RoutesListCall) doRequest(alt string) (*http.Response, error) {
  100679. reqHeaders := make(http.Header)
  100680. for k, v := range c.header_ {
  100681. reqHeaders[k] = v
  100682. }
  100683. reqHeaders.Set("User-Agent", c.s.userAgent())
  100684. if c.ifNoneMatch_ != "" {
  100685. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  100686. }
  100687. var body io.Reader = nil
  100688. c.urlParams_.Set("alt", alt)
  100689. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes")
  100690. urls += "?" + c.urlParams_.Encode()
  100691. req, _ := http.NewRequest("GET", urls, body)
  100692. req.Header = reqHeaders
  100693. googleapi.Expand(req.URL, map[string]string{
  100694. "project": c.project,
  100695. })
  100696. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  100697. }
  100698. // Do executes the "compute.routes.list" call.
  100699. // Exactly one of *RouteList or error will be non-nil. Any non-2xx
  100700. // status code is an error. Response headers are in either
  100701. // *RouteList.ServerResponse.Header or (if a response was returned at
  100702. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  100703. // to check whether the returned error was because
  100704. // http.StatusNotModified was returned.
  100705. func (c *RoutesListCall) Do(opts ...googleapi.CallOption) (*RouteList, error) {
  100706. gensupport.SetOptions(c.urlParams_, opts...)
  100707. res, err := c.doRequest("json")
  100708. if res != nil && res.StatusCode == http.StatusNotModified {
  100709. if res.Body != nil {
  100710. res.Body.Close()
  100711. }
  100712. return nil, &googleapi.Error{
  100713. Code: res.StatusCode,
  100714. Header: res.Header,
  100715. }
  100716. }
  100717. if err != nil {
  100718. return nil, err
  100719. }
  100720. defer googleapi.CloseBody(res)
  100721. if err := googleapi.CheckResponse(res); err != nil {
  100722. return nil, err
  100723. }
  100724. ret := &RouteList{
  100725. ServerResponse: googleapi.ServerResponse{
  100726. Header: res.Header,
  100727. HTTPStatusCode: res.StatusCode,
  100728. },
  100729. }
  100730. target := &ret
  100731. if err := gensupport.DecodeResponse(target, res); err != nil {
  100732. return nil, err
  100733. }
  100734. return ret, nil
  100735. // {
  100736. // "description": "Retrieves the list of Route resources available to the specified project.",
  100737. // "httpMethod": "GET",
  100738. // "id": "compute.routes.list",
  100739. // "parameterOrder": [
  100740. // "project"
  100741. // ],
  100742. // "parameters": {
  100743. // "filter": {
  100744. // "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).",
  100745. // "location": "query",
  100746. // "type": "string"
  100747. // },
  100748. // "maxResults": {
  100749. // "default": "500",
  100750. // "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)",
  100751. // "format": "uint32",
  100752. // "location": "query",
  100753. // "minimum": "0",
  100754. // "type": "integer"
  100755. // },
  100756. // "orderBy": {
  100757. // "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.",
  100758. // "location": "query",
  100759. // "type": "string"
  100760. // },
  100761. // "pageToken": {
  100762. // "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.",
  100763. // "location": "query",
  100764. // "type": "string"
  100765. // },
  100766. // "project": {
  100767. // "description": "Project ID for this request.",
  100768. // "location": "path",
  100769. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  100770. // "required": true,
  100771. // "type": "string"
  100772. // }
  100773. // },
  100774. // "path": "{project}/global/routes",
  100775. // "response": {
  100776. // "$ref": "RouteList"
  100777. // },
  100778. // "scopes": [
  100779. // "https://www.googleapis.com/auth/cloud-platform",
  100780. // "https://www.googleapis.com/auth/compute",
  100781. // "https://www.googleapis.com/auth/compute.readonly"
  100782. // ]
  100783. // }
  100784. }
  100785. // Pages invokes f for each page of results.
  100786. // A non-nil error returned from f will halt the iteration.
  100787. // The provided context supersedes any context provided to the Context method.
  100788. func (c *RoutesListCall) Pages(ctx context.Context, f func(*RouteList) error) error {
  100789. c.ctx_ = ctx
  100790. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  100791. for {
  100792. x, err := c.Do()
  100793. if err != nil {
  100794. return err
  100795. }
  100796. if err := f(x); err != nil {
  100797. return err
  100798. }
  100799. if x.NextPageToken == "" {
  100800. return nil
  100801. }
  100802. c.PageToken(x.NextPageToken)
  100803. }
  100804. }
  100805. // method id "compute.routes.testIamPermissions":
  100806. type RoutesTestIamPermissionsCall struct {
  100807. s *Service
  100808. project string
  100809. resource string
  100810. testpermissionsrequest *TestPermissionsRequest
  100811. urlParams_ gensupport.URLParams
  100812. ctx_ context.Context
  100813. header_ http.Header
  100814. }
  100815. // TestIamPermissions: Returns permissions that a caller has on the
  100816. // specified resource.
  100817. func (r *RoutesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *RoutesTestIamPermissionsCall {
  100818. c := &RoutesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  100819. c.project = project
  100820. c.resource = resource
  100821. c.testpermissionsrequest = testpermissionsrequest
  100822. return c
  100823. }
  100824. // Fields allows partial responses to be retrieved. See
  100825. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  100826. // for more information.
  100827. func (c *RoutesTestIamPermissionsCall) Fields(s ...googleapi.Field) *RoutesTestIamPermissionsCall {
  100828. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  100829. return c
  100830. }
  100831. // Context sets the context to be used in this call's Do method. Any
  100832. // pending HTTP request will be aborted if the provided context is
  100833. // canceled.
  100834. func (c *RoutesTestIamPermissionsCall) Context(ctx context.Context) *RoutesTestIamPermissionsCall {
  100835. c.ctx_ = ctx
  100836. return c
  100837. }
  100838. // Header returns an http.Header that can be modified by the caller to
  100839. // add HTTP headers to the request.
  100840. func (c *RoutesTestIamPermissionsCall) Header() http.Header {
  100841. if c.header_ == nil {
  100842. c.header_ = make(http.Header)
  100843. }
  100844. return c.header_
  100845. }
  100846. func (c *RoutesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  100847. reqHeaders := make(http.Header)
  100848. for k, v := range c.header_ {
  100849. reqHeaders[k] = v
  100850. }
  100851. reqHeaders.Set("User-Agent", c.s.userAgent())
  100852. var body io.Reader = nil
  100853. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  100854. if err != nil {
  100855. return nil, err
  100856. }
  100857. reqHeaders.Set("Content-Type", "application/json")
  100858. c.urlParams_.Set("alt", alt)
  100859. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes/{resource}/testIamPermissions")
  100860. urls += "?" + c.urlParams_.Encode()
  100861. req, _ := http.NewRequest("POST", urls, body)
  100862. req.Header = reqHeaders
  100863. googleapi.Expand(req.URL, map[string]string{
  100864. "project": c.project,
  100865. "resource": c.resource,
  100866. })
  100867. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  100868. }
  100869. // Do executes the "compute.routes.testIamPermissions" call.
  100870. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  100871. // non-2xx status code is an error. Response headers are in either
  100872. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  100873. // returned at all) in error.(*googleapi.Error).Header. Use
  100874. // googleapi.IsNotModified to check whether the returned error was
  100875. // because http.StatusNotModified was returned.
  100876. func (c *RoutesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  100877. gensupport.SetOptions(c.urlParams_, opts...)
  100878. res, err := c.doRequest("json")
  100879. if res != nil && res.StatusCode == http.StatusNotModified {
  100880. if res.Body != nil {
  100881. res.Body.Close()
  100882. }
  100883. return nil, &googleapi.Error{
  100884. Code: res.StatusCode,
  100885. Header: res.Header,
  100886. }
  100887. }
  100888. if err != nil {
  100889. return nil, err
  100890. }
  100891. defer googleapi.CloseBody(res)
  100892. if err := googleapi.CheckResponse(res); err != nil {
  100893. return nil, err
  100894. }
  100895. ret := &TestPermissionsResponse{
  100896. ServerResponse: googleapi.ServerResponse{
  100897. Header: res.Header,
  100898. HTTPStatusCode: res.StatusCode,
  100899. },
  100900. }
  100901. target := &ret
  100902. if err := gensupport.DecodeResponse(target, res); err != nil {
  100903. return nil, err
  100904. }
  100905. return ret, nil
  100906. // {
  100907. // "description": "Returns permissions that a caller has on the specified resource.",
  100908. // "httpMethod": "POST",
  100909. // "id": "compute.routes.testIamPermissions",
  100910. // "parameterOrder": [
  100911. // "project",
  100912. // "resource"
  100913. // ],
  100914. // "parameters": {
  100915. // "project": {
  100916. // "description": "Project ID for this request.",
  100917. // "location": "path",
  100918. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  100919. // "required": true,
  100920. // "type": "string"
  100921. // },
  100922. // "resource": {
  100923. // "description": "Name of the resource for this request.",
  100924. // "location": "path",
  100925. // "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?",
  100926. // "required": true,
  100927. // "type": "string"
  100928. // }
  100929. // },
  100930. // "path": "{project}/global/routes/{resource}/testIamPermissions",
  100931. // "request": {
  100932. // "$ref": "TestPermissionsRequest"
  100933. // },
  100934. // "response": {
  100935. // "$ref": "TestPermissionsResponse"
  100936. // },
  100937. // "scopes": [
  100938. // "https://www.googleapis.com/auth/cloud-platform",
  100939. // "https://www.googleapis.com/auth/compute",
  100940. // "https://www.googleapis.com/auth/compute.readonly"
  100941. // ]
  100942. // }
  100943. }
  100944. // method id "compute.securityPolicies.addRule":
  100945. type SecurityPoliciesAddRuleCall struct {
  100946. s *Service
  100947. project string
  100948. securityPolicy string
  100949. securitypolicyrule *SecurityPolicyRule
  100950. urlParams_ gensupport.URLParams
  100951. ctx_ context.Context
  100952. header_ http.Header
  100953. }
  100954. // AddRule: Inserts a rule into a security policy.
  100955. func (r *SecurityPoliciesService) AddRule(project string, securityPolicy string, securitypolicyrule *SecurityPolicyRule) *SecurityPoliciesAddRuleCall {
  100956. c := &SecurityPoliciesAddRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  100957. c.project = project
  100958. c.securityPolicy = securityPolicy
  100959. c.securitypolicyrule = securitypolicyrule
  100960. return c
  100961. }
  100962. // ValidateOnly sets the optional parameter "validateOnly": If true, the
  100963. // request will not be committed.
  100964. func (c *SecurityPoliciesAddRuleCall) ValidateOnly(validateOnly bool) *SecurityPoliciesAddRuleCall {
  100965. c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
  100966. return c
  100967. }
  100968. // Fields allows partial responses to be retrieved. See
  100969. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  100970. // for more information.
  100971. func (c *SecurityPoliciesAddRuleCall) Fields(s ...googleapi.Field) *SecurityPoliciesAddRuleCall {
  100972. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  100973. return c
  100974. }
  100975. // Context sets the context to be used in this call's Do method. Any
  100976. // pending HTTP request will be aborted if the provided context is
  100977. // canceled.
  100978. func (c *SecurityPoliciesAddRuleCall) Context(ctx context.Context) *SecurityPoliciesAddRuleCall {
  100979. c.ctx_ = ctx
  100980. return c
  100981. }
  100982. // Header returns an http.Header that can be modified by the caller to
  100983. // add HTTP headers to the request.
  100984. func (c *SecurityPoliciesAddRuleCall) Header() http.Header {
  100985. if c.header_ == nil {
  100986. c.header_ = make(http.Header)
  100987. }
  100988. return c.header_
  100989. }
  100990. func (c *SecurityPoliciesAddRuleCall) doRequest(alt string) (*http.Response, error) {
  100991. reqHeaders := make(http.Header)
  100992. for k, v := range c.header_ {
  100993. reqHeaders[k] = v
  100994. }
  100995. reqHeaders.Set("User-Agent", c.s.userAgent())
  100996. var body io.Reader = nil
  100997. body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyrule)
  100998. if err != nil {
  100999. return nil, err
  101000. }
  101001. reqHeaders.Set("Content-Type", "application/json")
  101002. c.urlParams_.Set("alt", alt)
  101003. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{securityPolicy}/addRule")
  101004. urls += "?" + c.urlParams_.Encode()
  101005. req, _ := http.NewRequest("POST", urls, body)
  101006. req.Header = reqHeaders
  101007. googleapi.Expand(req.URL, map[string]string{
  101008. "project": c.project,
  101009. "securityPolicy": c.securityPolicy,
  101010. })
  101011. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  101012. }
  101013. // Do executes the "compute.securityPolicies.addRule" call.
  101014. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  101015. // status code is an error. Response headers are in either
  101016. // *Operation.ServerResponse.Header or (if a response was returned at
  101017. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  101018. // to check whether the returned error was because
  101019. // http.StatusNotModified was returned.
  101020. func (c *SecurityPoliciesAddRuleCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  101021. gensupport.SetOptions(c.urlParams_, opts...)
  101022. res, err := c.doRequest("json")
  101023. if res != nil && res.StatusCode == http.StatusNotModified {
  101024. if res.Body != nil {
  101025. res.Body.Close()
  101026. }
  101027. return nil, &googleapi.Error{
  101028. Code: res.StatusCode,
  101029. Header: res.Header,
  101030. }
  101031. }
  101032. if err != nil {
  101033. return nil, err
  101034. }
  101035. defer googleapi.CloseBody(res)
  101036. if err := googleapi.CheckResponse(res); err != nil {
  101037. return nil, err
  101038. }
  101039. ret := &Operation{
  101040. ServerResponse: googleapi.ServerResponse{
  101041. Header: res.Header,
  101042. HTTPStatusCode: res.StatusCode,
  101043. },
  101044. }
  101045. target := &ret
  101046. if err := gensupport.DecodeResponse(target, res); err != nil {
  101047. return nil, err
  101048. }
  101049. return ret, nil
  101050. // {
  101051. // "description": "Inserts a rule into a security policy.",
  101052. // "httpMethod": "POST",
  101053. // "id": "compute.securityPolicies.addRule",
  101054. // "parameterOrder": [
  101055. // "project",
  101056. // "securityPolicy"
  101057. // ],
  101058. // "parameters": {
  101059. // "project": {
  101060. // "description": "Project ID for this request.",
  101061. // "location": "path",
  101062. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  101063. // "required": true,
  101064. // "type": "string"
  101065. // },
  101066. // "securityPolicy": {
  101067. // "description": "Name of the security policy to update.",
  101068. // "location": "path",
  101069. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  101070. // "required": true,
  101071. // "type": "string"
  101072. // },
  101073. // "validateOnly": {
  101074. // "description": "If true, the request will not be committed.",
  101075. // "location": "query",
  101076. // "type": "boolean"
  101077. // }
  101078. // },
  101079. // "path": "{project}/global/securityPolicies/{securityPolicy}/addRule",
  101080. // "request": {
  101081. // "$ref": "SecurityPolicyRule"
  101082. // },
  101083. // "response": {
  101084. // "$ref": "Operation"
  101085. // },
  101086. // "scopes": [
  101087. // "https://www.googleapis.com/auth/cloud-platform",
  101088. // "https://www.googleapis.com/auth/compute"
  101089. // ]
  101090. // }
  101091. }
  101092. // method id "compute.securityPolicies.delete":
  101093. type SecurityPoliciesDeleteCall struct {
  101094. s *Service
  101095. project string
  101096. securityPolicy string
  101097. urlParams_ gensupport.URLParams
  101098. ctx_ context.Context
  101099. header_ http.Header
  101100. }
  101101. // Delete: Deletes the specified policy.
  101102. func (r *SecurityPoliciesService) Delete(project string, securityPolicy string) *SecurityPoliciesDeleteCall {
  101103. c := &SecurityPoliciesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  101104. c.project = project
  101105. c.securityPolicy = securityPolicy
  101106. return c
  101107. }
  101108. // RequestId sets the optional parameter "requestId": An optional
  101109. // request ID to identify requests. Specify a unique request ID so that
  101110. // if you must retry your request, the server will know to ignore the
  101111. // request if it has already been completed.
  101112. //
  101113. // For example, consider a situation where you make an initial request
  101114. // and the request times out. If you make the request again with the
  101115. // same request ID, the server can check if original operation with the
  101116. // same request ID was received, and if so, will ignore the second
  101117. // request. This prevents clients from accidentally creating duplicate
  101118. // commitments.
  101119. //
  101120. // The request ID must be a valid UUID with the exception that zero UUID
  101121. // is not supported (00000000-0000-0000-0000-000000000000).
  101122. func (c *SecurityPoliciesDeleteCall) RequestId(requestId string) *SecurityPoliciesDeleteCall {
  101123. c.urlParams_.Set("requestId", requestId)
  101124. return c
  101125. }
  101126. // Fields allows partial responses to be retrieved. See
  101127. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  101128. // for more information.
  101129. func (c *SecurityPoliciesDeleteCall) Fields(s ...googleapi.Field) *SecurityPoliciesDeleteCall {
  101130. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  101131. return c
  101132. }
  101133. // Context sets the context to be used in this call's Do method. Any
  101134. // pending HTTP request will be aborted if the provided context is
  101135. // canceled.
  101136. func (c *SecurityPoliciesDeleteCall) Context(ctx context.Context) *SecurityPoliciesDeleteCall {
  101137. c.ctx_ = ctx
  101138. return c
  101139. }
  101140. // Header returns an http.Header that can be modified by the caller to
  101141. // add HTTP headers to the request.
  101142. func (c *SecurityPoliciesDeleteCall) Header() http.Header {
  101143. if c.header_ == nil {
  101144. c.header_ = make(http.Header)
  101145. }
  101146. return c.header_
  101147. }
  101148. func (c *SecurityPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) {
  101149. reqHeaders := make(http.Header)
  101150. for k, v := range c.header_ {
  101151. reqHeaders[k] = v
  101152. }
  101153. reqHeaders.Set("User-Agent", c.s.userAgent())
  101154. var body io.Reader = nil
  101155. c.urlParams_.Set("alt", alt)
  101156. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{securityPolicy}")
  101157. urls += "?" + c.urlParams_.Encode()
  101158. req, _ := http.NewRequest("DELETE", urls, body)
  101159. req.Header = reqHeaders
  101160. googleapi.Expand(req.URL, map[string]string{
  101161. "project": c.project,
  101162. "securityPolicy": c.securityPolicy,
  101163. })
  101164. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  101165. }
  101166. // Do executes the "compute.securityPolicies.delete" call.
  101167. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  101168. // status code is an error. Response headers are in either
  101169. // *Operation.ServerResponse.Header or (if a response was returned at
  101170. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  101171. // to check whether the returned error was because
  101172. // http.StatusNotModified was returned.
  101173. func (c *SecurityPoliciesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  101174. gensupport.SetOptions(c.urlParams_, opts...)
  101175. res, err := c.doRequest("json")
  101176. if res != nil && res.StatusCode == http.StatusNotModified {
  101177. if res.Body != nil {
  101178. res.Body.Close()
  101179. }
  101180. return nil, &googleapi.Error{
  101181. Code: res.StatusCode,
  101182. Header: res.Header,
  101183. }
  101184. }
  101185. if err != nil {
  101186. return nil, err
  101187. }
  101188. defer googleapi.CloseBody(res)
  101189. if err := googleapi.CheckResponse(res); err != nil {
  101190. return nil, err
  101191. }
  101192. ret := &Operation{
  101193. ServerResponse: googleapi.ServerResponse{
  101194. Header: res.Header,
  101195. HTTPStatusCode: res.StatusCode,
  101196. },
  101197. }
  101198. target := &ret
  101199. if err := gensupport.DecodeResponse(target, res); err != nil {
  101200. return nil, err
  101201. }
  101202. return ret, nil
  101203. // {
  101204. // "description": "Deletes the specified policy.",
  101205. // "httpMethod": "DELETE",
  101206. // "id": "compute.securityPolicies.delete",
  101207. // "parameterOrder": [
  101208. // "project",
  101209. // "securityPolicy"
  101210. // ],
  101211. // "parameters": {
  101212. // "project": {
  101213. // "description": "Project ID for this request.",
  101214. // "location": "path",
  101215. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  101216. // "required": true,
  101217. // "type": "string"
  101218. // },
  101219. // "requestId": {
  101220. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  101221. // "location": "query",
  101222. // "type": "string"
  101223. // },
  101224. // "securityPolicy": {
  101225. // "description": "Name of the security policy to delete.",
  101226. // "location": "path",
  101227. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  101228. // "required": true,
  101229. // "type": "string"
  101230. // }
  101231. // },
  101232. // "path": "{project}/global/securityPolicies/{securityPolicy}",
  101233. // "response": {
  101234. // "$ref": "Operation"
  101235. // },
  101236. // "scopes": [
  101237. // "https://www.googleapis.com/auth/cloud-platform",
  101238. // "https://www.googleapis.com/auth/compute"
  101239. // ]
  101240. // }
  101241. }
  101242. // method id "compute.securityPolicies.get":
  101243. type SecurityPoliciesGetCall struct {
  101244. s *Service
  101245. project string
  101246. securityPolicy string
  101247. urlParams_ gensupport.URLParams
  101248. ifNoneMatch_ string
  101249. ctx_ context.Context
  101250. header_ http.Header
  101251. }
  101252. // Get: List all of the ordered rules present in a single specified
  101253. // policy.
  101254. func (r *SecurityPoliciesService) Get(project string, securityPolicy string) *SecurityPoliciesGetCall {
  101255. c := &SecurityPoliciesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  101256. c.project = project
  101257. c.securityPolicy = securityPolicy
  101258. return c
  101259. }
  101260. // Fields allows partial responses to be retrieved. See
  101261. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  101262. // for more information.
  101263. func (c *SecurityPoliciesGetCall) Fields(s ...googleapi.Field) *SecurityPoliciesGetCall {
  101264. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  101265. return c
  101266. }
  101267. // IfNoneMatch sets the optional parameter which makes the operation
  101268. // fail if the object's ETag matches the given value. This is useful for
  101269. // getting updates only after the object has changed since the last
  101270. // request. Use googleapi.IsNotModified to check whether the response
  101271. // error from Do is the result of In-None-Match.
  101272. func (c *SecurityPoliciesGetCall) IfNoneMatch(entityTag string) *SecurityPoliciesGetCall {
  101273. c.ifNoneMatch_ = entityTag
  101274. return c
  101275. }
  101276. // Context sets the context to be used in this call's Do method. Any
  101277. // pending HTTP request will be aborted if the provided context is
  101278. // canceled.
  101279. func (c *SecurityPoliciesGetCall) Context(ctx context.Context) *SecurityPoliciesGetCall {
  101280. c.ctx_ = ctx
  101281. return c
  101282. }
  101283. // Header returns an http.Header that can be modified by the caller to
  101284. // add HTTP headers to the request.
  101285. func (c *SecurityPoliciesGetCall) Header() http.Header {
  101286. if c.header_ == nil {
  101287. c.header_ = make(http.Header)
  101288. }
  101289. return c.header_
  101290. }
  101291. func (c *SecurityPoliciesGetCall) doRequest(alt string) (*http.Response, error) {
  101292. reqHeaders := make(http.Header)
  101293. for k, v := range c.header_ {
  101294. reqHeaders[k] = v
  101295. }
  101296. reqHeaders.Set("User-Agent", c.s.userAgent())
  101297. if c.ifNoneMatch_ != "" {
  101298. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  101299. }
  101300. var body io.Reader = nil
  101301. c.urlParams_.Set("alt", alt)
  101302. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{securityPolicy}")
  101303. urls += "?" + c.urlParams_.Encode()
  101304. req, _ := http.NewRequest("GET", urls, body)
  101305. req.Header = reqHeaders
  101306. googleapi.Expand(req.URL, map[string]string{
  101307. "project": c.project,
  101308. "securityPolicy": c.securityPolicy,
  101309. })
  101310. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  101311. }
  101312. // Do executes the "compute.securityPolicies.get" call.
  101313. // Exactly one of *SecurityPolicy or error will be non-nil. Any non-2xx
  101314. // status code is an error. Response headers are in either
  101315. // *SecurityPolicy.ServerResponse.Header or (if a response was returned
  101316. // at all) in error.(*googleapi.Error).Header. Use
  101317. // googleapi.IsNotModified to check whether the returned error was
  101318. // because http.StatusNotModified was returned.
  101319. func (c *SecurityPoliciesGetCall) Do(opts ...googleapi.CallOption) (*SecurityPolicy, error) {
  101320. gensupport.SetOptions(c.urlParams_, opts...)
  101321. res, err := c.doRequest("json")
  101322. if res != nil && res.StatusCode == http.StatusNotModified {
  101323. if res.Body != nil {
  101324. res.Body.Close()
  101325. }
  101326. return nil, &googleapi.Error{
  101327. Code: res.StatusCode,
  101328. Header: res.Header,
  101329. }
  101330. }
  101331. if err != nil {
  101332. return nil, err
  101333. }
  101334. defer googleapi.CloseBody(res)
  101335. if err := googleapi.CheckResponse(res); err != nil {
  101336. return nil, err
  101337. }
  101338. ret := &SecurityPolicy{
  101339. ServerResponse: googleapi.ServerResponse{
  101340. Header: res.Header,
  101341. HTTPStatusCode: res.StatusCode,
  101342. },
  101343. }
  101344. target := &ret
  101345. if err := gensupport.DecodeResponse(target, res); err != nil {
  101346. return nil, err
  101347. }
  101348. return ret, nil
  101349. // {
  101350. // "description": "List all of the ordered rules present in a single specified policy.",
  101351. // "httpMethod": "GET",
  101352. // "id": "compute.securityPolicies.get",
  101353. // "parameterOrder": [
  101354. // "project",
  101355. // "securityPolicy"
  101356. // ],
  101357. // "parameters": {
  101358. // "project": {
  101359. // "description": "Project ID for this request.",
  101360. // "location": "path",
  101361. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  101362. // "required": true,
  101363. // "type": "string"
  101364. // },
  101365. // "securityPolicy": {
  101366. // "description": "Name of the security policy to get.",
  101367. // "location": "path",
  101368. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  101369. // "required": true,
  101370. // "type": "string"
  101371. // }
  101372. // },
  101373. // "path": "{project}/global/securityPolicies/{securityPolicy}",
  101374. // "response": {
  101375. // "$ref": "SecurityPolicy"
  101376. // },
  101377. // "scopes": [
  101378. // "https://www.googleapis.com/auth/cloud-platform",
  101379. // "https://www.googleapis.com/auth/compute",
  101380. // "https://www.googleapis.com/auth/compute.readonly"
  101381. // ]
  101382. // }
  101383. }
  101384. // method id "compute.securityPolicies.getRule":
  101385. type SecurityPoliciesGetRuleCall struct {
  101386. s *Service
  101387. project string
  101388. securityPolicy string
  101389. urlParams_ gensupport.URLParams
  101390. ifNoneMatch_ string
  101391. ctx_ context.Context
  101392. header_ http.Header
  101393. }
  101394. // GetRule: Gets a rule at the specified priority.
  101395. func (r *SecurityPoliciesService) GetRule(project string, securityPolicy string) *SecurityPoliciesGetRuleCall {
  101396. c := &SecurityPoliciesGetRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  101397. c.project = project
  101398. c.securityPolicy = securityPolicy
  101399. return c
  101400. }
  101401. // Priority sets the optional parameter "priority": The priority of the
  101402. // rule to get from the security policy.
  101403. func (c *SecurityPoliciesGetRuleCall) Priority(priority int64) *SecurityPoliciesGetRuleCall {
  101404. c.urlParams_.Set("priority", fmt.Sprint(priority))
  101405. return c
  101406. }
  101407. // Fields allows partial responses to be retrieved. See
  101408. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  101409. // for more information.
  101410. func (c *SecurityPoliciesGetRuleCall) Fields(s ...googleapi.Field) *SecurityPoliciesGetRuleCall {
  101411. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  101412. return c
  101413. }
  101414. // IfNoneMatch sets the optional parameter which makes the operation
  101415. // fail if the object's ETag matches the given value. This is useful for
  101416. // getting updates only after the object has changed since the last
  101417. // request. Use googleapi.IsNotModified to check whether the response
  101418. // error from Do is the result of In-None-Match.
  101419. func (c *SecurityPoliciesGetRuleCall) IfNoneMatch(entityTag string) *SecurityPoliciesGetRuleCall {
  101420. c.ifNoneMatch_ = entityTag
  101421. return c
  101422. }
  101423. // Context sets the context to be used in this call's Do method. Any
  101424. // pending HTTP request will be aborted if the provided context is
  101425. // canceled.
  101426. func (c *SecurityPoliciesGetRuleCall) Context(ctx context.Context) *SecurityPoliciesGetRuleCall {
  101427. c.ctx_ = ctx
  101428. return c
  101429. }
  101430. // Header returns an http.Header that can be modified by the caller to
  101431. // add HTTP headers to the request.
  101432. func (c *SecurityPoliciesGetRuleCall) Header() http.Header {
  101433. if c.header_ == nil {
  101434. c.header_ = make(http.Header)
  101435. }
  101436. return c.header_
  101437. }
  101438. func (c *SecurityPoliciesGetRuleCall) doRequest(alt string) (*http.Response, error) {
  101439. reqHeaders := make(http.Header)
  101440. for k, v := range c.header_ {
  101441. reqHeaders[k] = v
  101442. }
  101443. reqHeaders.Set("User-Agent", c.s.userAgent())
  101444. if c.ifNoneMatch_ != "" {
  101445. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  101446. }
  101447. var body io.Reader = nil
  101448. c.urlParams_.Set("alt", alt)
  101449. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{securityPolicy}/getRule")
  101450. urls += "?" + c.urlParams_.Encode()
  101451. req, _ := http.NewRequest("GET", urls, body)
  101452. req.Header = reqHeaders
  101453. googleapi.Expand(req.URL, map[string]string{
  101454. "project": c.project,
  101455. "securityPolicy": c.securityPolicy,
  101456. })
  101457. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  101458. }
  101459. // Do executes the "compute.securityPolicies.getRule" call.
  101460. // Exactly one of *SecurityPolicyRule or error will be non-nil. Any
  101461. // non-2xx status code is an error. Response headers are in either
  101462. // *SecurityPolicyRule.ServerResponse.Header or (if a response was
  101463. // returned at all) in error.(*googleapi.Error).Header. Use
  101464. // googleapi.IsNotModified to check whether the returned error was
  101465. // because http.StatusNotModified was returned.
  101466. func (c *SecurityPoliciesGetRuleCall) Do(opts ...googleapi.CallOption) (*SecurityPolicyRule, error) {
  101467. gensupport.SetOptions(c.urlParams_, opts...)
  101468. res, err := c.doRequest("json")
  101469. if res != nil && res.StatusCode == http.StatusNotModified {
  101470. if res.Body != nil {
  101471. res.Body.Close()
  101472. }
  101473. return nil, &googleapi.Error{
  101474. Code: res.StatusCode,
  101475. Header: res.Header,
  101476. }
  101477. }
  101478. if err != nil {
  101479. return nil, err
  101480. }
  101481. defer googleapi.CloseBody(res)
  101482. if err := googleapi.CheckResponse(res); err != nil {
  101483. return nil, err
  101484. }
  101485. ret := &SecurityPolicyRule{
  101486. ServerResponse: googleapi.ServerResponse{
  101487. Header: res.Header,
  101488. HTTPStatusCode: res.StatusCode,
  101489. },
  101490. }
  101491. target := &ret
  101492. if err := gensupport.DecodeResponse(target, res); err != nil {
  101493. return nil, err
  101494. }
  101495. return ret, nil
  101496. // {
  101497. // "description": "Gets a rule at the specified priority.",
  101498. // "httpMethod": "GET",
  101499. // "id": "compute.securityPolicies.getRule",
  101500. // "parameterOrder": [
  101501. // "project",
  101502. // "securityPolicy"
  101503. // ],
  101504. // "parameters": {
  101505. // "priority": {
  101506. // "description": "The priority of the rule to get from the security policy.",
  101507. // "format": "int32",
  101508. // "location": "query",
  101509. // "type": "integer"
  101510. // },
  101511. // "project": {
  101512. // "description": "Project ID for this request.",
  101513. // "location": "path",
  101514. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  101515. // "required": true,
  101516. // "type": "string"
  101517. // },
  101518. // "securityPolicy": {
  101519. // "description": "Name of the security policy to which the queried rule belongs.",
  101520. // "location": "path",
  101521. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  101522. // "required": true,
  101523. // "type": "string"
  101524. // }
  101525. // },
  101526. // "path": "{project}/global/securityPolicies/{securityPolicy}/getRule",
  101527. // "response": {
  101528. // "$ref": "SecurityPolicyRule"
  101529. // },
  101530. // "scopes": [
  101531. // "https://www.googleapis.com/auth/cloud-platform",
  101532. // "https://www.googleapis.com/auth/compute",
  101533. // "https://www.googleapis.com/auth/compute.readonly"
  101534. // ]
  101535. // }
  101536. }
  101537. // method id "compute.securityPolicies.insert":
  101538. type SecurityPoliciesInsertCall struct {
  101539. s *Service
  101540. project string
  101541. securitypolicy *SecurityPolicy
  101542. urlParams_ gensupport.URLParams
  101543. ctx_ context.Context
  101544. header_ http.Header
  101545. }
  101546. // Insert: Creates a new policy in the specified project using the data
  101547. // included in the request.
  101548. func (r *SecurityPoliciesService) Insert(project string, securitypolicy *SecurityPolicy) *SecurityPoliciesInsertCall {
  101549. c := &SecurityPoliciesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  101550. c.project = project
  101551. c.securitypolicy = securitypolicy
  101552. return c
  101553. }
  101554. // RequestId sets the optional parameter "requestId": An optional
  101555. // request ID to identify requests. Specify a unique request ID so that
  101556. // if you must retry your request, the server will know to ignore the
  101557. // request if it has already been completed.
  101558. //
  101559. // For example, consider a situation where you make an initial request
  101560. // and the request times out. If you make the request again with the
  101561. // same request ID, the server can check if original operation with the
  101562. // same request ID was received, and if so, will ignore the second
  101563. // request. This prevents clients from accidentally creating duplicate
  101564. // commitments.
  101565. //
  101566. // The request ID must be a valid UUID with the exception that zero UUID
  101567. // is not supported (00000000-0000-0000-0000-000000000000).
  101568. func (c *SecurityPoliciesInsertCall) RequestId(requestId string) *SecurityPoliciesInsertCall {
  101569. c.urlParams_.Set("requestId", requestId)
  101570. return c
  101571. }
  101572. // ValidateOnly sets the optional parameter "validateOnly": If true, the
  101573. // request will not be committed.
  101574. func (c *SecurityPoliciesInsertCall) ValidateOnly(validateOnly bool) *SecurityPoliciesInsertCall {
  101575. c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
  101576. return c
  101577. }
  101578. // Fields allows partial responses to be retrieved. See
  101579. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  101580. // for more information.
  101581. func (c *SecurityPoliciesInsertCall) Fields(s ...googleapi.Field) *SecurityPoliciesInsertCall {
  101582. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  101583. return c
  101584. }
  101585. // Context sets the context to be used in this call's Do method. Any
  101586. // pending HTTP request will be aborted if the provided context is
  101587. // canceled.
  101588. func (c *SecurityPoliciesInsertCall) Context(ctx context.Context) *SecurityPoliciesInsertCall {
  101589. c.ctx_ = ctx
  101590. return c
  101591. }
  101592. // Header returns an http.Header that can be modified by the caller to
  101593. // add HTTP headers to the request.
  101594. func (c *SecurityPoliciesInsertCall) Header() http.Header {
  101595. if c.header_ == nil {
  101596. c.header_ = make(http.Header)
  101597. }
  101598. return c.header_
  101599. }
  101600. func (c *SecurityPoliciesInsertCall) doRequest(alt string) (*http.Response, error) {
  101601. reqHeaders := make(http.Header)
  101602. for k, v := range c.header_ {
  101603. reqHeaders[k] = v
  101604. }
  101605. reqHeaders.Set("User-Agent", c.s.userAgent())
  101606. var body io.Reader = nil
  101607. body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicy)
  101608. if err != nil {
  101609. return nil, err
  101610. }
  101611. reqHeaders.Set("Content-Type", "application/json")
  101612. c.urlParams_.Set("alt", alt)
  101613. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies")
  101614. urls += "?" + c.urlParams_.Encode()
  101615. req, _ := http.NewRequest("POST", urls, body)
  101616. req.Header = reqHeaders
  101617. googleapi.Expand(req.URL, map[string]string{
  101618. "project": c.project,
  101619. })
  101620. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  101621. }
  101622. // Do executes the "compute.securityPolicies.insert" call.
  101623. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  101624. // status code is an error. Response headers are in either
  101625. // *Operation.ServerResponse.Header or (if a response was returned at
  101626. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  101627. // to check whether the returned error was because
  101628. // http.StatusNotModified was returned.
  101629. func (c *SecurityPoliciesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  101630. gensupport.SetOptions(c.urlParams_, opts...)
  101631. res, err := c.doRequest("json")
  101632. if res != nil && res.StatusCode == http.StatusNotModified {
  101633. if res.Body != nil {
  101634. res.Body.Close()
  101635. }
  101636. return nil, &googleapi.Error{
  101637. Code: res.StatusCode,
  101638. Header: res.Header,
  101639. }
  101640. }
  101641. if err != nil {
  101642. return nil, err
  101643. }
  101644. defer googleapi.CloseBody(res)
  101645. if err := googleapi.CheckResponse(res); err != nil {
  101646. return nil, err
  101647. }
  101648. ret := &Operation{
  101649. ServerResponse: googleapi.ServerResponse{
  101650. Header: res.Header,
  101651. HTTPStatusCode: res.StatusCode,
  101652. },
  101653. }
  101654. target := &ret
  101655. if err := gensupport.DecodeResponse(target, res); err != nil {
  101656. return nil, err
  101657. }
  101658. return ret, nil
  101659. // {
  101660. // "description": "Creates a new policy in the specified project using the data included in the request.",
  101661. // "httpMethod": "POST",
  101662. // "id": "compute.securityPolicies.insert",
  101663. // "parameterOrder": [
  101664. // "project"
  101665. // ],
  101666. // "parameters": {
  101667. // "project": {
  101668. // "description": "Project ID for this request.",
  101669. // "location": "path",
  101670. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  101671. // "required": true,
  101672. // "type": "string"
  101673. // },
  101674. // "requestId": {
  101675. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  101676. // "location": "query",
  101677. // "type": "string"
  101678. // },
  101679. // "validateOnly": {
  101680. // "description": "If true, the request will not be committed.",
  101681. // "location": "query",
  101682. // "type": "boolean"
  101683. // }
  101684. // },
  101685. // "path": "{project}/global/securityPolicies",
  101686. // "request": {
  101687. // "$ref": "SecurityPolicy"
  101688. // },
  101689. // "response": {
  101690. // "$ref": "Operation"
  101691. // },
  101692. // "scopes": [
  101693. // "https://www.googleapis.com/auth/cloud-platform",
  101694. // "https://www.googleapis.com/auth/compute"
  101695. // ]
  101696. // }
  101697. }
  101698. // method id "compute.securityPolicies.list":
  101699. type SecurityPoliciesListCall struct {
  101700. s *Service
  101701. project string
  101702. urlParams_ gensupport.URLParams
  101703. ifNoneMatch_ string
  101704. ctx_ context.Context
  101705. header_ http.Header
  101706. }
  101707. // List: List all the policies that have been configured for the
  101708. // specified project.
  101709. func (r *SecurityPoliciesService) List(project string) *SecurityPoliciesListCall {
  101710. c := &SecurityPoliciesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  101711. c.project = project
  101712. return c
  101713. }
  101714. // Filter sets the optional parameter "filter": A filter expression that
  101715. // filters resources listed in the response. The expression must specify
  101716. // the field name, a comparison operator, and the value that you want to
  101717. // use for filtering. The value must be a string, a number, or a
  101718. // boolean. The comparison operator must be either =, !=, >, or <.
  101719. //
  101720. // For example, if you are filtering Compute Engine instances, you can
  101721. // exclude instances named example-instance by specifying name !=
  101722. // example-instance.
  101723. //
  101724. // You can also filter nested fields. For example, you could specify
  101725. // scheduling.automaticRestart = false to include instances only if they
  101726. // are not scheduled for automatic restarts. You can use filtering on
  101727. // nested fields to filter based on resource labels.
  101728. //
  101729. // To filter on multiple expressions, provide each separate expression
  101730. // within parentheses. For example, (scheduling.automaticRestart = true)
  101731. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  101732. // AND expression. However, you can include AND and OR expressions
  101733. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  101734. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  101735. // true).
  101736. func (c *SecurityPoliciesListCall) Filter(filter string) *SecurityPoliciesListCall {
  101737. c.urlParams_.Set("filter", filter)
  101738. return c
  101739. }
  101740. // MaxResults sets the optional parameter "maxResults": The maximum
  101741. // number of results per page that should be returned. If the number of
  101742. // available results is larger than maxResults, Compute Engine returns a
  101743. // nextPageToken that can be used to get the next page of results in
  101744. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  101745. // (Default: 500)
  101746. func (c *SecurityPoliciesListCall) MaxResults(maxResults int64) *SecurityPoliciesListCall {
  101747. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  101748. return c
  101749. }
  101750. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  101751. // a certain order. By default, results are returned in alphanumerical
  101752. // order based on the resource name.
  101753. //
  101754. // You can also sort results in descending order based on the creation
  101755. // timestamp using orderBy="creationTimestamp desc". This sorts results
  101756. // based on the creationTimestamp field in reverse chronological order
  101757. // (newest result first). Use this to sort resources like operations so
  101758. // that the newest operation is returned first.
  101759. //
  101760. // Currently, only sorting by name or creationTimestamp desc is
  101761. // supported.
  101762. func (c *SecurityPoliciesListCall) OrderBy(orderBy string) *SecurityPoliciesListCall {
  101763. c.urlParams_.Set("orderBy", orderBy)
  101764. return c
  101765. }
  101766. // PageToken sets the optional parameter "pageToken": Specifies a page
  101767. // token to use. Set pageToken to the nextPageToken returned by a
  101768. // previous list request to get the next page of results.
  101769. func (c *SecurityPoliciesListCall) PageToken(pageToken string) *SecurityPoliciesListCall {
  101770. c.urlParams_.Set("pageToken", pageToken)
  101771. return c
  101772. }
  101773. // Fields allows partial responses to be retrieved. See
  101774. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  101775. // for more information.
  101776. func (c *SecurityPoliciesListCall) Fields(s ...googleapi.Field) *SecurityPoliciesListCall {
  101777. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  101778. return c
  101779. }
  101780. // IfNoneMatch sets the optional parameter which makes the operation
  101781. // fail if the object's ETag matches the given value. This is useful for
  101782. // getting updates only after the object has changed since the last
  101783. // request. Use googleapi.IsNotModified to check whether the response
  101784. // error from Do is the result of In-None-Match.
  101785. func (c *SecurityPoliciesListCall) IfNoneMatch(entityTag string) *SecurityPoliciesListCall {
  101786. c.ifNoneMatch_ = entityTag
  101787. return c
  101788. }
  101789. // Context sets the context to be used in this call's Do method. Any
  101790. // pending HTTP request will be aborted if the provided context is
  101791. // canceled.
  101792. func (c *SecurityPoliciesListCall) Context(ctx context.Context) *SecurityPoliciesListCall {
  101793. c.ctx_ = ctx
  101794. return c
  101795. }
  101796. // Header returns an http.Header that can be modified by the caller to
  101797. // add HTTP headers to the request.
  101798. func (c *SecurityPoliciesListCall) Header() http.Header {
  101799. if c.header_ == nil {
  101800. c.header_ = make(http.Header)
  101801. }
  101802. return c.header_
  101803. }
  101804. func (c *SecurityPoliciesListCall) doRequest(alt string) (*http.Response, error) {
  101805. reqHeaders := make(http.Header)
  101806. for k, v := range c.header_ {
  101807. reqHeaders[k] = v
  101808. }
  101809. reqHeaders.Set("User-Agent", c.s.userAgent())
  101810. if c.ifNoneMatch_ != "" {
  101811. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  101812. }
  101813. var body io.Reader = nil
  101814. c.urlParams_.Set("alt", alt)
  101815. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies")
  101816. urls += "?" + c.urlParams_.Encode()
  101817. req, _ := http.NewRequest("GET", urls, body)
  101818. req.Header = reqHeaders
  101819. googleapi.Expand(req.URL, map[string]string{
  101820. "project": c.project,
  101821. })
  101822. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  101823. }
  101824. // Do executes the "compute.securityPolicies.list" call.
  101825. // Exactly one of *SecurityPolicyList or error will be non-nil. Any
  101826. // non-2xx status code is an error. Response headers are in either
  101827. // *SecurityPolicyList.ServerResponse.Header or (if a response was
  101828. // returned at all) in error.(*googleapi.Error).Header. Use
  101829. // googleapi.IsNotModified to check whether the returned error was
  101830. // because http.StatusNotModified was returned.
  101831. func (c *SecurityPoliciesListCall) Do(opts ...googleapi.CallOption) (*SecurityPolicyList, error) {
  101832. gensupport.SetOptions(c.urlParams_, opts...)
  101833. res, err := c.doRequest("json")
  101834. if res != nil && res.StatusCode == http.StatusNotModified {
  101835. if res.Body != nil {
  101836. res.Body.Close()
  101837. }
  101838. return nil, &googleapi.Error{
  101839. Code: res.StatusCode,
  101840. Header: res.Header,
  101841. }
  101842. }
  101843. if err != nil {
  101844. return nil, err
  101845. }
  101846. defer googleapi.CloseBody(res)
  101847. if err := googleapi.CheckResponse(res); err != nil {
  101848. return nil, err
  101849. }
  101850. ret := &SecurityPolicyList{
  101851. ServerResponse: googleapi.ServerResponse{
  101852. Header: res.Header,
  101853. HTTPStatusCode: res.StatusCode,
  101854. },
  101855. }
  101856. target := &ret
  101857. if err := gensupport.DecodeResponse(target, res); err != nil {
  101858. return nil, err
  101859. }
  101860. return ret, nil
  101861. // {
  101862. // "description": "List all the policies that have been configured for the specified project.",
  101863. // "httpMethod": "GET",
  101864. // "id": "compute.securityPolicies.list",
  101865. // "parameterOrder": [
  101866. // "project"
  101867. // ],
  101868. // "parameters": {
  101869. // "filter": {
  101870. // "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).",
  101871. // "location": "query",
  101872. // "type": "string"
  101873. // },
  101874. // "maxResults": {
  101875. // "default": "500",
  101876. // "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)",
  101877. // "format": "uint32",
  101878. // "location": "query",
  101879. // "minimum": "0",
  101880. // "type": "integer"
  101881. // },
  101882. // "orderBy": {
  101883. // "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.",
  101884. // "location": "query",
  101885. // "type": "string"
  101886. // },
  101887. // "pageToken": {
  101888. // "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.",
  101889. // "location": "query",
  101890. // "type": "string"
  101891. // },
  101892. // "project": {
  101893. // "description": "Project ID for this request.",
  101894. // "location": "path",
  101895. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  101896. // "required": true,
  101897. // "type": "string"
  101898. // }
  101899. // },
  101900. // "path": "{project}/global/securityPolicies",
  101901. // "response": {
  101902. // "$ref": "SecurityPolicyList"
  101903. // },
  101904. // "scopes": [
  101905. // "https://www.googleapis.com/auth/cloud-platform",
  101906. // "https://www.googleapis.com/auth/compute",
  101907. // "https://www.googleapis.com/auth/compute.readonly"
  101908. // ]
  101909. // }
  101910. }
  101911. // Pages invokes f for each page of results.
  101912. // A non-nil error returned from f will halt the iteration.
  101913. // The provided context supersedes any context provided to the Context method.
  101914. func (c *SecurityPoliciesListCall) Pages(ctx context.Context, f func(*SecurityPolicyList) error) error {
  101915. c.ctx_ = ctx
  101916. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  101917. for {
  101918. x, err := c.Do()
  101919. if err != nil {
  101920. return err
  101921. }
  101922. if err := f(x); err != nil {
  101923. return err
  101924. }
  101925. if x.NextPageToken == "" {
  101926. return nil
  101927. }
  101928. c.PageToken(x.NextPageToken)
  101929. }
  101930. }
  101931. // method id "compute.securityPolicies.listPreconfiguredExpressionSets":
  101932. type SecurityPoliciesListPreconfiguredExpressionSetsCall struct {
  101933. s *Service
  101934. project string
  101935. urlParams_ gensupport.URLParams
  101936. ifNoneMatch_ string
  101937. ctx_ context.Context
  101938. header_ http.Header
  101939. }
  101940. // ListPreconfiguredExpressionSets: Gets the current list of
  101941. // preconfigured Web Application Firewall (WAF) expressions.
  101942. func (r *SecurityPoliciesService) ListPreconfiguredExpressionSets(project string) *SecurityPoliciesListPreconfiguredExpressionSetsCall {
  101943. c := &SecurityPoliciesListPreconfiguredExpressionSetsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  101944. c.project = project
  101945. return c
  101946. }
  101947. // Filter sets the optional parameter "filter": A filter expression that
  101948. // filters resources listed in the response. The expression must specify
  101949. // the field name, a comparison operator, and the value that you want to
  101950. // use for filtering. The value must be a string, a number, or a
  101951. // boolean. The comparison operator must be either =, !=, >, or <.
  101952. //
  101953. // For example, if you are filtering Compute Engine instances, you can
  101954. // exclude instances named example-instance by specifying name !=
  101955. // example-instance.
  101956. //
  101957. // You can also filter nested fields. For example, you could specify
  101958. // scheduling.automaticRestart = false to include instances only if they
  101959. // are not scheduled for automatic restarts. You can use filtering on
  101960. // nested fields to filter based on resource labels.
  101961. //
  101962. // To filter on multiple expressions, provide each separate expression
  101963. // within parentheses. For example, (scheduling.automaticRestart = true)
  101964. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  101965. // AND expression. However, you can include AND and OR expressions
  101966. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  101967. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  101968. // true).
  101969. func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) Filter(filter string) *SecurityPoliciesListPreconfiguredExpressionSetsCall {
  101970. c.urlParams_.Set("filter", filter)
  101971. return c
  101972. }
  101973. // MaxResults sets the optional parameter "maxResults": The maximum
  101974. // number of results per page that should be returned. If the number of
  101975. // available results is larger than maxResults, Compute Engine returns a
  101976. // nextPageToken that can be used to get the next page of results in
  101977. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  101978. // (Default: 500)
  101979. func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) MaxResults(maxResults int64) *SecurityPoliciesListPreconfiguredExpressionSetsCall {
  101980. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  101981. return c
  101982. }
  101983. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  101984. // a certain order. By default, results are returned in alphanumerical
  101985. // order based on the resource name.
  101986. //
  101987. // You can also sort results in descending order based on the creation
  101988. // timestamp using orderBy="creationTimestamp desc". This sorts results
  101989. // based on the creationTimestamp field in reverse chronological order
  101990. // (newest result first). Use this to sort resources like operations so
  101991. // that the newest operation is returned first.
  101992. //
  101993. // Currently, only sorting by name or creationTimestamp desc is
  101994. // supported.
  101995. func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) OrderBy(orderBy string) *SecurityPoliciesListPreconfiguredExpressionSetsCall {
  101996. c.urlParams_.Set("orderBy", orderBy)
  101997. return c
  101998. }
  101999. // PageToken sets the optional parameter "pageToken": Specifies a page
  102000. // token to use. Set pageToken to the nextPageToken returned by a
  102001. // previous list request to get the next page of results.
  102002. func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) PageToken(pageToken string) *SecurityPoliciesListPreconfiguredExpressionSetsCall {
  102003. c.urlParams_.Set("pageToken", pageToken)
  102004. return c
  102005. }
  102006. // Fields allows partial responses to be retrieved. See
  102007. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  102008. // for more information.
  102009. func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) Fields(s ...googleapi.Field) *SecurityPoliciesListPreconfiguredExpressionSetsCall {
  102010. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  102011. return c
  102012. }
  102013. // IfNoneMatch sets the optional parameter which makes the operation
  102014. // fail if the object's ETag matches the given value. This is useful for
  102015. // getting updates only after the object has changed since the last
  102016. // request. Use googleapi.IsNotModified to check whether the response
  102017. // error from Do is the result of In-None-Match.
  102018. func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) IfNoneMatch(entityTag string) *SecurityPoliciesListPreconfiguredExpressionSetsCall {
  102019. c.ifNoneMatch_ = entityTag
  102020. return c
  102021. }
  102022. // Context sets the context to be used in this call's Do method. Any
  102023. // pending HTTP request will be aborted if the provided context is
  102024. // canceled.
  102025. func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) Context(ctx context.Context) *SecurityPoliciesListPreconfiguredExpressionSetsCall {
  102026. c.ctx_ = ctx
  102027. return c
  102028. }
  102029. // Header returns an http.Header that can be modified by the caller to
  102030. // add HTTP headers to the request.
  102031. func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) Header() http.Header {
  102032. if c.header_ == nil {
  102033. c.header_ = make(http.Header)
  102034. }
  102035. return c.header_
  102036. }
  102037. func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) doRequest(alt string) (*http.Response, error) {
  102038. reqHeaders := make(http.Header)
  102039. for k, v := range c.header_ {
  102040. reqHeaders[k] = v
  102041. }
  102042. reqHeaders.Set("User-Agent", c.s.userAgent())
  102043. if c.ifNoneMatch_ != "" {
  102044. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  102045. }
  102046. var body io.Reader = nil
  102047. c.urlParams_.Set("alt", alt)
  102048. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/listPreconfiguredExpressionSets")
  102049. urls += "?" + c.urlParams_.Encode()
  102050. req, _ := http.NewRequest("GET", urls, body)
  102051. req.Header = reqHeaders
  102052. googleapi.Expand(req.URL, map[string]string{
  102053. "project": c.project,
  102054. })
  102055. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  102056. }
  102057. // Do executes the "compute.securityPolicies.listPreconfiguredExpressionSets" call.
  102058. // Exactly one of
  102059. // *SecurityPoliciesListPreconfiguredExpressionSetsResponse or error
  102060. // will be non-nil. Any non-2xx status code is an error. Response
  102061. // headers are in either
  102062. // *SecurityPoliciesListPreconfiguredExpressionSetsResponse.ServerRespons
  102063. // e.Header or (if a response was returned at all) in
  102064. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  102065. // whether the returned error was because http.StatusNotModified was
  102066. // returned.
  102067. func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) Do(opts ...googleapi.CallOption) (*SecurityPoliciesListPreconfiguredExpressionSetsResponse, error) {
  102068. gensupport.SetOptions(c.urlParams_, opts...)
  102069. res, err := c.doRequest("json")
  102070. if res != nil && res.StatusCode == http.StatusNotModified {
  102071. if res.Body != nil {
  102072. res.Body.Close()
  102073. }
  102074. return nil, &googleapi.Error{
  102075. Code: res.StatusCode,
  102076. Header: res.Header,
  102077. }
  102078. }
  102079. if err != nil {
  102080. return nil, err
  102081. }
  102082. defer googleapi.CloseBody(res)
  102083. if err := googleapi.CheckResponse(res); err != nil {
  102084. return nil, err
  102085. }
  102086. ret := &SecurityPoliciesListPreconfiguredExpressionSetsResponse{
  102087. ServerResponse: googleapi.ServerResponse{
  102088. Header: res.Header,
  102089. HTTPStatusCode: res.StatusCode,
  102090. },
  102091. }
  102092. target := &ret
  102093. if err := gensupport.DecodeResponse(target, res); err != nil {
  102094. return nil, err
  102095. }
  102096. return ret, nil
  102097. // {
  102098. // "description": "Gets the current list of preconfigured Web Application Firewall (WAF) expressions.",
  102099. // "httpMethod": "GET",
  102100. // "id": "compute.securityPolicies.listPreconfiguredExpressionSets",
  102101. // "parameterOrder": [
  102102. // "project"
  102103. // ],
  102104. // "parameters": {
  102105. // "filter": {
  102106. // "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).",
  102107. // "location": "query",
  102108. // "type": "string"
  102109. // },
  102110. // "maxResults": {
  102111. // "default": "500",
  102112. // "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)",
  102113. // "format": "uint32",
  102114. // "location": "query",
  102115. // "minimum": "0",
  102116. // "type": "integer"
  102117. // },
  102118. // "orderBy": {
  102119. // "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.",
  102120. // "location": "query",
  102121. // "type": "string"
  102122. // },
  102123. // "pageToken": {
  102124. // "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.",
  102125. // "location": "query",
  102126. // "type": "string"
  102127. // },
  102128. // "project": {
  102129. // "description": "Project ID for this request.",
  102130. // "location": "path",
  102131. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  102132. // "required": true,
  102133. // "type": "string"
  102134. // }
  102135. // },
  102136. // "path": "{project}/global/securityPolicies/listPreconfiguredExpressionSets",
  102137. // "response": {
  102138. // "$ref": "SecurityPoliciesListPreconfiguredExpressionSetsResponse"
  102139. // },
  102140. // "scopes": [
  102141. // "https://www.googleapis.com/auth/cloud-platform",
  102142. // "https://www.googleapis.com/auth/compute"
  102143. // ]
  102144. // }
  102145. }
  102146. // method id "compute.securityPolicies.patch":
  102147. type SecurityPoliciesPatchCall struct {
  102148. s *Service
  102149. project string
  102150. securityPolicy string
  102151. securitypolicy *SecurityPolicy
  102152. urlParams_ gensupport.URLParams
  102153. ctx_ context.Context
  102154. header_ http.Header
  102155. }
  102156. // Patch: Patches the specified policy with the data included in the
  102157. // request.
  102158. func (r *SecurityPoliciesService) Patch(project string, securityPolicy string, securitypolicy *SecurityPolicy) *SecurityPoliciesPatchCall {
  102159. c := &SecurityPoliciesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  102160. c.project = project
  102161. c.securityPolicy = securityPolicy
  102162. c.securitypolicy = securitypolicy
  102163. return c
  102164. }
  102165. // RequestId sets the optional parameter "requestId": An optional
  102166. // request ID to identify requests. Specify a unique request ID so that
  102167. // if you must retry your request, the server will know to ignore the
  102168. // request if it has already been completed.
  102169. //
  102170. // For example, consider a situation where you make an initial request
  102171. // and the request times out. If you make the request again with the
  102172. // same request ID, the server can check if original operation with the
  102173. // same request ID was received, and if so, will ignore the second
  102174. // request. This prevents clients from accidentally creating duplicate
  102175. // commitments.
  102176. //
  102177. // The request ID must be a valid UUID with the exception that zero UUID
  102178. // is not supported (00000000-0000-0000-0000-000000000000).
  102179. func (c *SecurityPoliciesPatchCall) RequestId(requestId string) *SecurityPoliciesPatchCall {
  102180. c.urlParams_.Set("requestId", requestId)
  102181. return c
  102182. }
  102183. // Fields allows partial responses to be retrieved. See
  102184. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  102185. // for more information.
  102186. func (c *SecurityPoliciesPatchCall) Fields(s ...googleapi.Field) *SecurityPoliciesPatchCall {
  102187. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  102188. return c
  102189. }
  102190. // Context sets the context to be used in this call's Do method. Any
  102191. // pending HTTP request will be aborted if the provided context is
  102192. // canceled.
  102193. func (c *SecurityPoliciesPatchCall) Context(ctx context.Context) *SecurityPoliciesPatchCall {
  102194. c.ctx_ = ctx
  102195. return c
  102196. }
  102197. // Header returns an http.Header that can be modified by the caller to
  102198. // add HTTP headers to the request.
  102199. func (c *SecurityPoliciesPatchCall) Header() http.Header {
  102200. if c.header_ == nil {
  102201. c.header_ = make(http.Header)
  102202. }
  102203. return c.header_
  102204. }
  102205. func (c *SecurityPoliciesPatchCall) doRequest(alt string) (*http.Response, error) {
  102206. reqHeaders := make(http.Header)
  102207. for k, v := range c.header_ {
  102208. reqHeaders[k] = v
  102209. }
  102210. reqHeaders.Set("User-Agent", c.s.userAgent())
  102211. var body io.Reader = nil
  102212. body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicy)
  102213. if err != nil {
  102214. return nil, err
  102215. }
  102216. reqHeaders.Set("Content-Type", "application/json")
  102217. c.urlParams_.Set("alt", alt)
  102218. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{securityPolicy}")
  102219. urls += "?" + c.urlParams_.Encode()
  102220. req, _ := http.NewRequest("PATCH", urls, body)
  102221. req.Header = reqHeaders
  102222. googleapi.Expand(req.URL, map[string]string{
  102223. "project": c.project,
  102224. "securityPolicy": c.securityPolicy,
  102225. })
  102226. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  102227. }
  102228. // Do executes the "compute.securityPolicies.patch" call.
  102229. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  102230. // status code is an error. Response headers are in either
  102231. // *Operation.ServerResponse.Header or (if a response was returned at
  102232. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  102233. // to check whether the returned error was because
  102234. // http.StatusNotModified was returned.
  102235. func (c *SecurityPoliciesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  102236. gensupport.SetOptions(c.urlParams_, opts...)
  102237. res, err := c.doRequest("json")
  102238. if res != nil && res.StatusCode == http.StatusNotModified {
  102239. if res.Body != nil {
  102240. res.Body.Close()
  102241. }
  102242. return nil, &googleapi.Error{
  102243. Code: res.StatusCode,
  102244. Header: res.Header,
  102245. }
  102246. }
  102247. if err != nil {
  102248. return nil, err
  102249. }
  102250. defer googleapi.CloseBody(res)
  102251. if err := googleapi.CheckResponse(res); err != nil {
  102252. return nil, err
  102253. }
  102254. ret := &Operation{
  102255. ServerResponse: googleapi.ServerResponse{
  102256. Header: res.Header,
  102257. HTTPStatusCode: res.StatusCode,
  102258. },
  102259. }
  102260. target := &ret
  102261. if err := gensupport.DecodeResponse(target, res); err != nil {
  102262. return nil, err
  102263. }
  102264. return ret, nil
  102265. // {
  102266. // "description": "Patches the specified policy with the data included in the request.",
  102267. // "httpMethod": "PATCH",
  102268. // "id": "compute.securityPolicies.patch",
  102269. // "parameterOrder": [
  102270. // "project",
  102271. // "securityPolicy"
  102272. // ],
  102273. // "parameters": {
  102274. // "project": {
  102275. // "description": "Project ID for this request.",
  102276. // "location": "path",
  102277. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  102278. // "required": true,
  102279. // "type": "string"
  102280. // },
  102281. // "requestId": {
  102282. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  102283. // "location": "query",
  102284. // "type": "string"
  102285. // },
  102286. // "securityPolicy": {
  102287. // "description": "Name of the security policy to update.",
  102288. // "location": "path",
  102289. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  102290. // "required": true,
  102291. // "type": "string"
  102292. // }
  102293. // },
  102294. // "path": "{project}/global/securityPolicies/{securityPolicy}",
  102295. // "request": {
  102296. // "$ref": "SecurityPolicy"
  102297. // },
  102298. // "response": {
  102299. // "$ref": "Operation"
  102300. // },
  102301. // "scopes": [
  102302. // "https://www.googleapis.com/auth/cloud-platform",
  102303. // "https://www.googleapis.com/auth/compute"
  102304. // ]
  102305. // }
  102306. }
  102307. // method id "compute.securityPolicies.patchRule":
  102308. type SecurityPoliciesPatchRuleCall struct {
  102309. s *Service
  102310. project string
  102311. securityPolicy string
  102312. securitypolicyrule *SecurityPolicyRule
  102313. urlParams_ gensupport.URLParams
  102314. ctx_ context.Context
  102315. header_ http.Header
  102316. }
  102317. // PatchRule: Patches a rule at the specified priority.
  102318. func (r *SecurityPoliciesService) PatchRule(project string, securityPolicy string, securitypolicyrule *SecurityPolicyRule) *SecurityPoliciesPatchRuleCall {
  102319. c := &SecurityPoliciesPatchRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  102320. c.project = project
  102321. c.securityPolicy = securityPolicy
  102322. c.securitypolicyrule = securitypolicyrule
  102323. return c
  102324. }
  102325. // Priority sets the optional parameter "priority": The priority of the
  102326. // rule to patch.
  102327. func (c *SecurityPoliciesPatchRuleCall) Priority(priority int64) *SecurityPoliciesPatchRuleCall {
  102328. c.urlParams_.Set("priority", fmt.Sprint(priority))
  102329. return c
  102330. }
  102331. // ValidateOnly sets the optional parameter "validateOnly": If true, the
  102332. // request will not be committed.
  102333. func (c *SecurityPoliciesPatchRuleCall) ValidateOnly(validateOnly bool) *SecurityPoliciesPatchRuleCall {
  102334. c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
  102335. return c
  102336. }
  102337. // Fields allows partial responses to be retrieved. See
  102338. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  102339. // for more information.
  102340. func (c *SecurityPoliciesPatchRuleCall) Fields(s ...googleapi.Field) *SecurityPoliciesPatchRuleCall {
  102341. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  102342. return c
  102343. }
  102344. // Context sets the context to be used in this call's Do method. Any
  102345. // pending HTTP request will be aborted if the provided context is
  102346. // canceled.
  102347. func (c *SecurityPoliciesPatchRuleCall) Context(ctx context.Context) *SecurityPoliciesPatchRuleCall {
  102348. c.ctx_ = ctx
  102349. return c
  102350. }
  102351. // Header returns an http.Header that can be modified by the caller to
  102352. // add HTTP headers to the request.
  102353. func (c *SecurityPoliciesPatchRuleCall) Header() http.Header {
  102354. if c.header_ == nil {
  102355. c.header_ = make(http.Header)
  102356. }
  102357. return c.header_
  102358. }
  102359. func (c *SecurityPoliciesPatchRuleCall) doRequest(alt string) (*http.Response, error) {
  102360. reqHeaders := make(http.Header)
  102361. for k, v := range c.header_ {
  102362. reqHeaders[k] = v
  102363. }
  102364. reqHeaders.Set("User-Agent", c.s.userAgent())
  102365. var body io.Reader = nil
  102366. body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyrule)
  102367. if err != nil {
  102368. return nil, err
  102369. }
  102370. reqHeaders.Set("Content-Type", "application/json")
  102371. c.urlParams_.Set("alt", alt)
  102372. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{securityPolicy}/patchRule")
  102373. urls += "?" + c.urlParams_.Encode()
  102374. req, _ := http.NewRequest("POST", urls, body)
  102375. req.Header = reqHeaders
  102376. googleapi.Expand(req.URL, map[string]string{
  102377. "project": c.project,
  102378. "securityPolicy": c.securityPolicy,
  102379. })
  102380. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  102381. }
  102382. // Do executes the "compute.securityPolicies.patchRule" call.
  102383. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  102384. // status code is an error. Response headers are in either
  102385. // *Operation.ServerResponse.Header or (if a response was returned at
  102386. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  102387. // to check whether the returned error was because
  102388. // http.StatusNotModified was returned.
  102389. func (c *SecurityPoliciesPatchRuleCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  102390. gensupport.SetOptions(c.urlParams_, opts...)
  102391. res, err := c.doRequest("json")
  102392. if res != nil && res.StatusCode == http.StatusNotModified {
  102393. if res.Body != nil {
  102394. res.Body.Close()
  102395. }
  102396. return nil, &googleapi.Error{
  102397. Code: res.StatusCode,
  102398. Header: res.Header,
  102399. }
  102400. }
  102401. if err != nil {
  102402. return nil, err
  102403. }
  102404. defer googleapi.CloseBody(res)
  102405. if err := googleapi.CheckResponse(res); err != nil {
  102406. return nil, err
  102407. }
  102408. ret := &Operation{
  102409. ServerResponse: googleapi.ServerResponse{
  102410. Header: res.Header,
  102411. HTTPStatusCode: res.StatusCode,
  102412. },
  102413. }
  102414. target := &ret
  102415. if err := gensupport.DecodeResponse(target, res); err != nil {
  102416. return nil, err
  102417. }
  102418. return ret, nil
  102419. // {
  102420. // "description": "Patches a rule at the specified priority.",
  102421. // "httpMethod": "POST",
  102422. // "id": "compute.securityPolicies.patchRule",
  102423. // "parameterOrder": [
  102424. // "project",
  102425. // "securityPolicy"
  102426. // ],
  102427. // "parameters": {
  102428. // "priority": {
  102429. // "description": "The priority of the rule to patch.",
  102430. // "format": "int32",
  102431. // "location": "query",
  102432. // "type": "integer"
  102433. // },
  102434. // "project": {
  102435. // "description": "Project ID for this request.",
  102436. // "location": "path",
  102437. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  102438. // "required": true,
  102439. // "type": "string"
  102440. // },
  102441. // "securityPolicy": {
  102442. // "description": "Name of the security policy to update.",
  102443. // "location": "path",
  102444. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  102445. // "required": true,
  102446. // "type": "string"
  102447. // },
  102448. // "validateOnly": {
  102449. // "description": "If true, the request will not be committed.",
  102450. // "location": "query",
  102451. // "type": "boolean"
  102452. // }
  102453. // },
  102454. // "path": "{project}/global/securityPolicies/{securityPolicy}/patchRule",
  102455. // "request": {
  102456. // "$ref": "SecurityPolicyRule"
  102457. // },
  102458. // "response": {
  102459. // "$ref": "Operation"
  102460. // },
  102461. // "scopes": [
  102462. // "https://www.googleapis.com/auth/cloud-platform",
  102463. // "https://www.googleapis.com/auth/compute"
  102464. // ]
  102465. // }
  102466. }
  102467. // method id "compute.securityPolicies.removeRule":
  102468. type SecurityPoliciesRemoveRuleCall struct {
  102469. s *Service
  102470. project string
  102471. securityPolicy string
  102472. urlParams_ gensupport.URLParams
  102473. ctx_ context.Context
  102474. header_ http.Header
  102475. }
  102476. // RemoveRule: Deletes a rule at the specified priority.
  102477. func (r *SecurityPoliciesService) RemoveRule(project string, securityPolicy string) *SecurityPoliciesRemoveRuleCall {
  102478. c := &SecurityPoliciesRemoveRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  102479. c.project = project
  102480. c.securityPolicy = securityPolicy
  102481. return c
  102482. }
  102483. // Priority sets the optional parameter "priority": The priority of the
  102484. // rule to remove from the security policy.
  102485. func (c *SecurityPoliciesRemoveRuleCall) Priority(priority int64) *SecurityPoliciesRemoveRuleCall {
  102486. c.urlParams_.Set("priority", fmt.Sprint(priority))
  102487. return c
  102488. }
  102489. // Fields allows partial responses to be retrieved. See
  102490. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  102491. // for more information.
  102492. func (c *SecurityPoliciesRemoveRuleCall) Fields(s ...googleapi.Field) *SecurityPoliciesRemoveRuleCall {
  102493. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  102494. return c
  102495. }
  102496. // Context sets the context to be used in this call's Do method. Any
  102497. // pending HTTP request will be aborted if the provided context is
  102498. // canceled.
  102499. func (c *SecurityPoliciesRemoveRuleCall) Context(ctx context.Context) *SecurityPoliciesRemoveRuleCall {
  102500. c.ctx_ = ctx
  102501. return c
  102502. }
  102503. // Header returns an http.Header that can be modified by the caller to
  102504. // add HTTP headers to the request.
  102505. func (c *SecurityPoliciesRemoveRuleCall) Header() http.Header {
  102506. if c.header_ == nil {
  102507. c.header_ = make(http.Header)
  102508. }
  102509. return c.header_
  102510. }
  102511. func (c *SecurityPoliciesRemoveRuleCall) doRequest(alt string) (*http.Response, error) {
  102512. reqHeaders := make(http.Header)
  102513. for k, v := range c.header_ {
  102514. reqHeaders[k] = v
  102515. }
  102516. reqHeaders.Set("User-Agent", c.s.userAgent())
  102517. var body io.Reader = nil
  102518. c.urlParams_.Set("alt", alt)
  102519. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{securityPolicy}/removeRule")
  102520. urls += "?" + c.urlParams_.Encode()
  102521. req, _ := http.NewRequest("POST", urls, body)
  102522. req.Header = reqHeaders
  102523. googleapi.Expand(req.URL, map[string]string{
  102524. "project": c.project,
  102525. "securityPolicy": c.securityPolicy,
  102526. })
  102527. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  102528. }
  102529. // Do executes the "compute.securityPolicies.removeRule" call.
  102530. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  102531. // status code is an error. Response headers are in either
  102532. // *Operation.ServerResponse.Header or (if a response was returned at
  102533. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  102534. // to check whether the returned error was because
  102535. // http.StatusNotModified was returned.
  102536. func (c *SecurityPoliciesRemoveRuleCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  102537. gensupport.SetOptions(c.urlParams_, opts...)
  102538. res, err := c.doRequest("json")
  102539. if res != nil && res.StatusCode == http.StatusNotModified {
  102540. if res.Body != nil {
  102541. res.Body.Close()
  102542. }
  102543. return nil, &googleapi.Error{
  102544. Code: res.StatusCode,
  102545. Header: res.Header,
  102546. }
  102547. }
  102548. if err != nil {
  102549. return nil, err
  102550. }
  102551. defer googleapi.CloseBody(res)
  102552. if err := googleapi.CheckResponse(res); err != nil {
  102553. return nil, err
  102554. }
  102555. ret := &Operation{
  102556. ServerResponse: googleapi.ServerResponse{
  102557. Header: res.Header,
  102558. HTTPStatusCode: res.StatusCode,
  102559. },
  102560. }
  102561. target := &ret
  102562. if err := gensupport.DecodeResponse(target, res); err != nil {
  102563. return nil, err
  102564. }
  102565. return ret, nil
  102566. // {
  102567. // "description": "Deletes a rule at the specified priority.",
  102568. // "httpMethod": "POST",
  102569. // "id": "compute.securityPolicies.removeRule",
  102570. // "parameterOrder": [
  102571. // "project",
  102572. // "securityPolicy"
  102573. // ],
  102574. // "parameters": {
  102575. // "priority": {
  102576. // "description": "The priority of the rule to remove from the security policy.",
  102577. // "format": "int32",
  102578. // "location": "query",
  102579. // "type": "integer"
  102580. // },
  102581. // "project": {
  102582. // "description": "Project ID for this request.",
  102583. // "location": "path",
  102584. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  102585. // "required": true,
  102586. // "type": "string"
  102587. // },
  102588. // "securityPolicy": {
  102589. // "description": "Name of the security policy to update.",
  102590. // "location": "path",
  102591. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  102592. // "required": true,
  102593. // "type": "string"
  102594. // }
  102595. // },
  102596. // "path": "{project}/global/securityPolicies/{securityPolicy}/removeRule",
  102597. // "response": {
  102598. // "$ref": "Operation"
  102599. // },
  102600. // "scopes": [
  102601. // "https://www.googleapis.com/auth/cloud-platform",
  102602. // "https://www.googleapis.com/auth/compute"
  102603. // ]
  102604. // }
  102605. }
  102606. // method id "compute.securityPolicies.setLabels":
  102607. type SecurityPoliciesSetLabelsCall struct {
  102608. s *Service
  102609. project string
  102610. resource string
  102611. globalsetlabelsrequest *GlobalSetLabelsRequest
  102612. urlParams_ gensupport.URLParams
  102613. ctx_ context.Context
  102614. header_ http.Header
  102615. }
  102616. // SetLabels: Sets the labels on a security policy. To learn more about
  102617. // labels, read the Labeling Resources documentation.
  102618. func (r *SecurityPoliciesService) SetLabels(project string, resource string, globalsetlabelsrequest *GlobalSetLabelsRequest) *SecurityPoliciesSetLabelsCall {
  102619. c := &SecurityPoliciesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  102620. c.project = project
  102621. c.resource = resource
  102622. c.globalsetlabelsrequest = globalsetlabelsrequest
  102623. return c
  102624. }
  102625. // Fields allows partial responses to be retrieved. See
  102626. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  102627. // for more information.
  102628. func (c *SecurityPoliciesSetLabelsCall) Fields(s ...googleapi.Field) *SecurityPoliciesSetLabelsCall {
  102629. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  102630. return c
  102631. }
  102632. // Context sets the context to be used in this call's Do method. Any
  102633. // pending HTTP request will be aborted if the provided context is
  102634. // canceled.
  102635. func (c *SecurityPoliciesSetLabelsCall) Context(ctx context.Context) *SecurityPoliciesSetLabelsCall {
  102636. c.ctx_ = ctx
  102637. return c
  102638. }
  102639. // Header returns an http.Header that can be modified by the caller to
  102640. // add HTTP headers to the request.
  102641. func (c *SecurityPoliciesSetLabelsCall) Header() http.Header {
  102642. if c.header_ == nil {
  102643. c.header_ = make(http.Header)
  102644. }
  102645. return c.header_
  102646. }
  102647. func (c *SecurityPoliciesSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  102648. reqHeaders := make(http.Header)
  102649. for k, v := range c.header_ {
  102650. reqHeaders[k] = v
  102651. }
  102652. reqHeaders.Set("User-Agent", c.s.userAgent())
  102653. var body io.Reader = nil
  102654. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest)
  102655. if err != nil {
  102656. return nil, err
  102657. }
  102658. reqHeaders.Set("Content-Type", "application/json")
  102659. c.urlParams_.Set("alt", alt)
  102660. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{resource}/setLabels")
  102661. urls += "?" + c.urlParams_.Encode()
  102662. req, _ := http.NewRequest("POST", urls, body)
  102663. req.Header = reqHeaders
  102664. googleapi.Expand(req.URL, map[string]string{
  102665. "project": c.project,
  102666. "resource": c.resource,
  102667. })
  102668. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  102669. }
  102670. // Do executes the "compute.securityPolicies.setLabels" call.
  102671. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  102672. // status code is an error. Response headers are in either
  102673. // *Operation.ServerResponse.Header or (if a response was returned at
  102674. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  102675. // to check whether the returned error was because
  102676. // http.StatusNotModified was returned.
  102677. func (c *SecurityPoliciesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  102678. gensupport.SetOptions(c.urlParams_, opts...)
  102679. res, err := c.doRequest("json")
  102680. if res != nil && res.StatusCode == http.StatusNotModified {
  102681. if res.Body != nil {
  102682. res.Body.Close()
  102683. }
  102684. return nil, &googleapi.Error{
  102685. Code: res.StatusCode,
  102686. Header: res.Header,
  102687. }
  102688. }
  102689. if err != nil {
  102690. return nil, err
  102691. }
  102692. defer googleapi.CloseBody(res)
  102693. if err := googleapi.CheckResponse(res); err != nil {
  102694. return nil, err
  102695. }
  102696. ret := &Operation{
  102697. ServerResponse: googleapi.ServerResponse{
  102698. Header: res.Header,
  102699. HTTPStatusCode: res.StatusCode,
  102700. },
  102701. }
  102702. target := &ret
  102703. if err := gensupport.DecodeResponse(target, res); err != nil {
  102704. return nil, err
  102705. }
  102706. return ret, nil
  102707. // {
  102708. // "description": "Sets the labels on a security policy. To learn more about labels, read the Labeling Resources documentation.",
  102709. // "httpMethod": "POST",
  102710. // "id": "compute.securityPolicies.setLabels",
  102711. // "parameterOrder": [
  102712. // "project",
  102713. // "resource"
  102714. // ],
  102715. // "parameters": {
  102716. // "project": {
  102717. // "description": "Project ID for this request.",
  102718. // "location": "path",
  102719. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  102720. // "required": true,
  102721. // "type": "string"
  102722. // },
  102723. // "resource": {
  102724. // "description": "Name of the resource for this request.",
  102725. // "location": "path",
  102726. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?",
  102727. // "required": true,
  102728. // "type": "string"
  102729. // }
  102730. // },
  102731. // "path": "{project}/global/securityPolicies/{resource}/setLabels",
  102732. // "request": {
  102733. // "$ref": "GlobalSetLabelsRequest"
  102734. // },
  102735. // "response": {
  102736. // "$ref": "Operation"
  102737. // },
  102738. // "scopes": [
  102739. // "https://www.googleapis.com/auth/cloud-platform",
  102740. // "https://www.googleapis.com/auth/compute"
  102741. // ]
  102742. // }
  102743. }
  102744. // method id "compute.securityPolicies.testIamPermissions":
  102745. type SecurityPoliciesTestIamPermissionsCall struct {
  102746. s *Service
  102747. project string
  102748. resource string
  102749. testpermissionsrequest *TestPermissionsRequest
  102750. urlParams_ gensupport.URLParams
  102751. ctx_ context.Context
  102752. header_ http.Header
  102753. }
  102754. // TestIamPermissions: Returns permissions that a caller has on the
  102755. // specified resource.
  102756. func (r *SecurityPoliciesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *SecurityPoliciesTestIamPermissionsCall {
  102757. c := &SecurityPoliciesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  102758. c.project = project
  102759. c.resource = resource
  102760. c.testpermissionsrequest = testpermissionsrequest
  102761. return c
  102762. }
  102763. // Fields allows partial responses to be retrieved. See
  102764. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  102765. // for more information.
  102766. func (c *SecurityPoliciesTestIamPermissionsCall) Fields(s ...googleapi.Field) *SecurityPoliciesTestIamPermissionsCall {
  102767. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  102768. return c
  102769. }
  102770. // Context sets the context to be used in this call's Do method. Any
  102771. // pending HTTP request will be aborted if the provided context is
  102772. // canceled.
  102773. func (c *SecurityPoliciesTestIamPermissionsCall) Context(ctx context.Context) *SecurityPoliciesTestIamPermissionsCall {
  102774. c.ctx_ = ctx
  102775. return c
  102776. }
  102777. // Header returns an http.Header that can be modified by the caller to
  102778. // add HTTP headers to the request.
  102779. func (c *SecurityPoliciesTestIamPermissionsCall) Header() http.Header {
  102780. if c.header_ == nil {
  102781. c.header_ = make(http.Header)
  102782. }
  102783. return c.header_
  102784. }
  102785. func (c *SecurityPoliciesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  102786. reqHeaders := make(http.Header)
  102787. for k, v := range c.header_ {
  102788. reqHeaders[k] = v
  102789. }
  102790. reqHeaders.Set("User-Agent", c.s.userAgent())
  102791. var body io.Reader = nil
  102792. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  102793. if err != nil {
  102794. return nil, err
  102795. }
  102796. reqHeaders.Set("Content-Type", "application/json")
  102797. c.urlParams_.Set("alt", alt)
  102798. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{resource}/testIamPermissions")
  102799. urls += "?" + c.urlParams_.Encode()
  102800. req, _ := http.NewRequest("POST", urls, body)
  102801. req.Header = reqHeaders
  102802. googleapi.Expand(req.URL, map[string]string{
  102803. "project": c.project,
  102804. "resource": c.resource,
  102805. })
  102806. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  102807. }
  102808. // Do executes the "compute.securityPolicies.testIamPermissions" call.
  102809. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  102810. // non-2xx status code is an error. Response headers are in either
  102811. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  102812. // returned at all) in error.(*googleapi.Error).Header. Use
  102813. // googleapi.IsNotModified to check whether the returned error was
  102814. // because http.StatusNotModified was returned.
  102815. func (c *SecurityPoliciesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  102816. gensupport.SetOptions(c.urlParams_, opts...)
  102817. res, err := c.doRequest("json")
  102818. if res != nil && res.StatusCode == http.StatusNotModified {
  102819. if res.Body != nil {
  102820. res.Body.Close()
  102821. }
  102822. return nil, &googleapi.Error{
  102823. Code: res.StatusCode,
  102824. Header: res.Header,
  102825. }
  102826. }
  102827. if err != nil {
  102828. return nil, err
  102829. }
  102830. defer googleapi.CloseBody(res)
  102831. if err := googleapi.CheckResponse(res); err != nil {
  102832. return nil, err
  102833. }
  102834. ret := &TestPermissionsResponse{
  102835. ServerResponse: googleapi.ServerResponse{
  102836. Header: res.Header,
  102837. HTTPStatusCode: res.StatusCode,
  102838. },
  102839. }
  102840. target := &ret
  102841. if err := gensupport.DecodeResponse(target, res); err != nil {
  102842. return nil, err
  102843. }
  102844. return ret, nil
  102845. // {
  102846. // "description": "Returns permissions that a caller has on the specified resource.",
  102847. // "httpMethod": "POST",
  102848. // "id": "compute.securityPolicies.testIamPermissions",
  102849. // "parameterOrder": [
  102850. // "project",
  102851. // "resource"
  102852. // ],
  102853. // "parameters": {
  102854. // "project": {
  102855. // "description": "Project ID for this request.",
  102856. // "location": "path",
  102857. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  102858. // "required": true,
  102859. // "type": "string"
  102860. // },
  102861. // "resource": {
  102862. // "description": "Name of the resource for this request.",
  102863. // "location": "path",
  102864. // "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?",
  102865. // "required": true,
  102866. // "type": "string"
  102867. // }
  102868. // },
  102869. // "path": "{project}/global/securityPolicies/{resource}/testIamPermissions",
  102870. // "request": {
  102871. // "$ref": "TestPermissionsRequest"
  102872. // },
  102873. // "response": {
  102874. // "$ref": "TestPermissionsResponse"
  102875. // },
  102876. // "scopes": [
  102877. // "https://www.googleapis.com/auth/cloud-platform",
  102878. // "https://www.googleapis.com/auth/compute",
  102879. // "https://www.googleapis.com/auth/compute.readonly"
  102880. // ]
  102881. // }
  102882. }
  102883. // method id "compute.snapshots.delete":
  102884. type SnapshotsDeleteCall struct {
  102885. s *Service
  102886. project string
  102887. snapshot string
  102888. urlParams_ gensupport.URLParams
  102889. ctx_ context.Context
  102890. header_ http.Header
  102891. }
  102892. // Delete: Deletes the specified Snapshot resource. Keep in mind that
  102893. // deleting a single snapshot might not necessarily delete all the data
  102894. // on that snapshot. If any data on the snapshot that is marked for
  102895. // deletion is needed for subsequent snapshots, the data will be moved
  102896. // to the next corresponding snapshot.
  102897. //
  102898. // For more information, see Deleting snaphots.
  102899. // For details, see https://cloud.google.com/compute/docs/reference/latest/snapshots/delete
  102900. func (r *SnapshotsService) Delete(project string, snapshot string) *SnapshotsDeleteCall {
  102901. c := &SnapshotsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  102902. c.project = project
  102903. c.snapshot = snapshot
  102904. return c
  102905. }
  102906. // RequestId sets the optional parameter "requestId": An optional
  102907. // request ID to identify requests. Specify a unique request ID so that
  102908. // if you must retry your request, the server will know to ignore the
  102909. // request if it has already been completed.
  102910. //
  102911. // For example, consider a situation where you make an initial request
  102912. // and the request times out. If you make the request again with the
  102913. // same request ID, the server can check if original operation with the
  102914. // same request ID was received, and if so, will ignore the second
  102915. // request. This prevents clients from accidentally creating duplicate
  102916. // commitments.
  102917. //
  102918. // The request ID must be a valid UUID with the exception that zero UUID
  102919. // is not supported (00000000-0000-0000-0000-000000000000).
  102920. func (c *SnapshotsDeleteCall) RequestId(requestId string) *SnapshotsDeleteCall {
  102921. c.urlParams_.Set("requestId", requestId)
  102922. return c
  102923. }
  102924. // Fields allows partial responses to be retrieved. See
  102925. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  102926. // for more information.
  102927. func (c *SnapshotsDeleteCall) Fields(s ...googleapi.Field) *SnapshotsDeleteCall {
  102928. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  102929. return c
  102930. }
  102931. // Context sets the context to be used in this call's Do method. Any
  102932. // pending HTTP request will be aborted if the provided context is
  102933. // canceled.
  102934. func (c *SnapshotsDeleteCall) Context(ctx context.Context) *SnapshotsDeleteCall {
  102935. c.ctx_ = ctx
  102936. return c
  102937. }
  102938. // Header returns an http.Header that can be modified by the caller to
  102939. // add HTTP headers to the request.
  102940. func (c *SnapshotsDeleteCall) Header() http.Header {
  102941. if c.header_ == nil {
  102942. c.header_ = make(http.Header)
  102943. }
  102944. return c.header_
  102945. }
  102946. func (c *SnapshotsDeleteCall) doRequest(alt string) (*http.Response, error) {
  102947. reqHeaders := make(http.Header)
  102948. for k, v := range c.header_ {
  102949. reqHeaders[k] = v
  102950. }
  102951. reqHeaders.Set("User-Agent", c.s.userAgent())
  102952. var body io.Reader = nil
  102953. c.urlParams_.Set("alt", alt)
  102954. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{snapshot}")
  102955. urls += "?" + c.urlParams_.Encode()
  102956. req, _ := http.NewRequest("DELETE", urls, body)
  102957. req.Header = reqHeaders
  102958. googleapi.Expand(req.URL, map[string]string{
  102959. "project": c.project,
  102960. "snapshot": c.snapshot,
  102961. })
  102962. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  102963. }
  102964. // Do executes the "compute.snapshots.delete" call.
  102965. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  102966. // status code is an error. Response headers are in either
  102967. // *Operation.ServerResponse.Header or (if a response was returned at
  102968. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  102969. // to check whether the returned error was because
  102970. // http.StatusNotModified was returned.
  102971. func (c *SnapshotsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  102972. gensupport.SetOptions(c.urlParams_, opts...)
  102973. res, err := c.doRequest("json")
  102974. if res != nil && res.StatusCode == http.StatusNotModified {
  102975. if res.Body != nil {
  102976. res.Body.Close()
  102977. }
  102978. return nil, &googleapi.Error{
  102979. Code: res.StatusCode,
  102980. Header: res.Header,
  102981. }
  102982. }
  102983. if err != nil {
  102984. return nil, err
  102985. }
  102986. defer googleapi.CloseBody(res)
  102987. if err := googleapi.CheckResponse(res); err != nil {
  102988. return nil, err
  102989. }
  102990. ret := &Operation{
  102991. ServerResponse: googleapi.ServerResponse{
  102992. Header: res.Header,
  102993. HTTPStatusCode: res.StatusCode,
  102994. },
  102995. }
  102996. target := &ret
  102997. if err := gensupport.DecodeResponse(target, res); err != nil {
  102998. return nil, err
  102999. }
  103000. return ret, nil
  103001. // {
  103002. // "description": "Deletes the specified Snapshot resource. Keep in mind that deleting a single snapshot might not necessarily delete all the data on that snapshot. If any data on the snapshot that is marked for deletion is needed for subsequent snapshots, the data will be moved to the next corresponding snapshot.\n\nFor more information, see Deleting snaphots.",
  103003. // "httpMethod": "DELETE",
  103004. // "id": "compute.snapshots.delete",
  103005. // "parameterOrder": [
  103006. // "project",
  103007. // "snapshot"
  103008. // ],
  103009. // "parameters": {
  103010. // "project": {
  103011. // "description": "Project ID for this request.",
  103012. // "location": "path",
  103013. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  103014. // "required": true,
  103015. // "type": "string"
  103016. // },
  103017. // "requestId": {
  103018. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  103019. // "location": "query",
  103020. // "type": "string"
  103021. // },
  103022. // "snapshot": {
  103023. // "description": "Name of the Snapshot resource to delete.",
  103024. // "location": "path",
  103025. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  103026. // "required": true,
  103027. // "type": "string"
  103028. // }
  103029. // },
  103030. // "path": "{project}/global/snapshots/{snapshot}",
  103031. // "response": {
  103032. // "$ref": "Operation"
  103033. // },
  103034. // "scopes": [
  103035. // "https://www.googleapis.com/auth/cloud-platform",
  103036. // "https://www.googleapis.com/auth/compute"
  103037. // ]
  103038. // }
  103039. }
  103040. // method id "compute.snapshots.get":
  103041. type SnapshotsGetCall struct {
  103042. s *Service
  103043. project string
  103044. snapshot string
  103045. urlParams_ gensupport.URLParams
  103046. ifNoneMatch_ string
  103047. ctx_ context.Context
  103048. header_ http.Header
  103049. }
  103050. // Get: Returns the specified Snapshot resource. Gets a list of
  103051. // available snapshots by making a list() request.
  103052. // For details, see https://cloud.google.com/compute/docs/reference/latest/snapshots/get
  103053. func (r *SnapshotsService) Get(project string, snapshot string) *SnapshotsGetCall {
  103054. c := &SnapshotsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  103055. c.project = project
  103056. c.snapshot = snapshot
  103057. return c
  103058. }
  103059. // Fields allows partial responses to be retrieved. See
  103060. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  103061. // for more information.
  103062. func (c *SnapshotsGetCall) Fields(s ...googleapi.Field) *SnapshotsGetCall {
  103063. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  103064. return c
  103065. }
  103066. // IfNoneMatch sets the optional parameter which makes the operation
  103067. // fail if the object's ETag matches the given value. This is useful for
  103068. // getting updates only after the object has changed since the last
  103069. // request. Use googleapi.IsNotModified to check whether the response
  103070. // error from Do is the result of In-None-Match.
  103071. func (c *SnapshotsGetCall) IfNoneMatch(entityTag string) *SnapshotsGetCall {
  103072. c.ifNoneMatch_ = entityTag
  103073. return c
  103074. }
  103075. // Context sets the context to be used in this call's Do method. Any
  103076. // pending HTTP request will be aborted if the provided context is
  103077. // canceled.
  103078. func (c *SnapshotsGetCall) Context(ctx context.Context) *SnapshotsGetCall {
  103079. c.ctx_ = ctx
  103080. return c
  103081. }
  103082. // Header returns an http.Header that can be modified by the caller to
  103083. // add HTTP headers to the request.
  103084. func (c *SnapshotsGetCall) Header() http.Header {
  103085. if c.header_ == nil {
  103086. c.header_ = make(http.Header)
  103087. }
  103088. return c.header_
  103089. }
  103090. func (c *SnapshotsGetCall) doRequest(alt string) (*http.Response, error) {
  103091. reqHeaders := make(http.Header)
  103092. for k, v := range c.header_ {
  103093. reqHeaders[k] = v
  103094. }
  103095. reqHeaders.Set("User-Agent", c.s.userAgent())
  103096. if c.ifNoneMatch_ != "" {
  103097. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  103098. }
  103099. var body io.Reader = nil
  103100. c.urlParams_.Set("alt", alt)
  103101. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{snapshot}")
  103102. urls += "?" + c.urlParams_.Encode()
  103103. req, _ := http.NewRequest("GET", urls, body)
  103104. req.Header = reqHeaders
  103105. googleapi.Expand(req.URL, map[string]string{
  103106. "project": c.project,
  103107. "snapshot": c.snapshot,
  103108. })
  103109. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  103110. }
  103111. // Do executes the "compute.snapshots.get" call.
  103112. // Exactly one of *Snapshot or error will be non-nil. Any non-2xx status
  103113. // code is an error. Response headers are in either
  103114. // *Snapshot.ServerResponse.Header or (if a response was returned at
  103115. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  103116. // to check whether the returned error was because
  103117. // http.StatusNotModified was returned.
  103118. func (c *SnapshotsGetCall) Do(opts ...googleapi.CallOption) (*Snapshot, error) {
  103119. gensupport.SetOptions(c.urlParams_, opts...)
  103120. res, err := c.doRequest("json")
  103121. if res != nil && res.StatusCode == http.StatusNotModified {
  103122. if res.Body != nil {
  103123. res.Body.Close()
  103124. }
  103125. return nil, &googleapi.Error{
  103126. Code: res.StatusCode,
  103127. Header: res.Header,
  103128. }
  103129. }
  103130. if err != nil {
  103131. return nil, err
  103132. }
  103133. defer googleapi.CloseBody(res)
  103134. if err := googleapi.CheckResponse(res); err != nil {
  103135. return nil, err
  103136. }
  103137. ret := &Snapshot{
  103138. ServerResponse: googleapi.ServerResponse{
  103139. Header: res.Header,
  103140. HTTPStatusCode: res.StatusCode,
  103141. },
  103142. }
  103143. target := &ret
  103144. if err := gensupport.DecodeResponse(target, res); err != nil {
  103145. return nil, err
  103146. }
  103147. return ret, nil
  103148. // {
  103149. // "description": "Returns the specified Snapshot resource. Gets a list of available snapshots by making a list() request.",
  103150. // "httpMethod": "GET",
  103151. // "id": "compute.snapshots.get",
  103152. // "parameterOrder": [
  103153. // "project",
  103154. // "snapshot"
  103155. // ],
  103156. // "parameters": {
  103157. // "project": {
  103158. // "description": "Project ID for this request.",
  103159. // "location": "path",
  103160. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  103161. // "required": true,
  103162. // "type": "string"
  103163. // },
  103164. // "snapshot": {
  103165. // "description": "Name of the Snapshot resource to return.",
  103166. // "location": "path",
  103167. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  103168. // "required": true,
  103169. // "type": "string"
  103170. // }
  103171. // },
  103172. // "path": "{project}/global/snapshots/{snapshot}",
  103173. // "response": {
  103174. // "$ref": "Snapshot"
  103175. // },
  103176. // "scopes": [
  103177. // "https://www.googleapis.com/auth/cloud-platform",
  103178. // "https://www.googleapis.com/auth/compute",
  103179. // "https://www.googleapis.com/auth/compute.readonly"
  103180. // ]
  103181. // }
  103182. }
  103183. // method id "compute.snapshots.getIamPolicy":
  103184. type SnapshotsGetIamPolicyCall struct {
  103185. s *Service
  103186. project string
  103187. resource string
  103188. urlParams_ gensupport.URLParams
  103189. ifNoneMatch_ string
  103190. ctx_ context.Context
  103191. header_ http.Header
  103192. }
  103193. // GetIamPolicy: Gets the access control policy for a resource. May be
  103194. // empty if no such policy or resource exists.
  103195. func (r *SnapshotsService) GetIamPolicy(project string, resource string) *SnapshotsGetIamPolicyCall {
  103196. c := &SnapshotsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  103197. c.project = project
  103198. c.resource = resource
  103199. return c
  103200. }
  103201. // Fields allows partial responses to be retrieved. See
  103202. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  103203. // for more information.
  103204. func (c *SnapshotsGetIamPolicyCall) Fields(s ...googleapi.Field) *SnapshotsGetIamPolicyCall {
  103205. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  103206. return c
  103207. }
  103208. // IfNoneMatch sets the optional parameter which makes the operation
  103209. // fail if the object's ETag matches the given value. This is useful for
  103210. // getting updates only after the object has changed since the last
  103211. // request. Use googleapi.IsNotModified to check whether the response
  103212. // error from Do is the result of In-None-Match.
  103213. func (c *SnapshotsGetIamPolicyCall) IfNoneMatch(entityTag string) *SnapshotsGetIamPolicyCall {
  103214. c.ifNoneMatch_ = entityTag
  103215. return c
  103216. }
  103217. // Context sets the context to be used in this call's Do method. Any
  103218. // pending HTTP request will be aborted if the provided context is
  103219. // canceled.
  103220. func (c *SnapshotsGetIamPolicyCall) Context(ctx context.Context) *SnapshotsGetIamPolicyCall {
  103221. c.ctx_ = ctx
  103222. return c
  103223. }
  103224. // Header returns an http.Header that can be modified by the caller to
  103225. // add HTTP headers to the request.
  103226. func (c *SnapshotsGetIamPolicyCall) Header() http.Header {
  103227. if c.header_ == nil {
  103228. c.header_ = make(http.Header)
  103229. }
  103230. return c.header_
  103231. }
  103232. func (c *SnapshotsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  103233. reqHeaders := make(http.Header)
  103234. for k, v := range c.header_ {
  103235. reqHeaders[k] = v
  103236. }
  103237. reqHeaders.Set("User-Agent", c.s.userAgent())
  103238. if c.ifNoneMatch_ != "" {
  103239. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  103240. }
  103241. var body io.Reader = nil
  103242. c.urlParams_.Set("alt", alt)
  103243. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{resource}/getIamPolicy")
  103244. urls += "?" + c.urlParams_.Encode()
  103245. req, _ := http.NewRequest("GET", urls, body)
  103246. req.Header = reqHeaders
  103247. googleapi.Expand(req.URL, map[string]string{
  103248. "project": c.project,
  103249. "resource": c.resource,
  103250. })
  103251. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  103252. }
  103253. // Do executes the "compute.snapshots.getIamPolicy" call.
  103254. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  103255. // code is an error. Response headers are in either
  103256. // *Policy.ServerResponse.Header or (if a response was returned at all)
  103257. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  103258. // check whether the returned error was because http.StatusNotModified
  103259. // was returned.
  103260. func (c *SnapshotsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  103261. gensupport.SetOptions(c.urlParams_, opts...)
  103262. res, err := c.doRequest("json")
  103263. if res != nil && res.StatusCode == http.StatusNotModified {
  103264. if res.Body != nil {
  103265. res.Body.Close()
  103266. }
  103267. return nil, &googleapi.Error{
  103268. Code: res.StatusCode,
  103269. Header: res.Header,
  103270. }
  103271. }
  103272. if err != nil {
  103273. return nil, err
  103274. }
  103275. defer googleapi.CloseBody(res)
  103276. if err := googleapi.CheckResponse(res); err != nil {
  103277. return nil, err
  103278. }
  103279. ret := &Policy{
  103280. ServerResponse: googleapi.ServerResponse{
  103281. Header: res.Header,
  103282. HTTPStatusCode: res.StatusCode,
  103283. },
  103284. }
  103285. target := &ret
  103286. if err := gensupport.DecodeResponse(target, res); err != nil {
  103287. return nil, err
  103288. }
  103289. return ret, nil
  103290. // {
  103291. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  103292. // "httpMethod": "GET",
  103293. // "id": "compute.snapshots.getIamPolicy",
  103294. // "parameterOrder": [
  103295. // "project",
  103296. // "resource"
  103297. // ],
  103298. // "parameters": {
  103299. // "project": {
  103300. // "description": "Project ID for this request.",
  103301. // "location": "path",
  103302. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  103303. // "required": true,
  103304. // "type": "string"
  103305. // },
  103306. // "resource": {
  103307. // "description": "Name of the resource for this request.",
  103308. // "location": "path",
  103309. // "pattern": "[a-z0-9](?:[-a-z0-9_]{0,61}[a-z0-9])?",
  103310. // "required": true,
  103311. // "type": "string"
  103312. // }
  103313. // },
  103314. // "path": "{project}/global/snapshots/{resource}/getIamPolicy",
  103315. // "response": {
  103316. // "$ref": "Policy"
  103317. // },
  103318. // "scopes": [
  103319. // "https://www.googleapis.com/auth/cloud-platform",
  103320. // "https://www.googleapis.com/auth/compute",
  103321. // "https://www.googleapis.com/auth/compute.readonly"
  103322. // ]
  103323. // }
  103324. }
  103325. // method id "compute.snapshots.list":
  103326. type SnapshotsListCall struct {
  103327. s *Service
  103328. project string
  103329. urlParams_ gensupport.URLParams
  103330. ifNoneMatch_ string
  103331. ctx_ context.Context
  103332. header_ http.Header
  103333. }
  103334. // List: Retrieves the list of Snapshot resources contained within the
  103335. // specified project.
  103336. // For details, see https://cloud.google.com/compute/docs/reference/latest/snapshots/list
  103337. func (r *SnapshotsService) List(project string) *SnapshotsListCall {
  103338. c := &SnapshotsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  103339. c.project = project
  103340. return c
  103341. }
  103342. // Filter sets the optional parameter "filter": A filter expression that
  103343. // filters resources listed in the response. The expression must specify
  103344. // the field name, a comparison operator, and the value that you want to
  103345. // use for filtering. The value must be a string, a number, or a
  103346. // boolean. The comparison operator must be either =, !=, >, or <.
  103347. //
  103348. // For example, if you are filtering Compute Engine instances, you can
  103349. // exclude instances named example-instance by specifying name !=
  103350. // example-instance.
  103351. //
  103352. // You can also filter nested fields. For example, you could specify
  103353. // scheduling.automaticRestart = false to include instances only if they
  103354. // are not scheduled for automatic restarts. You can use filtering on
  103355. // nested fields to filter based on resource labels.
  103356. //
  103357. // To filter on multiple expressions, provide each separate expression
  103358. // within parentheses. For example, (scheduling.automaticRestart = true)
  103359. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  103360. // AND expression. However, you can include AND and OR expressions
  103361. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  103362. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  103363. // true).
  103364. func (c *SnapshotsListCall) Filter(filter string) *SnapshotsListCall {
  103365. c.urlParams_.Set("filter", filter)
  103366. return c
  103367. }
  103368. // MaxResults sets the optional parameter "maxResults": The maximum
  103369. // number of results per page that should be returned. If the number of
  103370. // available results is larger than maxResults, Compute Engine returns a
  103371. // nextPageToken that can be used to get the next page of results in
  103372. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  103373. // (Default: 500)
  103374. func (c *SnapshotsListCall) MaxResults(maxResults int64) *SnapshotsListCall {
  103375. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  103376. return c
  103377. }
  103378. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  103379. // a certain order. By default, results are returned in alphanumerical
  103380. // order based on the resource name.
  103381. //
  103382. // You can also sort results in descending order based on the creation
  103383. // timestamp using orderBy="creationTimestamp desc". This sorts results
  103384. // based on the creationTimestamp field in reverse chronological order
  103385. // (newest result first). Use this to sort resources like operations so
  103386. // that the newest operation is returned first.
  103387. //
  103388. // Currently, only sorting by name or creationTimestamp desc is
  103389. // supported.
  103390. func (c *SnapshotsListCall) OrderBy(orderBy string) *SnapshotsListCall {
  103391. c.urlParams_.Set("orderBy", orderBy)
  103392. return c
  103393. }
  103394. // PageToken sets the optional parameter "pageToken": Specifies a page
  103395. // token to use. Set pageToken to the nextPageToken returned by a
  103396. // previous list request to get the next page of results.
  103397. func (c *SnapshotsListCall) PageToken(pageToken string) *SnapshotsListCall {
  103398. c.urlParams_.Set("pageToken", pageToken)
  103399. return c
  103400. }
  103401. // Fields allows partial responses to be retrieved. See
  103402. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  103403. // for more information.
  103404. func (c *SnapshotsListCall) Fields(s ...googleapi.Field) *SnapshotsListCall {
  103405. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  103406. return c
  103407. }
  103408. // IfNoneMatch sets the optional parameter which makes the operation
  103409. // fail if the object's ETag matches the given value. This is useful for
  103410. // getting updates only after the object has changed since the last
  103411. // request. Use googleapi.IsNotModified to check whether the response
  103412. // error from Do is the result of In-None-Match.
  103413. func (c *SnapshotsListCall) IfNoneMatch(entityTag string) *SnapshotsListCall {
  103414. c.ifNoneMatch_ = entityTag
  103415. return c
  103416. }
  103417. // Context sets the context to be used in this call's Do method. Any
  103418. // pending HTTP request will be aborted if the provided context is
  103419. // canceled.
  103420. func (c *SnapshotsListCall) Context(ctx context.Context) *SnapshotsListCall {
  103421. c.ctx_ = ctx
  103422. return c
  103423. }
  103424. // Header returns an http.Header that can be modified by the caller to
  103425. // add HTTP headers to the request.
  103426. func (c *SnapshotsListCall) Header() http.Header {
  103427. if c.header_ == nil {
  103428. c.header_ = make(http.Header)
  103429. }
  103430. return c.header_
  103431. }
  103432. func (c *SnapshotsListCall) doRequest(alt string) (*http.Response, error) {
  103433. reqHeaders := make(http.Header)
  103434. for k, v := range c.header_ {
  103435. reqHeaders[k] = v
  103436. }
  103437. reqHeaders.Set("User-Agent", c.s.userAgent())
  103438. if c.ifNoneMatch_ != "" {
  103439. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  103440. }
  103441. var body io.Reader = nil
  103442. c.urlParams_.Set("alt", alt)
  103443. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots")
  103444. urls += "?" + c.urlParams_.Encode()
  103445. req, _ := http.NewRequest("GET", urls, body)
  103446. req.Header = reqHeaders
  103447. googleapi.Expand(req.URL, map[string]string{
  103448. "project": c.project,
  103449. })
  103450. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  103451. }
  103452. // Do executes the "compute.snapshots.list" call.
  103453. // Exactly one of *SnapshotList or error will be non-nil. Any non-2xx
  103454. // status code is an error. Response headers are in either
  103455. // *SnapshotList.ServerResponse.Header or (if a response was returned at
  103456. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  103457. // to check whether the returned error was because
  103458. // http.StatusNotModified was returned.
  103459. func (c *SnapshotsListCall) Do(opts ...googleapi.CallOption) (*SnapshotList, error) {
  103460. gensupport.SetOptions(c.urlParams_, opts...)
  103461. res, err := c.doRequest("json")
  103462. if res != nil && res.StatusCode == http.StatusNotModified {
  103463. if res.Body != nil {
  103464. res.Body.Close()
  103465. }
  103466. return nil, &googleapi.Error{
  103467. Code: res.StatusCode,
  103468. Header: res.Header,
  103469. }
  103470. }
  103471. if err != nil {
  103472. return nil, err
  103473. }
  103474. defer googleapi.CloseBody(res)
  103475. if err := googleapi.CheckResponse(res); err != nil {
  103476. return nil, err
  103477. }
  103478. ret := &SnapshotList{
  103479. ServerResponse: googleapi.ServerResponse{
  103480. Header: res.Header,
  103481. HTTPStatusCode: res.StatusCode,
  103482. },
  103483. }
  103484. target := &ret
  103485. if err := gensupport.DecodeResponse(target, res); err != nil {
  103486. return nil, err
  103487. }
  103488. return ret, nil
  103489. // {
  103490. // "description": "Retrieves the list of Snapshot resources contained within the specified project.",
  103491. // "httpMethod": "GET",
  103492. // "id": "compute.snapshots.list",
  103493. // "parameterOrder": [
  103494. // "project"
  103495. // ],
  103496. // "parameters": {
  103497. // "filter": {
  103498. // "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).",
  103499. // "location": "query",
  103500. // "type": "string"
  103501. // },
  103502. // "maxResults": {
  103503. // "default": "500",
  103504. // "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)",
  103505. // "format": "uint32",
  103506. // "location": "query",
  103507. // "minimum": "0",
  103508. // "type": "integer"
  103509. // },
  103510. // "orderBy": {
  103511. // "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.",
  103512. // "location": "query",
  103513. // "type": "string"
  103514. // },
  103515. // "pageToken": {
  103516. // "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.",
  103517. // "location": "query",
  103518. // "type": "string"
  103519. // },
  103520. // "project": {
  103521. // "description": "Project ID for this request.",
  103522. // "location": "path",
  103523. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  103524. // "required": true,
  103525. // "type": "string"
  103526. // }
  103527. // },
  103528. // "path": "{project}/global/snapshots",
  103529. // "response": {
  103530. // "$ref": "SnapshotList"
  103531. // },
  103532. // "scopes": [
  103533. // "https://www.googleapis.com/auth/cloud-platform",
  103534. // "https://www.googleapis.com/auth/compute",
  103535. // "https://www.googleapis.com/auth/compute.readonly"
  103536. // ]
  103537. // }
  103538. }
  103539. // Pages invokes f for each page of results.
  103540. // A non-nil error returned from f will halt the iteration.
  103541. // The provided context supersedes any context provided to the Context method.
  103542. func (c *SnapshotsListCall) Pages(ctx context.Context, f func(*SnapshotList) error) error {
  103543. c.ctx_ = ctx
  103544. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  103545. for {
  103546. x, err := c.Do()
  103547. if err != nil {
  103548. return err
  103549. }
  103550. if err := f(x); err != nil {
  103551. return err
  103552. }
  103553. if x.NextPageToken == "" {
  103554. return nil
  103555. }
  103556. c.PageToken(x.NextPageToken)
  103557. }
  103558. }
  103559. // method id "compute.snapshots.setIamPolicy":
  103560. type SnapshotsSetIamPolicyCall struct {
  103561. s *Service
  103562. project string
  103563. resource string
  103564. globalsetpolicyrequest *GlobalSetPolicyRequest
  103565. urlParams_ gensupport.URLParams
  103566. ctx_ context.Context
  103567. header_ http.Header
  103568. }
  103569. // SetIamPolicy: Sets the access control policy on the specified
  103570. // resource. Replaces any existing policy.
  103571. func (r *SnapshotsService) SetIamPolicy(project string, resource string, globalsetpolicyrequest *GlobalSetPolicyRequest) *SnapshotsSetIamPolicyCall {
  103572. c := &SnapshotsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  103573. c.project = project
  103574. c.resource = resource
  103575. c.globalsetpolicyrequest = globalsetpolicyrequest
  103576. return c
  103577. }
  103578. // Fields allows partial responses to be retrieved. See
  103579. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  103580. // for more information.
  103581. func (c *SnapshotsSetIamPolicyCall) Fields(s ...googleapi.Field) *SnapshotsSetIamPolicyCall {
  103582. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  103583. return c
  103584. }
  103585. // Context sets the context to be used in this call's Do method. Any
  103586. // pending HTTP request will be aborted if the provided context is
  103587. // canceled.
  103588. func (c *SnapshotsSetIamPolicyCall) Context(ctx context.Context) *SnapshotsSetIamPolicyCall {
  103589. c.ctx_ = ctx
  103590. return c
  103591. }
  103592. // Header returns an http.Header that can be modified by the caller to
  103593. // add HTTP headers to the request.
  103594. func (c *SnapshotsSetIamPolicyCall) Header() http.Header {
  103595. if c.header_ == nil {
  103596. c.header_ = make(http.Header)
  103597. }
  103598. return c.header_
  103599. }
  103600. func (c *SnapshotsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  103601. reqHeaders := make(http.Header)
  103602. for k, v := range c.header_ {
  103603. reqHeaders[k] = v
  103604. }
  103605. reqHeaders.Set("User-Agent", c.s.userAgent())
  103606. var body io.Reader = nil
  103607. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest)
  103608. if err != nil {
  103609. return nil, err
  103610. }
  103611. reqHeaders.Set("Content-Type", "application/json")
  103612. c.urlParams_.Set("alt", alt)
  103613. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{resource}/setIamPolicy")
  103614. urls += "?" + c.urlParams_.Encode()
  103615. req, _ := http.NewRequest("POST", urls, body)
  103616. req.Header = reqHeaders
  103617. googleapi.Expand(req.URL, map[string]string{
  103618. "project": c.project,
  103619. "resource": c.resource,
  103620. })
  103621. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  103622. }
  103623. // Do executes the "compute.snapshots.setIamPolicy" call.
  103624. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  103625. // code is an error. Response headers are in either
  103626. // *Policy.ServerResponse.Header or (if a response was returned at all)
  103627. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  103628. // check whether the returned error was because http.StatusNotModified
  103629. // was returned.
  103630. func (c *SnapshotsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  103631. gensupport.SetOptions(c.urlParams_, opts...)
  103632. res, err := c.doRequest("json")
  103633. if res != nil && res.StatusCode == http.StatusNotModified {
  103634. if res.Body != nil {
  103635. res.Body.Close()
  103636. }
  103637. return nil, &googleapi.Error{
  103638. Code: res.StatusCode,
  103639. Header: res.Header,
  103640. }
  103641. }
  103642. if err != nil {
  103643. return nil, err
  103644. }
  103645. defer googleapi.CloseBody(res)
  103646. if err := googleapi.CheckResponse(res); err != nil {
  103647. return nil, err
  103648. }
  103649. ret := &Policy{
  103650. ServerResponse: googleapi.ServerResponse{
  103651. Header: res.Header,
  103652. HTTPStatusCode: res.StatusCode,
  103653. },
  103654. }
  103655. target := &ret
  103656. if err := gensupport.DecodeResponse(target, res); err != nil {
  103657. return nil, err
  103658. }
  103659. return ret, nil
  103660. // {
  103661. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  103662. // "httpMethod": "POST",
  103663. // "id": "compute.snapshots.setIamPolicy",
  103664. // "parameterOrder": [
  103665. // "project",
  103666. // "resource"
  103667. // ],
  103668. // "parameters": {
  103669. // "project": {
  103670. // "description": "Project ID for this request.",
  103671. // "location": "path",
  103672. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  103673. // "required": true,
  103674. // "type": "string"
  103675. // },
  103676. // "resource": {
  103677. // "description": "Name of the resource for this request.",
  103678. // "location": "path",
  103679. // "pattern": "[a-z0-9](?:[-a-z0-9_]{0,61}[a-z0-9])?",
  103680. // "required": true,
  103681. // "type": "string"
  103682. // }
  103683. // },
  103684. // "path": "{project}/global/snapshots/{resource}/setIamPolicy",
  103685. // "request": {
  103686. // "$ref": "GlobalSetPolicyRequest"
  103687. // },
  103688. // "response": {
  103689. // "$ref": "Policy"
  103690. // },
  103691. // "scopes": [
  103692. // "https://www.googleapis.com/auth/cloud-platform",
  103693. // "https://www.googleapis.com/auth/compute"
  103694. // ]
  103695. // }
  103696. }
  103697. // method id "compute.snapshots.setLabels":
  103698. type SnapshotsSetLabelsCall struct {
  103699. s *Service
  103700. project string
  103701. resource string
  103702. globalsetlabelsrequest *GlobalSetLabelsRequest
  103703. urlParams_ gensupport.URLParams
  103704. ctx_ context.Context
  103705. header_ http.Header
  103706. }
  103707. // SetLabels: Sets the labels on a snapshot. To learn more about labels,
  103708. // read the Labeling Resources documentation.
  103709. func (r *SnapshotsService) SetLabels(project string, resource string, globalsetlabelsrequest *GlobalSetLabelsRequest) *SnapshotsSetLabelsCall {
  103710. c := &SnapshotsSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  103711. c.project = project
  103712. c.resource = resource
  103713. c.globalsetlabelsrequest = globalsetlabelsrequest
  103714. return c
  103715. }
  103716. // Fields allows partial responses to be retrieved. See
  103717. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  103718. // for more information.
  103719. func (c *SnapshotsSetLabelsCall) Fields(s ...googleapi.Field) *SnapshotsSetLabelsCall {
  103720. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  103721. return c
  103722. }
  103723. // Context sets the context to be used in this call's Do method. Any
  103724. // pending HTTP request will be aborted if the provided context is
  103725. // canceled.
  103726. func (c *SnapshotsSetLabelsCall) Context(ctx context.Context) *SnapshotsSetLabelsCall {
  103727. c.ctx_ = ctx
  103728. return c
  103729. }
  103730. // Header returns an http.Header that can be modified by the caller to
  103731. // add HTTP headers to the request.
  103732. func (c *SnapshotsSetLabelsCall) Header() http.Header {
  103733. if c.header_ == nil {
  103734. c.header_ = make(http.Header)
  103735. }
  103736. return c.header_
  103737. }
  103738. func (c *SnapshotsSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  103739. reqHeaders := make(http.Header)
  103740. for k, v := range c.header_ {
  103741. reqHeaders[k] = v
  103742. }
  103743. reqHeaders.Set("User-Agent", c.s.userAgent())
  103744. var body io.Reader = nil
  103745. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest)
  103746. if err != nil {
  103747. return nil, err
  103748. }
  103749. reqHeaders.Set("Content-Type", "application/json")
  103750. c.urlParams_.Set("alt", alt)
  103751. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{resource}/setLabels")
  103752. urls += "?" + c.urlParams_.Encode()
  103753. req, _ := http.NewRequest("POST", urls, body)
  103754. req.Header = reqHeaders
  103755. googleapi.Expand(req.URL, map[string]string{
  103756. "project": c.project,
  103757. "resource": c.resource,
  103758. })
  103759. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  103760. }
  103761. // Do executes the "compute.snapshots.setLabels" call.
  103762. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  103763. // status code is an error. Response headers are in either
  103764. // *Operation.ServerResponse.Header or (if a response was returned at
  103765. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  103766. // to check whether the returned error was because
  103767. // http.StatusNotModified was returned.
  103768. func (c *SnapshotsSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  103769. gensupport.SetOptions(c.urlParams_, opts...)
  103770. res, err := c.doRequest("json")
  103771. if res != nil && res.StatusCode == http.StatusNotModified {
  103772. if res.Body != nil {
  103773. res.Body.Close()
  103774. }
  103775. return nil, &googleapi.Error{
  103776. Code: res.StatusCode,
  103777. Header: res.Header,
  103778. }
  103779. }
  103780. if err != nil {
  103781. return nil, err
  103782. }
  103783. defer googleapi.CloseBody(res)
  103784. if err := googleapi.CheckResponse(res); err != nil {
  103785. return nil, err
  103786. }
  103787. ret := &Operation{
  103788. ServerResponse: googleapi.ServerResponse{
  103789. Header: res.Header,
  103790. HTTPStatusCode: res.StatusCode,
  103791. },
  103792. }
  103793. target := &ret
  103794. if err := gensupport.DecodeResponse(target, res); err != nil {
  103795. return nil, err
  103796. }
  103797. return ret, nil
  103798. // {
  103799. // "description": "Sets the labels on a snapshot. To learn more about labels, read the Labeling Resources documentation.",
  103800. // "httpMethod": "POST",
  103801. // "id": "compute.snapshots.setLabels",
  103802. // "parameterOrder": [
  103803. // "project",
  103804. // "resource"
  103805. // ],
  103806. // "parameters": {
  103807. // "project": {
  103808. // "description": "Project ID for this request.",
  103809. // "location": "path",
  103810. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  103811. // "required": true,
  103812. // "type": "string"
  103813. // },
  103814. // "resource": {
  103815. // "description": "Name of the resource for this request.",
  103816. // "location": "path",
  103817. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?",
  103818. // "required": true,
  103819. // "type": "string"
  103820. // }
  103821. // },
  103822. // "path": "{project}/global/snapshots/{resource}/setLabels",
  103823. // "request": {
  103824. // "$ref": "GlobalSetLabelsRequest"
  103825. // },
  103826. // "response": {
  103827. // "$ref": "Operation"
  103828. // },
  103829. // "scopes": [
  103830. // "https://www.googleapis.com/auth/cloud-platform",
  103831. // "https://www.googleapis.com/auth/compute"
  103832. // ]
  103833. // }
  103834. }
  103835. // method id "compute.snapshots.testIamPermissions":
  103836. type SnapshotsTestIamPermissionsCall struct {
  103837. s *Service
  103838. project string
  103839. resource string
  103840. testpermissionsrequest *TestPermissionsRequest
  103841. urlParams_ gensupport.URLParams
  103842. ctx_ context.Context
  103843. header_ http.Header
  103844. }
  103845. // TestIamPermissions: Returns permissions that a caller has on the
  103846. // specified resource.
  103847. func (r *SnapshotsService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *SnapshotsTestIamPermissionsCall {
  103848. c := &SnapshotsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  103849. c.project = project
  103850. c.resource = resource
  103851. c.testpermissionsrequest = testpermissionsrequest
  103852. return c
  103853. }
  103854. // Fields allows partial responses to be retrieved. See
  103855. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  103856. // for more information.
  103857. func (c *SnapshotsTestIamPermissionsCall) Fields(s ...googleapi.Field) *SnapshotsTestIamPermissionsCall {
  103858. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  103859. return c
  103860. }
  103861. // Context sets the context to be used in this call's Do method. Any
  103862. // pending HTTP request will be aborted if the provided context is
  103863. // canceled.
  103864. func (c *SnapshotsTestIamPermissionsCall) Context(ctx context.Context) *SnapshotsTestIamPermissionsCall {
  103865. c.ctx_ = ctx
  103866. return c
  103867. }
  103868. // Header returns an http.Header that can be modified by the caller to
  103869. // add HTTP headers to the request.
  103870. func (c *SnapshotsTestIamPermissionsCall) Header() http.Header {
  103871. if c.header_ == nil {
  103872. c.header_ = make(http.Header)
  103873. }
  103874. return c.header_
  103875. }
  103876. func (c *SnapshotsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  103877. reqHeaders := make(http.Header)
  103878. for k, v := range c.header_ {
  103879. reqHeaders[k] = v
  103880. }
  103881. reqHeaders.Set("User-Agent", c.s.userAgent())
  103882. var body io.Reader = nil
  103883. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  103884. if err != nil {
  103885. return nil, err
  103886. }
  103887. reqHeaders.Set("Content-Type", "application/json")
  103888. c.urlParams_.Set("alt", alt)
  103889. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{resource}/testIamPermissions")
  103890. urls += "?" + c.urlParams_.Encode()
  103891. req, _ := http.NewRequest("POST", urls, body)
  103892. req.Header = reqHeaders
  103893. googleapi.Expand(req.URL, map[string]string{
  103894. "project": c.project,
  103895. "resource": c.resource,
  103896. })
  103897. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  103898. }
  103899. // Do executes the "compute.snapshots.testIamPermissions" call.
  103900. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  103901. // non-2xx status code is an error. Response headers are in either
  103902. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  103903. // returned at all) in error.(*googleapi.Error).Header. Use
  103904. // googleapi.IsNotModified to check whether the returned error was
  103905. // because http.StatusNotModified was returned.
  103906. func (c *SnapshotsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  103907. gensupport.SetOptions(c.urlParams_, opts...)
  103908. res, err := c.doRequest("json")
  103909. if res != nil && res.StatusCode == http.StatusNotModified {
  103910. if res.Body != nil {
  103911. res.Body.Close()
  103912. }
  103913. return nil, &googleapi.Error{
  103914. Code: res.StatusCode,
  103915. Header: res.Header,
  103916. }
  103917. }
  103918. if err != nil {
  103919. return nil, err
  103920. }
  103921. defer googleapi.CloseBody(res)
  103922. if err := googleapi.CheckResponse(res); err != nil {
  103923. return nil, err
  103924. }
  103925. ret := &TestPermissionsResponse{
  103926. ServerResponse: googleapi.ServerResponse{
  103927. Header: res.Header,
  103928. HTTPStatusCode: res.StatusCode,
  103929. },
  103930. }
  103931. target := &ret
  103932. if err := gensupport.DecodeResponse(target, res); err != nil {
  103933. return nil, err
  103934. }
  103935. return ret, nil
  103936. // {
  103937. // "description": "Returns permissions that a caller has on the specified resource.",
  103938. // "httpMethod": "POST",
  103939. // "id": "compute.snapshots.testIamPermissions",
  103940. // "parameterOrder": [
  103941. // "project",
  103942. // "resource"
  103943. // ],
  103944. // "parameters": {
  103945. // "project": {
  103946. // "description": "Project ID for this request.",
  103947. // "location": "path",
  103948. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  103949. // "required": true,
  103950. // "type": "string"
  103951. // },
  103952. // "resource": {
  103953. // "description": "Name of the resource for this request.",
  103954. // "location": "path",
  103955. // "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?",
  103956. // "required": true,
  103957. // "type": "string"
  103958. // }
  103959. // },
  103960. // "path": "{project}/global/snapshots/{resource}/testIamPermissions",
  103961. // "request": {
  103962. // "$ref": "TestPermissionsRequest"
  103963. // },
  103964. // "response": {
  103965. // "$ref": "TestPermissionsResponse"
  103966. // },
  103967. // "scopes": [
  103968. // "https://www.googleapis.com/auth/cloud-platform",
  103969. // "https://www.googleapis.com/auth/compute",
  103970. // "https://www.googleapis.com/auth/compute.readonly"
  103971. // ]
  103972. // }
  103973. }
  103974. // method id "compute.sslCertificates.delete":
  103975. type SslCertificatesDeleteCall struct {
  103976. s *Service
  103977. project string
  103978. sslCertificate string
  103979. urlParams_ gensupport.URLParams
  103980. ctx_ context.Context
  103981. header_ http.Header
  103982. }
  103983. // Delete: Deletes the specified SslCertificate resource.
  103984. func (r *SslCertificatesService) Delete(project string, sslCertificate string) *SslCertificatesDeleteCall {
  103985. c := &SslCertificatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  103986. c.project = project
  103987. c.sslCertificate = sslCertificate
  103988. return c
  103989. }
  103990. // RequestId sets the optional parameter "requestId": An optional
  103991. // request ID to identify requests. Specify a unique request ID so that
  103992. // if you must retry your request, the server will know to ignore the
  103993. // request if it has already been completed.
  103994. //
  103995. // For example, consider a situation where you make an initial request
  103996. // and the request times out. If you make the request again with the
  103997. // same request ID, the server can check if original operation with the
  103998. // same request ID was received, and if so, will ignore the second
  103999. // request. This prevents clients from accidentally creating duplicate
  104000. // commitments.
  104001. //
  104002. // The request ID must be a valid UUID with the exception that zero UUID
  104003. // is not supported (00000000-0000-0000-0000-000000000000).
  104004. func (c *SslCertificatesDeleteCall) RequestId(requestId string) *SslCertificatesDeleteCall {
  104005. c.urlParams_.Set("requestId", requestId)
  104006. return c
  104007. }
  104008. // Fields allows partial responses to be retrieved. See
  104009. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  104010. // for more information.
  104011. func (c *SslCertificatesDeleteCall) Fields(s ...googleapi.Field) *SslCertificatesDeleteCall {
  104012. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  104013. return c
  104014. }
  104015. // Context sets the context to be used in this call's Do method. Any
  104016. // pending HTTP request will be aborted if the provided context is
  104017. // canceled.
  104018. func (c *SslCertificatesDeleteCall) Context(ctx context.Context) *SslCertificatesDeleteCall {
  104019. c.ctx_ = ctx
  104020. return c
  104021. }
  104022. // Header returns an http.Header that can be modified by the caller to
  104023. // add HTTP headers to the request.
  104024. func (c *SslCertificatesDeleteCall) Header() http.Header {
  104025. if c.header_ == nil {
  104026. c.header_ = make(http.Header)
  104027. }
  104028. return c.header_
  104029. }
  104030. func (c *SslCertificatesDeleteCall) doRequest(alt string) (*http.Response, error) {
  104031. reqHeaders := make(http.Header)
  104032. for k, v := range c.header_ {
  104033. reqHeaders[k] = v
  104034. }
  104035. reqHeaders.Set("User-Agent", c.s.userAgent())
  104036. var body io.Reader = nil
  104037. c.urlParams_.Set("alt", alt)
  104038. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates/{sslCertificate}")
  104039. urls += "?" + c.urlParams_.Encode()
  104040. req, _ := http.NewRequest("DELETE", urls, body)
  104041. req.Header = reqHeaders
  104042. googleapi.Expand(req.URL, map[string]string{
  104043. "project": c.project,
  104044. "sslCertificate": c.sslCertificate,
  104045. })
  104046. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  104047. }
  104048. // Do executes the "compute.sslCertificates.delete" call.
  104049. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  104050. // status code is an error. Response headers are in either
  104051. // *Operation.ServerResponse.Header or (if a response was returned at
  104052. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  104053. // to check whether the returned error was because
  104054. // http.StatusNotModified was returned.
  104055. func (c *SslCertificatesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  104056. gensupport.SetOptions(c.urlParams_, opts...)
  104057. res, err := c.doRequest("json")
  104058. if res != nil && res.StatusCode == http.StatusNotModified {
  104059. if res.Body != nil {
  104060. res.Body.Close()
  104061. }
  104062. return nil, &googleapi.Error{
  104063. Code: res.StatusCode,
  104064. Header: res.Header,
  104065. }
  104066. }
  104067. if err != nil {
  104068. return nil, err
  104069. }
  104070. defer googleapi.CloseBody(res)
  104071. if err := googleapi.CheckResponse(res); err != nil {
  104072. return nil, err
  104073. }
  104074. ret := &Operation{
  104075. ServerResponse: googleapi.ServerResponse{
  104076. Header: res.Header,
  104077. HTTPStatusCode: res.StatusCode,
  104078. },
  104079. }
  104080. target := &ret
  104081. if err := gensupport.DecodeResponse(target, res); err != nil {
  104082. return nil, err
  104083. }
  104084. return ret, nil
  104085. // {
  104086. // "description": "Deletes the specified SslCertificate resource.",
  104087. // "httpMethod": "DELETE",
  104088. // "id": "compute.sslCertificates.delete",
  104089. // "parameterOrder": [
  104090. // "project",
  104091. // "sslCertificate"
  104092. // ],
  104093. // "parameters": {
  104094. // "project": {
  104095. // "description": "Project ID for this request.",
  104096. // "location": "path",
  104097. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  104098. // "required": true,
  104099. // "type": "string"
  104100. // },
  104101. // "requestId": {
  104102. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  104103. // "location": "query",
  104104. // "type": "string"
  104105. // },
  104106. // "sslCertificate": {
  104107. // "description": "Name of the SslCertificate resource to delete.",
  104108. // "location": "path",
  104109. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  104110. // "required": true,
  104111. // "type": "string"
  104112. // }
  104113. // },
  104114. // "path": "{project}/global/sslCertificates/{sslCertificate}",
  104115. // "response": {
  104116. // "$ref": "Operation"
  104117. // },
  104118. // "scopes": [
  104119. // "https://www.googleapis.com/auth/cloud-platform",
  104120. // "https://www.googleapis.com/auth/compute"
  104121. // ]
  104122. // }
  104123. }
  104124. // method id "compute.sslCertificates.get":
  104125. type SslCertificatesGetCall struct {
  104126. s *Service
  104127. project string
  104128. sslCertificate string
  104129. urlParams_ gensupport.URLParams
  104130. ifNoneMatch_ string
  104131. ctx_ context.Context
  104132. header_ http.Header
  104133. }
  104134. // Get: Returns the specified SslCertificate resource. Gets a list of
  104135. // available SSL certificates by making a list() request.
  104136. func (r *SslCertificatesService) Get(project string, sslCertificate string) *SslCertificatesGetCall {
  104137. c := &SslCertificatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  104138. c.project = project
  104139. c.sslCertificate = sslCertificate
  104140. return c
  104141. }
  104142. // Fields allows partial responses to be retrieved. See
  104143. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  104144. // for more information.
  104145. func (c *SslCertificatesGetCall) Fields(s ...googleapi.Field) *SslCertificatesGetCall {
  104146. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  104147. return c
  104148. }
  104149. // IfNoneMatch sets the optional parameter which makes the operation
  104150. // fail if the object's ETag matches the given value. This is useful for
  104151. // getting updates only after the object has changed since the last
  104152. // request. Use googleapi.IsNotModified to check whether the response
  104153. // error from Do is the result of In-None-Match.
  104154. func (c *SslCertificatesGetCall) IfNoneMatch(entityTag string) *SslCertificatesGetCall {
  104155. c.ifNoneMatch_ = entityTag
  104156. return c
  104157. }
  104158. // Context sets the context to be used in this call's Do method. Any
  104159. // pending HTTP request will be aborted if the provided context is
  104160. // canceled.
  104161. func (c *SslCertificatesGetCall) Context(ctx context.Context) *SslCertificatesGetCall {
  104162. c.ctx_ = ctx
  104163. return c
  104164. }
  104165. // Header returns an http.Header that can be modified by the caller to
  104166. // add HTTP headers to the request.
  104167. func (c *SslCertificatesGetCall) Header() http.Header {
  104168. if c.header_ == nil {
  104169. c.header_ = make(http.Header)
  104170. }
  104171. return c.header_
  104172. }
  104173. func (c *SslCertificatesGetCall) doRequest(alt string) (*http.Response, error) {
  104174. reqHeaders := make(http.Header)
  104175. for k, v := range c.header_ {
  104176. reqHeaders[k] = v
  104177. }
  104178. reqHeaders.Set("User-Agent", c.s.userAgent())
  104179. if c.ifNoneMatch_ != "" {
  104180. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  104181. }
  104182. var body io.Reader = nil
  104183. c.urlParams_.Set("alt", alt)
  104184. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates/{sslCertificate}")
  104185. urls += "?" + c.urlParams_.Encode()
  104186. req, _ := http.NewRequest("GET", urls, body)
  104187. req.Header = reqHeaders
  104188. googleapi.Expand(req.URL, map[string]string{
  104189. "project": c.project,
  104190. "sslCertificate": c.sslCertificate,
  104191. })
  104192. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  104193. }
  104194. // Do executes the "compute.sslCertificates.get" call.
  104195. // Exactly one of *SslCertificate or error will be non-nil. Any non-2xx
  104196. // status code is an error. Response headers are in either
  104197. // *SslCertificate.ServerResponse.Header or (if a response was returned
  104198. // at all) in error.(*googleapi.Error).Header. Use
  104199. // googleapi.IsNotModified to check whether the returned error was
  104200. // because http.StatusNotModified was returned.
  104201. func (c *SslCertificatesGetCall) Do(opts ...googleapi.CallOption) (*SslCertificate, error) {
  104202. gensupport.SetOptions(c.urlParams_, opts...)
  104203. res, err := c.doRequest("json")
  104204. if res != nil && res.StatusCode == http.StatusNotModified {
  104205. if res.Body != nil {
  104206. res.Body.Close()
  104207. }
  104208. return nil, &googleapi.Error{
  104209. Code: res.StatusCode,
  104210. Header: res.Header,
  104211. }
  104212. }
  104213. if err != nil {
  104214. return nil, err
  104215. }
  104216. defer googleapi.CloseBody(res)
  104217. if err := googleapi.CheckResponse(res); err != nil {
  104218. return nil, err
  104219. }
  104220. ret := &SslCertificate{
  104221. ServerResponse: googleapi.ServerResponse{
  104222. Header: res.Header,
  104223. HTTPStatusCode: res.StatusCode,
  104224. },
  104225. }
  104226. target := &ret
  104227. if err := gensupport.DecodeResponse(target, res); err != nil {
  104228. return nil, err
  104229. }
  104230. return ret, nil
  104231. // {
  104232. // "description": "Returns the specified SslCertificate resource. Gets a list of available SSL certificates by making a list() request.",
  104233. // "httpMethod": "GET",
  104234. // "id": "compute.sslCertificates.get",
  104235. // "parameterOrder": [
  104236. // "project",
  104237. // "sslCertificate"
  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. // "sslCertificate": {
  104248. // "description": "Name of the SslCertificate resource to return.",
  104249. // "location": "path",
  104250. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  104251. // "required": true,
  104252. // "type": "string"
  104253. // }
  104254. // },
  104255. // "path": "{project}/global/sslCertificates/{sslCertificate}",
  104256. // "response": {
  104257. // "$ref": "SslCertificate"
  104258. // },
  104259. // "scopes": [
  104260. // "https://www.googleapis.com/auth/cloud-platform",
  104261. // "https://www.googleapis.com/auth/compute",
  104262. // "https://www.googleapis.com/auth/compute.readonly"
  104263. // ]
  104264. // }
  104265. }
  104266. // method id "compute.sslCertificates.insert":
  104267. type SslCertificatesInsertCall struct {
  104268. s *Service
  104269. project string
  104270. sslcertificate *SslCertificate
  104271. urlParams_ gensupport.URLParams
  104272. ctx_ context.Context
  104273. header_ http.Header
  104274. }
  104275. // Insert: Creates a SslCertificate resource in the specified project
  104276. // using the data included in the request.
  104277. func (r *SslCertificatesService) Insert(project string, sslcertificate *SslCertificate) *SslCertificatesInsertCall {
  104278. c := &SslCertificatesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  104279. c.project = project
  104280. c.sslcertificate = sslcertificate
  104281. return c
  104282. }
  104283. // RequestId sets the optional parameter "requestId": An optional
  104284. // request ID to identify requests. Specify a unique request ID so that
  104285. // if you must retry your request, the server will know to ignore the
  104286. // request if it has already been completed.
  104287. //
  104288. // For example, consider a situation where you make an initial request
  104289. // and the request times out. If you make the request again with the
  104290. // same request ID, the server can check if original operation with the
  104291. // same request ID was received, and if so, will ignore the second
  104292. // request. This prevents clients from accidentally creating duplicate
  104293. // commitments.
  104294. //
  104295. // The request ID must be a valid UUID with the exception that zero UUID
  104296. // is not supported (00000000-0000-0000-0000-000000000000).
  104297. func (c *SslCertificatesInsertCall) RequestId(requestId string) *SslCertificatesInsertCall {
  104298. c.urlParams_.Set("requestId", requestId)
  104299. return c
  104300. }
  104301. // Fields allows partial responses to be retrieved. See
  104302. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  104303. // for more information.
  104304. func (c *SslCertificatesInsertCall) Fields(s ...googleapi.Field) *SslCertificatesInsertCall {
  104305. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  104306. return c
  104307. }
  104308. // Context sets the context to be used in this call's Do method. Any
  104309. // pending HTTP request will be aborted if the provided context is
  104310. // canceled.
  104311. func (c *SslCertificatesInsertCall) Context(ctx context.Context) *SslCertificatesInsertCall {
  104312. c.ctx_ = ctx
  104313. return c
  104314. }
  104315. // Header returns an http.Header that can be modified by the caller to
  104316. // add HTTP headers to the request.
  104317. func (c *SslCertificatesInsertCall) Header() http.Header {
  104318. if c.header_ == nil {
  104319. c.header_ = make(http.Header)
  104320. }
  104321. return c.header_
  104322. }
  104323. func (c *SslCertificatesInsertCall) doRequest(alt string) (*http.Response, error) {
  104324. reqHeaders := make(http.Header)
  104325. for k, v := range c.header_ {
  104326. reqHeaders[k] = v
  104327. }
  104328. reqHeaders.Set("User-Agent", c.s.userAgent())
  104329. var body io.Reader = nil
  104330. body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslcertificate)
  104331. if err != nil {
  104332. return nil, err
  104333. }
  104334. reqHeaders.Set("Content-Type", "application/json")
  104335. c.urlParams_.Set("alt", alt)
  104336. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates")
  104337. urls += "?" + c.urlParams_.Encode()
  104338. req, _ := http.NewRequest("POST", urls, body)
  104339. req.Header = reqHeaders
  104340. googleapi.Expand(req.URL, map[string]string{
  104341. "project": c.project,
  104342. })
  104343. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  104344. }
  104345. // Do executes the "compute.sslCertificates.insert" call.
  104346. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  104347. // status code is an error. Response headers are in either
  104348. // *Operation.ServerResponse.Header or (if a response was returned at
  104349. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  104350. // to check whether the returned error was because
  104351. // http.StatusNotModified was returned.
  104352. func (c *SslCertificatesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  104353. gensupport.SetOptions(c.urlParams_, opts...)
  104354. res, err := c.doRequest("json")
  104355. if res != nil && res.StatusCode == http.StatusNotModified {
  104356. if res.Body != nil {
  104357. res.Body.Close()
  104358. }
  104359. return nil, &googleapi.Error{
  104360. Code: res.StatusCode,
  104361. Header: res.Header,
  104362. }
  104363. }
  104364. if err != nil {
  104365. return nil, err
  104366. }
  104367. defer googleapi.CloseBody(res)
  104368. if err := googleapi.CheckResponse(res); err != nil {
  104369. return nil, err
  104370. }
  104371. ret := &Operation{
  104372. ServerResponse: googleapi.ServerResponse{
  104373. Header: res.Header,
  104374. HTTPStatusCode: res.StatusCode,
  104375. },
  104376. }
  104377. target := &ret
  104378. if err := gensupport.DecodeResponse(target, res); err != nil {
  104379. return nil, err
  104380. }
  104381. return ret, nil
  104382. // {
  104383. // "description": "Creates a SslCertificate resource in the specified project using the data included in the request.",
  104384. // "httpMethod": "POST",
  104385. // "id": "compute.sslCertificates.insert",
  104386. // "parameterOrder": [
  104387. // "project"
  104388. // ],
  104389. // "parameters": {
  104390. // "project": {
  104391. // "description": "Project ID for this request.",
  104392. // "location": "path",
  104393. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  104394. // "required": true,
  104395. // "type": "string"
  104396. // },
  104397. // "requestId": {
  104398. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  104399. // "location": "query",
  104400. // "type": "string"
  104401. // }
  104402. // },
  104403. // "path": "{project}/global/sslCertificates",
  104404. // "request": {
  104405. // "$ref": "SslCertificate"
  104406. // },
  104407. // "response": {
  104408. // "$ref": "Operation"
  104409. // },
  104410. // "scopes": [
  104411. // "https://www.googleapis.com/auth/cloud-platform",
  104412. // "https://www.googleapis.com/auth/compute"
  104413. // ]
  104414. // }
  104415. }
  104416. // method id "compute.sslCertificates.list":
  104417. type SslCertificatesListCall struct {
  104418. s *Service
  104419. project string
  104420. urlParams_ gensupport.URLParams
  104421. ifNoneMatch_ string
  104422. ctx_ context.Context
  104423. header_ http.Header
  104424. }
  104425. // List: Retrieves the list of SslCertificate resources available to the
  104426. // specified project.
  104427. func (r *SslCertificatesService) List(project string) *SslCertificatesListCall {
  104428. c := &SslCertificatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  104429. c.project = project
  104430. return c
  104431. }
  104432. // Filter sets the optional parameter "filter": A filter expression that
  104433. // filters resources listed in the response. The expression must specify
  104434. // the field name, a comparison operator, and the value that you want to
  104435. // use for filtering. The value must be a string, a number, or a
  104436. // boolean. The comparison operator must be either =, !=, >, or <.
  104437. //
  104438. // For example, if you are filtering Compute Engine instances, you can
  104439. // exclude instances named example-instance by specifying name !=
  104440. // example-instance.
  104441. //
  104442. // You can also filter nested fields. For example, you could specify
  104443. // scheduling.automaticRestart = false to include instances only if they
  104444. // are not scheduled for automatic restarts. You can use filtering on
  104445. // nested fields to filter based on resource labels.
  104446. //
  104447. // To filter on multiple expressions, provide each separate expression
  104448. // within parentheses. For example, (scheduling.automaticRestart = true)
  104449. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  104450. // AND expression. However, you can include AND and OR expressions
  104451. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  104452. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  104453. // true).
  104454. func (c *SslCertificatesListCall) Filter(filter string) *SslCertificatesListCall {
  104455. c.urlParams_.Set("filter", filter)
  104456. return c
  104457. }
  104458. // MaxResults sets the optional parameter "maxResults": The maximum
  104459. // number of results per page that should be returned. If the number of
  104460. // available results is larger than maxResults, Compute Engine returns a
  104461. // nextPageToken that can be used to get the next page of results in
  104462. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  104463. // (Default: 500)
  104464. func (c *SslCertificatesListCall) MaxResults(maxResults int64) *SslCertificatesListCall {
  104465. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  104466. return c
  104467. }
  104468. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  104469. // a certain order. By default, results are returned in alphanumerical
  104470. // order based on the resource name.
  104471. //
  104472. // You can also sort results in descending order based on the creation
  104473. // timestamp using orderBy="creationTimestamp desc". This sorts results
  104474. // based on the creationTimestamp field in reverse chronological order
  104475. // (newest result first). Use this to sort resources like operations so
  104476. // that the newest operation is returned first.
  104477. //
  104478. // Currently, only sorting by name or creationTimestamp desc is
  104479. // supported.
  104480. func (c *SslCertificatesListCall) OrderBy(orderBy string) *SslCertificatesListCall {
  104481. c.urlParams_.Set("orderBy", orderBy)
  104482. return c
  104483. }
  104484. // PageToken sets the optional parameter "pageToken": Specifies a page
  104485. // token to use. Set pageToken to the nextPageToken returned by a
  104486. // previous list request to get the next page of results.
  104487. func (c *SslCertificatesListCall) PageToken(pageToken string) *SslCertificatesListCall {
  104488. c.urlParams_.Set("pageToken", pageToken)
  104489. return c
  104490. }
  104491. // Fields allows partial responses to be retrieved. See
  104492. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  104493. // for more information.
  104494. func (c *SslCertificatesListCall) Fields(s ...googleapi.Field) *SslCertificatesListCall {
  104495. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  104496. return c
  104497. }
  104498. // IfNoneMatch sets the optional parameter which makes the operation
  104499. // fail if the object's ETag matches the given value. This is useful for
  104500. // getting updates only after the object has changed since the last
  104501. // request. Use googleapi.IsNotModified to check whether the response
  104502. // error from Do is the result of In-None-Match.
  104503. func (c *SslCertificatesListCall) IfNoneMatch(entityTag string) *SslCertificatesListCall {
  104504. c.ifNoneMatch_ = entityTag
  104505. return c
  104506. }
  104507. // Context sets the context to be used in this call's Do method. Any
  104508. // pending HTTP request will be aborted if the provided context is
  104509. // canceled.
  104510. func (c *SslCertificatesListCall) Context(ctx context.Context) *SslCertificatesListCall {
  104511. c.ctx_ = ctx
  104512. return c
  104513. }
  104514. // Header returns an http.Header that can be modified by the caller to
  104515. // add HTTP headers to the request.
  104516. func (c *SslCertificatesListCall) Header() http.Header {
  104517. if c.header_ == nil {
  104518. c.header_ = make(http.Header)
  104519. }
  104520. return c.header_
  104521. }
  104522. func (c *SslCertificatesListCall) doRequest(alt string) (*http.Response, error) {
  104523. reqHeaders := make(http.Header)
  104524. for k, v := range c.header_ {
  104525. reqHeaders[k] = v
  104526. }
  104527. reqHeaders.Set("User-Agent", c.s.userAgent())
  104528. if c.ifNoneMatch_ != "" {
  104529. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  104530. }
  104531. var body io.Reader = nil
  104532. c.urlParams_.Set("alt", alt)
  104533. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates")
  104534. urls += "?" + c.urlParams_.Encode()
  104535. req, _ := http.NewRequest("GET", urls, body)
  104536. req.Header = reqHeaders
  104537. googleapi.Expand(req.URL, map[string]string{
  104538. "project": c.project,
  104539. })
  104540. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  104541. }
  104542. // Do executes the "compute.sslCertificates.list" call.
  104543. // Exactly one of *SslCertificateList or error will be non-nil. Any
  104544. // non-2xx status code is an error. Response headers are in either
  104545. // *SslCertificateList.ServerResponse.Header or (if a response was
  104546. // returned at all) in error.(*googleapi.Error).Header. Use
  104547. // googleapi.IsNotModified to check whether the returned error was
  104548. // because http.StatusNotModified was returned.
  104549. func (c *SslCertificatesListCall) Do(opts ...googleapi.CallOption) (*SslCertificateList, error) {
  104550. gensupport.SetOptions(c.urlParams_, opts...)
  104551. res, err := c.doRequest("json")
  104552. if res != nil && res.StatusCode == http.StatusNotModified {
  104553. if res.Body != nil {
  104554. res.Body.Close()
  104555. }
  104556. return nil, &googleapi.Error{
  104557. Code: res.StatusCode,
  104558. Header: res.Header,
  104559. }
  104560. }
  104561. if err != nil {
  104562. return nil, err
  104563. }
  104564. defer googleapi.CloseBody(res)
  104565. if err := googleapi.CheckResponse(res); err != nil {
  104566. return nil, err
  104567. }
  104568. ret := &SslCertificateList{
  104569. ServerResponse: googleapi.ServerResponse{
  104570. Header: res.Header,
  104571. HTTPStatusCode: res.StatusCode,
  104572. },
  104573. }
  104574. target := &ret
  104575. if err := gensupport.DecodeResponse(target, res); err != nil {
  104576. return nil, err
  104577. }
  104578. return ret, nil
  104579. // {
  104580. // "description": "Retrieves the list of SslCertificate resources available to the specified project.",
  104581. // "httpMethod": "GET",
  104582. // "id": "compute.sslCertificates.list",
  104583. // "parameterOrder": [
  104584. // "project"
  104585. // ],
  104586. // "parameters": {
  104587. // "filter": {
  104588. // "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).",
  104589. // "location": "query",
  104590. // "type": "string"
  104591. // },
  104592. // "maxResults": {
  104593. // "default": "500",
  104594. // "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)",
  104595. // "format": "uint32",
  104596. // "location": "query",
  104597. // "minimum": "0",
  104598. // "type": "integer"
  104599. // },
  104600. // "orderBy": {
  104601. // "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.",
  104602. // "location": "query",
  104603. // "type": "string"
  104604. // },
  104605. // "pageToken": {
  104606. // "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.",
  104607. // "location": "query",
  104608. // "type": "string"
  104609. // },
  104610. // "project": {
  104611. // "description": "Project ID for this request.",
  104612. // "location": "path",
  104613. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  104614. // "required": true,
  104615. // "type": "string"
  104616. // }
  104617. // },
  104618. // "path": "{project}/global/sslCertificates",
  104619. // "response": {
  104620. // "$ref": "SslCertificateList"
  104621. // },
  104622. // "scopes": [
  104623. // "https://www.googleapis.com/auth/cloud-platform",
  104624. // "https://www.googleapis.com/auth/compute",
  104625. // "https://www.googleapis.com/auth/compute.readonly"
  104626. // ]
  104627. // }
  104628. }
  104629. // Pages invokes f for each page of results.
  104630. // A non-nil error returned from f will halt the iteration.
  104631. // The provided context supersedes any context provided to the Context method.
  104632. func (c *SslCertificatesListCall) Pages(ctx context.Context, f func(*SslCertificateList) error) error {
  104633. c.ctx_ = ctx
  104634. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  104635. for {
  104636. x, err := c.Do()
  104637. if err != nil {
  104638. return err
  104639. }
  104640. if err := f(x); err != nil {
  104641. return err
  104642. }
  104643. if x.NextPageToken == "" {
  104644. return nil
  104645. }
  104646. c.PageToken(x.NextPageToken)
  104647. }
  104648. }
  104649. // method id "compute.sslCertificates.testIamPermissions":
  104650. type SslCertificatesTestIamPermissionsCall struct {
  104651. s *Service
  104652. project string
  104653. resource string
  104654. testpermissionsrequest *TestPermissionsRequest
  104655. urlParams_ gensupport.URLParams
  104656. ctx_ context.Context
  104657. header_ http.Header
  104658. }
  104659. // TestIamPermissions: Returns permissions that a caller has on the
  104660. // specified resource.
  104661. func (r *SslCertificatesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *SslCertificatesTestIamPermissionsCall {
  104662. c := &SslCertificatesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  104663. c.project = project
  104664. c.resource = resource
  104665. c.testpermissionsrequest = testpermissionsrequest
  104666. return c
  104667. }
  104668. // Fields allows partial responses to be retrieved. See
  104669. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  104670. // for more information.
  104671. func (c *SslCertificatesTestIamPermissionsCall) Fields(s ...googleapi.Field) *SslCertificatesTestIamPermissionsCall {
  104672. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  104673. return c
  104674. }
  104675. // Context sets the context to be used in this call's Do method. Any
  104676. // pending HTTP request will be aborted if the provided context is
  104677. // canceled.
  104678. func (c *SslCertificatesTestIamPermissionsCall) Context(ctx context.Context) *SslCertificatesTestIamPermissionsCall {
  104679. c.ctx_ = ctx
  104680. return c
  104681. }
  104682. // Header returns an http.Header that can be modified by the caller to
  104683. // add HTTP headers to the request.
  104684. func (c *SslCertificatesTestIamPermissionsCall) Header() http.Header {
  104685. if c.header_ == nil {
  104686. c.header_ = make(http.Header)
  104687. }
  104688. return c.header_
  104689. }
  104690. func (c *SslCertificatesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  104691. reqHeaders := make(http.Header)
  104692. for k, v := range c.header_ {
  104693. reqHeaders[k] = v
  104694. }
  104695. reqHeaders.Set("User-Agent", c.s.userAgent())
  104696. var body io.Reader = nil
  104697. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  104698. if err != nil {
  104699. return nil, err
  104700. }
  104701. reqHeaders.Set("Content-Type", "application/json")
  104702. c.urlParams_.Set("alt", alt)
  104703. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates/{resource}/testIamPermissions")
  104704. urls += "?" + c.urlParams_.Encode()
  104705. req, _ := http.NewRequest("POST", urls, body)
  104706. req.Header = reqHeaders
  104707. googleapi.Expand(req.URL, map[string]string{
  104708. "project": c.project,
  104709. "resource": c.resource,
  104710. })
  104711. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  104712. }
  104713. // Do executes the "compute.sslCertificates.testIamPermissions" call.
  104714. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  104715. // non-2xx status code is an error. Response headers are in either
  104716. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  104717. // returned at all) in error.(*googleapi.Error).Header. Use
  104718. // googleapi.IsNotModified to check whether the returned error was
  104719. // because http.StatusNotModified was returned.
  104720. func (c *SslCertificatesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  104721. gensupport.SetOptions(c.urlParams_, opts...)
  104722. res, err := c.doRequest("json")
  104723. if res != nil && res.StatusCode == http.StatusNotModified {
  104724. if res.Body != nil {
  104725. res.Body.Close()
  104726. }
  104727. return nil, &googleapi.Error{
  104728. Code: res.StatusCode,
  104729. Header: res.Header,
  104730. }
  104731. }
  104732. if err != nil {
  104733. return nil, err
  104734. }
  104735. defer googleapi.CloseBody(res)
  104736. if err := googleapi.CheckResponse(res); err != nil {
  104737. return nil, err
  104738. }
  104739. ret := &TestPermissionsResponse{
  104740. ServerResponse: googleapi.ServerResponse{
  104741. Header: res.Header,
  104742. HTTPStatusCode: res.StatusCode,
  104743. },
  104744. }
  104745. target := &ret
  104746. if err := gensupport.DecodeResponse(target, res); err != nil {
  104747. return nil, err
  104748. }
  104749. return ret, nil
  104750. // {
  104751. // "description": "Returns permissions that a caller has on the specified resource.",
  104752. // "httpMethod": "POST",
  104753. // "id": "compute.sslCertificates.testIamPermissions",
  104754. // "parameterOrder": [
  104755. // "project",
  104756. // "resource"
  104757. // ],
  104758. // "parameters": {
  104759. // "project": {
  104760. // "description": "Project ID for this request.",
  104761. // "location": "path",
  104762. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  104763. // "required": true,
  104764. // "type": "string"
  104765. // },
  104766. // "resource": {
  104767. // "description": "Name of the resource for this request.",
  104768. // "location": "path",
  104769. // "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?",
  104770. // "required": true,
  104771. // "type": "string"
  104772. // }
  104773. // },
  104774. // "path": "{project}/global/sslCertificates/{resource}/testIamPermissions",
  104775. // "request": {
  104776. // "$ref": "TestPermissionsRequest"
  104777. // },
  104778. // "response": {
  104779. // "$ref": "TestPermissionsResponse"
  104780. // },
  104781. // "scopes": [
  104782. // "https://www.googleapis.com/auth/cloud-platform",
  104783. // "https://www.googleapis.com/auth/compute",
  104784. // "https://www.googleapis.com/auth/compute.readonly"
  104785. // ]
  104786. // }
  104787. }
  104788. // method id "compute.sslPolicies.delete":
  104789. type SslPoliciesDeleteCall struct {
  104790. s *Service
  104791. project string
  104792. sslPolicy string
  104793. urlParams_ gensupport.URLParams
  104794. ctx_ context.Context
  104795. header_ http.Header
  104796. }
  104797. // Delete: Deletes the specified SSL policy. The SSL policy resource can
  104798. // be deleted only if it is not in use by any TargetHttpsProxy or
  104799. // TargetSslProxy resources.
  104800. func (r *SslPoliciesService) Delete(project string, sslPolicy string) *SslPoliciesDeleteCall {
  104801. c := &SslPoliciesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  104802. c.project = project
  104803. c.sslPolicy = sslPolicy
  104804. return c
  104805. }
  104806. // RequestId sets the optional parameter "requestId": An optional
  104807. // request ID to identify requests. Specify a unique request ID so that
  104808. // if you must retry your request, the server will know to ignore the
  104809. // request if it has already been completed.
  104810. //
  104811. // For example, consider a situation where you make an initial request
  104812. // and the request times out. If you make the request again with the
  104813. // same request ID, the server can check if original operation with the
  104814. // same request ID was received, and if so, will ignore the second
  104815. // request. This prevents clients from accidentally creating duplicate
  104816. // commitments.
  104817. //
  104818. // The request ID must be a valid UUID with the exception that zero UUID
  104819. // is not supported (00000000-0000-0000-0000-000000000000).
  104820. func (c *SslPoliciesDeleteCall) RequestId(requestId string) *SslPoliciesDeleteCall {
  104821. c.urlParams_.Set("requestId", requestId)
  104822. return c
  104823. }
  104824. // Fields allows partial responses to be retrieved. See
  104825. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  104826. // for more information.
  104827. func (c *SslPoliciesDeleteCall) Fields(s ...googleapi.Field) *SslPoliciesDeleteCall {
  104828. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  104829. return c
  104830. }
  104831. // Context sets the context to be used in this call's Do method. Any
  104832. // pending HTTP request will be aborted if the provided context is
  104833. // canceled.
  104834. func (c *SslPoliciesDeleteCall) Context(ctx context.Context) *SslPoliciesDeleteCall {
  104835. c.ctx_ = ctx
  104836. return c
  104837. }
  104838. // Header returns an http.Header that can be modified by the caller to
  104839. // add HTTP headers to the request.
  104840. func (c *SslPoliciesDeleteCall) Header() http.Header {
  104841. if c.header_ == nil {
  104842. c.header_ = make(http.Header)
  104843. }
  104844. return c.header_
  104845. }
  104846. func (c *SslPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) {
  104847. reqHeaders := make(http.Header)
  104848. for k, v := range c.header_ {
  104849. reqHeaders[k] = v
  104850. }
  104851. reqHeaders.Set("User-Agent", c.s.userAgent())
  104852. var body io.Reader = nil
  104853. c.urlParams_.Set("alt", alt)
  104854. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslPolicies/{sslPolicy}")
  104855. urls += "?" + c.urlParams_.Encode()
  104856. req, _ := http.NewRequest("DELETE", urls, body)
  104857. req.Header = reqHeaders
  104858. googleapi.Expand(req.URL, map[string]string{
  104859. "project": c.project,
  104860. "sslPolicy": c.sslPolicy,
  104861. })
  104862. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  104863. }
  104864. // Do executes the "compute.sslPolicies.delete" call.
  104865. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  104866. // status code is an error. Response headers are in either
  104867. // *Operation.ServerResponse.Header or (if a response was returned at
  104868. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  104869. // to check whether the returned error was because
  104870. // http.StatusNotModified was returned.
  104871. func (c *SslPoliciesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  104872. gensupport.SetOptions(c.urlParams_, opts...)
  104873. res, err := c.doRequest("json")
  104874. if res != nil && res.StatusCode == http.StatusNotModified {
  104875. if res.Body != nil {
  104876. res.Body.Close()
  104877. }
  104878. return nil, &googleapi.Error{
  104879. Code: res.StatusCode,
  104880. Header: res.Header,
  104881. }
  104882. }
  104883. if err != nil {
  104884. return nil, err
  104885. }
  104886. defer googleapi.CloseBody(res)
  104887. if err := googleapi.CheckResponse(res); err != nil {
  104888. return nil, err
  104889. }
  104890. ret := &Operation{
  104891. ServerResponse: googleapi.ServerResponse{
  104892. Header: res.Header,
  104893. HTTPStatusCode: res.StatusCode,
  104894. },
  104895. }
  104896. target := &ret
  104897. if err := gensupport.DecodeResponse(target, res); err != nil {
  104898. return nil, err
  104899. }
  104900. return ret, nil
  104901. // {
  104902. // "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.",
  104903. // "httpMethod": "DELETE",
  104904. // "id": "compute.sslPolicies.delete",
  104905. // "parameterOrder": [
  104906. // "project",
  104907. // "sslPolicy"
  104908. // ],
  104909. // "parameters": {
  104910. // "project": {
  104911. // "description": "Project ID for this request.",
  104912. // "location": "path",
  104913. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  104914. // "required": true,
  104915. // "type": "string"
  104916. // },
  104917. // "requestId": {
  104918. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  104919. // "location": "query",
  104920. // "type": "string"
  104921. // },
  104922. // "sslPolicy": {
  104923. // "description": "Name of the SSL policy to delete. The name must be 1-63 characters long, and comply with RFC1035.",
  104924. // "location": "path",
  104925. // "required": true,
  104926. // "type": "string"
  104927. // }
  104928. // },
  104929. // "path": "{project}/global/sslPolicies/{sslPolicy}",
  104930. // "response": {
  104931. // "$ref": "Operation"
  104932. // },
  104933. // "scopes": [
  104934. // "https://www.googleapis.com/auth/cloud-platform",
  104935. // "https://www.googleapis.com/auth/compute"
  104936. // ]
  104937. // }
  104938. }
  104939. // method id "compute.sslPolicies.get":
  104940. type SslPoliciesGetCall struct {
  104941. s *Service
  104942. project string
  104943. sslPolicy string
  104944. urlParams_ gensupport.URLParams
  104945. ifNoneMatch_ string
  104946. ctx_ context.Context
  104947. header_ http.Header
  104948. }
  104949. // Get: Lists all of the ordered rules present in a single specified
  104950. // policy.
  104951. func (r *SslPoliciesService) Get(project string, sslPolicy string) *SslPoliciesGetCall {
  104952. c := &SslPoliciesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  104953. c.project = project
  104954. c.sslPolicy = sslPolicy
  104955. return c
  104956. }
  104957. // Fields allows partial responses to be retrieved. See
  104958. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  104959. // for more information.
  104960. func (c *SslPoliciesGetCall) Fields(s ...googleapi.Field) *SslPoliciesGetCall {
  104961. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  104962. return c
  104963. }
  104964. // IfNoneMatch sets the optional parameter which makes the operation
  104965. // fail if the object's ETag matches the given value. This is useful for
  104966. // getting updates only after the object has changed since the last
  104967. // request. Use googleapi.IsNotModified to check whether the response
  104968. // error from Do is the result of In-None-Match.
  104969. func (c *SslPoliciesGetCall) IfNoneMatch(entityTag string) *SslPoliciesGetCall {
  104970. c.ifNoneMatch_ = entityTag
  104971. return c
  104972. }
  104973. // Context sets the context to be used in this call's Do method. Any
  104974. // pending HTTP request will be aborted if the provided context is
  104975. // canceled.
  104976. func (c *SslPoliciesGetCall) Context(ctx context.Context) *SslPoliciesGetCall {
  104977. c.ctx_ = ctx
  104978. return c
  104979. }
  104980. // Header returns an http.Header that can be modified by the caller to
  104981. // add HTTP headers to the request.
  104982. func (c *SslPoliciesGetCall) Header() http.Header {
  104983. if c.header_ == nil {
  104984. c.header_ = make(http.Header)
  104985. }
  104986. return c.header_
  104987. }
  104988. func (c *SslPoliciesGetCall) doRequest(alt string) (*http.Response, error) {
  104989. reqHeaders := make(http.Header)
  104990. for k, v := range c.header_ {
  104991. reqHeaders[k] = v
  104992. }
  104993. reqHeaders.Set("User-Agent", c.s.userAgent())
  104994. if c.ifNoneMatch_ != "" {
  104995. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  104996. }
  104997. var body io.Reader = nil
  104998. c.urlParams_.Set("alt", alt)
  104999. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslPolicies/{sslPolicy}")
  105000. urls += "?" + c.urlParams_.Encode()
  105001. req, _ := http.NewRequest("GET", urls, body)
  105002. req.Header = reqHeaders
  105003. googleapi.Expand(req.URL, map[string]string{
  105004. "project": c.project,
  105005. "sslPolicy": c.sslPolicy,
  105006. })
  105007. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  105008. }
  105009. // Do executes the "compute.sslPolicies.get" call.
  105010. // Exactly one of *SslPolicy or error will be non-nil. Any non-2xx
  105011. // status code is an error. Response headers are in either
  105012. // *SslPolicy.ServerResponse.Header or (if a response was returned at
  105013. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  105014. // to check whether the returned error was because
  105015. // http.StatusNotModified was returned.
  105016. func (c *SslPoliciesGetCall) Do(opts ...googleapi.CallOption) (*SslPolicy, error) {
  105017. gensupport.SetOptions(c.urlParams_, opts...)
  105018. res, err := c.doRequest("json")
  105019. if res != nil && res.StatusCode == http.StatusNotModified {
  105020. if res.Body != nil {
  105021. res.Body.Close()
  105022. }
  105023. return nil, &googleapi.Error{
  105024. Code: res.StatusCode,
  105025. Header: res.Header,
  105026. }
  105027. }
  105028. if err != nil {
  105029. return nil, err
  105030. }
  105031. defer googleapi.CloseBody(res)
  105032. if err := googleapi.CheckResponse(res); err != nil {
  105033. return nil, err
  105034. }
  105035. ret := &SslPolicy{
  105036. ServerResponse: googleapi.ServerResponse{
  105037. Header: res.Header,
  105038. HTTPStatusCode: res.StatusCode,
  105039. },
  105040. }
  105041. target := &ret
  105042. if err := gensupport.DecodeResponse(target, res); err != nil {
  105043. return nil, err
  105044. }
  105045. return ret, nil
  105046. // {
  105047. // "description": "Lists all of the ordered rules present in a single specified policy.",
  105048. // "httpMethod": "GET",
  105049. // "id": "compute.sslPolicies.get",
  105050. // "parameterOrder": [
  105051. // "project",
  105052. // "sslPolicy"
  105053. // ],
  105054. // "parameters": {
  105055. // "project": {
  105056. // "description": "Project ID for this request.",
  105057. // "location": "path",
  105058. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  105059. // "required": true,
  105060. // "type": "string"
  105061. // },
  105062. // "sslPolicy": {
  105063. // "description": "Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035.",
  105064. // "location": "path",
  105065. // "required": true,
  105066. // "type": "string"
  105067. // }
  105068. // },
  105069. // "path": "{project}/global/sslPolicies/{sslPolicy}",
  105070. // "response": {
  105071. // "$ref": "SslPolicy"
  105072. // },
  105073. // "scopes": [
  105074. // "https://www.googleapis.com/auth/cloud-platform",
  105075. // "https://www.googleapis.com/auth/compute",
  105076. // "https://www.googleapis.com/auth/compute.readonly"
  105077. // ]
  105078. // }
  105079. }
  105080. // method id "compute.sslPolicies.insert":
  105081. type SslPoliciesInsertCall struct {
  105082. s *Service
  105083. project string
  105084. sslpolicy *SslPolicy
  105085. urlParams_ gensupport.URLParams
  105086. ctx_ context.Context
  105087. header_ http.Header
  105088. }
  105089. // Insert: Returns the specified SSL policy resource. Gets a list of
  105090. // available SSL policies by making a list() request.
  105091. func (r *SslPoliciesService) Insert(project string, sslpolicy *SslPolicy) *SslPoliciesInsertCall {
  105092. c := &SslPoliciesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  105093. c.project = project
  105094. c.sslpolicy = sslpolicy
  105095. return c
  105096. }
  105097. // RequestId sets the optional parameter "requestId": An optional
  105098. // request ID to identify requests. Specify a unique request ID so that
  105099. // if you must retry your request, the server will know to ignore the
  105100. // request if it has already been completed.
  105101. //
  105102. // For example, consider a situation where you make an initial request
  105103. // and the request times out. If you make the request again with the
  105104. // same request ID, the server can check if original operation with the
  105105. // same request ID was received, and if so, will ignore the second
  105106. // request. This prevents clients from accidentally creating duplicate
  105107. // commitments.
  105108. //
  105109. // The request ID must be a valid UUID with the exception that zero UUID
  105110. // is not supported (00000000-0000-0000-0000-000000000000).
  105111. func (c *SslPoliciesInsertCall) RequestId(requestId string) *SslPoliciesInsertCall {
  105112. c.urlParams_.Set("requestId", requestId)
  105113. return c
  105114. }
  105115. // Fields allows partial responses to be retrieved. See
  105116. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  105117. // for more information.
  105118. func (c *SslPoliciesInsertCall) Fields(s ...googleapi.Field) *SslPoliciesInsertCall {
  105119. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  105120. return c
  105121. }
  105122. // Context sets the context to be used in this call's Do method. Any
  105123. // pending HTTP request will be aborted if the provided context is
  105124. // canceled.
  105125. func (c *SslPoliciesInsertCall) Context(ctx context.Context) *SslPoliciesInsertCall {
  105126. c.ctx_ = ctx
  105127. return c
  105128. }
  105129. // Header returns an http.Header that can be modified by the caller to
  105130. // add HTTP headers to the request.
  105131. func (c *SslPoliciesInsertCall) Header() http.Header {
  105132. if c.header_ == nil {
  105133. c.header_ = make(http.Header)
  105134. }
  105135. return c.header_
  105136. }
  105137. func (c *SslPoliciesInsertCall) doRequest(alt string) (*http.Response, error) {
  105138. reqHeaders := make(http.Header)
  105139. for k, v := range c.header_ {
  105140. reqHeaders[k] = v
  105141. }
  105142. reqHeaders.Set("User-Agent", c.s.userAgent())
  105143. var body io.Reader = nil
  105144. body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslpolicy)
  105145. if err != nil {
  105146. return nil, err
  105147. }
  105148. reqHeaders.Set("Content-Type", "application/json")
  105149. c.urlParams_.Set("alt", alt)
  105150. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslPolicies")
  105151. urls += "?" + c.urlParams_.Encode()
  105152. req, _ := http.NewRequest("POST", urls, body)
  105153. req.Header = reqHeaders
  105154. googleapi.Expand(req.URL, map[string]string{
  105155. "project": c.project,
  105156. })
  105157. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  105158. }
  105159. // Do executes the "compute.sslPolicies.insert" call.
  105160. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  105161. // status code is an error. Response headers are in either
  105162. // *Operation.ServerResponse.Header or (if a response was returned at
  105163. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  105164. // to check whether the returned error was because
  105165. // http.StatusNotModified was returned.
  105166. func (c *SslPoliciesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  105167. gensupport.SetOptions(c.urlParams_, opts...)
  105168. res, err := c.doRequest("json")
  105169. if res != nil && res.StatusCode == http.StatusNotModified {
  105170. if res.Body != nil {
  105171. res.Body.Close()
  105172. }
  105173. return nil, &googleapi.Error{
  105174. Code: res.StatusCode,
  105175. Header: res.Header,
  105176. }
  105177. }
  105178. if err != nil {
  105179. return nil, err
  105180. }
  105181. defer googleapi.CloseBody(res)
  105182. if err := googleapi.CheckResponse(res); err != nil {
  105183. return nil, err
  105184. }
  105185. ret := &Operation{
  105186. ServerResponse: googleapi.ServerResponse{
  105187. Header: res.Header,
  105188. HTTPStatusCode: res.StatusCode,
  105189. },
  105190. }
  105191. target := &ret
  105192. if err := gensupport.DecodeResponse(target, res); err != nil {
  105193. return nil, err
  105194. }
  105195. return ret, nil
  105196. // {
  105197. // "description": "Returns the specified SSL policy resource. Gets a list of available SSL policies by making a list() request.",
  105198. // "httpMethod": "POST",
  105199. // "id": "compute.sslPolicies.insert",
  105200. // "parameterOrder": [
  105201. // "project"
  105202. // ],
  105203. // "parameters": {
  105204. // "project": {
  105205. // "description": "Project ID for this request.",
  105206. // "location": "path",
  105207. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  105208. // "required": true,
  105209. // "type": "string"
  105210. // },
  105211. // "requestId": {
  105212. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  105213. // "location": "query",
  105214. // "type": "string"
  105215. // }
  105216. // },
  105217. // "path": "{project}/global/sslPolicies",
  105218. // "request": {
  105219. // "$ref": "SslPolicy"
  105220. // },
  105221. // "response": {
  105222. // "$ref": "Operation"
  105223. // },
  105224. // "scopes": [
  105225. // "https://www.googleapis.com/auth/cloud-platform",
  105226. // "https://www.googleapis.com/auth/compute"
  105227. // ]
  105228. // }
  105229. }
  105230. // method id "compute.sslPolicies.list":
  105231. type SslPoliciesListCall struct {
  105232. s *Service
  105233. project string
  105234. urlParams_ gensupport.URLParams
  105235. ifNoneMatch_ string
  105236. ctx_ context.Context
  105237. header_ http.Header
  105238. }
  105239. // List: Lists all the SSL policies that have been configured for the
  105240. // specified project.
  105241. func (r *SslPoliciesService) List(project string) *SslPoliciesListCall {
  105242. c := &SslPoliciesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  105243. c.project = project
  105244. return c
  105245. }
  105246. // Filter sets the optional parameter "filter": A filter expression that
  105247. // filters resources listed in the response. The expression must specify
  105248. // the field name, a comparison operator, and the value that you want to
  105249. // use for filtering. The value must be a string, a number, or a
  105250. // boolean. The comparison operator must be either =, !=, >, or <.
  105251. //
  105252. // For example, if you are filtering Compute Engine instances, you can
  105253. // exclude instances named example-instance by specifying name !=
  105254. // example-instance.
  105255. //
  105256. // You can also filter nested fields. For example, you could specify
  105257. // scheduling.automaticRestart = false to include instances only if they
  105258. // are not scheduled for automatic restarts. You can use filtering on
  105259. // nested fields to filter based on resource labels.
  105260. //
  105261. // To filter on multiple expressions, provide each separate expression
  105262. // within parentheses. For example, (scheduling.automaticRestart = true)
  105263. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  105264. // AND expression. However, you can include AND and OR expressions
  105265. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  105266. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  105267. // true).
  105268. func (c *SslPoliciesListCall) Filter(filter string) *SslPoliciesListCall {
  105269. c.urlParams_.Set("filter", filter)
  105270. return c
  105271. }
  105272. // MaxResults sets the optional parameter "maxResults": The maximum
  105273. // number of results per page that should be returned. If the number of
  105274. // available results is larger than maxResults, Compute Engine returns a
  105275. // nextPageToken that can be used to get the next page of results in
  105276. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  105277. // (Default: 500)
  105278. func (c *SslPoliciesListCall) MaxResults(maxResults int64) *SslPoliciesListCall {
  105279. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  105280. return c
  105281. }
  105282. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  105283. // a certain order. By default, results are returned in alphanumerical
  105284. // order based on the resource name.
  105285. //
  105286. // You can also sort results in descending order based on the creation
  105287. // timestamp using orderBy="creationTimestamp desc". This sorts results
  105288. // based on the creationTimestamp field in reverse chronological order
  105289. // (newest result first). Use this to sort resources like operations so
  105290. // that the newest operation is returned first.
  105291. //
  105292. // Currently, only sorting by name or creationTimestamp desc is
  105293. // supported.
  105294. func (c *SslPoliciesListCall) OrderBy(orderBy string) *SslPoliciesListCall {
  105295. c.urlParams_.Set("orderBy", orderBy)
  105296. return c
  105297. }
  105298. // PageToken sets the optional parameter "pageToken": Specifies a page
  105299. // token to use. Set pageToken to the nextPageToken returned by a
  105300. // previous list request to get the next page of results.
  105301. func (c *SslPoliciesListCall) PageToken(pageToken string) *SslPoliciesListCall {
  105302. c.urlParams_.Set("pageToken", pageToken)
  105303. return c
  105304. }
  105305. // Fields allows partial responses to be retrieved. See
  105306. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  105307. // for more information.
  105308. func (c *SslPoliciesListCall) Fields(s ...googleapi.Field) *SslPoliciesListCall {
  105309. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  105310. return c
  105311. }
  105312. // IfNoneMatch sets the optional parameter which makes the operation
  105313. // fail if the object's ETag matches the given value. This is useful for
  105314. // getting updates only after the object has changed since the last
  105315. // request. Use googleapi.IsNotModified to check whether the response
  105316. // error from Do is the result of In-None-Match.
  105317. func (c *SslPoliciesListCall) IfNoneMatch(entityTag string) *SslPoliciesListCall {
  105318. c.ifNoneMatch_ = entityTag
  105319. return c
  105320. }
  105321. // Context sets the context to be used in this call's Do method. Any
  105322. // pending HTTP request will be aborted if the provided context is
  105323. // canceled.
  105324. func (c *SslPoliciesListCall) Context(ctx context.Context) *SslPoliciesListCall {
  105325. c.ctx_ = ctx
  105326. return c
  105327. }
  105328. // Header returns an http.Header that can be modified by the caller to
  105329. // add HTTP headers to the request.
  105330. func (c *SslPoliciesListCall) Header() http.Header {
  105331. if c.header_ == nil {
  105332. c.header_ = make(http.Header)
  105333. }
  105334. return c.header_
  105335. }
  105336. func (c *SslPoliciesListCall) doRequest(alt string) (*http.Response, error) {
  105337. reqHeaders := make(http.Header)
  105338. for k, v := range c.header_ {
  105339. reqHeaders[k] = v
  105340. }
  105341. reqHeaders.Set("User-Agent", c.s.userAgent())
  105342. if c.ifNoneMatch_ != "" {
  105343. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  105344. }
  105345. var body io.Reader = nil
  105346. c.urlParams_.Set("alt", alt)
  105347. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslPolicies")
  105348. urls += "?" + c.urlParams_.Encode()
  105349. req, _ := http.NewRequest("GET", urls, body)
  105350. req.Header = reqHeaders
  105351. googleapi.Expand(req.URL, map[string]string{
  105352. "project": c.project,
  105353. })
  105354. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  105355. }
  105356. // Do executes the "compute.sslPolicies.list" call.
  105357. // Exactly one of *SslPoliciesList or error will be non-nil. Any non-2xx
  105358. // status code is an error. Response headers are in either
  105359. // *SslPoliciesList.ServerResponse.Header or (if a response was returned
  105360. // at all) in error.(*googleapi.Error).Header. Use
  105361. // googleapi.IsNotModified to check whether the returned error was
  105362. // because http.StatusNotModified was returned.
  105363. func (c *SslPoliciesListCall) Do(opts ...googleapi.CallOption) (*SslPoliciesList, error) {
  105364. gensupport.SetOptions(c.urlParams_, opts...)
  105365. res, err := c.doRequest("json")
  105366. if res != nil && res.StatusCode == http.StatusNotModified {
  105367. if res.Body != nil {
  105368. res.Body.Close()
  105369. }
  105370. return nil, &googleapi.Error{
  105371. Code: res.StatusCode,
  105372. Header: res.Header,
  105373. }
  105374. }
  105375. if err != nil {
  105376. return nil, err
  105377. }
  105378. defer googleapi.CloseBody(res)
  105379. if err := googleapi.CheckResponse(res); err != nil {
  105380. return nil, err
  105381. }
  105382. ret := &SslPoliciesList{
  105383. ServerResponse: googleapi.ServerResponse{
  105384. Header: res.Header,
  105385. HTTPStatusCode: res.StatusCode,
  105386. },
  105387. }
  105388. target := &ret
  105389. if err := gensupport.DecodeResponse(target, res); err != nil {
  105390. return nil, err
  105391. }
  105392. return ret, nil
  105393. // {
  105394. // "description": "Lists all the SSL policies that have been configured for the specified project.",
  105395. // "httpMethod": "GET",
  105396. // "id": "compute.sslPolicies.list",
  105397. // "parameterOrder": [
  105398. // "project"
  105399. // ],
  105400. // "parameters": {
  105401. // "filter": {
  105402. // "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).",
  105403. // "location": "query",
  105404. // "type": "string"
  105405. // },
  105406. // "maxResults": {
  105407. // "default": "500",
  105408. // "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)",
  105409. // "format": "uint32",
  105410. // "location": "query",
  105411. // "minimum": "0",
  105412. // "type": "integer"
  105413. // },
  105414. // "orderBy": {
  105415. // "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.",
  105416. // "location": "query",
  105417. // "type": "string"
  105418. // },
  105419. // "pageToken": {
  105420. // "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.",
  105421. // "location": "query",
  105422. // "type": "string"
  105423. // },
  105424. // "project": {
  105425. // "description": "Project ID for this request.",
  105426. // "location": "path",
  105427. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  105428. // "required": true,
  105429. // "type": "string"
  105430. // }
  105431. // },
  105432. // "path": "{project}/global/sslPolicies",
  105433. // "response": {
  105434. // "$ref": "SslPoliciesList"
  105435. // },
  105436. // "scopes": [
  105437. // "https://www.googleapis.com/auth/cloud-platform",
  105438. // "https://www.googleapis.com/auth/compute",
  105439. // "https://www.googleapis.com/auth/compute.readonly"
  105440. // ]
  105441. // }
  105442. }
  105443. // Pages invokes f for each page of results.
  105444. // A non-nil error returned from f will halt the iteration.
  105445. // The provided context supersedes any context provided to the Context method.
  105446. func (c *SslPoliciesListCall) Pages(ctx context.Context, f func(*SslPoliciesList) error) error {
  105447. c.ctx_ = ctx
  105448. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  105449. for {
  105450. x, err := c.Do()
  105451. if err != nil {
  105452. return err
  105453. }
  105454. if err := f(x); err != nil {
  105455. return err
  105456. }
  105457. if x.NextPageToken == "" {
  105458. return nil
  105459. }
  105460. c.PageToken(x.NextPageToken)
  105461. }
  105462. }
  105463. // method id "compute.sslPolicies.listAvailableFeatures":
  105464. type SslPoliciesListAvailableFeaturesCall struct {
  105465. s *Service
  105466. project string
  105467. urlParams_ gensupport.URLParams
  105468. ifNoneMatch_ string
  105469. ctx_ context.Context
  105470. header_ http.Header
  105471. }
  105472. // ListAvailableFeatures: Lists all features that can be specified in
  105473. // the SSL policy when using custom profile.
  105474. func (r *SslPoliciesService) ListAvailableFeatures(project string) *SslPoliciesListAvailableFeaturesCall {
  105475. c := &SslPoliciesListAvailableFeaturesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  105476. c.project = project
  105477. return c
  105478. }
  105479. // Filter sets the optional parameter "filter": A filter expression that
  105480. // filters resources listed in the response. The expression must specify
  105481. // the field name, a comparison operator, and the value that you want to
  105482. // use for filtering. The value must be a string, a number, or a
  105483. // boolean. The comparison operator must be either =, !=, >, or <.
  105484. //
  105485. // For example, if you are filtering Compute Engine instances, you can
  105486. // exclude instances named example-instance by specifying name !=
  105487. // example-instance.
  105488. //
  105489. // You can also filter nested fields. For example, you could specify
  105490. // scheduling.automaticRestart = false to include instances only if they
  105491. // are not scheduled for automatic restarts. You can use filtering on
  105492. // nested fields to filter based on resource labels.
  105493. //
  105494. // To filter on multiple expressions, provide each separate expression
  105495. // within parentheses. For example, (scheduling.automaticRestart = true)
  105496. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  105497. // AND expression. However, you can include AND and OR expressions
  105498. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  105499. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  105500. // true).
  105501. func (c *SslPoliciesListAvailableFeaturesCall) Filter(filter string) *SslPoliciesListAvailableFeaturesCall {
  105502. c.urlParams_.Set("filter", filter)
  105503. return c
  105504. }
  105505. // MaxResults sets the optional parameter "maxResults": The maximum
  105506. // number of results per page that should be returned. If the number of
  105507. // available results is larger than maxResults, Compute Engine returns a
  105508. // nextPageToken that can be used to get the next page of results in
  105509. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  105510. // (Default: 500)
  105511. func (c *SslPoliciesListAvailableFeaturesCall) MaxResults(maxResults int64) *SslPoliciesListAvailableFeaturesCall {
  105512. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  105513. return c
  105514. }
  105515. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  105516. // a certain order. By default, results are returned in alphanumerical
  105517. // order based on the resource name.
  105518. //
  105519. // You can also sort results in descending order based on the creation
  105520. // timestamp using orderBy="creationTimestamp desc". This sorts results
  105521. // based on the creationTimestamp field in reverse chronological order
  105522. // (newest result first). Use this to sort resources like operations so
  105523. // that the newest operation is returned first.
  105524. //
  105525. // Currently, only sorting by name or creationTimestamp desc is
  105526. // supported.
  105527. func (c *SslPoliciesListAvailableFeaturesCall) OrderBy(orderBy string) *SslPoliciesListAvailableFeaturesCall {
  105528. c.urlParams_.Set("orderBy", orderBy)
  105529. return c
  105530. }
  105531. // PageToken sets the optional parameter "pageToken": Specifies a page
  105532. // token to use. Set pageToken to the nextPageToken returned by a
  105533. // previous list request to get the next page of results.
  105534. func (c *SslPoliciesListAvailableFeaturesCall) PageToken(pageToken string) *SslPoliciesListAvailableFeaturesCall {
  105535. c.urlParams_.Set("pageToken", pageToken)
  105536. return c
  105537. }
  105538. // Fields allows partial responses to be retrieved. See
  105539. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  105540. // for more information.
  105541. func (c *SslPoliciesListAvailableFeaturesCall) Fields(s ...googleapi.Field) *SslPoliciesListAvailableFeaturesCall {
  105542. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  105543. return c
  105544. }
  105545. // IfNoneMatch sets the optional parameter which makes the operation
  105546. // fail if the object's ETag matches the given value. This is useful for
  105547. // getting updates only after the object has changed since the last
  105548. // request. Use googleapi.IsNotModified to check whether the response
  105549. // error from Do is the result of In-None-Match.
  105550. func (c *SslPoliciesListAvailableFeaturesCall) IfNoneMatch(entityTag string) *SslPoliciesListAvailableFeaturesCall {
  105551. c.ifNoneMatch_ = entityTag
  105552. return c
  105553. }
  105554. // Context sets the context to be used in this call's Do method. Any
  105555. // pending HTTP request will be aborted if the provided context is
  105556. // canceled.
  105557. func (c *SslPoliciesListAvailableFeaturesCall) Context(ctx context.Context) *SslPoliciesListAvailableFeaturesCall {
  105558. c.ctx_ = ctx
  105559. return c
  105560. }
  105561. // Header returns an http.Header that can be modified by the caller to
  105562. // add HTTP headers to the request.
  105563. func (c *SslPoliciesListAvailableFeaturesCall) Header() http.Header {
  105564. if c.header_ == nil {
  105565. c.header_ = make(http.Header)
  105566. }
  105567. return c.header_
  105568. }
  105569. func (c *SslPoliciesListAvailableFeaturesCall) doRequest(alt string) (*http.Response, error) {
  105570. reqHeaders := make(http.Header)
  105571. for k, v := range c.header_ {
  105572. reqHeaders[k] = v
  105573. }
  105574. reqHeaders.Set("User-Agent", c.s.userAgent())
  105575. if c.ifNoneMatch_ != "" {
  105576. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  105577. }
  105578. var body io.Reader = nil
  105579. c.urlParams_.Set("alt", alt)
  105580. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslPolicies/listAvailableFeatures")
  105581. urls += "?" + c.urlParams_.Encode()
  105582. req, _ := http.NewRequest("GET", urls, body)
  105583. req.Header = reqHeaders
  105584. googleapi.Expand(req.URL, map[string]string{
  105585. "project": c.project,
  105586. })
  105587. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  105588. }
  105589. // Do executes the "compute.sslPolicies.listAvailableFeatures" call.
  105590. // Exactly one of *SslPoliciesListAvailableFeaturesResponse or error
  105591. // will be non-nil. Any non-2xx status code is an error. Response
  105592. // headers are in either
  105593. // *SslPoliciesListAvailableFeaturesResponse.ServerResponse.Header or
  105594. // (if a response was returned at all) in
  105595. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  105596. // whether the returned error was because http.StatusNotModified was
  105597. // returned.
  105598. func (c *SslPoliciesListAvailableFeaturesCall) Do(opts ...googleapi.CallOption) (*SslPoliciesListAvailableFeaturesResponse, error) {
  105599. gensupport.SetOptions(c.urlParams_, opts...)
  105600. res, err := c.doRequest("json")
  105601. if res != nil && res.StatusCode == http.StatusNotModified {
  105602. if res.Body != nil {
  105603. res.Body.Close()
  105604. }
  105605. return nil, &googleapi.Error{
  105606. Code: res.StatusCode,
  105607. Header: res.Header,
  105608. }
  105609. }
  105610. if err != nil {
  105611. return nil, err
  105612. }
  105613. defer googleapi.CloseBody(res)
  105614. if err := googleapi.CheckResponse(res); err != nil {
  105615. return nil, err
  105616. }
  105617. ret := &SslPoliciesListAvailableFeaturesResponse{
  105618. ServerResponse: googleapi.ServerResponse{
  105619. Header: res.Header,
  105620. HTTPStatusCode: res.StatusCode,
  105621. },
  105622. }
  105623. target := &ret
  105624. if err := gensupport.DecodeResponse(target, res); err != nil {
  105625. return nil, err
  105626. }
  105627. return ret, nil
  105628. // {
  105629. // "description": "Lists all features that can be specified in the SSL policy when using custom profile.",
  105630. // "httpMethod": "GET",
  105631. // "id": "compute.sslPolicies.listAvailableFeatures",
  105632. // "parameterOrder": [
  105633. // "project"
  105634. // ],
  105635. // "parameters": {
  105636. // "filter": {
  105637. // "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).",
  105638. // "location": "query",
  105639. // "type": "string"
  105640. // },
  105641. // "maxResults": {
  105642. // "default": "500",
  105643. // "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)",
  105644. // "format": "uint32",
  105645. // "location": "query",
  105646. // "minimum": "0",
  105647. // "type": "integer"
  105648. // },
  105649. // "orderBy": {
  105650. // "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.",
  105651. // "location": "query",
  105652. // "type": "string"
  105653. // },
  105654. // "pageToken": {
  105655. // "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.",
  105656. // "location": "query",
  105657. // "type": "string"
  105658. // },
  105659. // "project": {
  105660. // "description": "Project ID for this request.",
  105661. // "location": "path",
  105662. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  105663. // "required": true,
  105664. // "type": "string"
  105665. // }
  105666. // },
  105667. // "path": "{project}/global/sslPolicies/listAvailableFeatures",
  105668. // "response": {
  105669. // "$ref": "SslPoliciesListAvailableFeaturesResponse"
  105670. // },
  105671. // "scopes": [
  105672. // "https://www.googleapis.com/auth/cloud-platform",
  105673. // "https://www.googleapis.com/auth/compute",
  105674. // "https://www.googleapis.com/auth/compute.readonly"
  105675. // ]
  105676. // }
  105677. }
  105678. // method id "compute.sslPolicies.patch":
  105679. type SslPoliciesPatchCall struct {
  105680. s *Service
  105681. project string
  105682. sslPolicy string
  105683. sslpolicy *SslPolicy
  105684. urlParams_ gensupport.URLParams
  105685. ctx_ context.Context
  105686. header_ http.Header
  105687. }
  105688. // Patch: Patches the specified SSL policy with the data included in the
  105689. // request.
  105690. func (r *SslPoliciesService) Patch(project string, sslPolicy string, sslpolicy *SslPolicy) *SslPoliciesPatchCall {
  105691. c := &SslPoliciesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  105692. c.project = project
  105693. c.sslPolicy = sslPolicy
  105694. c.sslpolicy = sslpolicy
  105695. return c
  105696. }
  105697. // RequestId sets the optional parameter "requestId": An optional
  105698. // request ID to identify requests. Specify a unique request ID so that
  105699. // if you must retry your request, the server will know to ignore the
  105700. // request if it has already been completed.
  105701. //
  105702. // For example, consider a situation where you make an initial request
  105703. // and the request times out. If you make the request again with the
  105704. // same request ID, the server can check if original operation with the
  105705. // same request ID was received, and if so, will ignore the second
  105706. // request. This prevents clients from accidentally creating duplicate
  105707. // commitments.
  105708. //
  105709. // The request ID must be a valid UUID with the exception that zero UUID
  105710. // is not supported (00000000-0000-0000-0000-000000000000).
  105711. func (c *SslPoliciesPatchCall) RequestId(requestId string) *SslPoliciesPatchCall {
  105712. c.urlParams_.Set("requestId", requestId)
  105713. return c
  105714. }
  105715. // Fields allows partial responses to be retrieved. See
  105716. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  105717. // for more information.
  105718. func (c *SslPoliciesPatchCall) Fields(s ...googleapi.Field) *SslPoliciesPatchCall {
  105719. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  105720. return c
  105721. }
  105722. // Context sets the context to be used in this call's Do method. Any
  105723. // pending HTTP request will be aborted if the provided context is
  105724. // canceled.
  105725. func (c *SslPoliciesPatchCall) Context(ctx context.Context) *SslPoliciesPatchCall {
  105726. c.ctx_ = ctx
  105727. return c
  105728. }
  105729. // Header returns an http.Header that can be modified by the caller to
  105730. // add HTTP headers to the request.
  105731. func (c *SslPoliciesPatchCall) Header() http.Header {
  105732. if c.header_ == nil {
  105733. c.header_ = make(http.Header)
  105734. }
  105735. return c.header_
  105736. }
  105737. func (c *SslPoliciesPatchCall) doRequest(alt string) (*http.Response, error) {
  105738. reqHeaders := make(http.Header)
  105739. for k, v := range c.header_ {
  105740. reqHeaders[k] = v
  105741. }
  105742. reqHeaders.Set("User-Agent", c.s.userAgent())
  105743. var body io.Reader = nil
  105744. body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslpolicy)
  105745. if err != nil {
  105746. return nil, err
  105747. }
  105748. reqHeaders.Set("Content-Type", "application/json")
  105749. c.urlParams_.Set("alt", alt)
  105750. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslPolicies/{sslPolicy}")
  105751. urls += "?" + c.urlParams_.Encode()
  105752. req, _ := http.NewRequest("PATCH", urls, body)
  105753. req.Header = reqHeaders
  105754. googleapi.Expand(req.URL, map[string]string{
  105755. "project": c.project,
  105756. "sslPolicy": c.sslPolicy,
  105757. })
  105758. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  105759. }
  105760. // Do executes the "compute.sslPolicies.patch" call.
  105761. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  105762. // status code is an error. Response headers are in either
  105763. // *Operation.ServerResponse.Header or (if a response was returned at
  105764. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  105765. // to check whether the returned error was because
  105766. // http.StatusNotModified was returned.
  105767. func (c *SslPoliciesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  105768. gensupport.SetOptions(c.urlParams_, opts...)
  105769. res, err := c.doRequest("json")
  105770. if res != nil && res.StatusCode == http.StatusNotModified {
  105771. if res.Body != nil {
  105772. res.Body.Close()
  105773. }
  105774. return nil, &googleapi.Error{
  105775. Code: res.StatusCode,
  105776. Header: res.Header,
  105777. }
  105778. }
  105779. if err != nil {
  105780. return nil, err
  105781. }
  105782. defer googleapi.CloseBody(res)
  105783. if err := googleapi.CheckResponse(res); err != nil {
  105784. return nil, err
  105785. }
  105786. ret := &Operation{
  105787. ServerResponse: googleapi.ServerResponse{
  105788. Header: res.Header,
  105789. HTTPStatusCode: res.StatusCode,
  105790. },
  105791. }
  105792. target := &ret
  105793. if err := gensupport.DecodeResponse(target, res); err != nil {
  105794. return nil, err
  105795. }
  105796. return ret, nil
  105797. // {
  105798. // "description": "Patches the specified SSL policy with the data included in the request.",
  105799. // "httpMethod": "PATCH",
  105800. // "id": "compute.sslPolicies.patch",
  105801. // "parameterOrder": [
  105802. // "project",
  105803. // "sslPolicy"
  105804. // ],
  105805. // "parameters": {
  105806. // "project": {
  105807. // "description": "Project ID for this request.",
  105808. // "location": "path",
  105809. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  105810. // "required": true,
  105811. // "type": "string"
  105812. // },
  105813. // "requestId": {
  105814. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  105815. // "location": "query",
  105816. // "type": "string"
  105817. // },
  105818. // "sslPolicy": {
  105819. // "description": "Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035.",
  105820. // "location": "path",
  105821. // "required": true,
  105822. // "type": "string"
  105823. // }
  105824. // },
  105825. // "path": "{project}/global/sslPolicies/{sslPolicy}",
  105826. // "request": {
  105827. // "$ref": "SslPolicy"
  105828. // },
  105829. // "response": {
  105830. // "$ref": "Operation"
  105831. // },
  105832. // "scopes": [
  105833. // "https://www.googleapis.com/auth/cloud-platform",
  105834. // "https://www.googleapis.com/auth/compute"
  105835. // ]
  105836. // }
  105837. }
  105838. // method id "compute.sslPolicies.testIamPermissions":
  105839. type SslPoliciesTestIamPermissionsCall struct {
  105840. s *Service
  105841. project string
  105842. resource string
  105843. testpermissionsrequest *TestPermissionsRequest
  105844. urlParams_ gensupport.URLParams
  105845. ctx_ context.Context
  105846. header_ http.Header
  105847. }
  105848. // TestIamPermissions: Returns permissions that a caller has on the
  105849. // specified resource.
  105850. func (r *SslPoliciesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *SslPoliciesTestIamPermissionsCall {
  105851. c := &SslPoliciesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  105852. c.project = project
  105853. c.resource = resource
  105854. c.testpermissionsrequest = testpermissionsrequest
  105855. return c
  105856. }
  105857. // Fields allows partial responses to be retrieved. See
  105858. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  105859. // for more information.
  105860. func (c *SslPoliciesTestIamPermissionsCall) Fields(s ...googleapi.Field) *SslPoliciesTestIamPermissionsCall {
  105861. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  105862. return c
  105863. }
  105864. // Context sets the context to be used in this call's Do method. Any
  105865. // pending HTTP request will be aborted if the provided context is
  105866. // canceled.
  105867. func (c *SslPoliciesTestIamPermissionsCall) Context(ctx context.Context) *SslPoliciesTestIamPermissionsCall {
  105868. c.ctx_ = ctx
  105869. return c
  105870. }
  105871. // Header returns an http.Header that can be modified by the caller to
  105872. // add HTTP headers to the request.
  105873. func (c *SslPoliciesTestIamPermissionsCall) Header() http.Header {
  105874. if c.header_ == nil {
  105875. c.header_ = make(http.Header)
  105876. }
  105877. return c.header_
  105878. }
  105879. func (c *SslPoliciesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  105880. reqHeaders := make(http.Header)
  105881. for k, v := range c.header_ {
  105882. reqHeaders[k] = v
  105883. }
  105884. reqHeaders.Set("User-Agent", c.s.userAgent())
  105885. var body io.Reader = nil
  105886. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  105887. if err != nil {
  105888. return nil, err
  105889. }
  105890. reqHeaders.Set("Content-Type", "application/json")
  105891. c.urlParams_.Set("alt", alt)
  105892. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslPolicies/{resource}/testIamPermissions")
  105893. urls += "?" + c.urlParams_.Encode()
  105894. req, _ := http.NewRequest("POST", urls, body)
  105895. req.Header = reqHeaders
  105896. googleapi.Expand(req.URL, map[string]string{
  105897. "project": c.project,
  105898. "resource": c.resource,
  105899. })
  105900. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  105901. }
  105902. // Do executes the "compute.sslPolicies.testIamPermissions" call.
  105903. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  105904. // non-2xx status code is an error. Response headers are in either
  105905. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  105906. // returned at all) in error.(*googleapi.Error).Header. Use
  105907. // googleapi.IsNotModified to check whether the returned error was
  105908. // because http.StatusNotModified was returned.
  105909. func (c *SslPoliciesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  105910. gensupport.SetOptions(c.urlParams_, opts...)
  105911. res, err := c.doRequest("json")
  105912. if res != nil && res.StatusCode == http.StatusNotModified {
  105913. if res.Body != nil {
  105914. res.Body.Close()
  105915. }
  105916. return nil, &googleapi.Error{
  105917. Code: res.StatusCode,
  105918. Header: res.Header,
  105919. }
  105920. }
  105921. if err != nil {
  105922. return nil, err
  105923. }
  105924. defer googleapi.CloseBody(res)
  105925. if err := googleapi.CheckResponse(res); err != nil {
  105926. return nil, err
  105927. }
  105928. ret := &TestPermissionsResponse{
  105929. ServerResponse: googleapi.ServerResponse{
  105930. Header: res.Header,
  105931. HTTPStatusCode: res.StatusCode,
  105932. },
  105933. }
  105934. target := &ret
  105935. if err := gensupport.DecodeResponse(target, res); err != nil {
  105936. return nil, err
  105937. }
  105938. return ret, nil
  105939. // {
  105940. // "description": "Returns permissions that a caller has on the specified resource.",
  105941. // "httpMethod": "POST",
  105942. // "id": "compute.sslPolicies.testIamPermissions",
  105943. // "parameterOrder": [
  105944. // "project",
  105945. // "resource"
  105946. // ],
  105947. // "parameters": {
  105948. // "project": {
  105949. // "description": "Project ID for this request.",
  105950. // "location": "path",
  105951. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  105952. // "required": true,
  105953. // "type": "string"
  105954. // },
  105955. // "resource": {
  105956. // "description": "Name of the resource for this request.",
  105957. // "location": "path",
  105958. // "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?",
  105959. // "required": true,
  105960. // "type": "string"
  105961. // }
  105962. // },
  105963. // "path": "{project}/global/sslPolicies/{resource}/testIamPermissions",
  105964. // "request": {
  105965. // "$ref": "TestPermissionsRequest"
  105966. // },
  105967. // "response": {
  105968. // "$ref": "TestPermissionsResponse"
  105969. // },
  105970. // "scopes": [
  105971. // "https://www.googleapis.com/auth/cloud-platform",
  105972. // "https://www.googleapis.com/auth/compute",
  105973. // "https://www.googleapis.com/auth/compute.readonly"
  105974. // ]
  105975. // }
  105976. }
  105977. // method id "compute.subnetworks.aggregatedList":
  105978. type SubnetworksAggregatedListCall struct {
  105979. s *Service
  105980. project string
  105981. urlParams_ gensupport.URLParams
  105982. ifNoneMatch_ string
  105983. ctx_ context.Context
  105984. header_ http.Header
  105985. }
  105986. // AggregatedList: Retrieves an aggregated list of subnetworks.
  105987. func (r *SubnetworksService) AggregatedList(project string) *SubnetworksAggregatedListCall {
  105988. c := &SubnetworksAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  105989. c.project = project
  105990. return c
  105991. }
  105992. // Filter sets the optional parameter "filter": A filter expression that
  105993. // filters resources listed in the response. The expression must specify
  105994. // the field name, a comparison operator, and the value that you want to
  105995. // use for filtering. The value must be a string, a number, or a
  105996. // boolean. The comparison operator must be either =, !=, >, or <.
  105997. //
  105998. // For example, if you are filtering Compute Engine instances, you can
  105999. // exclude instances named example-instance by specifying name !=
  106000. // example-instance.
  106001. //
  106002. // You can also filter nested fields. For example, you could specify
  106003. // scheduling.automaticRestart = false to include instances only if they
  106004. // are not scheduled for automatic restarts. You can use filtering on
  106005. // nested fields to filter based on resource labels.
  106006. //
  106007. // To filter on multiple expressions, provide each separate expression
  106008. // within parentheses. For example, (scheduling.automaticRestart = true)
  106009. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  106010. // AND expression. However, you can include AND and OR expressions
  106011. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  106012. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  106013. // true).
  106014. func (c *SubnetworksAggregatedListCall) Filter(filter string) *SubnetworksAggregatedListCall {
  106015. c.urlParams_.Set("filter", filter)
  106016. return c
  106017. }
  106018. // MaxResults sets the optional parameter "maxResults": The maximum
  106019. // number of results per page that should be returned. If the number of
  106020. // available results is larger than maxResults, Compute Engine returns a
  106021. // nextPageToken that can be used to get the next page of results in
  106022. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  106023. // (Default: 500)
  106024. func (c *SubnetworksAggregatedListCall) MaxResults(maxResults int64) *SubnetworksAggregatedListCall {
  106025. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  106026. return c
  106027. }
  106028. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  106029. // a certain order. By default, results are returned in alphanumerical
  106030. // order based on the resource name.
  106031. //
  106032. // You can also sort results in descending order based on the creation
  106033. // timestamp using orderBy="creationTimestamp desc". This sorts results
  106034. // based on the creationTimestamp field in reverse chronological order
  106035. // (newest result first). Use this to sort resources like operations so
  106036. // that the newest operation is returned first.
  106037. //
  106038. // Currently, only sorting by name or creationTimestamp desc is
  106039. // supported.
  106040. func (c *SubnetworksAggregatedListCall) OrderBy(orderBy string) *SubnetworksAggregatedListCall {
  106041. c.urlParams_.Set("orderBy", orderBy)
  106042. return c
  106043. }
  106044. // PageToken sets the optional parameter "pageToken": Specifies a page
  106045. // token to use. Set pageToken to the nextPageToken returned by a
  106046. // previous list request to get the next page of results.
  106047. func (c *SubnetworksAggregatedListCall) PageToken(pageToken string) *SubnetworksAggregatedListCall {
  106048. c.urlParams_.Set("pageToken", pageToken)
  106049. return c
  106050. }
  106051. // Fields allows partial responses to be retrieved. See
  106052. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  106053. // for more information.
  106054. func (c *SubnetworksAggregatedListCall) Fields(s ...googleapi.Field) *SubnetworksAggregatedListCall {
  106055. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  106056. return c
  106057. }
  106058. // IfNoneMatch sets the optional parameter which makes the operation
  106059. // fail if the object's ETag matches the given value. This is useful for
  106060. // getting updates only after the object has changed since the last
  106061. // request. Use googleapi.IsNotModified to check whether the response
  106062. // error from Do is the result of In-None-Match.
  106063. func (c *SubnetworksAggregatedListCall) IfNoneMatch(entityTag string) *SubnetworksAggregatedListCall {
  106064. c.ifNoneMatch_ = entityTag
  106065. return c
  106066. }
  106067. // Context sets the context to be used in this call's Do method. Any
  106068. // pending HTTP request will be aborted if the provided context is
  106069. // canceled.
  106070. func (c *SubnetworksAggregatedListCall) Context(ctx context.Context) *SubnetworksAggregatedListCall {
  106071. c.ctx_ = ctx
  106072. return c
  106073. }
  106074. // Header returns an http.Header that can be modified by the caller to
  106075. // add HTTP headers to the request.
  106076. func (c *SubnetworksAggregatedListCall) Header() http.Header {
  106077. if c.header_ == nil {
  106078. c.header_ = make(http.Header)
  106079. }
  106080. return c.header_
  106081. }
  106082. func (c *SubnetworksAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  106083. reqHeaders := make(http.Header)
  106084. for k, v := range c.header_ {
  106085. reqHeaders[k] = v
  106086. }
  106087. reqHeaders.Set("User-Agent", c.s.userAgent())
  106088. if c.ifNoneMatch_ != "" {
  106089. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  106090. }
  106091. var body io.Reader = nil
  106092. c.urlParams_.Set("alt", alt)
  106093. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/subnetworks")
  106094. urls += "?" + c.urlParams_.Encode()
  106095. req, _ := http.NewRequest("GET", urls, body)
  106096. req.Header = reqHeaders
  106097. googleapi.Expand(req.URL, map[string]string{
  106098. "project": c.project,
  106099. })
  106100. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  106101. }
  106102. // Do executes the "compute.subnetworks.aggregatedList" call.
  106103. // Exactly one of *SubnetworkAggregatedList or error will be non-nil.
  106104. // Any non-2xx status code is an error. Response headers are in either
  106105. // *SubnetworkAggregatedList.ServerResponse.Header or (if a response was
  106106. // returned at all) in error.(*googleapi.Error).Header. Use
  106107. // googleapi.IsNotModified to check whether the returned error was
  106108. // because http.StatusNotModified was returned.
  106109. func (c *SubnetworksAggregatedListCall) Do(opts ...googleapi.CallOption) (*SubnetworkAggregatedList, error) {
  106110. gensupport.SetOptions(c.urlParams_, opts...)
  106111. res, err := c.doRequest("json")
  106112. if res != nil && res.StatusCode == http.StatusNotModified {
  106113. if res.Body != nil {
  106114. res.Body.Close()
  106115. }
  106116. return nil, &googleapi.Error{
  106117. Code: res.StatusCode,
  106118. Header: res.Header,
  106119. }
  106120. }
  106121. if err != nil {
  106122. return nil, err
  106123. }
  106124. defer googleapi.CloseBody(res)
  106125. if err := googleapi.CheckResponse(res); err != nil {
  106126. return nil, err
  106127. }
  106128. ret := &SubnetworkAggregatedList{
  106129. ServerResponse: googleapi.ServerResponse{
  106130. Header: res.Header,
  106131. HTTPStatusCode: res.StatusCode,
  106132. },
  106133. }
  106134. target := &ret
  106135. if err := gensupport.DecodeResponse(target, res); err != nil {
  106136. return nil, err
  106137. }
  106138. return ret, nil
  106139. // {
  106140. // "description": "Retrieves an aggregated list of subnetworks.",
  106141. // "httpMethod": "GET",
  106142. // "id": "compute.subnetworks.aggregatedList",
  106143. // "parameterOrder": [
  106144. // "project"
  106145. // ],
  106146. // "parameters": {
  106147. // "filter": {
  106148. // "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).",
  106149. // "location": "query",
  106150. // "type": "string"
  106151. // },
  106152. // "maxResults": {
  106153. // "default": "500",
  106154. // "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)",
  106155. // "format": "uint32",
  106156. // "location": "query",
  106157. // "minimum": "0",
  106158. // "type": "integer"
  106159. // },
  106160. // "orderBy": {
  106161. // "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.",
  106162. // "location": "query",
  106163. // "type": "string"
  106164. // },
  106165. // "pageToken": {
  106166. // "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.",
  106167. // "location": "query",
  106168. // "type": "string"
  106169. // },
  106170. // "project": {
  106171. // "description": "Project ID for this request.",
  106172. // "location": "path",
  106173. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  106174. // "required": true,
  106175. // "type": "string"
  106176. // }
  106177. // },
  106178. // "path": "{project}/aggregated/subnetworks",
  106179. // "response": {
  106180. // "$ref": "SubnetworkAggregatedList"
  106181. // },
  106182. // "scopes": [
  106183. // "https://www.googleapis.com/auth/cloud-platform",
  106184. // "https://www.googleapis.com/auth/compute",
  106185. // "https://www.googleapis.com/auth/compute.readonly"
  106186. // ]
  106187. // }
  106188. }
  106189. // Pages invokes f for each page of results.
  106190. // A non-nil error returned from f will halt the iteration.
  106191. // The provided context supersedes any context provided to the Context method.
  106192. func (c *SubnetworksAggregatedListCall) Pages(ctx context.Context, f func(*SubnetworkAggregatedList) error) error {
  106193. c.ctx_ = ctx
  106194. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  106195. for {
  106196. x, err := c.Do()
  106197. if err != nil {
  106198. return err
  106199. }
  106200. if err := f(x); err != nil {
  106201. return err
  106202. }
  106203. if x.NextPageToken == "" {
  106204. return nil
  106205. }
  106206. c.PageToken(x.NextPageToken)
  106207. }
  106208. }
  106209. // method id "compute.subnetworks.delete":
  106210. type SubnetworksDeleteCall struct {
  106211. s *Service
  106212. project string
  106213. region string
  106214. subnetwork string
  106215. urlParams_ gensupport.URLParams
  106216. ctx_ context.Context
  106217. header_ http.Header
  106218. }
  106219. // Delete: Deletes the specified subnetwork.
  106220. func (r *SubnetworksService) Delete(project string, region string, subnetwork string) *SubnetworksDeleteCall {
  106221. c := &SubnetworksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  106222. c.project = project
  106223. c.region = region
  106224. c.subnetwork = subnetwork
  106225. return c
  106226. }
  106227. // RequestId sets the optional parameter "requestId": An optional
  106228. // request ID to identify requests. Specify a unique request ID so that
  106229. // if you must retry your request, the server will know to ignore the
  106230. // request if it has already been completed.
  106231. //
  106232. // For example, consider a situation where you make an initial request
  106233. // and the request times out. If you make the request again with the
  106234. // same request ID, the server can check if original operation with the
  106235. // same request ID was received, and if so, will ignore the second
  106236. // request. This prevents clients from accidentally creating duplicate
  106237. // commitments.
  106238. //
  106239. // The request ID must be a valid UUID with the exception that zero UUID
  106240. // is not supported (00000000-0000-0000-0000-000000000000).
  106241. func (c *SubnetworksDeleteCall) RequestId(requestId string) *SubnetworksDeleteCall {
  106242. c.urlParams_.Set("requestId", requestId)
  106243. return c
  106244. }
  106245. // Fields allows partial responses to be retrieved. See
  106246. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  106247. // for more information.
  106248. func (c *SubnetworksDeleteCall) Fields(s ...googleapi.Field) *SubnetworksDeleteCall {
  106249. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  106250. return c
  106251. }
  106252. // Context sets the context to be used in this call's Do method. Any
  106253. // pending HTTP request will be aborted if the provided context is
  106254. // canceled.
  106255. func (c *SubnetworksDeleteCall) Context(ctx context.Context) *SubnetworksDeleteCall {
  106256. c.ctx_ = ctx
  106257. return c
  106258. }
  106259. // Header returns an http.Header that can be modified by the caller to
  106260. // add HTTP headers to the request.
  106261. func (c *SubnetworksDeleteCall) Header() http.Header {
  106262. if c.header_ == nil {
  106263. c.header_ = make(http.Header)
  106264. }
  106265. return c.header_
  106266. }
  106267. func (c *SubnetworksDeleteCall) doRequest(alt string) (*http.Response, error) {
  106268. reqHeaders := make(http.Header)
  106269. for k, v := range c.header_ {
  106270. reqHeaders[k] = v
  106271. }
  106272. reqHeaders.Set("User-Agent", c.s.userAgent())
  106273. var body io.Reader = nil
  106274. c.urlParams_.Set("alt", alt)
  106275. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{subnetwork}")
  106276. urls += "?" + c.urlParams_.Encode()
  106277. req, _ := http.NewRequest("DELETE", urls, body)
  106278. req.Header = reqHeaders
  106279. googleapi.Expand(req.URL, map[string]string{
  106280. "project": c.project,
  106281. "region": c.region,
  106282. "subnetwork": c.subnetwork,
  106283. })
  106284. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  106285. }
  106286. // Do executes the "compute.subnetworks.delete" call.
  106287. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  106288. // status code is an error. Response headers are in either
  106289. // *Operation.ServerResponse.Header or (if a response was returned at
  106290. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  106291. // to check whether the returned error was because
  106292. // http.StatusNotModified was returned.
  106293. func (c *SubnetworksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  106294. gensupport.SetOptions(c.urlParams_, opts...)
  106295. res, err := c.doRequest("json")
  106296. if res != nil && res.StatusCode == http.StatusNotModified {
  106297. if res.Body != nil {
  106298. res.Body.Close()
  106299. }
  106300. return nil, &googleapi.Error{
  106301. Code: res.StatusCode,
  106302. Header: res.Header,
  106303. }
  106304. }
  106305. if err != nil {
  106306. return nil, err
  106307. }
  106308. defer googleapi.CloseBody(res)
  106309. if err := googleapi.CheckResponse(res); err != nil {
  106310. return nil, err
  106311. }
  106312. ret := &Operation{
  106313. ServerResponse: googleapi.ServerResponse{
  106314. Header: res.Header,
  106315. HTTPStatusCode: res.StatusCode,
  106316. },
  106317. }
  106318. target := &ret
  106319. if err := gensupport.DecodeResponse(target, res); err != nil {
  106320. return nil, err
  106321. }
  106322. return ret, nil
  106323. // {
  106324. // "description": "Deletes the specified subnetwork.",
  106325. // "httpMethod": "DELETE",
  106326. // "id": "compute.subnetworks.delete",
  106327. // "parameterOrder": [
  106328. // "project",
  106329. // "region",
  106330. // "subnetwork"
  106331. // ],
  106332. // "parameters": {
  106333. // "project": {
  106334. // "description": "Project ID for this request.",
  106335. // "location": "path",
  106336. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  106337. // "required": true,
  106338. // "type": "string"
  106339. // },
  106340. // "region": {
  106341. // "description": "Name of the region scoping this request.",
  106342. // "location": "path",
  106343. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  106344. // "required": true,
  106345. // "type": "string"
  106346. // },
  106347. // "requestId": {
  106348. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  106349. // "location": "query",
  106350. // "type": "string"
  106351. // },
  106352. // "subnetwork": {
  106353. // "description": "Name of the Subnetwork resource to delete.",
  106354. // "location": "path",
  106355. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  106356. // "required": true,
  106357. // "type": "string"
  106358. // }
  106359. // },
  106360. // "path": "{project}/regions/{region}/subnetworks/{subnetwork}",
  106361. // "response": {
  106362. // "$ref": "Operation"
  106363. // },
  106364. // "scopes": [
  106365. // "https://www.googleapis.com/auth/cloud-platform",
  106366. // "https://www.googleapis.com/auth/compute"
  106367. // ]
  106368. // }
  106369. }
  106370. // method id "compute.subnetworks.expandIpCidrRange":
  106371. type SubnetworksExpandIpCidrRangeCall struct {
  106372. s *Service
  106373. project string
  106374. region string
  106375. subnetwork string
  106376. subnetworksexpandipcidrrangerequest *SubnetworksExpandIpCidrRangeRequest
  106377. urlParams_ gensupport.URLParams
  106378. ctx_ context.Context
  106379. header_ http.Header
  106380. }
  106381. // ExpandIpCidrRange: Expands the IP CIDR range of the subnetwork to a
  106382. // specified value.
  106383. func (r *SubnetworksService) ExpandIpCidrRange(project string, region string, subnetwork string, subnetworksexpandipcidrrangerequest *SubnetworksExpandIpCidrRangeRequest) *SubnetworksExpandIpCidrRangeCall {
  106384. c := &SubnetworksExpandIpCidrRangeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  106385. c.project = project
  106386. c.region = region
  106387. c.subnetwork = subnetwork
  106388. c.subnetworksexpandipcidrrangerequest = subnetworksexpandipcidrrangerequest
  106389. return c
  106390. }
  106391. // RequestId sets the optional parameter "requestId": An optional
  106392. // request ID to identify requests. Specify a unique request ID so that
  106393. // if you must retry your request, the server will know to ignore the
  106394. // request if it has already been completed.
  106395. //
  106396. // For example, consider a situation where you make an initial request
  106397. // and the request times out. If you make the request again with the
  106398. // same request ID, the server can check if original operation with the
  106399. // same request ID was received, and if so, will ignore the second
  106400. // request. This prevents clients from accidentally creating duplicate
  106401. // commitments.
  106402. //
  106403. // The request ID must be a valid UUID with the exception that zero UUID
  106404. // is not supported (00000000-0000-0000-0000-000000000000).
  106405. func (c *SubnetworksExpandIpCidrRangeCall) RequestId(requestId string) *SubnetworksExpandIpCidrRangeCall {
  106406. c.urlParams_.Set("requestId", requestId)
  106407. return c
  106408. }
  106409. // Fields allows partial responses to be retrieved. See
  106410. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  106411. // for more information.
  106412. func (c *SubnetworksExpandIpCidrRangeCall) Fields(s ...googleapi.Field) *SubnetworksExpandIpCidrRangeCall {
  106413. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  106414. return c
  106415. }
  106416. // Context sets the context to be used in this call's Do method. Any
  106417. // pending HTTP request will be aborted if the provided context is
  106418. // canceled.
  106419. func (c *SubnetworksExpandIpCidrRangeCall) Context(ctx context.Context) *SubnetworksExpandIpCidrRangeCall {
  106420. c.ctx_ = ctx
  106421. return c
  106422. }
  106423. // Header returns an http.Header that can be modified by the caller to
  106424. // add HTTP headers to the request.
  106425. func (c *SubnetworksExpandIpCidrRangeCall) Header() http.Header {
  106426. if c.header_ == nil {
  106427. c.header_ = make(http.Header)
  106428. }
  106429. return c.header_
  106430. }
  106431. func (c *SubnetworksExpandIpCidrRangeCall) doRequest(alt string) (*http.Response, error) {
  106432. reqHeaders := make(http.Header)
  106433. for k, v := range c.header_ {
  106434. reqHeaders[k] = v
  106435. }
  106436. reqHeaders.Set("User-Agent", c.s.userAgent())
  106437. var body io.Reader = nil
  106438. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subnetworksexpandipcidrrangerequest)
  106439. if err != nil {
  106440. return nil, err
  106441. }
  106442. reqHeaders.Set("Content-Type", "application/json")
  106443. c.urlParams_.Set("alt", alt)
  106444. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{subnetwork}/expandIpCidrRange")
  106445. urls += "?" + c.urlParams_.Encode()
  106446. req, _ := http.NewRequest("POST", urls, body)
  106447. req.Header = reqHeaders
  106448. googleapi.Expand(req.URL, map[string]string{
  106449. "project": c.project,
  106450. "region": c.region,
  106451. "subnetwork": c.subnetwork,
  106452. })
  106453. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  106454. }
  106455. // Do executes the "compute.subnetworks.expandIpCidrRange" call.
  106456. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  106457. // status code is an error. Response headers are in either
  106458. // *Operation.ServerResponse.Header or (if a response was returned at
  106459. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  106460. // to check whether the returned error was because
  106461. // http.StatusNotModified was returned.
  106462. func (c *SubnetworksExpandIpCidrRangeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  106463. gensupport.SetOptions(c.urlParams_, opts...)
  106464. res, err := c.doRequest("json")
  106465. if res != nil && res.StatusCode == http.StatusNotModified {
  106466. if res.Body != nil {
  106467. res.Body.Close()
  106468. }
  106469. return nil, &googleapi.Error{
  106470. Code: res.StatusCode,
  106471. Header: res.Header,
  106472. }
  106473. }
  106474. if err != nil {
  106475. return nil, err
  106476. }
  106477. defer googleapi.CloseBody(res)
  106478. if err := googleapi.CheckResponse(res); err != nil {
  106479. return nil, err
  106480. }
  106481. ret := &Operation{
  106482. ServerResponse: googleapi.ServerResponse{
  106483. Header: res.Header,
  106484. HTTPStatusCode: res.StatusCode,
  106485. },
  106486. }
  106487. target := &ret
  106488. if err := gensupport.DecodeResponse(target, res); err != nil {
  106489. return nil, err
  106490. }
  106491. return ret, nil
  106492. // {
  106493. // "description": "Expands the IP CIDR range of the subnetwork to a specified value.",
  106494. // "httpMethod": "POST",
  106495. // "id": "compute.subnetworks.expandIpCidrRange",
  106496. // "parameterOrder": [
  106497. // "project",
  106498. // "region",
  106499. // "subnetwork"
  106500. // ],
  106501. // "parameters": {
  106502. // "project": {
  106503. // "description": "Project ID for this request.",
  106504. // "location": "path",
  106505. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  106506. // "required": true,
  106507. // "type": "string"
  106508. // },
  106509. // "region": {
  106510. // "description": "Name of the region scoping this request.",
  106511. // "location": "path",
  106512. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  106513. // "required": true,
  106514. // "type": "string"
  106515. // },
  106516. // "requestId": {
  106517. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  106518. // "location": "query",
  106519. // "type": "string"
  106520. // },
  106521. // "subnetwork": {
  106522. // "description": "Name of the Subnetwork resource to update.",
  106523. // "location": "path",
  106524. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  106525. // "required": true,
  106526. // "type": "string"
  106527. // }
  106528. // },
  106529. // "path": "{project}/regions/{region}/subnetworks/{subnetwork}/expandIpCidrRange",
  106530. // "request": {
  106531. // "$ref": "SubnetworksExpandIpCidrRangeRequest"
  106532. // },
  106533. // "response": {
  106534. // "$ref": "Operation"
  106535. // },
  106536. // "scopes": [
  106537. // "https://www.googleapis.com/auth/cloud-platform",
  106538. // "https://www.googleapis.com/auth/compute"
  106539. // ]
  106540. // }
  106541. }
  106542. // method id "compute.subnetworks.get":
  106543. type SubnetworksGetCall struct {
  106544. s *Service
  106545. project string
  106546. region string
  106547. subnetwork string
  106548. urlParams_ gensupport.URLParams
  106549. ifNoneMatch_ string
  106550. ctx_ context.Context
  106551. header_ http.Header
  106552. }
  106553. // Get: Returns the specified subnetwork. Gets a list of available
  106554. // subnetworks list() request.
  106555. func (r *SubnetworksService) Get(project string, region string, subnetwork string) *SubnetworksGetCall {
  106556. c := &SubnetworksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  106557. c.project = project
  106558. c.region = region
  106559. c.subnetwork = subnetwork
  106560. return c
  106561. }
  106562. // Fields allows partial responses to be retrieved. See
  106563. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  106564. // for more information.
  106565. func (c *SubnetworksGetCall) Fields(s ...googleapi.Field) *SubnetworksGetCall {
  106566. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  106567. return c
  106568. }
  106569. // IfNoneMatch sets the optional parameter which makes the operation
  106570. // fail if the object's ETag matches the given value. This is useful for
  106571. // getting updates only after the object has changed since the last
  106572. // request. Use googleapi.IsNotModified to check whether the response
  106573. // error from Do is the result of In-None-Match.
  106574. func (c *SubnetworksGetCall) IfNoneMatch(entityTag string) *SubnetworksGetCall {
  106575. c.ifNoneMatch_ = entityTag
  106576. return c
  106577. }
  106578. // Context sets the context to be used in this call's Do method. Any
  106579. // pending HTTP request will be aborted if the provided context is
  106580. // canceled.
  106581. func (c *SubnetworksGetCall) Context(ctx context.Context) *SubnetworksGetCall {
  106582. c.ctx_ = ctx
  106583. return c
  106584. }
  106585. // Header returns an http.Header that can be modified by the caller to
  106586. // add HTTP headers to the request.
  106587. func (c *SubnetworksGetCall) Header() http.Header {
  106588. if c.header_ == nil {
  106589. c.header_ = make(http.Header)
  106590. }
  106591. return c.header_
  106592. }
  106593. func (c *SubnetworksGetCall) doRequest(alt string) (*http.Response, error) {
  106594. reqHeaders := make(http.Header)
  106595. for k, v := range c.header_ {
  106596. reqHeaders[k] = v
  106597. }
  106598. reqHeaders.Set("User-Agent", c.s.userAgent())
  106599. if c.ifNoneMatch_ != "" {
  106600. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  106601. }
  106602. var body io.Reader = nil
  106603. c.urlParams_.Set("alt", alt)
  106604. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{subnetwork}")
  106605. urls += "?" + c.urlParams_.Encode()
  106606. req, _ := http.NewRequest("GET", urls, body)
  106607. req.Header = reqHeaders
  106608. googleapi.Expand(req.URL, map[string]string{
  106609. "project": c.project,
  106610. "region": c.region,
  106611. "subnetwork": c.subnetwork,
  106612. })
  106613. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  106614. }
  106615. // Do executes the "compute.subnetworks.get" call.
  106616. // Exactly one of *Subnetwork or error will be non-nil. Any non-2xx
  106617. // status code is an error. Response headers are in either
  106618. // *Subnetwork.ServerResponse.Header or (if a response was returned at
  106619. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  106620. // to check whether the returned error was because
  106621. // http.StatusNotModified was returned.
  106622. func (c *SubnetworksGetCall) Do(opts ...googleapi.CallOption) (*Subnetwork, error) {
  106623. gensupport.SetOptions(c.urlParams_, opts...)
  106624. res, err := c.doRequest("json")
  106625. if res != nil && res.StatusCode == http.StatusNotModified {
  106626. if res.Body != nil {
  106627. res.Body.Close()
  106628. }
  106629. return nil, &googleapi.Error{
  106630. Code: res.StatusCode,
  106631. Header: res.Header,
  106632. }
  106633. }
  106634. if err != nil {
  106635. return nil, err
  106636. }
  106637. defer googleapi.CloseBody(res)
  106638. if err := googleapi.CheckResponse(res); err != nil {
  106639. return nil, err
  106640. }
  106641. ret := &Subnetwork{
  106642. ServerResponse: googleapi.ServerResponse{
  106643. Header: res.Header,
  106644. HTTPStatusCode: res.StatusCode,
  106645. },
  106646. }
  106647. target := &ret
  106648. if err := gensupport.DecodeResponse(target, res); err != nil {
  106649. return nil, err
  106650. }
  106651. return ret, nil
  106652. // {
  106653. // "description": "Returns the specified subnetwork. Gets a list of available subnetworks list() request.",
  106654. // "httpMethod": "GET",
  106655. // "id": "compute.subnetworks.get",
  106656. // "parameterOrder": [
  106657. // "project",
  106658. // "region",
  106659. // "subnetwork"
  106660. // ],
  106661. // "parameters": {
  106662. // "project": {
  106663. // "description": "Project ID for this request.",
  106664. // "location": "path",
  106665. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  106666. // "required": true,
  106667. // "type": "string"
  106668. // },
  106669. // "region": {
  106670. // "description": "Name of the region scoping this request.",
  106671. // "location": "path",
  106672. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  106673. // "required": true,
  106674. // "type": "string"
  106675. // },
  106676. // "subnetwork": {
  106677. // "description": "Name of the Subnetwork resource to return.",
  106678. // "location": "path",
  106679. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  106680. // "required": true,
  106681. // "type": "string"
  106682. // }
  106683. // },
  106684. // "path": "{project}/regions/{region}/subnetworks/{subnetwork}",
  106685. // "response": {
  106686. // "$ref": "Subnetwork"
  106687. // },
  106688. // "scopes": [
  106689. // "https://www.googleapis.com/auth/cloud-platform",
  106690. // "https://www.googleapis.com/auth/compute",
  106691. // "https://www.googleapis.com/auth/compute.readonly"
  106692. // ]
  106693. // }
  106694. }
  106695. // method id "compute.subnetworks.getIamPolicy":
  106696. type SubnetworksGetIamPolicyCall struct {
  106697. s *Service
  106698. project string
  106699. region string
  106700. resource string
  106701. urlParams_ gensupport.URLParams
  106702. ifNoneMatch_ string
  106703. ctx_ context.Context
  106704. header_ http.Header
  106705. }
  106706. // GetIamPolicy: Gets the access control policy for a resource. May be
  106707. // empty if no such policy or resource exists.
  106708. func (r *SubnetworksService) GetIamPolicy(project string, region string, resource string) *SubnetworksGetIamPolicyCall {
  106709. c := &SubnetworksGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  106710. c.project = project
  106711. c.region = region
  106712. c.resource = resource
  106713. return c
  106714. }
  106715. // Fields allows partial responses to be retrieved. See
  106716. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  106717. // for more information.
  106718. func (c *SubnetworksGetIamPolicyCall) Fields(s ...googleapi.Field) *SubnetworksGetIamPolicyCall {
  106719. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  106720. return c
  106721. }
  106722. // IfNoneMatch sets the optional parameter which makes the operation
  106723. // fail if the object's ETag matches the given value. This is useful for
  106724. // getting updates only after the object has changed since the last
  106725. // request. Use googleapi.IsNotModified to check whether the response
  106726. // error from Do is the result of In-None-Match.
  106727. func (c *SubnetworksGetIamPolicyCall) IfNoneMatch(entityTag string) *SubnetworksGetIamPolicyCall {
  106728. c.ifNoneMatch_ = entityTag
  106729. return c
  106730. }
  106731. // Context sets the context to be used in this call's Do method. Any
  106732. // pending HTTP request will be aborted if the provided context is
  106733. // canceled.
  106734. func (c *SubnetworksGetIamPolicyCall) Context(ctx context.Context) *SubnetworksGetIamPolicyCall {
  106735. c.ctx_ = ctx
  106736. return c
  106737. }
  106738. // Header returns an http.Header that can be modified by the caller to
  106739. // add HTTP headers to the request.
  106740. func (c *SubnetworksGetIamPolicyCall) Header() http.Header {
  106741. if c.header_ == nil {
  106742. c.header_ = make(http.Header)
  106743. }
  106744. return c.header_
  106745. }
  106746. func (c *SubnetworksGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  106747. reqHeaders := make(http.Header)
  106748. for k, v := range c.header_ {
  106749. reqHeaders[k] = v
  106750. }
  106751. reqHeaders.Set("User-Agent", c.s.userAgent())
  106752. if c.ifNoneMatch_ != "" {
  106753. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  106754. }
  106755. var body io.Reader = nil
  106756. c.urlParams_.Set("alt", alt)
  106757. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{resource}/getIamPolicy")
  106758. urls += "?" + c.urlParams_.Encode()
  106759. req, _ := http.NewRequest("GET", urls, body)
  106760. req.Header = reqHeaders
  106761. googleapi.Expand(req.URL, map[string]string{
  106762. "project": c.project,
  106763. "region": c.region,
  106764. "resource": c.resource,
  106765. })
  106766. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  106767. }
  106768. // Do executes the "compute.subnetworks.getIamPolicy" call.
  106769. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  106770. // code is an error. Response headers are in either
  106771. // *Policy.ServerResponse.Header or (if a response was returned at all)
  106772. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  106773. // check whether the returned error was because http.StatusNotModified
  106774. // was returned.
  106775. func (c *SubnetworksGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  106776. gensupport.SetOptions(c.urlParams_, opts...)
  106777. res, err := c.doRequest("json")
  106778. if res != nil && res.StatusCode == http.StatusNotModified {
  106779. if res.Body != nil {
  106780. res.Body.Close()
  106781. }
  106782. return nil, &googleapi.Error{
  106783. Code: res.StatusCode,
  106784. Header: res.Header,
  106785. }
  106786. }
  106787. if err != nil {
  106788. return nil, err
  106789. }
  106790. defer googleapi.CloseBody(res)
  106791. if err := googleapi.CheckResponse(res); err != nil {
  106792. return nil, err
  106793. }
  106794. ret := &Policy{
  106795. ServerResponse: googleapi.ServerResponse{
  106796. Header: res.Header,
  106797. HTTPStatusCode: res.StatusCode,
  106798. },
  106799. }
  106800. target := &ret
  106801. if err := gensupport.DecodeResponse(target, res); err != nil {
  106802. return nil, err
  106803. }
  106804. return ret, nil
  106805. // {
  106806. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  106807. // "httpMethod": "GET",
  106808. // "id": "compute.subnetworks.getIamPolicy",
  106809. // "parameterOrder": [
  106810. // "project",
  106811. // "region",
  106812. // "resource"
  106813. // ],
  106814. // "parameters": {
  106815. // "project": {
  106816. // "description": "Project ID for this request.",
  106817. // "location": "path",
  106818. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  106819. // "required": true,
  106820. // "type": "string"
  106821. // },
  106822. // "region": {
  106823. // "description": "The name of the region for this request.",
  106824. // "location": "path",
  106825. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  106826. // "required": true,
  106827. // "type": "string"
  106828. // },
  106829. // "resource": {
  106830. // "description": "Name of the resource for this request.",
  106831. // "location": "path",
  106832. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  106833. // "required": true,
  106834. // "type": "string"
  106835. // }
  106836. // },
  106837. // "path": "{project}/regions/{region}/subnetworks/{resource}/getIamPolicy",
  106838. // "response": {
  106839. // "$ref": "Policy"
  106840. // },
  106841. // "scopes": [
  106842. // "https://www.googleapis.com/auth/cloud-platform",
  106843. // "https://www.googleapis.com/auth/compute",
  106844. // "https://www.googleapis.com/auth/compute.readonly"
  106845. // ]
  106846. // }
  106847. }
  106848. // method id "compute.subnetworks.insert":
  106849. type SubnetworksInsertCall struct {
  106850. s *Service
  106851. project string
  106852. region string
  106853. subnetwork *Subnetwork
  106854. urlParams_ gensupport.URLParams
  106855. ctx_ context.Context
  106856. header_ http.Header
  106857. }
  106858. // Insert: Creates a subnetwork in the specified project using the data
  106859. // included in the request.
  106860. func (r *SubnetworksService) Insert(project string, region string, subnetwork *Subnetwork) *SubnetworksInsertCall {
  106861. c := &SubnetworksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  106862. c.project = project
  106863. c.region = region
  106864. c.subnetwork = subnetwork
  106865. return c
  106866. }
  106867. // RequestId sets the optional parameter "requestId": An optional
  106868. // request ID to identify requests. Specify a unique request ID so that
  106869. // if you must retry your request, the server will know to ignore the
  106870. // request if it has already been completed.
  106871. //
  106872. // For example, consider a situation where you make an initial request
  106873. // and the request times out. If you make the request again with the
  106874. // same request ID, the server can check if original operation with the
  106875. // same request ID was received, and if so, will ignore the second
  106876. // request. This prevents clients from accidentally creating duplicate
  106877. // commitments.
  106878. //
  106879. // The request ID must be a valid UUID with the exception that zero UUID
  106880. // is not supported (00000000-0000-0000-0000-000000000000).
  106881. func (c *SubnetworksInsertCall) RequestId(requestId string) *SubnetworksInsertCall {
  106882. c.urlParams_.Set("requestId", requestId)
  106883. return c
  106884. }
  106885. // Fields allows partial responses to be retrieved. See
  106886. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  106887. // for more information.
  106888. func (c *SubnetworksInsertCall) Fields(s ...googleapi.Field) *SubnetworksInsertCall {
  106889. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  106890. return c
  106891. }
  106892. // Context sets the context to be used in this call's Do method. Any
  106893. // pending HTTP request will be aborted if the provided context is
  106894. // canceled.
  106895. func (c *SubnetworksInsertCall) Context(ctx context.Context) *SubnetworksInsertCall {
  106896. c.ctx_ = ctx
  106897. return c
  106898. }
  106899. // Header returns an http.Header that can be modified by the caller to
  106900. // add HTTP headers to the request.
  106901. func (c *SubnetworksInsertCall) Header() http.Header {
  106902. if c.header_ == nil {
  106903. c.header_ = make(http.Header)
  106904. }
  106905. return c.header_
  106906. }
  106907. func (c *SubnetworksInsertCall) doRequest(alt string) (*http.Response, error) {
  106908. reqHeaders := make(http.Header)
  106909. for k, v := range c.header_ {
  106910. reqHeaders[k] = v
  106911. }
  106912. reqHeaders.Set("User-Agent", c.s.userAgent())
  106913. var body io.Reader = nil
  106914. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subnetwork)
  106915. if err != nil {
  106916. return nil, err
  106917. }
  106918. reqHeaders.Set("Content-Type", "application/json")
  106919. c.urlParams_.Set("alt", alt)
  106920. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks")
  106921. urls += "?" + c.urlParams_.Encode()
  106922. req, _ := http.NewRequest("POST", urls, body)
  106923. req.Header = reqHeaders
  106924. googleapi.Expand(req.URL, map[string]string{
  106925. "project": c.project,
  106926. "region": c.region,
  106927. })
  106928. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  106929. }
  106930. // Do executes the "compute.subnetworks.insert" call.
  106931. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  106932. // status code is an error. Response headers are in either
  106933. // *Operation.ServerResponse.Header or (if a response was returned at
  106934. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  106935. // to check whether the returned error was because
  106936. // http.StatusNotModified was returned.
  106937. func (c *SubnetworksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  106938. gensupport.SetOptions(c.urlParams_, opts...)
  106939. res, err := c.doRequest("json")
  106940. if res != nil && res.StatusCode == http.StatusNotModified {
  106941. if res.Body != nil {
  106942. res.Body.Close()
  106943. }
  106944. return nil, &googleapi.Error{
  106945. Code: res.StatusCode,
  106946. Header: res.Header,
  106947. }
  106948. }
  106949. if err != nil {
  106950. return nil, err
  106951. }
  106952. defer googleapi.CloseBody(res)
  106953. if err := googleapi.CheckResponse(res); err != nil {
  106954. return nil, err
  106955. }
  106956. ret := &Operation{
  106957. ServerResponse: googleapi.ServerResponse{
  106958. Header: res.Header,
  106959. HTTPStatusCode: res.StatusCode,
  106960. },
  106961. }
  106962. target := &ret
  106963. if err := gensupport.DecodeResponse(target, res); err != nil {
  106964. return nil, err
  106965. }
  106966. return ret, nil
  106967. // {
  106968. // "description": "Creates a subnetwork in the specified project using the data included in the request.",
  106969. // "httpMethod": "POST",
  106970. // "id": "compute.subnetworks.insert",
  106971. // "parameterOrder": [
  106972. // "project",
  106973. // "region"
  106974. // ],
  106975. // "parameters": {
  106976. // "project": {
  106977. // "description": "Project ID for this request.",
  106978. // "location": "path",
  106979. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  106980. // "required": true,
  106981. // "type": "string"
  106982. // },
  106983. // "region": {
  106984. // "description": "Name of the region scoping this request.",
  106985. // "location": "path",
  106986. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  106987. // "required": true,
  106988. // "type": "string"
  106989. // },
  106990. // "requestId": {
  106991. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  106992. // "location": "query",
  106993. // "type": "string"
  106994. // }
  106995. // },
  106996. // "path": "{project}/regions/{region}/subnetworks",
  106997. // "request": {
  106998. // "$ref": "Subnetwork"
  106999. // },
  107000. // "response": {
  107001. // "$ref": "Operation"
  107002. // },
  107003. // "scopes": [
  107004. // "https://www.googleapis.com/auth/cloud-platform",
  107005. // "https://www.googleapis.com/auth/compute"
  107006. // ]
  107007. // }
  107008. }
  107009. // method id "compute.subnetworks.list":
  107010. type SubnetworksListCall struct {
  107011. s *Service
  107012. project string
  107013. region string
  107014. urlParams_ gensupport.URLParams
  107015. ifNoneMatch_ string
  107016. ctx_ context.Context
  107017. header_ http.Header
  107018. }
  107019. // List: Retrieves a list of subnetworks available to the specified
  107020. // project.
  107021. func (r *SubnetworksService) List(project string, region string) *SubnetworksListCall {
  107022. c := &SubnetworksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  107023. c.project = project
  107024. c.region = region
  107025. return c
  107026. }
  107027. // Filter sets the optional parameter "filter": A filter expression that
  107028. // filters resources listed in the response. The expression must specify
  107029. // the field name, a comparison operator, and the value that you want to
  107030. // use for filtering. The value must be a string, a number, or a
  107031. // boolean. The comparison operator must be either =, !=, >, or <.
  107032. //
  107033. // For example, if you are filtering Compute Engine instances, you can
  107034. // exclude instances named example-instance by specifying name !=
  107035. // example-instance.
  107036. //
  107037. // You can also filter nested fields. For example, you could specify
  107038. // scheduling.automaticRestart = false to include instances only if they
  107039. // are not scheduled for automatic restarts. You can use filtering on
  107040. // nested fields to filter based on resource labels.
  107041. //
  107042. // To filter on multiple expressions, provide each separate expression
  107043. // within parentheses. For example, (scheduling.automaticRestart = true)
  107044. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  107045. // AND expression. However, you can include AND and OR expressions
  107046. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  107047. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  107048. // true).
  107049. func (c *SubnetworksListCall) Filter(filter string) *SubnetworksListCall {
  107050. c.urlParams_.Set("filter", filter)
  107051. return c
  107052. }
  107053. // MaxResults sets the optional parameter "maxResults": The maximum
  107054. // number of results per page that should be returned. If the number of
  107055. // available results is larger than maxResults, Compute Engine returns a
  107056. // nextPageToken that can be used to get the next page of results in
  107057. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  107058. // (Default: 500)
  107059. func (c *SubnetworksListCall) MaxResults(maxResults int64) *SubnetworksListCall {
  107060. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  107061. return c
  107062. }
  107063. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  107064. // a certain order. By default, results are returned in alphanumerical
  107065. // order based on the resource name.
  107066. //
  107067. // You can also sort results in descending order based on the creation
  107068. // timestamp using orderBy="creationTimestamp desc". This sorts results
  107069. // based on the creationTimestamp field in reverse chronological order
  107070. // (newest result first). Use this to sort resources like operations so
  107071. // that the newest operation is returned first.
  107072. //
  107073. // Currently, only sorting by name or creationTimestamp desc is
  107074. // supported.
  107075. func (c *SubnetworksListCall) OrderBy(orderBy string) *SubnetworksListCall {
  107076. c.urlParams_.Set("orderBy", orderBy)
  107077. return c
  107078. }
  107079. // PageToken sets the optional parameter "pageToken": Specifies a page
  107080. // token to use. Set pageToken to the nextPageToken returned by a
  107081. // previous list request to get the next page of results.
  107082. func (c *SubnetworksListCall) PageToken(pageToken string) *SubnetworksListCall {
  107083. c.urlParams_.Set("pageToken", pageToken)
  107084. return c
  107085. }
  107086. // Fields allows partial responses to be retrieved. See
  107087. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  107088. // for more information.
  107089. func (c *SubnetworksListCall) Fields(s ...googleapi.Field) *SubnetworksListCall {
  107090. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  107091. return c
  107092. }
  107093. // IfNoneMatch sets the optional parameter which makes the operation
  107094. // fail if the object's ETag matches the given value. This is useful for
  107095. // getting updates only after the object has changed since the last
  107096. // request. Use googleapi.IsNotModified to check whether the response
  107097. // error from Do is the result of In-None-Match.
  107098. func (c *SubnetworksListCall) IfNoneMatch(entityTag string) *SubnetworksListCall {
  107099. c.ifNoneMatch_ = entityTag
  107100. return c
  107101. }
  107102. // Context sets the context to be used in this call's Do method. Any
  107103. // pending HTTP request will be aborted if the provided context is
  107104. // canceled.
  107105. func (c *SubnetworksListCall) Context(ctx context.Context) *SubnetworksListCall {
  107106. c.ctx_ = ctx
  107107. return c
  107108. }
  107109. // Header returns an http.Header that can be modified by the caller to
  107110. // add HTTP headers to the request.
  107111. func (c *SubnetworksListCall) Header() http.Header {
  107112. if c.header_ == nil {
  107113. c.header_ = make(http.Header)
  107114. }
  107115. return c.header_
  107116. }
  107117. func (c *SubnetworksListCall) doRequest(alt string) (*http.Response, error) {
  107118. reqHeaders := make(http.Header)
  107119. for k, v := range c.header_ {
  107120. reqHeaders[k] = v
  107121. }
  107122. reqHeaders.Set("User-Agent", c.s.userAgent())
  107123. if c.ifNoneMatch_ != "" {
  107124. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  107125. }
  107126. var body io.Reader = nil
  107127. c.urlParams_.Set("alt", alt)
  107128. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks")
  107129. urls += "?" + c.urlParams_.Encode()
  107130. req, _ := http.NewRequest("GET", urls, body)
  107131. req.Header = reqHeaders
  107132. googleapi.Expand(req.URL, map[string]string{
  107133. "project": c.project,
  107134. "region": c.region,
  107135. })
  107136. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  107137. }
  107138. // Do executes the "compute.subnetworks.list" call.
  107139. // Exactly one of *SubnetworkList or error will be non-nil. Any non-2xx
  107140. // status code is an error. Response headers are in either
  107141. // *SubnetworkList.ServerResponse.Header or (if a response was returned
  107142. // at all) in error.(*googleapi.Error).Header. Use
  107143. // googleapi.IsNotModified to check whether the returned error was
  107144. // because http.StatusNotModified was returned.
  107145. func (c *SubnetworksListCall) Do(opts ...googleapi.CallOption) (*SubnetworkList, error) {
  107146. gensupport.SetOptions(c.urlParams_, opts...)
  107147. res, err := c.doRequest("json")
  107148. if res != nil && res.StatusCode == http.StatusNotModified {
  107149. if res.Body != nil {
  107150. res.Body.Close()
  107151. }
  107152. return nil, &googleapi.Error{
  107153. Code: res.StatusCode,
  107154. Header: res.Header,
  107155. }
  107156. }
  107157. if err != nil {
  107158. return nil, err
  107159. }
  107160. defer googleapi.CloseBody(res)
  107161. if err := googleapi.CheckResponse(res); err != nil {
  107162. return nil, err
  107163. }
  107164. ret := &SubnetworkList{
  107165. ServerResponse: googleapi.ServerResponse{
  107166. Header: res.Header,
  107167. HTTPStatusCode: res.StatusCode,
  107168. },
  107169. }
  107170. target := &ret
  107171. if err := gensupport.DecodeResponse(target, res); err != nil {
  107172. return nil, err
  107173. }
  107174. return ret, nil
  107175. // {
  107176. // "description": "Retrieves a list of subnetworks available to the specified project.",
  107177. // "httpMethod": "GET",
  107178. // "id": "compute.subnetworks.list",
  107179. // "parameterOrder": [
  107180. // "project",
  107181. // "region"
  107182. // ],
  107183. // "parameters": {
  107184. // "filter": {
  107185. // "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).",
  107186. // "location": "query",
  107187. // "type": "string"
  107188. // },
  107189. // "maxResults": {
  107190. // "default": "500",
  107191. // "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)",
  107192. // "format": "uint32",
  107193. // "location": "query",
  107194. // "minimum": "0",
  107195. // "type": "integer"
  107196. // },
  107197. // "orderBy": {
  107198. // "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.",
  107199. // "location": "query",
  107200. // "type": "string"
  107201. // },
  107202. // "pageToken": {
  107203. // "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.",
  107204. // "location": "query",
  107205. // "type": "string"
  107206. // },
  107207. // "project": {
  107208. // "description": "Project ID for this request.",
  107209. // "location": "path",
  107210. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  107211. // "required": true,
  107212. // "type": "string"
  107213. // },
  107214. // "region": {
  107215. // "description": "Name of the region scoping this request.",
  107216. // "location": "path",
  107217. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  107218. // "required": true,
  107219. // "type": "string"
  107220. // }
  107221. // },
  107222. // "path": "{project}/regions/{region}/subnetworks",
  107223. // "response": {
  107224. // "$ref": "SubnetworkList"
  107225. // },
  107226. // "scopes": [
  107227. // "https://www.googleapis.com/auth/cloud-platform",
  107228. // "https://www.googleapis.com/auth/compute",
  107229. // "https://www.googleapis.com/auth/compute.readonly"
  107230. // ]
  107231. // }
  107232. }
  107233. // Pages invokes f for each page of results.
  107234. // A non-nil error returned from f will halt the iteration.
  107235. // The provided context supersedes any context provided to the Context method.
  107236. func (c *SubnetworksListCall) Pages(ctx context.Context, f func(*SubnetworkList) error) error {
  107237. c.ctx_ = ctx
  107238. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  107239. for {
  107240. x, err := c.Do()
  107241. if err != nil {
  107242. return err
  107243. }
  107244. if err := f(x); err != nil {
  107245. return err
  107246. }
  107247. if x.NextPageToken == "" {
  107248. return nil
  107249. }
  107250. c.PageToken(x.NextPageToken)
  107251. }
  107252. }
  107253. // method id "compute.subnetworks.listUsable":
  107254. type SubnetworksListUsableCall struct {
  107255. s *Service
  107256. project string
  107257. urlParams_ gensupport.URLParams
  107258. ifNoneMatch_ string
  107259. ctx_ context.Context
  107260. header_ http.Header
  107261. }
  107262. // ListUsable: Retrieves an aggregated list of usable subnetworks.
  107263. func (r *SubnetworksService) ListUsable(project string) *SubnetworksListUsableCall {
  107264. c := &SubnetworksListUsableCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  107265. c.project = project
  107266. return c
  107267. }
  107268. // Filter sets the optional parameter "filter": A filter expression that
  107269. // filters resources listed in the response. The expression must specify
  107270. // the field name, a comparison operator, and the value that you want to
  107271. // use for filtering. The value must be a string, a number, or a
  107272. // boolean. The comparison operator must be either =, !=, >, or <.
  107273. //
  107274. // For example, if you are filtering Compute Engine instances, you can
  107275. // exclude instances named example-instance by specifying name !=
  107276. // example-instance.
  107277. //
  107278. // You can also filter nested fields. For example, you could specify
  107279. // scheduling.automaticRestart = false to include instances only if they
  107280. // are not scheduled for automatic restarts. You can use filtering on
  107281. // nested fields to filter based on resource labels.
  107282. //
  107283. // To filter on multiple expressions, provide each separate expression
  107284. // within parentheses. For example, (scheduling.automaticRestart = true)
  107285. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  107286. // AND expression. However, you can include AND and OR expressions
  107287. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  107288. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  107289. // true).
  107290. func (c *SubnetworksListUsableCall) Filter(filter string) *SubnetworksListUsableCall {
  107291. c.urlParams_.Set("filter", filter)
  107292. return c
  107293. }
  107294. // MaxResults sets the optional parameter "maxResults": The maximum
  107295. // number of results per page that should be returned. If the number of
  107296. // available results is larger than maxResults, Compute Engine returns a
  107297. // nextPageToken that can be used to get the next page of results in
  107298. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  107299. // (Default: 500)
  107300. func (c *SubnetworksListUsableCall) MaxResults(maxResults int64) *SubnetworksListUsableCall {
  107301. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  107302. return c
  107303. }
  107304. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  107305. // a certain order. By default, results are returned in alphanumerical
  107306. // order based on the resource name.
  107307. //
  107308. // You can also sort results in descending order based on the creation
  107309. // timestamp using orderBy="creationTimestamp desc". This sorts results
  107310. // based on the creationTimestamp field in reverse chronological order
  107311. // (newest result first). Use this to sort resources like operations so
  107312. // that the newest operation is returned first.
  107313. //
  107314. // Currently, only sorting by name or creationTimestamp desc is
  107315. // supported.
  107316. func (c *SubnetworksListUsableCall) OrderBy(orderBy string) *SubnetworksListUsableCall {
  107317. c.urlParams_.Set("orderBy", orderBy)
  107318. return c
  107319. }
  107320. // PageToken sets the optional parameter "pageToken": Specifies a page
  107321. // token to use. Set pageToken to the nextPageToken returned by a
  107322. // previous list request to get the next page of results.
  107323. func (c *SubnetworksListUsableCall) PageToken(pageToken string) *SubnetworksListUsableCall {
  107324. c.urlParams_.Set("pageToken", pageToken)
  107325. return c
  107326. }
  107327. // Fields allows partial responses to be retrieved. See
  107328. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  107329. // for more information.
  107330. func (c *SubnetworksListUsableCall) Fields(s ...googleapi.Field) *SubnetworksListUsableCall {
  107331. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  107332. return c
  107333. }
  107334. // IfNoneMatch sets the optional parameter which makes the operation
  107335. // fail if the object's ETag matches the given value. This is useful for
  107336. // getting updates only after the object has changed since the last
  107337. // request. Use googleapi.IsNotModified to check whether the response
  107338. // error from Do is the result of In-None-Match.
  107339. func (c *SubnetworksListUsableCall) IfNoneMatch(entityTag string) *SubnetworksListUsableCall {
  107340. c.ifNoneMatch_ = entityTag
  107341. return c
  107342. }
  107343. // Context sets the context to be used in this call's Do method. Any
  107344. // pending HTTP request will be aborted if the provided context is
  107345. // canceled.
  107346. func (c *SubnetworksListUsableCall) Context(ctx context.Context) *SubnetworksListUsableCall {
  107347. c.ctx_ = ctx
  107348. return c
  107349. }
  107350. // Header returns an http.Header that can be modified by the caller to
  107351. // add HTTP headers to the request.
  107352. func (c *SubnetworksListUsableCall) Header() http.Header {
  107353. if c.header_ == nil {
  107354. c.header_ = make(http.Header)
  107355. }
  107356. return c.header_
  107357. }
  107358. func (c *SubnetworksListUsableCall) doRequest(alt string) (*http.Response, error) {
  107359. reqHeaders := make(http.Header)
  107360. for k, v := range c.header_ {
  107361. reqHeaders[k] = v
  107362. }
  107363. reqHeaders.Set("User-Agent", c.s.userAgent())
  107364. if c.ifNoneMatch_ != "" {
  107365. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  107366. }
  107367. var body io.Reader = nil
  107368. c.urlParams_.Set("alt", alt)
  107369. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/subnetworks/listUsable")
  107370. urls += "?" + c.urlParams_.Encode()
  107371. req, _ := http.NewRequest("GET", urls, body)
  107372. req.Header = reqHeaders
  107373. googleapi.Expand(req.URL, map[string]string{
  107374. "project": c.project,
  107375. })
  107376. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  107377. }
  107378. // Do executes the "compute.subnetworks.listUsable" call.
  107379. // Exactly one of *UsableSubnetworksAggregatedList or error will be
  107380. // non-nil. Any non-2xx status code is an error. Response headers are in
  107381. // either *UsableSubnetworksAggregatedList.ServerResponse.Header or (if
  107382. // a response was returned at all) in error.(*googleapi.Error).Header.
  107383. // Use googleapi.IsNotModified to check whether the returned error was
  107384. // because http.StatusNotModified was returned.
  107385. func (c *SubnetworksListUsableCall) Do(opts ...googleapi.CallOption) (*UsableSubnetworksAggregatedList, error) {
  107386. gensupport.SetOptions(c.urlParams_, opts...)
  107387. res, err := c.doRequest("json")
  107388. if res != nil && res.StatusCode == http.StatusNotModified {
  107389. if res.Body != nil {
  107390. res.Body.Close()
  107391. }
  107392. return nil, &googleapi.Error{
  107393. Code: res.StatusCode,
  107394. Header: res.Header,
  107395. }
  107396. }
  107397. if err != nil {
  107398. return nil, err
  107399. }
  107400. defer googleapi.CloseBody(res)
  107401. if err := googleapi.CheckResponse(res); err != nil {
  107402. return nil, err
  107403. }
  107404. ret := &UsableSubnetworksAggregatedList{
  107405. ServerResponse: googleapi.ServerResponse{
  107406. Header: res.Header,
  107407. HTTPStatusCode: res.StatusCode,
  107408. },
  107409. }
  107410. target := &ret
  107411. if err := gensupport.DecodeResponse(target, res); err != nil {
  107412. return nil, err
  107413. }
  107414. return ret, nil
  107415. // {
  107416. // "description": "Retrieves an aggregated list of usable subnetworks.",
  107417. // "httpMethod": "GET",
  107418. // "id": "compute.subnetworks.listUsable",
  107419. // "parameterOrder": [
  107420. // "project"
  107421. // ],
  107422. // "parameters": {
  107423. // "filter": {
  107424. // "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).",
  107425. // "location": "query",
  107426. // "type": "string"
  107427. // },
  107428. // "maxResults": {
  107429. // "default": "500",
  107430. // "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)",
  107431. // "format": "uint32",
  107432. // "location": "query",
  107433. // "minimum": "0",
  107434. // "type": "integer"
  107435. // },
  107436. // "orderBy": {
  107437. // "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.",
  107438. // "location": "query",
  107439. // "type": "string"
  107440. // },
  107441. // "pageToken": {
  107442. // "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.",
  107443. // "location": "query",
  107444. // "type": "string"
  107445. // },
  107446. // "project": {
  107447. // "description": "Project ID for this request.",
  107448. // "location": "path",
  107449. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  107450. // "required": true,
  107451. // "type": "string"
  107452. // }
  107453. // },
  107454. // "path": "{project}/aggregated/subnetworks/listUsable",
  107455. // "response": {
  107456. // "$ref": "UsableSubnetworksAggregatedList"
  107457. // },
  107458. // "scopes": [
  107459. // "https://www.googleapis.com/auth/cloud-platform",
  107460. // "https://www.googleapis.com/auth/compute",
  107461. // "https://www.googleapis.com/auth/compute.readonly"
  107462. // ]
  107463. // }
  107464. }
  107465. // Pages invokes f for each page of results.
  107466. // A non-nil error returned from f will halt the iteration.
  107467. // The provided context supersedes any context provided to the Context method.
  107468. func (c *SubnetworksListUsableCall) Pages(ctx context.Context, f func(*UsableSubnetworksAggregatedList) error) error {
  107469. c.ctx_ = ctx
  107470. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  107471. for {
  107472. x, err := c.Do()
  107473. if err != nil {
  107474. return err
  107475. }
  107476. if err := f(x); err != nil {
  107477. return err
  107478. }
  107479. if x.NextPageToken == "" {
  107480. return nil
  107481. }
  107482. c.PageToken(x.NextPageToken)
  107483. }
  107484. }
  107485. // method id "compute.subnetworks.patch":
  107486. type SubnetworksPatchCall struct {
  107487. s *Service
  107488. project string
  107489. region string
  107490. subnetwork string
  107491. subnetwork2 *Subnetwork
  107492. urlParams_ gensupport.URLParams
  107493. ctx_ context.Context
  107494. header_ http.Header
  107495. }
  107496. // Patch: Patches the specified subnetwork with the data included in the
  107497. // request. Only the following fields within the subnetwork resource can
  107498. // be specified in the request: secondary_ip_range,
  107499. // allow_subnet_cidr_routes_overlap and role. It is also mandatory to
  107500. // specify the current fingeprint of the subnetwork resource being
  107501. // patched.
  107502. func (r *SubnetworksService) Patch(project string, region string, subnetwork string, subnetwork2 *Subnetwork) *SubnetworksPatchCall {
  107503. c := &SubnetworksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  107504. c.project = project
  107505. c.region = region
  107506. c.subnetwork = subnetwork
  107507. c.subnetwork2 = subnetwork2
  107508. return c
  107509. }
  107510. // RequestId sets the optional parameter "requestId": An optional
  107511. // request ID to identify requests. Specify a unique request ID so that
  107512. // if you must retry your request, the server will know to ignore the
  107513. // request if it has already been completed.
  107514. //
  107515. // For example, consider a situation where you make an initial request
  107516. // and the request times out. If you make the request again with the
  107517. // same request ID, the server can check if original operation with the
  107518. // same request ID was received, and if so, will ignore the second
  107519. // request. This prevents clients from accidentally creating duplicate
  107520. // commitments.
  107521. //
  107522. // The request ID must be a valid UUID with the exception that zero UUID
  107523. // is not supported (00000000-0000-0000-0000-000000000000).
  107524. func (c *SubnetworksPatchCall) RequestId(requestId string) *SubnetworksPatchCall {
  107525. c.urlParams_.Set("requestId", requestId)
  107526. return c
  107527. }
  107528. // Fields allows partial responses to be retrieved. See
  107529. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  107530. // for more information.
  107531. func (c *SubnetworksPatchCall) Fields(s ...googleapi.Field) *SubnetworksPatchCall {
  107532. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  107533. return c
  107534. }
  107535. // Context sets the context to be used in this call's Do method. Any
  107536. // pending HTTP request will be aborted if the provided context is
  107537. // canceled.
  107538. func (c *SubnetworksPatchCall) Context(ctx context.Context) *SubnetworksPatchCall {
  107539. c.ctx_ = ctx
  107540. return c
  107541. }
  107542. // Header returns an http.Header that can be modified by the caller to
  107543. // add HTTP headers to the request.
  107544. func (c *SubnetworksPatchCall) Header() http.Header {
  107545. if c.header_ == nil {
  107546. c.header_ = make(http.Header)
  107547. }
  107548. return c.header_
  107549. }
  107550. func (c *SubnetworksPatchCall) doRequest(alt string) (*http.Response, error) {
  107551. reqHeaders := make(http.Header)
  107552. for k, v := range c.header_ {
  107553. reqHeaders[k] = v
  107554. }
  107555. reqHeaders.Set("User-Agent", c.s.userAgent())
  107556. var body io.Reader = nil
  107557. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subnetwork2)
  107558. if err != nil {
  107559. return nil, err
  107560. }
  107561. reqHeaders.Set("Content-Type", "application/json")
  107562. c.urlParams_.Set("alt", alt)
  107563. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{subnetwork}")
  107564. urls += "?" + c.urlParams_.Encode()
  107565. req, _ := http.NewRequest("PATCH", urls, body)
  107566. req.Header = reqHeaders
  107567. googleapi.Expand(req.URL, map[string]string{
  107568. "project": c.project,
  107569. "region": c.region,
  107570. "subnetwork": c.subnetwork,
  107571. })
  107572. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  107573. }
  107574. // Do executes the "compute.subnetworks.patch" call.
  107575. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  107576. // status code is an error. Response headers are in either
  107577. // *Operation.ServerResponse.Header or (if a response was returned at
  107578. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  107579. // to check whether the returned error was because
  107580. // http.StatusNotModified was returned.
  107581. func (c *SubnetworksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  107582. gensupport.SetOptions(c.urlParams_, opts...)
  107583. res, err := c.doRequest("json")
  107584. if res != nil && res.StatusCode == http.StatusNotModified {
  107585. if res.Body != nil {
  107586. res.Body.Close()
  107587. }
  107588. return nil, &googleapi.Error{
  107589. Code: res.StatusCode,
  107590. Header: res.Header,
  107591. }
  107592. }
  107593. if err != nil {
  107594. return nil, err
  107595. }
  107596. defer googleapi.CloseBody(res)
  107597. if err := googleapi.CheckResponse(res); err != nil {
  107598. return nil, err
  107599. }
  107600. ret := &Operation{
  107601. ServerResponse: googleapi.ServerResponse{
  107602. Header: res.Header,
  107603. HTTPStatusCode: res.StatusCode,
  107604. },
  107605. }
  107606. target := &ret
  107607. if err := gensupport.DecodeResponse(target, res); err != nil {
  107608. return nil, err
  107609. }
  107610. return ret, nil
  107611. // {
  107612. // "description": "Patches the specified subnetwork with the data included in the request. Only the following fields within the subnetwork resource can be specified in the request: secondary_ip_range, allow_subnet_cidr_routes_overlap and role. It is also mandatory to specify the current fingeprint of the subnetwork resource being patched.",
  107613. // "httpMethod": "PATCH",
  107614. // "id": "compute.subnetworks.patch",
  107615. // "parameterOrder": [
  107616. // "project",
  107617. // "region",
  107618. // "subnetwork"
  107619. // ],
  107620. // "parameters": {
  107621. // "project": {
  107622. // "description": "Project ID for this request.",
  107623. // "location": "path",
  107624. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  107625. // "required": true,
  107626. // "type": "string"
  107627. // },
  107628. // "region": {
  107629. // "description": "Name of the region scoping this request.",
  107630. // "location": "path",
  107631. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  107632. // "required": true,
  107633. // "type": "string"
  107634. // },
  107635. // "requestId": {
  107636. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  107637. // "location": "query",
  107638. // "type": "string"
  107639. // },
  107640. // "subnetwork": {
  107641. // "description": "Name of the Subnetwork resource to patch.",
  107642. // "location": "path",
  107643. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  107644. // "required": true,
  107645. // "type": "string"
  107646. // }
  107647. // },
  107648. // "path": "{project}/regions/{region}/subnetworks/{subnetwork}",
  107649. // "request": {
  107650. // "$ref": "Subnetwork"
  107651. // },
  107652. // "response": {
  107653. // "$ref": "Operation"
  107654. // },
  107655. // "scopes": [
  107656. // "https://www.googleapis.com/auth/cloud-platform",
  107657. // "https://www.googleapis.com/auth/compute"
  107658. // ]
  107659. // }
  107660. }
  107661. // method id "compute.subnetworks.setIamPolicy":
  107662. type SubnetworksSetIamPolicyCall struct {
  107663. s *Service
  107664. project string
  107665. region string
  107666. resource string
  107667. regionsetpolicyrequest *RegionSetPolicyRequest
  107668. urlParams_ gensupport.URLParams
  107669. ctx_ context.Context
  107670. header_ http.Header
  107671. }
  107672. // SetIamPolicy: Sets the access control policy on the specified
  107673. // resource. Replaces any existing policy.
  107674. func (r *SubnetworksService) SetIamPolicy(project string, region string, resource string, regionsetpolicyrequest *RegionSetPolicyRequest) *SubnetworksSetIamPolicyCall {
  107675. c := &SubnetworksSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  107676. c.project = project
  107677. c.region = region
  107678. c.resource = resource
  107679. c.regionsetpolicyrequest = regionsetpolicyrequest
  107680. return c
  107681. }
  107682. // Fields allows partial responses to be retrieved. See
  107683. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  107684. // for more information.
  107685. func (c *SubnetworksSetIamPolicyCall) Fields(s ...googleapi.Field) *SubnetworksSetIamPolicyCall {
  107686. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  107687. return c
  107688. }
  107689. // Context sets the context to be used in this call's Do method. Any
  107690. // pending HTTP request will be aborted if the provided context is
  107691. // canceled.
  107692. func (c *SubnetworksSetIamPolicyCall) Context(ctx context.Context) *SubnetworksSetIamPolicyCall {
  107693. c.ctx_ = ctx
  107694. return c
  107695. }
  107696. // Header returns an http.Header that can be modified by the caller to
  107697. // add HTTP headers to the request.
  107698. func (c *SubnetworksSetIamPolicyCall) Header() http.Header {
  107699. if c.header_ == nil {
  107700. c.header_ = make(http.Header)
  107701. }
  107702. return c.header_
  107703. }
  107704. func (c *SubnetworksSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  107705. reqHeaders := make(http.Header)
  107706. for k, v := range c.header_ {
  107707. reqHeaders[k] = v
  107708. }
  107709. reqHeaders.Set("User-Agent", c.s.userAgent())
  107710. var body io.Reader = nil
  107711. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest)
  107712. if err != nil {
  107713. return nil, err
  107714. }
  107715. reqHeaders.Set("Content-Type", "application/json")
  107716. c.urlParams_.Set("alt", alt)
  107717. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{resource}/setIamPolicy")
  107718. urls += "?" + c.urlParams_.Encode()
  107719. req, _ := http.NewRequest("POST", urls, body)
  107720. req.Header = reqHeaders
  107721. googleapi.Expand(req.URL, map[string]string{
  107722. "project": c.project,
  107723. "region": c.region,
  107724. "resource": c.resource,
  107725. })
  107726. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  107727. }
  107728. // Do executes the "compute.subnetworks.setIamPolicy" call.
  107729. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  107730. // code is an error. Response headers are in either
  107731. // *Policy.ServerResponse.Header or (if a response was returned at all)
  107732. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  107733. // check whether the returned error was because http.StatusNotModified
  107734. // was returned.
  107735. func (c *SubnetworksSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  107736. gensupport.SetOptions(c.urlParams_, opts...)
  107737. res, err := c.doRequest("json")
  107738. if res != nil && res.StatusCode == http.StatusNotModified {
  107739. if res.Body != nil {
  107740. res.Body.Close()
  107741. }
  107742. return nil, &googleapi.Error{
  107743. Code: res.StatusCode,
  107744. Header: res.Header,
  107745. }
  107746. }
  107747. if err != nil {
  107748. return nil, err
  107749. }
  107750. defer googleapi.CloseBody(res)
  107751. if err := googleapi.CheckResponse(res); err != nil {
  107752. return nil, err
  107753. }
  107754. ret := &Policy{
  107755. ServerResponse: googleapi.ServerResponse{
  107756. Header: res.Header,
  107757. HTTPStatusCode: res.StatusCode,
  107758. },
  107759. }
  107760. target := &ret
  107761. if err := gensupport.DecodeResponse(target, res); err != nil {
  107762. return nil, err
  107763. }
  107764. return ret, nil
  107765. // {
  107766. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  107767. // "httpMethod": "POST",
  107768. // "id": "compute.subnetworks.setIamPolicy",
  107769. // "parameterOrder": [
  107770. // "project",
  107771. // "region",
  107772. // "resource"
  107773. // ],
  107774. // "parameters": {
  107775. // "project": {
  107776. // "description": "Project ID for this request.",
  107777. // "location": "path",
  107778. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  107779. // "required": true,
  107780. // "type": "string"
  107781. // },
  107782. // "region": {
  107783. // "description": "The name of the region for this request.",
  107784. // "location": "path",
  107785. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  107786. // "required": true,
  107787. // "type": "string"
  107788. // },
  107789. // "resource": {
  107790. // "description": "Name of the resource for this request.",
  107791. // "location": "path",
  107792. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  107793. // "required": true,
  107794. // "type": "string"
  107795. // }
  107796. // },
  107797. // "path": "{project}/regions/{region}/subnetworks/{resource}/setIamPolicy",
  107798. // "request": {
  107799. // "$ref": "RegionSetPolicyRequest"
  107800. // },
  107801. // "response": {
  107802. // "$ref": "Policy"
  107803. // },
  107804. // "scopes": [
  107805. // "https://www.googleapis.com/auth/cloud-platform",
  107806. // "https://www.googleapis.com/auth/compute"
  107807. // ]
  107808. // }
  107809. }
  107810. // method id "compute.subnetworks.setPrivateIpGoogleAccess":
  107811. type SubnetworksSetPrivateIpGoogleAccessCall struct {
  107812. s *Service
  107813. project string
  107814. region string
  107815. subnetwork string
  107816. subnetworkssetprivateipgoogleaccessrequest *SubnetworksSetPrivateIpGoogleAccessRequest
  107817. urlParams_ gensupport.URLParams
  107818. ctx_ context.Context
  107819. header_ http.Header
  107820. }
  107821. // SetPrivateIpGoogleAccess: Set whether VMs in this subnet can access
  107822. // Google services without assigning external IP addresses through
  107823. // Private Google Access.
  107824. func (r *SubnetworksService) SetPrivateIpGoogleAccess(project string, region string, subnetwork string, subnetworkssetprivateipgoogleaccessrequest *SubnetworksSetPrivateIpGoogleAccessRequest) *SubnetworksSetPrivateIpGoogleAccessCall {
  107825. c := &SubnetworksSetPrivateIpGoogleAccessCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  107826. c.project = project
  107827. c.region = region
  107828. c.subnetwork = subnetwork
  107829. c.subnetworkssetprivateipgoogleaccessrequest = subnetworkssetprivateipgoogleaccessrequest
  107830. return c
  107831. }
  107832. // RequestId sets the optional parameter "requestId": An optional
  107833. // request ID to identify requests. Specify a unique request ID so that
  107834. // if you must retry your request, the server will know to ignore the
  107835. // request if it has already been completed.
  107836. //
  107837. // For example, consider a situation where you make an initial request
  107838. // and the request times out. If you make the request again with the
  107839. // same request ID, the server can check if original operation with the
  107840. // same request ID was received, and if so, will ignore the second
  107841. // request. This prevents clients from accidentally creating duplicate
  107842. // commitments.
  107843. //
  107844. // The request ID must be a valid UUID with the exception that zero UUID
  107845. // is not supported (00000000-0000-0000-0000-000000000000).
  107846. func (c *SubnetworksSetPrivateIpGoogleAccessCall) RequestId(requestId string) *SubnetworksSetPrivateIpGoogleAccessCall {
  107847. c.urlParams_.Set("requestId", requestId)
  107848. return c
  107849. }
  107850. // Fields allows partial responses to be retrieved. See
  107851. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  107852. // for more information.
  107853. func (c *SubnetworksSetPrivateIpGoogleAccessCall) Fields(s ...googleapi.Field) *SubnetworksSetPrivateIpGoogleAccessCall {
  107854. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  107855. return c
  107856. }
  107857. // Context sets the context to be used in this call's Do method. Any
  107858. // pending HTTP request will be aborted if the provided context is
  107859. // canceled.
  107860. func (c *SubnetworksSetPrivateIpGoogleAccessCall) Context(ctx context.Context) *SubnetworksSetPrivateIpGoogleAccessCall {
  107861. c.ctx_ = ctx
  107862. return c
  107863. }
  107864. // Header returns an http.Header that can be modified by the caller to
  107865. // add HTTP headers to the request.
  107866. func (c *SubnetworksSetPrivateIpGoogleAccessCall) Header() http.Header {
  107867. if c.header_ == nil {
  107868. c.header_ = make(http.Header)
  107869. }
  107870. return c.header_
  107871. }
  107872. func (c *SubnetworksSetPrivateIpGoogleAccessCall) doRequest(alt string) (*http.Response, error) {
  107873. reqHeaders := make(http.Header)
  107874. for k, v := range c.header_ {
  107875. reqHeaders[k] = v
  107876. }
  107877. reqHeaders.Set("User-Agent", c.s.userAgent())
  107878. var body io.Reader = nil
  107879. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subnetworkssetprivateipgoogleaccessrequest)
  107880. if err != nil {
  107881. return nil, err
  107882. }
  107883. reqHeaders.Set("Content-Type", "application/json")
  107884. c.urlParams_.Set("alt", alt)
  107885. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{subnetwork}/setPrivateIpGoogleAccess")
  107886. urls += "?" + c.urlParams_.Encode()
  107887. req, _ := http.NewRequest("POST", urls, body)
  107888. req.Header = reqHeaders
  107889. googleapi.Expand(req.URL, map[string]string{
  107890. "project": c.project,
  107891. "region": c.region,
  107892. "subnetwork": c.subnetwork,
  107893. })
  107894. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  107895. }
  107896. // Do executes the "compute.subnetworks.setPrivateIpGoogleAccess" call.
  107897. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  107898. // status code is an error. Response headers are in either
  107899. // *Operation.ServerResponse.Header or (if a response was returned at
  107900. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  107901. // to check whether the returned error was because
  107902. // http.StatusNotModified was returned.
  107903. func (c *SubnetworksSetPrivateIpGoogleAccessCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  107904. gensupport.SetOptions(c.urlParams_, opts...)
  107905. res, err := c.doRequest("json")
  107906. if res != nil && res.StatusCode == http.StatusNotModified {
  107907. if res.Body != nil {
  107908. res.Body.Close()
  107909. }
  107910. return nil, &googleapi.Error{
  107911. Code: res.StatusCode,
  107912. Header: res.Header,
  107913. }
  107914. }
  107915. if err != nil {
  107916. return nil, err
  107917. }
  107918. defer googleapi.CloseBody(res)
  107919. if err := googleapi.CheckResponse(res); err != nil {
  107920. return nil, err
  107921. }
  107922. ret := &Operation{
  107923. ServerResponse: googleapi.ServerResponse{
  107924. Header: res.Header,
  107925. HTTPStatusCode: res.StatusCode,
  107926. },
  107927. }
  107928. target := &ret
  107929. if err := gensupport.DecodeResponse(target, res); err != nil {
  107930. return nil, err
  107931. }
  107932. return ret, nil
  107933. // {
  107934. // "description": "Set whether VMs in this subnet can access Google services without assigning external IP addresses through Private Google Access.",
  107935. // "httpMethod": "POST",
  107936. // "id": "compute.subnetworks.setPrivateIpGoogleAccess",
  107937. // "parameterOrder": [
  107938. // "project",
  107939. // "region",
  107940. // "subnetwork"
  107941. // ],
  107942. // "parameters": {
  107943. // "project": {
  107944. // "description": "Project ID for this request.",
  107945. // "location": "path",
  107946. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  107947. // "required": true,
  107948. // "type": "string"
  107949. // },
  107950. // "region": {
  107951. // "description": "Name of the region scoping this request.",
  107952. // "location": "path",
  107953. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  107954. // "required": true,
  107955. // "type": "string"
  107956. // },
  107957. // "requestId": {
  107958. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  107959. // "location": "query",
  107960. // "type": "string"
  107961. // },
  107962. // "subnetwork": {
  107963. // "description": "Name of the Subnetwork resource.",
  107964. // "location": "path",
  107965. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  107966. // "required": true,
  107967. // "type": "string"
  107968. // }
  107969. // },
  107970. // "path": "{project}/regions/{region}/subnetworks/{subnetwork}/setPrivateIpGoogleAccess",
  107971. // "request": {
  107972. // "$ref": "SubnetworksSetPrivateIpGoogleAccessRequest"
  107973. // },
  107974. // "response": {
  107975. // "$ref": "Operation"
  107976. // },
  107977. // "scopes": [
  107978. // "https://www.googleapis.com/auth/cloud-platform",
  107979. // "https://www.googleapis.com/auth/compute"
  107980. // ]
  107981. // }
  107982. }
  107983. // method id "compute.subnetworks.testIamPermissions":
  107984. type SubnetworksTestIamPermissionsCall struct {
  107985. s *Service
  107986. project string
  107987. region string
  107988. resource string
  107989. testpermissionsrequest *TestPermissionsRequest
  107990. urlParams_ gensupport.URLParams
  107991. ctx_ context.Context
  107992. header_ http.Header
  107993. }
  107994. // TestIamPermissions: Returns permissions that a caller has on the
  107995. // specified resource.
  107996. func (r *SubnetworksService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *SubnetworksTestIamPermissionsCall {
  107997. c := &SubnetworksTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  107998. c.project = project
  107999. c.region = region
  108000. c.resource = resource
  108001. c.testpermissionsrequest = testpermissionsrequest
  108002. return c
  108003. }
  108004. // Fields allows partial responses to be retrieved. See
  108005. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  108006. // for more information.
  108007. func (c *SubnetworksTestIamPermissionsCall) Fields(s ...googleapi.Field) *SubnetworksTestIamPermissionsCall {
  108008. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  108009. return c
  108010. }
  108011. // Context sets the context to be used in this call's Do method. Any
  108012. // pending HTTP request will be aborted if the provided context is
  108013. // canceled.
  108014. func (c *SubnetworksTestIamPermissionsCall) Context(ctx context.Context) *SubnetworksTestIamPermissionsCall {
  108015. c.ctx_ = ctx
  108016. return c
  108017. }
  108018. // Header returns an http.Header that can be modified by the caller to
  108019. // add HTTP headers to the request.
  108020. func (c *SubnetworksTestIamPermissionsCall) Header() http.Header {
  108021. if c.header_ == nil {
  108022. c.header_ = make(http.Header)
  108023. }
  108024. return c.header_
  108025. }
  108026. func (c *SubnetworksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  108027. reqHeaders := make(http.Header)
  108028. for k, v := range c.header_ {
  108029. reqHeaders[k] = v
  108030. }
  108031. reqHeaders.Set("User-Agent", c.s.userAgent())
  108032. var body io.Reader = nil
  108033. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  108034. if err != nil {
  108035. return nil, err
  108036. }
  108037. reqHeaders.Set("Content-Type", "application/json")
  108038. c.urlParams_.Set("alt", alt)
  108039. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{resource}/testIamPermissions")
  108040. urls += "?" + c.urlParams_.Encode()
  108041. req, _ := http.NewRequest("POST", urls, body)
  108042. req.Header = reqHeaders
  108043. googleapi.Expand(req.URL, map[string]string{
  108044. "project": c.project,
  108045. "region": c.region,
  108046. "resource": c.resource,
  108047. })
  108048. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  108049. }
  108050. // Do executes the "compute.subnetworks.testIamPermissions" call.
  108051. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  108052. // non-2xx status code is an error. Response headers are in either
  108053. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  108054. // returned at all) in error.(*googleapi.Error).Header. Use
  108055. // googleapi.IsNotModified to check whether the returned error was
  108056. // because http.StatusNotModified was returned.
  108057. func (c *SubnetworksTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  108058. gensupport.SetOptions(c.urlParams_, opts...)
  108059. res, err := c.doRequest("json")
  108060. if res != nil && res.StatusCode == http.StatusNotModified {
  108061. if res.Body != nil {
  108062. res.Body.Close()
  108063. }
  108064. return nil, &googleapi.Error{
  108065. Code: res.StatusCode,
  108066. Header: res.Header,
  108067. }
  108068. }
  108069. if err != nil {
  108070. return nil, err
  108071. }
  108072. defer googleapi.CloseBody(res)
  108073. if err := googleapi.CheckResponse(res); err != nil {
  108074. return nil, err
  108075. }
  108076. ret := &TestPermissionsResponse{
  108077. ServerResponse: googleapi.ServerResponse{
  108078. Header: res.Header,
  108079. HTTPStatusCode: res.StatusCode,
  108080. },
  108081. }
  108082. target := &ret
  108083. if err := gensupport.DecodeResponse(target, res); err != nil {
  108084. return nil, err
  108085. }
  108086. return ret, nil
  108087. // {
  108088. // "description": "Returns permissions that a caller has on the specified resource.",
  108089. // "httpMethod": "POST",
  108090. // "id": "compute.subnetworks.testIamPermissions",
  108091. // "parameterOrder": [
  108092. // "project",
  108093. // "region",
  108094. // "resource"
  108095. // ],
  108096. // "parameters": {
  108097. // "project": {
  108098. // "description": "Project ID for this request.",
  108099. // "location": "path",
  108100. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  108101. // "required": true,
  108102. // "type": "string"
  108103. // },
  108104. // "region": {
  108105. // "description": "The name of the region for this request.",
  108106. // "location": "path",
  108107. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  108108. // "required": true,
  108109. // "type": "string"
  108110. // },
  108111. // "resource": {
  108112. // "description": "Name of the resource for this request.",
  108113. // "location": "path",
  108114. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  108115. // "required": true,
  108116. // "type": "string"
  108117. // }
  108118. // },
  108119. // "path": "{project}/regions/{region}/subnetworks/{resource}/testIamPermissions",
  108120. // "request": {
  108121. // "$ref": "TestPermissionsRequest"
  108122. // },
  108123. // "response": {
  108124. // "$ref": "TestPermissionsResponse"
  108125. // },
  108126. // "scopes": [
  108127. // "https://www.googleapis.com/auth/cloud-platform",
  108128. // "https://www.googleapis.com/auth/compute",
  108129. // "https://www.googleapis.com/auth/compute.readonly"
  108130. // ]
  108131. // }
  108132. }
  108133. // method id "compute.targetHttpProxies.aggregatedList":
  108134. type TargetHttpProxiesAggregatedListCall struct {
  108135. s *Service
  108136. project string
  108137. urlParams_ gensupport.URLParams
  108138. ifNoneMatch_ string
  108139. ctx_ context.Context
  108140. header_ http.Header
  108141. }
  108142. // AggregatedList: Retrieves the list of all TargetHttpProxy resources,
  108143. // regional and global, available to the specified project.
  108144. func (r *TargetHttpProxiesService) AggregatedList(project string) *TargetHttpProxiesAggregatedListCall {
  108145. c := &TargetHttpProxiesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  108146. c.project = project
  108147. return c
  108148. }
  108149. // Filter sets the optional parameter "filter": A filter expression that
  108150. // filters resources listed in the response. The expression must specify
  108151. // the field name, a comparison operator, and the value that you want to
  108152. // use for filtering. The value must be a string, a number, or a
  108153. // boolean. The comparison operator must be either =, !=, >, or <.
  108154. //
  108155. // For example, if you are filtering Compute Engine instances, you can
  108156. // exclude instances named example-instance by specifying name !=
  108157. // example-instance.
  108158. //
  108159. // You can also filter nested fields. For example, you could specify
  108160. // scheduling.automaticRestart = false to include instances only if they
  108161. // are not scheduled for automatic restarts. You can use filtering on
  108162. // nested fields to filter based on resource labels.
  108163. //
  108164. // To filter on multiple expressions, provide each separate expression
  108165. // within parentheses. For example, (scheduling.automaticRestart = true)
  108166. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  108167. // AND expression. However, you can include AND and OR expressions
  108168. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  108169. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  108170. // true).
  108171. func (c *TargetHttpProxiesAggregatedListCall) Filter(filter string) *TargetHttpProxiesAggregatedListCall {
  108172. c.urlParams_.Set("filter", filter)
  108173. return c
  108174. }
  108175. // MaxResults sets the optional parameter "maxResults": The maximum
  108176. // number of results per page that should be returned. If the number of
  108177. // available results is larger than maxResults, Compute Engine returns a
  108178. // nextPageToken that can be used to get the next page of results in
  108179. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  108180. // (Default: 500)
  108181. func (c *TargetHttpProxiesAggregatedListCall) MaxResults(maxResults int64) *TargetHttpProxiesAggregatedListCall {
  108182. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  108183. return c
  108184. }
  108185. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  108186. // a certain order. By default, results are returned in alphanumerical
  108187. // order based on the resource name.
  108188. //
  108189. // You can also sort results in descending order based on the creation
  108190. // timestamp using orderBy="creationTimestamp desc". This sorts results
  108191. // based on the creationTimestamp field in reverse chronological order
  108192. // (newest result first). Use this to sort resources like operations so
  108193. // that the newest operation is returned first.
  108194. //
  108195. // Currently, only sorting by name or creationTimestamp desc is
  108196. // supported.
  108197. func (c *TargetHttpProxiesAggregatedListCall) OrderBy(orderBy string) *TargetHttpProxiesAggregatedListCall {
  108198. c.urlParams_.Set("orderBy", orderBy)
  108199. return c
  108200. }
  108201. // PageToken sets the optional parameter "pageToken": Specifies a page
  108202. // token to use. Set pageToken to the nextPageToken returned by a
  108203. // previous list request to get the next page of results.
  108204. func (c *TargetHttpProxiesAggregatedListCall) PageToken(pageToken string) *TargetHttpProxiesAggregatedListCall {
  108205. c.urlParams_.Set("pageToken", pageToken)
  108206. return c
  108207. }
  108208. // Fields allows partial responses to be retrieved. See
  108209. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  108210. // for more information.
  108211. func (c *TargetHttpProxiesAggregatedListCall) Fields(s ...googleapi.Field) *TargetHttpProxiesAggregatedListCall {
  108212. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  108213. return c
  108214. }
  108215. // IfNoneMatch sets the optional parameter which makes the operation
  108216. // fail if the object's ETag matches the given value. This is useful for
  108217. // getting updates only after the object has changed since the last
  108218. // request. Use googleapi.IsNotModified to check whether the response
  108219. // error from Do is the result of In-None-Match.
  108220. func (c *TargetHttpProxiesAggregatedListCall) IfNoneMatch(entityTag string) *TargetHttpProxiesAggregatedListCall {
  108221. c.ifNoneMatch_ = entityTag
  108222. return c
  108223. }
  108224. // Context sets the context to be used in this call's Do method. Any
  108225. // pending HTTP request will be aborted if the provided context is
  108226. // canceled.
  108227. func (c *TargetHttpProxiesAggregatedListCall) Context(ctx context.Context) *TargetHttpProxiesAggregatedListCall {
  108228. c.ctx_ = ctx
  108229. return c
  108230. }
  108231. // Header returns an http.Header that can be modified by the caller to
  108232. // add HTTP headers to the request.
  108233. func (c *TargetHttpProxiesAggregatedListCall) Header() http.Header {
  108234. if c.header_ == nil {
  108235. c.header_ = make(http.Header)
  108236. }
  108237. return c.header_
  108238. }
  108239. func (c *TargetHttpProxiesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  108240. reqHeaders := make(http.Header)
  108241. for k, v := range c.header_ {
  108242. reqHeaders[k] = v
  108243. }
  108244. reqHeaders.Set("User-Agent", c.s.userAgent())
  108245. if c.ifNoneMatch_ != "" {
  108246. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  108247. }
  108248. var body io.Reader = nil
  108249. c.urlParams_.Set("alt", alt)
  108250. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/targetHttpProxies")
  108251. urls += "?" + c.urlParams_.Encode()
  108252. req, _ := http.NewRequest("GET", urls, body)
  108253. req.Header = reqHeaders
  108254. googleapi.Expand(req.URL, map[string]string{
  108255. "project": c.project,
  108256. })
  108257. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  108258. }
  108259. // Do executes the "compute.targetHttpProxies.aggregatedList" call.
  108260. // Exactly one of *TargetHttpProxyAggregatedList or error will be
  108261. // non-nil. Any non-2xx status code is an error. Response headers are in
  108262. // either *TargetHttpProxyAggregatedList.ServerResponse.Header or (if a
  108263. // response was returned at all) in error.(*googleapi.Error).Header. Use
  108264. // googleapi.IsNotModified to check whether the returned error was
  108265. // because http.StatusNotModified was returned.
  108266. func (c *TargetHttpProxiesAggregatedListCall) Do(opts ...googleapi.CallOption) (*TargetHttpProxyAggregatedList, error) {
  108267. gensupport.SetOptions(c.urlParams_, opts...)
  108268. res, err := c.doRequest("json")
  108269. if res != nil && res.StatusCode == http.StatusNotModified {
  108270. if res.Body != nil {
  108271. res.Body.Close()
  108272. }
  108273. return nil, &googleapi.Error{
  108274. Code: res.StatusCode,
  108275. Header: res.Header,
  108276. }
  108277. }
  108278. if err != nil {
  108279. return nil, err
  108280. }
  108281. defer googleapi.CloseBody(res)
  108282. if err := googleapi.CheckResponse(res); err != nil {
  108283. return nil, err
  108284. }
  108285. ret := &TargetHttpProxyAggregatedList{
  108286. ServerResponse: googleapi.ServerResponse{
  108287. Header: res.Header,
  108288. HTTPStatusCode: res.StatusCode,
  108289. },
  108290. }
  108291. target := &ret
  108292. if err := gensupport.DecodeResponse(target, res); err != nil {
  108293. return nil, err
  108294. }
  108295. return ret, nil
  108296. // {
  108297. // "description": "Retrieves the list of all TargetHttpProxy resources, regional and global, available to the specified project.",
  108298. // "httpMethod": "GET",
  108299. // "id": "compute.targetHttpProxies.aggregatedList",
  108300. // "parameterOrder": [
  108301. // "project"
  108302. // ],
  108303. // "parameters": {
  108304. // "filter": {
  108305. // "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).",
  108306. // "location": "query",
  108307. // "type": "string"
  108308. // },
  108309. // "maxResults": {
  108310. // "default": "500",
  108311. // "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)",
  108312. // "format": "uint32",
  108313. // "location": "query",
  108314. // "minimum": "0",
  108315. // "type": "integer"
  108316. // },
  108317. // "orderBy": {
  108318. // "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.",
  108319. // "location": "query",
  108320. // "type": "string"
  108321. // },
  108322. // "pageToken": {
  108323. // "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.",
  108324. // "location": "query",
  108325. // "type": "string"
  108326. // },
  108327. // "project": {
  108328. // "description": "Name of the project scoping this request.",
  108329. // "location": "path",
  108330. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  108331. // "required": true,
  108332. // "type": "string"
  108333. // }
  108334. // },
  108335. // "path": "{project}/aggregated/targetHttpProxies",
  108336. // "response": {
  108337. // "$ref": "TargetHttpProxyAggregatedList"
  108338. // },
  108339. // "scopes": [
  108340. // "https://www.googleapis.com/auth/cloud-platform",
  108341. // "https://www.googleapis.com/auth/compute",
  108342. // "https://www.googleapis.com/auth/compute.readonly"
  108343. // ]
  108344. // }
  108345. }
  108346. // Pages invokes f for each page of results.
  108347. // A non-nil error returned from f will halt the iteration.
  108348. // The provided context supersedes any context provided to the Context method.
  108349. func (c *TargetHttpProxiesAggregatedListCall) Pages(ctx context.Context, f func(*TargetHttpProxyAggregatedList) error) error {
  108350. c.ctx_ = ctx
  108351. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  108352. for {
  108353. x, err := c.Do()
  108354. if err != nil {
  108355. return err
  108356. }
  108357. if err := f(x); err != nil {
  108358. return err
  108359. }
  108360. if x.NextPageToken == "" {
  108361. return nil
  108362. }
  108363. c.PageToken(x.NextPageToken)
  108364. }
  108365. }
  108366. // method id "compute.targetHttpProxies.delete":
  108367. type TargetHttpProxiesDeleteCall struct {
  108368. s *Service
  108369. project string
  108370. targetHttpProxy string
  108371. urlParams_ gensupport.URLParams
  108372. ctx_ context.Context
  108373. header_ http.Header
  108374. }
  108375. // Delete: Deletes the specified TargetHttpProxy resource.
  108376. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/delete
  108377. func (r *TargetHttpProxiesService) Delete(project string, targetHttpProxy string) *TargetHttpProxiesDeleteCall {
  108378. c := &TargetHttpProxiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  108379. c.project = project
  108380. c.targetHttpProxy = targetHttpProxy
  108381. return c
  108382. }
  108383. // RequestId sets the optional parameter "requestId": An optional
  108384. // request ID to identify requests. Specify a unique request ID so that
  108385. // if you must retry your request, the server will know to ignore the
  108386. // request if it has already been completed.
  108387. //
  108388. // For example, consider a situation where you make an initial request
  108389. // and the request times out. If you make the request again with the
  108390. // same request ID, the server can check if original operation with the
  108391. // same request ID was received, and if so, will ignore the second
  108392. // request. This prevents clients from accidentally creating duplicate
  108393. // commitments.
  108394. //
  108395. // The request ID must be a valid UUID with the exception that zero UUID
  108396. // is not supported (00000000-0000-0000-0000-000000000000).
  108397. func (c *TargetHttpProxiesDeleteCall) RequestId(requestId string) *TargetHttpProxiesDeleteCall {
  108398. c.urlParams_.Set("requestId", requestId)
  108399. return c
  108400. }
  108401. // Fields allows partial responses to be retrieved. See
  108402. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  108403. // for more information.
  108404. func (c *TargetHttpProxiesDeleteCall) Fields(s ...googleapi.Field) *TargetHttpProxiesDeleteCall {
  108405. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  108406. return c
  108407. }
  108408. // Context sets the context to be used in this call's Do method. Any
  108409. // pending HTTP request will be aborted if the provided context is
  108410. // canceled.
  108411. func (c *TargetHttpProxiesDeleteCall) Context(ctx context.Context) *TargetHttpProxiesDeleteCall {
  108412. c.ctx_ = ctx
  108413. return c
  108414. }
  108415. // Header returns an http.Header that can be modified by the caller to
  108416. // add HTTP headers to the request.
  108417. func (c *TargetHttpProxiesDeleteCall) Header() http.Header {
  108418. if c.header_ == nil {
  108419. c.header_ = make(http.Header)
  108420. }
  108421. return c.header_
  108422. }
  108423. func (c *TargetHttpProxiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  108424. reqHeaders := make(http.Header)
  108425. for k, v := range c.header_ {
  108426. reqHeaders[k] = v
  108427. }
  108428. reqHeaders.Set("User-Agent", c.s.userAgent())
  108429. var body io.Reader = nil
  108430. c.urlParams_.Set("alt", alt)
  108431. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies/{targetHttpProxy}")
  108432. urls += "?" + c.urlParams_.Encode()
  108433. req, _ := http.NewRequest("DELETE", urls, body)
  108434. req.Header = reqHeaders
  108435. googleapi.Expand(req.URL, map[string]string{
  108436. "project": c.project,
  108437. "targetHttpProxy": c.targetHttpProxy,
  108438. })
  108439. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  108440. }
  108441. // Do executes the "compute.targetHttpProxies.delete" call.
  108442. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  108443. // status code is an error. Response headers are in either
  108444. // *Operation.ServerResponse.Header or (if a response was returned at
  108445. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  108446. // to check whether the returned error was because
  108447. // http.StatusNotModified was returned.
  108448. func (c *TargetHttpProxiesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  108449. gensupport.SetOptions(c.urlParams_, opts...)
  108450. res, err := c.doRequest("json")
  108451. if res != nil && res.StatusCode == http.StatusNotModified {
  108452. if res.Body != nil {
  108453. res.Body.Close()
  108454. }
  108455. return nil, &googleapi.Error{
  108456. Code: res.StatusCode,
  108457. Header: res.Header,
  108458. }
  108459. }
  108460. if err != nil {
  108461. return nil, err
  108462. }
  108463. defer googleapi.CloseBody(res)
  108464. if err := googleapi.CheckResponse(res); err != nil {
  108465. return nil, err
  108466. }
  108467. ret := &Operation{
  108468. ServerResponse: googleapi.ServerResponse{
  108469. Header: res.Header,
  108470. HTTPStatusCode: res.StatusCode,
  108471. },
  108472. }
  108473. target := &ret
  108474. if err := gensupport.DecodeResponse(target, res); err != nil {
  108475. return nil, err
  108476. }
  108477. return ret, nil
  108478. // {
  108479. // "description": "Deletes the specified TargetHttpProxy resource.",
  108480. // "httpMethod": "DELETE",
  108481. // "id": "compute.targetHttpProxies.delete",
  108482. // "parameterOrder": [
  108483. // "project",
  108484. // "targetHttpProxy"
  108485. // ],
  108486. // "parameters": {
  108487. // "project": {
  108488. // "description": "Project ID for this request.",
  108489. // "location": "path",
  108490. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  108491. // "required": true,
  108492. // "type": "string"
  108493. // },
  108494. // "requestId": {
  108495. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  108496. // "location": "query",
  108497. // "type": "string"
  108498. // },
  108499. // "targetHttpProxy": {
  108500. // "description": "Name of the TargetHttpProxy resource to delete.",
  108501. // "location": "path",
  108502. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  108503. // "required": true,
  108504. // "type": "string"
  108505. // }
  108506. // },
  108507. // "path": "{project}/global/targetHttpProxies/{targetHttpProxy}",
  108508. // "response": {
  108509. // "$ref": "Operation"
  108510. // },
  108511. // "scopes": [
  108512. // "https://www.googleapis.com/auth/cloud-platform",
  108513. // "https://www.googleapis.com/auth/compute"
  108514. // ]
  108515. // }
  108516. }
  108517. // method id "compute.targetHttpProxies.get":
  108518. type TargetHttpProxiesGetCall struct {
  108519. s *Service
  108520. project string
  108521. targetHttpProxy string
  108522. urlParams_ gensupport.URLParams
  108523. ifNoneMatch_ string
  108524. ctx_ context.Context
  108525. header_ http.Header
  108526. }
  108527. // Get: Returns the specified TargetHttpProxy resource. Gets a list of
  108528. // available target HTTP proxies by making a list() request.
  108529. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/get
  108530. func (r *TargetHttpProxiesService) Get(project string, targetHttpProxy string) *TargetHttpProxiesGetCall {
  108531. c := &TargetHttpProxiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  108532. c.project = project
  108533. c.targetHttpProxy = targetHttpProxy
  108534. return c
  108535. }
  108536. // Fields allows partial responses to be retrieved. See
  108537. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  108538. // for more information.
  108539. func (c *TargetHttpProxiesGetCall) Fields(s ...googleapi.Field) *TargetHttpProxiesGetCall {
  108540. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  108541. return c
  108542. }
  108543. // IfNoneMatch sets the optional parameter which makes the operation
  108544. // fail if the object's ETag matches the given value. This is useful for
  108545. // getting updates only after the object has changed since the last
  108546. // request. Use googleapi.IsNotModified to check whether the response
  108547. // error from Do is the result of In-None-Match.
  108548. func (c *TargetHttpProxiesGetCall) IfNoneMatch(entityTag string) *TargetHttpProxiesGetCall {
  108549. c.ifNoneMatch_ = entityTag
  108550. return c
  108551. }
  108552. // Context sets the context to be used in this call's Do method. Any
  108553. // pending HTTP request will be aborted if the provided context is
  108554. // canceled.
  108555. func (c *TargetHttpProxiesGetCall) Context(ctx context.Context) *TargetHttpProxiesGetCall {
  108556. c.ctx_ = ctx
  108557. return c
  108558. }
  108559. // Header returns an http.Header that can be modified by the caller to
  108560. // add HTTP headers to the request.
  108561. func (c *TargetHttpProxiesGetCall) Header() http.Header {
  108562. if c.header_ == nil {
  108563. c.header_ = make(http.Header)
  108564. }
  108565. return c.header_
  108566. }
  108567. func (c *TargetHttpProxiesGetCall) doRequest(alt string) (*http.Response, error) {
  108568. reqHeaders := make(http.Header)
  108569. for k, v := range c.header_ {
  108570. reqHeaders[k] = v
  108571. }
  108572. reqHeaders.Set("User-Agent", c.s.userAgent())
  108573. if c.ifNoneMatch_ != "" {
  108574. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  108575. }
  108576. var body io.Reader = nil
  108577. c.urlParams_.Set("alt", alt)
  108578. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies/{targetHttpProxy}")
  108579. urls += "?" + c.urlParams_.Encode()
  108580. req, _ := http.NewRequest("GET", urls, body)
  108581. req.Header = reqHeaders
  108582. googleapi.Expand(req.URL, map[string]string{
  108583. "project": c.project,
  108584. "targetHttpProxy": c.targetHttpProxy,
  108585. })
  108586. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  108587. }
  108588. // Do executes the "compute.targetHttpProxies.get" call.
  108589. // Exactly one of *TargetHttpProxy or error will be non-nil. Any non-2xx
  108590. // status code is an error. Response headers are in either
  108591. // *TargetHttpProxy.ServerResponse.Header or (if a response was returned
  108592. // at all) in error.(*googleapi.Error).Header. Use
  108593. // googleapi.IsNotModified to check whether the returned error was
  108594. // because http.StatusNotModified was returned.
  108595. func (c *TargetHttpProxiesGetCall) Do(opts ...googleapi.CallOption) (*TargetHttpProxy, error) {
  108596. gensupport.SetOptions(c.urlParams_, opts...)
  108597. res, err := c.doRequest("json")
  108598. if res != nil && res.StatusCode == http.StatusNotModified {
  108599. if res.Body != nil {
  108600. res.Body.Close()
  108601. }
  108602. return nil, &googleapi.Error{
  108603. Code: res.StatusCode,
  108604. Header: res.Header,
  108605. }
  108606. }
  108607. if err != nil {
  108608. return nil, err
  108609. }
  108610. defer googleapi.CloseBody(res)
  108611. if err := googleapi.CheckResponse(res); err != nil {
  108612. return nil, err
  108613. }
  108614. ret := &TargetHttpProxy{
  108615. ServerResponse: googleapi.ServerResponse{
  108616. Header: res.Header,
  108617. HTTPStatusCode: res.StatusCode,
  108618. },
  108619. }
  108620. target := &ret
  108621. if err := gensupport.DecodeResponse(target, res); err != nil {
  108622. return nil, err
  108623. }
  108624. return ret, nil
  108625. // {
  108626. // "description": "Returns the specified TargetHttpProxy resource. Gets a list of available target HTTP proxies by making a list() request.",
  108627. // "httpMethod": "GET",
  108628. // "id": "compute.targetHttpProxies.get",
  108629. // "parameterOrder": [
  108630. // "project",
  108631. // "targetHttpProxy"
  108632. // ],
  108633. // "parameters": {
  108634. // "project": {
  108635. // "description": "Project ID for this request.",
  108636. // "location": "path",
  108637. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  108638. // "required": true,
  108639. // "type": "string"
  108640. // },
  108641. // "targetHttpProxy": {
  108642. // "description": "Name of the TargetHttpProxy resource to return.",
  108643. // "location": "path",
  108644. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  108645. // "required": true,
  108646. // "type": "string"
  108647. // }
  108648. // },
  108649. // "path": "{project}/global/targetHttpProxies/{targetHttpProxy}",
  108650. // "response": {
  108651. // "$ref": "TargetHttpProxy"
  108652. // },
  108653. // "scopes": [
  108654. // "https://www.googleapis.com/auth/cloud-platform",
  108655. // "https://www.googleapis.com/auth/compute",
  108656. // "https://www.googleapis.com/auth/compute.readonly"
  108657. // ]
  108658. // }
  108659. }
  108660. // method id "compute.targetHttpProxies.insert":
  108661. type TargetHttpProxiesInsertCall struct {
  108662. s *Service
  108663. project string
  108664. targethttpproxy *TargetHttpProxy
  108665. urlParams_ gensupport.URLParams
  108666. ctx_ context.Context
  108667. header_ http.Header
  108668. }
  108669. // Insert: Creates a TargetHttpProxy resource in the specified project
  108670. // using the data included in the request.
  108671. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/insert
  108672. func (r *TargetHttpProxiesService) Insert(project string, targethttpproxy *TargetHttpProxy) *TargetHttpProxiesInsertCall {
  108673. c := &TargetHttpProxiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  108674. c.project = project
  108675. c.targethttpproxy = targethttpproxy
  108676. return c
  108677. }
  108678. // RequestId sets the optional parameter "requestId": An optional
  108679. // request ID to identify requests. Specify a unique request ID so that
  108680. // if you must retry your request, the server will know to ignore the
  108681. // request if it has already been completed.
  108682. //
  108683. // For example, consider a situation where you make an initial request
  108684. // and the request times out. If you make the request again with the
  108685. // same request ID, the server can check if original operation with the
  108686. // same request ID was received, and if so, will ignore the second
  108687. // request. This prevents clients from accidentally creating duplicate
  108688. // commitments.
  108689. //
  108690. // The request ID must be a valid UUID with the exception that zero UUID
  108691. // is not supported (00000000-0000-0000-0000-000000000000).
  108692. func (c *TargetHttpProxiesInsertCall) RequestId(requestId string) *TargetHttpProxiesInsertCall {
  108693. c.urlParams_.Set("requestId", requestId)
  108694. return c
  108695. }
  108696. // Fields allows partial responses to be retrieved. See
  108697. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  108698. // for more information.
  108699. func (c *TargetHttpProxiesInsertCall) Fields(s ...googleapi.Field) *TargetHttpProxiesInsertCall {
  108700. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  108701. return c
  108702. }
  108703. // Context sets the context to be used in this call's Do method. Any
  108704. // pending HTTP request will be aborted if the provided context is
  108705. // canceled.
  108706. func (c *TargetHttpProxiesInsertCall) Context(ctx context.Context) *TargetHttpProxiesInsertCall {
  108707. c.ctx_ = ctx
  108708. return c
  108709. }
  108710. // Header returns an http.Header that can be modified by the caller to
  108711. // add HTTP headers to the request.
  108712. func (c *TargetHttpProxiesInsertCall) Header() http.Header {
  108713. if c.header_ == nil {
  108714. c.header_ = make(http.Header)
  108715. }
  108716. return c.header_
  108717. }
  108718. func (c *TargetHttpProxiesInsertCall) doRequest(alt string) (*http.Response, error) {
  108719. reqHeaders := make(http.Header)
  108720. for k, v := range c.header_ {
  108721. reqHeaders[k] = v
  108722. }
  108723. reqHeaders.Set("User-Agent", c.s.userAgent())
  108724. var body io.Reader = nil
  108725. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpproxy)
  108726. if err != nil {
  108727. return nil, err
  108728. }
  108729. reqHeaders.Set("Content-Type", "application/json")
  108730. c.urlParams_.Set("alt", alt)
  108731. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies")
  108732. urls += "?" + c.urlParams_.Encode()
  108733. req, _ := http.NewRequest("POST", urls, body)
  108734. req.Header = reqHeaders
  108735. googleapi.Expand(req.URL, map[string]string{
  108736. "project": c.project,
  108737. })
  108738. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  108739. }
  108740. // Do executes the "compute.targetHttpProxies.insert" call.
  108741. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  108742. // status code is an error. Response headers are in either
  108743. // *Operation.ServerResponse.Header or (if a response was returned at
  108744. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  108745. // to check whether the returned error was because
  108746. // http.StatusNotModified was returned.
  108747. func (c *TargetHttpProxiesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  108748. gensupport.SetOptions(c.urlParams_, opts...)
  108749. res, err := c.doRequest("json")
  108750. if res != nil && res.StatusCode == http.StatusNotModified {
  108751. if res.Body != nil {
  108752. res.Body.Close()
  108753. }
  108754. return nil, &googleapi.Error{
  108755. Code: res.StatusCode,
  108756. Header: res.Header,
  108757. }
  108758. }
  108759. if err != nil {
  108760. return nil, err
  108761. }
  108762. defer googleapi.CloseBody(res)
  108763. if err := googleapi.CheckResponse(res); err != nil {
  108764. return nil, err
  108765. }
  108766. ret := &Operation{
  108767. ServerResponse: googleapi.ServerResponse{
  108768. Header: res.Header,
  108769. HTTPStatusCode: res.StatusCode,
  108770. },
  108771. }
  108772. target := &ret
  108773. if err := gensupport.DecodeResponse(target, res); err != nil {
  108774. return nil, err
  108775. }
  108776. return ret, nil
  108777. // {
  108778. // "description": "Creates a TargetHttpProxy resource in the specified project using the data included in the request.",
  108779. // "httpMethod": "POST",
  108780. // "id": "compute.targetHttpProxies.insert",
  108781. // "parameterOrder": [
  108782. // "project"
  108783. // ],
  108784. // "parameters": {
  108785. // "project": {
  108786. // "description": "Project ID for this request.",
  108787. // "location": "path",
  108788. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  108789. // "required": true,
  108790. // "type": "string"
  108791. // },
  108792. // "requestId": {
  108793. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  108794. // "location": "query",
  108795. // "type": "string"
  108796. // }
  108797. // },
  108798. // "path": "{project}/global/targetHttpProxies",
  108799. // "request": {
  108800. // "$ref": "TargetHttpProxy"
  108801. // },
  108802. // "response": {
  108803. // "$ref": "Operation"
  108804. // },
  108805. // "scopes": [
  108806. // "https://www.googleapis.com/auth/cloud-platform",
  108807. // "https://www.googleapis.com/auth/compute"
  108808. // ]
  108809. // }
  108810. }
  108811. // method id "compute.targetHttpProxies.list":
  108812. type TargetHttpProxiesListCall struct {
  108813. s *Service
  108814. project string
  108815. urlParams_ gensupport.URLParams
  108816. ifNoneMatch_ string
  108817. ctx_ context.Context
  108818. header_ http.Header
  108819. }
  108820. // List: Retrieves the list of TargetHttpProxy resources available to
  108821. // the specified project.
  108822. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/list
  108823. func (r *TargetHttpProxiesService) List(project string) *TargetHttpProxiesListCall {
  108824. c := &TargetHttpProxiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  108825. c.project = project
  108826. return c
  108827. }
  108828. // Filter sets the optional parameter "filter": A filter expression that
  108829. // filters resources listed in the response. The expression must specify
  108830. // the field name, a comparison operator, and the value that you want to
  108831. // use for filtering. The value must be a string, a number, or a
  108832. // boolean. The comparison operator must be either =, !=, >, or <.
  108833. //
  108834. // For example, if you are filtering Compute Engine instances, you can
  108835. // exclude instances named example-instance by specifying name !=
  108836. // example-instance.
  108837. //
  108838. // You can also filter nested fields. For example, you could specify
  108839. // scheduling.automaticRestart = false to include instances only if they
  108840. // are not scheduled for automatic restarts. You can use filtering on
  108841. // nested fields to filter based on resource labels.
  108842. //
  108843. // To filter on multiple expressions, provide each separate expression
  108844. // within parentheses. For example, (scheduling.automaticRestart = true)
  108845. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  108846. // AND expression. However, you can include AND and OR expressions
  108847. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  108848. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  108849. // true).
  108850. func (c *TargetHttpProxiesListCall) Filter(filter string) *TargetHttpProxiesListCall {
  108851. c.urlParams_.Set("filter", filter)
  108852. return c
  108853. }
  108854. // MaxResults sets the optional parameter "maxResults": The maximum
  108855. // number of results per page that should be returned. If the number of
  108856. // available results is larger than maxResults, Compute Engine returns a
  108857. // nextPageToken that can be used to get the next page of results in
  108858. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  108859. // (Default: 500)
  108860. func (c *TargetHttpProxiesListCall) MaxResults(maxResults int64) *TargetHttpProxiesListCall {
  108861. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  108862. return c
  108863. }
  108864. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  108865. // a certain order. By default, results are returned in alphanumerical
  108866. // order based on the resource name.
  108867. //
  108868. // You can also sort results in descending order based on the creation
  108869. // timestamp using orderBy="creationTimestamp desc". This sorts results
  108870. // based on the creationTimestamp field in reverse chronological order
  108871. // (newest result first). Use this to sort resources like operations so
  108872. // that the newest operation is returned first.
  108873. //
  108874. // Currently, only sorting by name or creationTimestamp desc is
  108875. // supported.
  108876. func (c *TargetHttpProxiesListCall) OrderBy(orderBy string) *TargetHttpProxiesListCall {
  108877. c.urlParams_.Set("orderBy", orderBy)
  108878. return c
  108879. }
  108880. // PageToken sets the optional parameter "pageToken": Specifies a page
  108881. // token to use. Set pageToken to the nextPageToken returned by a
  108882. // previous list request to get the next page of results.
  108883. func (c *TargetHttpProxiesListCall) PageToken(pageToken string) *TargetHttpProxiesListCall {
  108884. c.urlParams_.Set("pageToken", pageToken)
  108885. return c
  108886. }
  108887. // Fields allows partial responses to be retrieved. See
  108888. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  108889. // for more information.
  108890. func (c *TargetHttpProxiesListCall) Fields(s ...googleapi.Field) *TargetHttpProxiesListCall {
  108891. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  108892. return c
  108893. }
  108894. // IfNoneMatch sets the optional parameter which makes the operation
  108895. // fail if the object's ETag matches the given value. This is useful for
  108896. // getting updates only after the object has changed since the last
  108897. // request. Use googleapi.IsNotModified to check whether the response
  108898. // error from Do is the result of In-None-Match.
  108899. func (c *TargetHttpProxiesListCall) IfNoneMatch(entityTag string) *TargetHttpProxiesListCall {
  108900. c.ifNoneMatch_ = entityTag
  108901. return c
  108902. }
  108903. // Context sets the context to be used in this call's Do method. Any
  108904. // pending HTTP request will be aborted if the provided context is
  108905. // canceled.
  108906. func (c *TargetHttpProxiesListCall) Context(ctx context.Context) *TargetHttpProxiesListCall {
  108907. c.ctx_ = ctx
  108908. return c
  108909. }
  108910. // Header returns an http.Header that can be modified by the caller to
  108911. // add HTTP headers to the request.
  108912. func (c *TargetHttpProxiesListCall) Header() http.Header {
  108913. if c.header_ == nil {
  108914. c.header_ = make(http.Header)
  108915. }
  108916. return c.header_
  108917. }
  108918. func (c *TargetHttpProxiesListCall) doRequest(alt string) (*http.Response, error) {
  108919. reqHeaders := make(http.Header)
  108920. for k, v := range c.header_ {
  108921. reqHeaders[k] = v
  108922. }
  108923. reqHeaders.Set("User-Agent", c.s.userAgent())
  108924. if c.ifNoneMatch_ != "" {
  108925. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  108926. }
  108927. var body io.Reader = nil
  108928. c.urlParams_.Set("alt", alt)
  108929. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies")
  108930. urls += "?" + c.urlParams_.Encode()
  108931. req, _ := http.NewRequest("GET", urls, body)
  108932. req.Header = reqHeaders
  108933. googleapi.Expand(req.URL, map[string]string{
  108934. "project": c.project,
  108935. })
  108936. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  108937. }
  108938. // Do executes the "compute.targetHttpProxies.list" call.
  108939. // Exactly one of *TargetHttpProxyList or error will be non-nil. Any
  108940. // non-2xx status code is an error. Response headers are in either
  108941. // *TargetHttpProxyList.ServerResponse.Header or (if a response was
  108942. // returned at all) in error.(*googleapi.Error).Header. Use
  108943. // googleapi.IsNotModified to check whether the returned error was
  108944. // because http.StatusNotModified was returned.
  108945. func (c *TargetHttpProxiesListCall) Do(opts ...googleapi.CallOption) (*TargetHttpProxyList, error) {
  108946. gensupport.SetOptions(c.urlParams_, opts...)
  108947. res, err := c.doRequest("json")
  108948. if res != nil && res.StatusCode == http.StatusNotModified {
  108949. if res.Body != nil {
  108950. res.Body.Close()
  108951. }
  108952. return nil, &googleapi.Error{
  108953. Code: res.StatusCode,
  108954. Header: res.Header,
  108955. }
  108956. }
  108957. if err != nil {
  108958. return nil, err
  108959. }
  108960. defer googleapi.CloseBody(res)
  108961. if err := googleapi.CheckResponse(res); err != nil {
  108962. return nil, err
  108963. }
  108964. ret := &TargetHttpProxyList{
  108965. ServerResponse: googleapi.ServerResponse{
  108966. Header: res.Header,
  108967. HTTPStatusCode: res.StatusCode,
  108968. },
  108969. }
  108970. target := &ret
  108971. if err := gensupport.DecodeResponse(target, res); err != nil {
  108972. return nil, err
  108973. }
  108974. return ret, nil
  108975. // {
  108976. // "description": "Retrieves the list of TargetHttpProxy resources available to the specified project.",
  108977. // "httpMethod": "GET",
  108978. // "id": "compute.targetHttpProxies.list",
  108979. // "parameterOrder": [
  108980. // "project"
  108981. // ],
  108982. // "parameters": {
  108983. // "filter": {
  108984. // "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).",
  108985. // "location": "query",
  108986. // "type": "string"
  108987. // },
  108988. // "maxResults": {
  108989. // "default": "500",
  108990. // "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)",
  108991. // "format": "uint32",
  108992. // "location": "query",
  108993. // "minimum": "0",
  108994. // "type": "integer"
  108995. // },
  108996. // "orderBy": {
  108997. // "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.",
  108998. // "location": "query",
  108999. // "type": "string"
  109000. // },
  109001. // "pageToken": {
  109002. // "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.",
  109003. // "location": "query",
  109004. // "type": "string"
  109005. // },
  109006. // "project": {
  109007. // "description": "Project ID for this request.",
  109008. // "location": "path",
  109009. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  109010. // "required": true,
  109011. // "type": "string"
  109012. // }
  109013. // },
  109014. // "path": "{project}/global/targetHttpProxies",
  109015. // "response": {
  109016. // "$ref": "TargetHttpProxyList"
  109017. // },
  109018. // "scopes": [
  109019. // "https://www.googleapis.com/auth/cloud-platform",
  109020. // "https://www.googleapis.com/auth/compute",
  109021. // "https://www.googleapis.com/auth/compute.readonly"
  109022. // ]
  109023. // }
  109024. }
  109025. // Pages invokes f for each page of results.
  109026. // A non-nil error returned from f will halt the iteration.
  109027. // The provided context supersedes any context provided to the Context method.
  109028. func (c *TargetHttpProxiesListCall) Pages(ctx context.Context, f func(*TargetHttpProxyList) error) error {
  109029. c.ctx_ = ctx
  109030. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  109031. for {
  109032. x, err := c.Do()
  109033. if err != nil {
  109034. return err
  109035. }
  109036. if err := f(x); err != nil {
  109037. return err
  109038. }
  109039. if x.NextPageToken == "" {
  109040. return nil
  109041. }
  109042. c.PageToken(x.NextPageToken)
  109043. }
  109044. }
  109045. // method id "compute.targetHttpProxies.setUrlMap":
  109046. type TargetHttpProxiesSetUrlMapCall struct {
  109047. s *Service
  109048. project string
  109049. targetHttpProxy string
  109050. urlmapreference *UrlMapReference
  109051. urlParams_ gensupport.URLParams
  109052. ctx_ context.Context
  109053. header_ http.Header
  109054. }
  109055. // SetUrlMap: Changes the URL map for TargetHttpProxy.
  109056. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/setUrlMap
  109057. func (r *TargetHttpProxiesService) SetUrlMap(project string, targetHttpProxy string, urlmapreference *UrlMapReference) *TargetHttpProxiesSetUrlMapCall {
  109058. c := &TargetHttpProxiesSetUrlMapCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  109059. c.project = project
  109060. c.targetHttpProxy = targetHttpProxy
  109061. c.urlmapreference = urlmapreference
  109062. return c
  109063. }
  109064. // RequestId sets the optional parameter "requestId": An optional
  109065. // request ID to identify requests. Specify a unique request ID so that
  109066. // if you must retry your request, the server will know to ignore the
  109067. // request if it has already been completed.
  109068. //
  109069. // For example, consider a situation where you make an initial request
  109070. // and the request times out. If you make the request again with the
  109071. // same request ID, the server can check if original operation with the
  109072. // same request ID was received, and if so, will ignore the second
  109073. // request. This prevents clients from accidentally creating duplicate
  109074. // commitments.
  109075. //
  109076. // The request ID must be a valid UUID with the exception that zero UUID
  109077. // is not supported (00000000-0000-0000-0000-000000000000).
  109078. func (c *TargetHttpProxiesSetUrlMapCall) RequestId(requestId string) *TargetHttpProxiesSetUrlMapCall {
  109079. c.urlParams_.Set("requestId", requestId)
  109080. return c
  109081. }
  109082. // Fields allows partial responses to be retrieved. See
  109083. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  109084. // for more information.
  109085. func (c *TargetHttpProxiesSetUrlMapCall) Fields(s ...googleapi.Field) *TargetHttpProxiesSetUrlMapCall {
  109086. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  109087. return c
  109088. }
  109089. // Context sets the context to be used in this call's Do method. Any
  109090. // pending HTTP request will be aborted if the provided context is
  109091. // canceled.
  109092. func (c *TargetHttpProxiesSetUrlMapCall) Context(ctx context.Context) *TargetHttpProxiesSetUrlMapCall {
  109093. c.ctx_ = ctx
  109094. return c
  109095. }
  109096. // Header returns an http.Header that can be modified by the caller to
  109097. // add HTTP headers to the request.
  109098. func (c *TargetHttpProxiesSetUrlMapCall) Header() http.Header {
  109099. if c.header_ == nil {
  109100. c.header_ = make(http.Header)
  109101. }
  109102. return c.header_
  109103. }
  109104. func (c *TargetHttpProxiesSetUrlMapCall) doRequest(alt string) (*http.Response, error) {
  109105. reqHeaders := make(http.Header)
  109106. for k, v := range c.header_ {
  109107. reqHeaders[k] = v
  109108. }
  109109. reqHeaders.Set("User-Agent", c.s.userAgent())
  109110. var body io.Reader = nil
  109111. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapreference)
  109112. if err != nil {
  109113. return nil, err
  109114. }
  109115. reqHeaders.Set("Content-Type", "application/json")
  109116. c.urlParams_.Set("alt", alt)
  109117. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/targetHttpProxies/{targetHttpProxy}/setUrlMap")
  109118. urls += "?" + c.urlParams_.Encode()
  109119. req, _ := http.NewRequest("POST", urls, body)
  109120. req.Header = reqHeaders
  109121. googleapi.Expand(req.URL, map[string]string{
  109122. "project": c.project,
  109123. "targetHttpProxy": c.targetHttpProxy,
  109124. })
  109125. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  109126. }
  109127. // Do executes the "compute.targetHttpProxies.setUrlMap" call.
  109128. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  109129. // status code is an error. Response headers are in either
  109130. // *Operation.ServerResponse.Header or (if a response was returned at
  109131. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  109132. // to check whether the returned error was because
  109133. // http.StatusNotModified was returned.
  109134. func (c *TargetHttpProxiesSetUrlMapCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  109135. gensupport.SetOptions(c.urlParams_, opts...)
  109136. res, err := c.doRequest("json")
  109137. if res != nil && res.StatusCode == http.StatusNotModified {
  109138. if res.Body != nil {
  109139. res.Body.Close()
  109140. }
  109141. return nil, &googleapi.Error{
  109142. Code: res.StatusCode,
  109143. Header: res.Header,
  109144. }
  109145. }
  109146. if err != nil {
  109147. return nil, err
  109148. }
  109149. defer googleapi.CloseBody(res)
  109150. if err := googleapi.CheckResponse(res); err != nil {
  109151. return nil, err
  109152. }
  109153. ret := &Operation{
  109154. ServerResponse: googleapi.ServerResponse{
  109155. Header: res.Header,
  109156. HTTPStatusCode: res.StatusCode,
  109157. },
  109158. }
  109159. target := &ret
  109160. if err := gensupport.DecodeResponse(target, res); err != nil {
  109161. return nil, err
  109162. }
  109163. return ret, nil
  109164. // {
  109165. // "description": "Changes the URL map for TargetHttpProxy.",
  109166. // "httpMethod": "POST",
  109167. // "id": "compute.targetHttpProxies.setUrlMap",
  109168. // "parameterOrder": [
  109169. // "project",
  109170. // "targetHttpProxy"
  109171. // ],
  109172. // "parameters": {
  109173. // "project": {
  109174. // "description": "Project ID for this request.",
  109175. // "location": "path",
  109176. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  109177. // "required": true,
  109178. // "type": "string"
  109179. // },
  109180. // "requestId": {
  109181. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  109182. // "location": "query",
  109183. // "type": "string"
  109184. // },
  109185. // "targetHttpProxy": {
  109186. // "description": "Name of the TargetHttpProxy to set a URL map for.",
  109187. // "location": "path",
  109188. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  109189. // "required": true,
  109190. // "type": "string"
  109191. // }
  109192. // },
  109193. // "path": "{project}/targetHttpProxies/{targetHttpProxy}/setUrlMap",
  109194. // "request": {
  109195. // "$ref": "UrlMapReference"
  109196. // },
  109197. // "response": {
  109198. // "$ref": "Operation"
  109199. // },
  109200. // "scopes": [
  109201. // "https://www.googleapis.com/auth/cloud-platform",
  109202. // "https://www.googleapis.com/auth/compute"
  109203. // ]
  109204. // }
  109205. }
  109206. // method id "compute.targetHttpProxies.testIamPermissions":
  109207. type TargetHttpProxiesTestIamPermissionsCall struct {
  109208. s *Service
  109209. project string
  109210. resource string
  109211. testpermissionsrequest *TestPermissionsRequest
  109212. urlParams_ gensupport.URLParams
  109213. ctx_ context.Context
  109214. header_ http.Header
  109215. }
  109216. // TestIamPermissions: Returns permissions that a caller has on the
  109217. // specified resource.
  109218. func (r *TargetHttpProxiesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *TargetHttpProxiesTestIamPermissionsCall {
  109219. c := &TargetHttpProxiesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  109220. c.project = project
  109221. c.resource = resource
  109222. c.testpermissionsrequest = testpermissionsrequest
  109223. return c
  109224. }
  109225. // Fields allows partial responses to be retrieved. See
  109226. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  109227. // for more information.
  109228. func (c *TargetHttpProxiesTestIamPermissionsCall) Fields(s ...googleapi.Field) *TargetHttpProxiesTestIamPermissionsCall {
  109229. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  109230. return c
  109231. }
  109232. // Context sets the context to be used in this call's Do method. Any
  109233. // pending HTTP request will be aborted if the provided context is
  109234. // canceled.
  109235. func (c *TargetHttpProxiesTestIamPermissionsCall) Context(ctx context.Context) *TargetHttpProxiesTestIamPermissionsCall {
  109236. c.ctx_ = ctx
  109237. return c
  109238. }
  109239. // Header returns an http.Header that can be modified by the caller to
  109240. // add HTTP headers to the request.
  109241. func (c *TargetHttpProxiesTestIamPermissionsCall) Header() http.Header {
  109242. if c.header_ == nil {
  109243. c.header_ = make(http.Header)
  109244. }
  109245. return c.header_
  109246. }
  109247. func (c *TargetHttpProxiesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  109248. reqHeaders := make(http.Header)
  109249. for k, v := range c.header_ {
  109250. reqHeaders[k] = v
  109251. }
  109252. reqHeaders.Set("User-Agent", c.s.userAgent())
  109253. var body io.Reader = nil
  109254. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  109255. if err != nil {
  109256. return nil, err
  109257. }
  109258. reqHeaders.Set("Content-Type", "application/json")
  109259. c.urlParams_.Set("alt", alt)
  109260. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies/{resource}/testIamPermissions")
  109261. urls += "?" + c.urlParams_.Encode()
  109262. req, _ := http.NewRequest("POST", urls, body)
  109263. req.Header = reqHeaders
  109264. googleapi.Expand(req.URL, map[string]string{
  109265. "project": c.project,
  109266. "resource": c.resource,
  109267. })
  109268. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  109269. }
  109270. // Do executes the "compute.targetHttpProxies.testIamPermissions" call.
  109271. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  109272. // non-2xx status code is an error. Response headers are in either
  109273. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  109274. // returned at all) in error.(*googleapi.Error).Header. Use
  109275. // googleapi.IsNotModified to check whether the returned error was
  109276. // because http.StatusNotModified was returned.
  109277. func (c *TargetHttpProxiesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  109278. gensupport.SetOptions(c.urlParams_, opts...)
  109279. res, err := c.doRequest("json")
  109280. if res != nil && res.StatusCode == http.StatusNotModified {
  109281. if res.Body != nil {
  109282. res.Body.Close()
  109283. }
  109284. return nil, &googleapi.Error{
  109285. Code: res.StatusCode,
  109286. Header: res.Header,
  109287. }
  109288. }
  109289. if err != nil {
  109290. return nil, err
  109291. }
  109292. defer googleapi.CloseBody(res)
  109293. if err := googleapi.CheckResponse(res); err != nil {
  109294. return nil, err
  109295. }
  109296. ret := &TestPermissionsResponse{
  109297. ServerResponse: googleapi.ServerResponse{
  109298. Header: res.Header,
  109299. HTTPStatusCode: res.StatusCode,
  109300. },
  109301. }
  109302. target := &ret
  109303. if err := gensupport.DecodeResponse(target, res); err != nil {
  109304. return nil, err
  109305. }
  109306. return ret, nil
  109307. // {
  109308. // "description": "Returns permissions that a caller has on the specified resource.",
  109309. // "httpMethod": "POST",
  109310. // "id": "compute.targetHttpProxies.testIamPermissions",
  109311. // "parameterOrder": [
  109312. // "project",
  109313. // "resource"
  109314. // ],
  109315. // "parameters": {
  109316. // "project": {
  109317. // "description": "Project ID for this request.",
  109318. // "location": "path",
  109319. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  109320. // "required": true,
  109321. // "type": "string"
  109322. // },
  109323. // "resource": {
  109324. // "description": "Name of the resource for this request.",
  109325. // "location": "path",
  109326. // "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?",
  109327. // "required": true,
  109328. // "type": "string"
  109329. // }
  109330. // },
  109331. // "path": "{project}/global/targetHttpProxies/{resource}/testIamPermissions",
  109332. // "request": {
  109333. // "$ref": "TestPermissionsRequest"
  109334. // },
  109335. // "response": {
  109336. // "$ref": "TestPermissionsResponse"
  109337. // },
  109338. // "scopes": [
  109339. // "https://www.googleapis.com/auth/cloud-platform",
  109340. // "https://www.googleapis.com/auth/compute",
  109341. // "https://www.googleapis.com/auth/compute.readonly"
  109342. // ]
  109343. // }
  109344. }
  109345. // method id "compute.targetHttpsProxies.delete":
  109346. type TargetHttpsProxiesDeleteCall struct {
  109347. s *Service
  109348. project string
  109349. targetHttpsProxy string
  109350. urlParams_ gensupport.URLParams
  109351. ctx_ context.Context
  109352. header_ http.Header
  109353. }
  109354. // Delete: Deletes the specified TargetHttpsProxy resource.
  109355. func (r *TargetHttpsProxiesService) Delete(project string, targetHttpsProxy string) *TargetHttpsProxiesDeleteCall {
  109356. c := &TargetHttpsProxiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  109357. c.project = project
  109358. c.targetHttpsProxy = targetHttpsProxy
  109359. return c
  109360. }
  109361. // RequestId sets the optional parameter "requestId": An optional
  109362. // request ID to identify requests. Specify a unique request ID so that
  109363. // if you must retry your request, the server will know to ignore the
  109364. // request if it has already been completed.
  109365. //
  109366. // For example, consider a situation where you make an initial request
  109367. // and the request times out. If you make the request again with the
  109368. // same request ID, the server can check if original operation with the
  109369. // same request ID was received, and if so, will ignore the second
  109370. // request. This prevents clients from accidentally creating duplicate
  109371. // commitments.
  109372. //
  109373. // The request ID must be a valid UUID with the exception that zero UUID
  109374. // is not supported (00000000-0000-0000-0000-000000000000).
  109375. func (c *TargetHttpsProxiesDeleteCall) RequestId(requestId string) *TargetHttpsProxiesDeleteCall {
  109376. c.urlParams_.Set("requestId", requestId)
  109377. return c
  109378. }
  109379. // Fields allows partial responses to be retrieved. See
  109380. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  109381. // for more information.
  109382. func (c *TargetHttpsProxiesDeleteCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesDeleteCall {
  109383. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  109384. return c
  109385. }
  109386. // Context sets the context to be used in this call's Do method. Any
  109387. // pending HTTP request will be aborted if the provided context is
  109388. // canceled.
  109389. func (c *TargetHttpsProxiesDeleteCall) Context(ctx context.Context) *TargetHttpsProxiesDeleteCall {
  109390. c.ctx_ = ctx
  109391. return c
  109392. }
  109393. // Header returns an http.Header that can be modified by the caller to
  109394. // add HTTP headers to the request.
  109395. func (c *TargetHttpsProxiesDeleteCall) Header() http.Header {
  109396. if c.header_ == nil {
  109397. c.header_ = make(http.Header)
  109398. }
  109399. return c.header_
  109400. }
  109401. func (c *TargetHttpsProxiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  109402. reqHeaders := make(http.Header)
  109403. for k, v := range c.header_ {
  109404. reqHeaders[k] = v
  109405. }
  109406. reqHeaders.Set("User-Agent", c.s.userAgent())
  109407. var body io.Reader = nil
  109408. c.urlParams_.Set("alt", alt)
  109409. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies/{targetHttpsProxy}")
  109410. urls += "?" + c.urlParams_.Encode()
  109411. req, _ := http.NewRequest("DELETE", urls, body)
  109412. req.Header = reqHeaders
  109413. googleapi.Expand(req.URL, map[string]string{
  109414. "project": c.project,
  109415. "targetHttpsProxy": c.targetHttpsProxy,
  109416. })
  109417. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  109418. }
  109419. // Do executes the "compute.targetHttpsProxies.delete" call.
  109420. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  109421. // status code is an error. Response headers are in either
  109422. // *Operation.ServerResponse.Header or (if a response was returned at
  109423. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  109424. // to check whether the returned error was because
  109425. // http.StatusNotModified was returned.
  109426. func (c *TargetHttpsProxiesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  109427. gensupport.SetOptions(c.urlParams_, opts...)
  109428. res, err := c.doRequest("json")
  109429. if res != nil && res.StatusCode == http.StatusNotModified {
  109430. if res.Body != nil {
  109431. res.Body.Close()
  109432. }
  109433. return nil, &googleapi.Error{
  109434. Code: res.StatusCode,
  109435. Header: res.Header,
  109436. }
  109437. }
  109438. if err != nil {
  109439. return nil, err
  109440. }
  109441. defer googleapi.CloseBody(res)
  109442. if err := googleapi.CheckResponse(res); err != nil {
  109443. return nil, err
  109444. }
  109445. ret := &Operation{
  109446. ServerResponse: googleapi.ServerResponse{
  109447. Header: res.Header,
  109448. HTTPStatusCode: res.StatusCode,
  109449. },
  109450. }
  109451. target := &ret
  109452. if err := gensupport.DecodeResponse(target, res); err != nil {
  109453. return nil, err
  109454. }
  109455. return ret, nil
  109456. // {
  109457. // "description": "Deletes the specified TargetHttpsProxy resource.",
  109458. // "httpMethod": "DELETE",
  109459. // "id": "compute.targetHttpsProxies.delete",
  109460. // "parameterOrder": [
  109461. // "project",
  109462. // "targetHttpsProxy"
  109463. // ],
  109464. // "parameters": {
  109465. // "project": {
  109466. // "description": "Project ID for this request.",
  109467. // "location": "path",
  109468. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  109469. // "required": true,
  109470. // "type": "string"
  109471. // },
  109472. // "requestId": {
  109473. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  109474. // "location": "query",
  109475. // "type": "string"
  109476. // },
  109477. // "targetHttpsProxy": {
  109478. // "description": "Name of the TargetHttpsProxy resource to delete.",
  109479. // "location": "path",
  109480. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  109481. // "required": true,
  109482. // "type": "string"
  109483. // }
  109484. // },
  109485. // "path": "{project}/global/targetHttpsProxies/{targetHttpsProxy}",
  109486. // "response": {
  109487. // "$ref": "Operation"
  109488. // },
  109489. // "scopes": [
  109490. // "https://www.googleapis.com/auth/cloud-platform",
  109491. // "https://www.googleapis.com/auth/compute"
  109492. // ]
  109493. // }
  109494. }
  109495. // method id "compute.targetHttpsProxies.get":
  109496. type TargetHttpsProxiesGetCall struct {
  109497. s *Service
  109498. project string
  109499. targetHttpsProxy string
  109500. urlParams_ gensupport.URLParams
  109501. ifNoneMatch_ string
  109502. ctx_ context.Context
  109503. header_ http.Header
  109504. }
  109505. // Get: Returns the specified TargetHttpsProxy resource. Gets a list of
  109506. // available target HTTPS proxies by making a list() request.
  109507. func (r *TargetHttpsProxiesService) Get(project string, targetHttpsProxy string) *TargetHttpsProxiesGetCall {
  109508. c := &TargetHttpsProxiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  109509. c.project = project
  109510. c.targetHttpsProxy = targetHttpsProxy
  109511. return c
  109512. }
  109513. // Fields allows partial responses to be retrieved. See
  109514. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  109515. // for more information.
  109516. func (c *TargetHttpsProxiesGetCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesGetCall {
  109517. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  109518. return c
  109519. }
  109520. // IfNoneMatch sets the optional parameter which makes the operation
  109521. // fail if the object's ETag matches the given value. This is useful for
  109522. // getting updates only after the object has changed since the last
  109523. // request. Use googleapi.IsNotModified to check whether the response
  109524. // error from Do is the result of In-None-Match.
  109525. func (c *TargetHttpsProxiesGetCall) IfNoneMatch(entityTag string) *TargetHttpsProxiesGetCall {
  109526. c.ifNoneMatch_ = entityTag
  109527. return c
  109528. }
  109529. // Context sets the context to be used in this call's Do method. Any
  109530. // pending HTTP request will be aborted if the provided context is
  109531. // canceled.
  109532. func (c *TargetHttpsProxiesGetCall) Context(ctx context.Context) *TargetHttpsProxiesGetCall {
  109533. c.ctx_ = ctx
  109534. return c
  109535. }
  109536. // Header returns an http.Header that can be modified by the caller to
  109537. // add HTTP headers to the request.
  109538. func (c *TargetHttpsProxiesGetCall) Header() http.Header {
  109539. if c.header_ == nil {
  109540. c.header_ = make(http.Header)
  109541. }
  109542. return c.header_
  109543. }
  109544. func (c *TargetHttpsProxiesGetCall) doRequest(alt string) (*http.Response, error) {
  109545. reqHeaders := make(http.Header)
  109546. for k, v := range c.header_ {
  109547. reqHeaders[k] = v
  109548. }
  109549. reqHeaders.Set("User-Agent", c.s.userAgent())
  109550. if c.ifNoneMatch_ != "" {
  109551. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  109552. }
  109553. var body io.Reader = nil
  109554. c.urlParams_.Set("alt", alt)
  109555. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies/{targetHttpsProxy}")
  109556. urls += "?" + c.urlParams_.Encode()
  109557. req, _ := http.NewRequest("GET", urls, body)
  109558. req.Header = reqHeaders
  109559. googleapi.Expand(req.URL, map[string]string{
  109560. "project": c.project,
  109561. "targetHttpsProxy": c.targetHttpsProxy,
  109562. })
  109563. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  109564. }
  109565. // Do executes the "compute.targetHttpsProxies.get" call.
  109566. // Exactly one of *TargetHttpsProxy or error will be non-nil. Any
  109567. // non-2xx status code is an error. Response headers are in either
  109568. // *TargetHttpsProxy.ServerResponse.Header or (if a response was
  109569. // returned at all) in error.(*googleapi.Error).Header. Use
  109570. // googleapi.IsNotModified to check whether the returned error was
  109571. // because http.StatusNotModified was returned.
  109572. func (c *TargetHttpsProxiesGetCall) Do(opts ...googleapi.CallOption) (*TargetHttpsProxy, error) {
  109573. gensupport.SetOptions(c.urlParams_, opts...)
  109574. res, err := c.doRequest("json")
  109575. if res != nil && res.StatusCode == http.StatusNotModified {
  109576. if res.Body != nil {
  109577. res.Body.Close()
  109578. }
  109579. return nil, &googleapi.Error{
  109580. Code: res.StatusCode,
  109581. Header: res.Header,
  109582. }
  109583. }
  109584. if err != nil {
  109585. return nil, err
  109586. }
  109587. defer googleapi.CloseBody(res)
  109588. if err := googleapi.CheckResponse(res); err != nil {
  109589. return nil, err
  109590. }
  109591. ret := &TargetHttpsProxy{
  109592. ServerResponse: googleapi.ServerResponse{
  109593. Header: res.Header,
  109594. HTTPStatusCode: res.StatusCode,
  109595. },
  109596. }
  109597. target := &ret
  109598. if err := gensupport.DecodeResponse(target, res); err != nil {
  109599. return nil, err
  109600. }
  109601. return ret, nil
  109602. // {
  109603. // "description": "Returns the specified TargetHttpsProxy resource. Gets a list of available target HTTPS proxies by making a list() request.",
  109604. // "httpMethod": "GET",
  109605. // "id": "compute.targetHttpsProxies.get",
  109606. // "parameterOrder": [
  109607. // "project",
  109608. // "targetHttpsProxy"
  109609. // ],
  109610. // "parameters": {
  109611. // "project": {
  109612. // "description": "Project ID for this request.",
  109613. // "location": "path",
  109614. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  109615. // "required": true,
  109616. // "type": "string"
  109617. // },
  109618. // "targetHttpsProxy": {
  109619. // "description": "Name of the TargetHttpsProxy resource to return.",
  109620. // "location": "path",
  109621. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  109622. // "required": true,
  109623. // "type": "string"
  109624. // }
  109625. // },
  109626. // "path": "{project}/global/targetHttpsProxies/{targetHttpsProxy}",
  109627. // "response": {
  109628. // "$ref": "TargetHttpsProxy"
  109629. // },
  109630. // "scopes": [
  109631. // "https://www.googleapis.com/auth/cloud-platform",
  109632. // "https://www.googleapis.com/auth/compute",
  109633. // "https://www.googleapis.com/auth/compute.readonly"
  109634. // ]
  109635. // }
  109636. }
  109637. // method id "compute.targetHttpsProxies.insert":
  109638. type TargetHttpsProxiesInsertCall struct {
  109639. s *Service
  109640. project string
  109641. targethttpsproxy *TargetHttpsProxy
  109642. urlParams_ gensupport.URLParams
  109643. ctx_ context.Context
  109644. header_ http.Header
  109645. }
  109646. // Insert: Creates a TargetHttpsProxy resource in the specified project
  109647. // using the data included in the request.
  109648. func (r *TargetHttpsProxiesService) Insert(project string, targethttpsproxy *TargetHttpsProxy) *TargetHttpsProxiesInsertCall {
  109649. c := &TargetHttpsProxiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  109650. c.project = project
  109651. c.targethttpsproxy = targethttpsproxy
  109652. return c
  109653. }
  109654. // RequestId sets the optional parameter "requestId": An optional
  109655. // request ID to identify requests. Specify a unique request ID so that
  109656. // if you must retry your request, the server will know to ignore the
  109657. // request if it has already been completed.
  109658. //
  109659. // For example, consider a situation where you make an initial request
  109660. // and the request times out. If you make the request again with the
  109661. // same request ID, the server can check if original operation with the
  109662. // same request ID was received, and if so, will ignore the second
  109663. // request. This prevents clients from accidentally creating duplicate
  109664. // commitments.
  109665. //
  109666. // The request ID must be a valid UUID with the exception that zero UUID
  109667. // is not supported (00000000-0000-0000-0000-000000000000).
  109668. func (c *TargetHttpsProxiesInsertCall) RequestId(requestId string) *TargetHttpsProxiesInsertCall {
  109669. c.urlParams_.Set("requestId", requestId)
  109670. return c
  109671. }
  109672. // Fields allows partial responses to be retrieved. See
  109673. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  109674. // for more information.
  109675. func (c *TargetHttpsProxiesInsertCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesInsertCall {
  109676. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  109677. return c
  109678. }
  109679. // Context sets the context to be used in this call's Do method. Any
  109680. // pending HTTP request will be aborted if the provided context is
  109681. // canceled.
  109682. func (c *TargetHttpsProxiesInsertCall) Context(ctx context.Context) *TargetHttpsProxiesInsertCall {
  109683. c.ctx_ = ctx
  109684. return c
  109685. }
  109686. // Header returns an http.Header that can be modified by the caller to
  109687. // add HTTP headers to the request.
  109688. func (c *TargetHttpsProxiesInsertCall) Header() http.Header {
  109689. if c.header_ == nil {
  109690. c.header_ = make(http.Header)
  109691. }
  109692. return c.header_
  109693. }
  109694. func (c *TargetHttpsProxiesInsertCall) doRequest(alt string) (*http.Response, error) {
  109695. reqHeaders := make(http.Header)
  109696. for k, v := range c.header_ {
  109697. reqHeaders[k] = v
  109698. }
  109699. reqHeaders.Set("User-Agent", c.s.userAgent())
  109700. var body io.Reader = nil
  109701. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxy)
  109702. if err != nil {
  109703. return nil, err
  109704. }
  109705. reqHeaders.Set("Content-Type", "application/json")
  109706. c.urlParams_.Set("alt", alt)
  109707. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies")
  109708. urls += "?" + c.urlParams_.Encode()
  109709. req, _ := http.NewRequest("POST", urls, body)
  109710. req.Header = reqHeaders
  109711. googleapi.Expand(req.URL, map[string]string{
  109712. "project": c.project,
  109713. })
  109714. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  109715. }
  109716. // Do executes the "compute.targetHttpsProxies.insert" call.
  109717. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  109718. // status code is an error. Response headers are in either
  109719. // *Operation.ServerResponse.Header or (if a response was returned at
  109720. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  109721. // to check whether the returned error was because
  109722. // http.StatusNotModified was returned.
  109723. func (c *TargetHttpsProxiesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  109724. gensupport.SetOptions(c.urlParams_, opts...)
  109725. res, err := c.doRequest("json")
  109726. if res != nil && res.StatusCode == http.StatusNotModified {
  109727. if res.Body != nil {
  109728. res.Body.Close()
  109729. }
  109730. return nil, &googleapi.Error{
  109731. Code: res.StatusCode,
  109732. Header: res.Header,
  109733. }
  109734. }
  109735. if err != nil {
  109736. return nil, err
  109737. }
  109738. defer googleapi.CloseBody(res)
  109739. if err := googleapi.CheckResponse(res); err != nil {
  109740. return nil, err
  109741. }
  109742. ret := &Operation{
  109743. ServerResponse: googleapi.ServerResponse{
  109744. Header: res.Header,
  109745. HTTPStatusCode: res.StatusCode,
  109746. },
  109747. }
  109748. target := &ret
  109749. if err := gensupport.DecodeResponse(target, res); err != nil {
  109750. return nil, err
  109751. }
  109752. return ret, nil
  109753. // {
  109754. // "description": "Creates a TargetHttpsProxy resource in the specified project using the data included in the request.",
  109755. // "httpMethod": "POST",
  109756. // "id": "compute.targetHttpsProxies.insert",
  109757. // "parameterOrder": [
  109758. // "project"
  109759. // ],
  109760. // "parameters": {
  109761. // "project": {
  109762. // "description": "Project ID for this request.",
  109763. // "location": "path",
  109764. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  109765. // "required": true,
  109766. // "type": "string"
  109767. // },
  109768. // "requestId": {
  109769. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  109770. // "location": "query",
  109771. // "type": "string"
  109772. // }
  109773. // },
  109774. // "path": "{project}/global/targetHttpsProxies",
  109775. // "request": {
  109776. // "$ref": "TargetHttpsProxy"
  109777. // },
  109778. // "response": {
  109779. // "$ref": "Operation"
  109780. // },
  109781. // "scopes": [
  109782. // "https://www.googleapis.com/auth/cloud-platform",
  109783. // "https://www.googleapis.com/auth/compute"
  109784. // ]
  109785. // }
  109786. }
  109787. // method id "compute.targetHttpsProxies.list":
  109788. type TargetHttpsProxiesListCall struct {
  109789. s *Service
  109790. project string
  109791. urlParams_ gensupport.URLParams
  109792. ifNoneMatch_ string
  109793. ctx_ context.Context
  109794. header_ http.Header
  109795. }
  109796. // List: Retrieves the list of TargetHttpsProxy resources available to
  109797. // the specified project.
  109798. func (r *TargetHttpsProxiesService) List(project string) *TargetHttpsProxiesListCall {
  109799. c := &TargetHttpsProxiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  109800. c.project = project
  109801. return c
  109802. }
  109803. // Filter sets the optional parameter "filter": A filter expression that
  109804. // filters resources listed in the response. The expression must specify
  109805. // the field name, a comparison operator, and the value that you want to
  109806. // use for filtering. The value must be a string, a number, or a
  109807. // boolean. The comparison operator must be either =, !=, >, or <.
  109808. //
  109809. // For example, if you are filtering Compute Engine instances, you can
  109810. // exclude instances named example-instance by specifying name !=
  109811. // example-instance.
  109812. //
  109813. // You can also filter nested fields. For example, you could specify
  109814. // scheduling.automaticRestart = false to include instances only if they
  109815. // are not scheduled for automatic restarts. You can use filtering on
  109816. // nested fields to filter based on resource labels.
  109817. //
  109818. // To filter on multiple expressions, provide each separate expression
  109819. // within parentheses. For example, (scheduling.automaticRestart = true)
  109820. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  109821. // AND expression. However, you can include AND and OR expressions
  109822. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  109823. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  109824. // true).
  109825. func (c *TargetHttpsProxiesListCall) Filter(filter string) *TargetHttpsProxiesListCall {
  109826. c.urlParams_.Set("filter", filter)
  109827. return c
  109828. }
  109829. // MaxResults sets the optional parameter "maxResults": The maximum
  109830. // number of results per page that should be returned. If the number of
  109831. // available results is larger than maxResults, Compute Engine returns a
  109832. // nextPageToken that can be used to get the next page of results in
  109833. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  109834. // (Default: 500)
  109835. func (c *TargetHttpsProxiesListCall) MaxResults(maxResults int64) *TargetHttpsProxiesListCall {
  109836. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  109837. return c
  109838. }
  109839. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  109840. // a certain order. By default, results are returned in alphanumerical
  109841. // order based on the resource name.
  109842. //
  109843. // You can also sort results in descending order based on the creation
  109844. // timestamp using orderBy="creationTimestamp desc". This sorts results
  109845. // based on the creationTimestamp field in reverse chronological order
  109846. // (newest result first). Use this to sort resources like operations so
  109847. // that the newest operation is returned first.
  109848. //
  109849. // Currently, only sorting by name or creationTimestamp desc is
  109850. // supported.
  109851. func (c *TargetHttpsProxiesListCall) OrderBy(orderBy string) *TargetHttpsProxiesListCall {
  109852. c.urlParams_.Set("orderBy", orderBy)
  109853. return c
  109854. }
  109855. // PageToken sets the optional parameter "pageToken": Specifies a page
  109856. // token to use. Set pageToken to the nextPageToken returned by a
  109857. // previous list request to get the next page of results.
  109858. func (c *TargetHttpsProxiesListCall) PageToken(pageToken string) *TargetHttpsProxiesListCall {
  109859. c.urlParams_.Set("pageToken", pageToken)
  109860. return c
  109861. }
  109862. // Fields allows partial responses to be retrieved. See
  109863. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  109864. // for more information.
  109865. func (c *TargetHttpsProxiesListCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesListCall {
  109866. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  109867. return c
  109868. }
  109869. // IfNoneMatch sets the optional parameter which makes the operation
  109870. // fail if the object's ETag matches the given value. This is useful for
  109871. // getting updates only after the object has changed since the last
  109872. // request. Use googleapi.IsNotModified to check whether the response
  109873. // error from Do is the result of In-None-Match.
  109874. func (c *TargetHttpsProxiesListCall) IfNoneMatch(entityTag string) *TargetHttpsProxiesListCall {
  109875. c.ifNoneMatch_ = entityTag
  109876. return c
  109877. }
  109878. // Context sets the context to be used in this call's Do method. Any
  109879. // pending HTTP request will be aborted if the provided context is
  109880. // canceled.
  109881. func (c *TargetHttpsProxiesListCall) Context(ctx context.Context) *TargetHttpsProxiesListCall {
  109882. c.ctx_ = ctx
  109883. return c
  109884. }
  109885. // Header returns an http.Header that can be modified by the caller to
  109886. // add HTTP headers to the request.
  109887. func (c *TargetHttpsProxiesListCall) Header() http.Header {
  109888. if c.header_ == nil {
  109889. c.header_ = make(http.Header)
  109890. }
  109891. return c.header_
  109892. }
  109893. func (c *TargetHttpsProxiesListCall) doRequest(alt string) (*http.Response, error) {
  109894. reqHeaders := make(http.Header)
  109895. for k, v := range c.header_ {
  109896. reqHeaders[k] = v
  109897. }
  109898. reqHeaders.Set("User-Agent", c.s.userAgent())
  109899. if c.ifNoneMatch_ != "" {
  109900. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  109901. }
  109902. var body io.Reader = nil
  109903. c.urlParams_.Set("alt", alt)
  109904. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies")
  109905. urls += "?" + c.urlParams_.Encode()
  109906. req, _ := http.NewRequest("GET", urls, body)
  109907. req.Header = reqHeaders
  109908. googleapi.Expand(req.URL, map[string]string{
  109909. "project": c.project,
  109910. })
  109911. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  109912. }
  109913. // Do executes the "compute.targetHttpsProxies.list" call.
  109914. // Exactly one of *TargetHttpsProxyList or error will be non-nil. Any
  109915. // non-2xx status code is an error. Response headers are in either
  109916. // *TargetHttpsProxyList.ServerResponse.Header or (if a response was
  109917. // returned at all) in error.(*googleapi.Error).Header. Use
  109918. // googleapi.IsNotModified to check whether the returned error was
  109919. // because http.StatusNotModified was returned.
  109920. func (c *TargetHttpsProxiesListCall) Do(opts ...googleapi.CallOption) (*TargetHttpsProxyList, error) {
  109921. gensupport.SetOptions(c.urlParams_, opts...)
  109922. res, err := c.doRequest("json")
  109923. if res != nil && res.StatusCode == http.StatusNotModified {
  109924. if res.Body != nil {
  109925. res.Body.Close()
  109926. }
  109927. return nil, &googleapi.Error{
  109928. Code: res.StatusCode,
  109929. Header: res.Header,
  109930. }
  109931. }
  109932. if err != nil {
  109933. return nil, err
  109934. }
  109935. defer googleapi.CloseBody(res)
  109936. if err := googleapi.CheckResponse(res); err != nil {
  109937. return nil, err
  109938. }
  109939. ret := &TargetHttpsProxyList{
  109940. ServerResponse: googleapi.ServerResponse{
  109941. Header: res.Header,
  109942. HTTPStatusCode: res.StatusCode,
  109943. },
  109944. }
  109945. target := &ret
  109946. if err := gensupport.DecodeResponse(target, res); err != nil {
  109947. return nil, err
  109948. }
  109949. return ret, nil
  109950. // {
  109951. // "description": "Retrieves the list of TargetHttpsProxy resources available to the specified project.",
  109952. // "httpMethod": "GET",
  109953. // "id": "compute.targetHttpsProxies.list",
  109954. // "parameterOrder": [
  109955. // "project"
  109956. // ],
  109957. // "parameters": {
  109958. // "filter": {
  109959. // "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).",
  109960. // "location": "query",
  109961. // "type": "string"
  109962. // },
  109963. // "maxResults": {
  109964. // "default": "500",
  109965. // "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)",
  109966. // "format": "uint32",
  109967. // "location": "query",
  109968. // "minimum": "0",
  109969. // "type": "integer"
  109970. // },
  109971. // "orderBy": {
  109972. // "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.",
  109973. // "location": "query",
  109974. // "type": "string"
  109975. // },
  109976. // "pageToken": {
  109977. // "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.",
  109978. // "location": "query",
  109979. // "type": "string"
  109980. // },
  109981. // "project": {
  109982. // "description": "Project ID for this request.",
  109983. // "location": "path",
  109984. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  109985. // "required": true,
  109986. // "type": "string"
  109987. // }
  109988. // },
  109989. // "path": "{project}/global/targetHttpsProxies",
  109990. // "response": {
  109991. // "$ref": "TargetHttpsProxyList"
  109992. // },
  109993. // "scopes": [
  109994. // "https://www.googleapis.com/auth/cloud-platform",
  109995. // "https://www.googleapis.com/auth/compute",
  109996. // "https://www.googleapis.com/auth/compute.readonly"
  109997. // ]
  109998. // }
  109999. }
  110000. // Pages invokes f for each page of results.
  110001. // A non-nil error returned from f will halt the iteration.
  110002. // The provided context supersedes any context provided to the Context method.
  110003. func (c *TargetHttpsProxiesListCall) Pages(ctx context.Context, f func(*TargetHttpsProxyList) error) error {
  110004. c.ctx_ = ctx
  110005. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  110006. for {
  110007. x, err := c.Do()
  110008. if err != nil {
  110009. return err
  110010. }
  110011. if err := f(x); err != nil {
  110012. return err
  110013. }
  110014. if x.NextPageToken == "" {
  110015. return nil
  110016. }
  110017. c.PageToken(x.NextPageToken)
  110018. }
  110019. }
  110020. // method id "compute.targetHttpsProxies.setQuicOverride":
  110021. type TargetHttpsProxiesSetQuicOverrideCall struct {
  110022. s *Service
  110023. project string
  110024. targetHttpsProxy string
  110025. targethttpsproxiessetquicoverriderequest *TargetHttpsProxiesSetQuicOverrideRequest
  110026. urlParams_ gensupport.URLParams
  110027. ctx_ context.Context
  110028. header_ http.Header
  110029. }
  110030. // SetQuicOverride: Sets the QUIC override policy for TargetHttpsProxy.
  110031. func (r *TargetHttpsProxiesService) SetQuicOverride(project string, targetHttpsProxy string, targethttpsproxiessetquicoverriderequest *TargetHttpsProxiesSetQuicOverrideRequest) *TargetHttpsProxiesSetQuicOverrideCall {
  110032. c := &TargetHttpsProxiesSetQuicOverrideCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  110033. c.project = project
  110034. c.targetHttpsProxy = targetHttpsProxy
  110035. c.targethttpsproxiessetquicoverriderequest = targethttpsproxiessetquicoverriderequest
  110036. return c
  110037. }
  110038. // RequestId sets the optional parameter "requestId": An optional
  110039. // request ID to identify requests. Specify a unique request ID so that
  110040. // if you must retry your request, the server will know to ignore the
  110041. // request if it has already been completed.
  110042. //
  110043. // For example, consider a situation where you make an initial request
  110044. // and the request times out. If you make the request again with the
  110045. // same request ID, the server can check if original operation with the
  110046. // same request ID was received, and if so, will ignore the second
  110047. // request. This prevents clients from accidentally creating duplicate
  110048. // commitments.
  110049. //
  110050. // The request ID must be a valid UUID with the exception that zero UUID
  110051. // is not supported (00000000-0000-0000-0000-000000000000).
  110052. func (c *TargetHttpsProxiesSetQuicOverrideCall) RequestId(requestId string) *TargetHttpsProxiesSetQuicOverrideCall {
  110053. c.urlParams_.Set("requestId", requestId)
  110054. return c
  110055. }
  110056. // Fields allows partial responses to be retrieved. See
  110057. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  110058. // for more information.
  110059. func (c *TargetHttpsProxiesSetQuicOverrideCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesSetQuicOverrideCall {
  110060. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  110061. return c
  110062. }
  110063. // Context sets the context to be used in this call's Do method. Any
  110064. // pending HTTP request will be aborted if the provided context is
  110065. // canceled.
  110066. func (c *TargetHttpsProxiesSetQuicOverrideCall) Context(ctx context.Context) *TargetHttpsProxiesSetQuicOverrideCall {
  110067. c.ctx_ = ctx
  110068. return c
  110069. }
  110070. // Header returns an http.Header that can be modified by the caller to
  110071. // add HTTP headers to the request.
  110072. func (c *TargetHttpsProxiesSetQuicOverrideCall) Header() http.Header {
  110073. if c.header_ == nil {
  110074. c.header_ = make(http.Header)
  110075. }
  110076. return c.header_
  110077. }
  110078. func (c *TargetHttpsProxiesSetQuicOverrideCall) doRequest(alt string) (*http.Response, error) {
  110079. reqHeaders := make(http.Header)
  110080. for k, v := range c.header_ {
  110081. reqHeaders[k] = v
  110082. }
  110083. reqHeaders.Set("User-Agent", c.s.userAgent())
  110084. var body io.Reader = nil
  110085. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxiessetquicoverriderequest)
  110086. if err != nil {
  110087. return nil, err
  110088. }
  110089. reqHeaders.Set("Content-Type", "application/json")
  110090. c.urlParams_.Set("alt", alt)
  110091. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies/{targetHttpsProxy}/setQuicOverride")
  110092. urls += "?" + c.urlParams_.Encode()
  110093. req, _ := http.NewRequest("POST", urls, body)
  110094. req.Header = reqHeaders
  110095. googleapi.Expand(req.URL, map[string]string{
  110096. "project": c.project,
  110097. "targetHttpsProxy": c.targetHttpsProxy,
  110098. })
  110099. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  110100. }
  110101. // Do executes the "compute.targetHttpsProxies.setQuicOverride" call.
  110102. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  110103. // status code is an error. Response headers are in either
  110104. // *Operation.ServerResponse.Header or (if a response was returned at
  110105. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  110106. // to check whether the returned error was because
  110107. // http.StatusNotModified was returned.
  110108. func (c *TargetHttpsProxiesSetQuicOverrideCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  110109. gensupport.SetOptions(c.urlParams_, opts...)
  110110. res, err := c.doRequest("json")
  110111. if res != nil && res.StatusCode == http.StatusNotModified {
  110112. if res.Body != nil {
  110113. res.Body.Close()
  110114. }
  110115. return nil, &googleapi.Error{
  110116. Code: res.StatusCode,
  110117. Header: res.Header,
  110118. }
  110119. }
  110120. if err != nil {
  110121. return nil, err
  110122. }
  110123. defer googleapi.CloseBody(res)
  110124. if err := googleapi.CheckResponse(res); err != nil {
  110125. return nil, err
  110126. }
  110127. ret := &Operation{
  110128. ServerResponse: googleapi.ServerResponse{
  110129. Header: res.Header,
  110130. HTTPStatusCode: res.StatusCode,
  110131. },
  110132. }
  110133. target := &ret
  110134. if err := gensupport.DecodeResponse(target, res); err != nil {
  110135. return nil, err
  110136. }
  110137. return ret, nil
  110138. // {
  110139. // "description": "Sets the QUIC override policy for TargetHttpsProxy.",
  110140. // "httpMethod": "POST",
  110141. // "id": "compute.targetHttpsProxies.setQuicOverride",
  110142. // "parameterOrder": [
  110143. // "project",
  110144. // "targetHttpsProxy"
  110145. // ],
  110146. // "parameters": {
  110147. // "project": {
  110148. // "description": "Project ID for this request.",
  110149. // "location": "path",
  110150. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  110151. // "required": true,
  110152. // "type": "string"
  110153. // },
  110154. // "requestId": {
  110155. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  110156. // "location": "query",
  110157. // "type": "string"
  110158. // },
  110159. // "targetHttpsProxy": {
  110160. // "description": "Name of the TargetHttpsProxy resource to set the QUIC override policy for. The name should conform to RFC1035.",
  110161. // "location": "path",
  110162. // "required": true,
  110163. // "type": "string"
  110164. // }
  110165. // },
  110166. // "path": "{project}/global/targetHttpsProxies/{targetHttpsProxy}/setQuicOverride",
  110167. // "request": {
  110168. // "$ref": "TargetHttpsProxiesSetQuicOverrideRequest"
  110169. // },
  110170. // "response": {
  110171. // "$ref": "Operation"
  110172. // },
  110173. // "scopes": [
  110174. // "https://www.googleapis.com/auth/cloud-platform",
  110175. // "https://www.googleapis.com/auth/compute"
  110176. // ]
  110177. // }
  110178. }
  110179. // method id "compute.targetHttpsProxies.setSslCertificates":
  110180. type TargetHttpsProxiesSetSslCertificatesCall struct {
  110181. s *Service
  110182. project string
  110183. targetHttpsProxy string
  110184. targethttpsproxiessetsslcertificatesrequest *TargetHttpsProxiesSetSslCertificatesRequest
  110185. urlParams_ gensupport.URLParams
  110186. ctx_ context.Context
  110187. header_ http.Header
  110188. }
  110189. // SetSslCertificates: Replaces SslCertificates for TargetHttpsProxy.
  110190. func (r *TargetHttpsProxiesService) SetSslCertificates(project string, targetHttpsProxy string, targethttpsproxiessetsslcertificatesrequest *TargetHttpsProxiesSetSslCertificatesRequest) *TargetHttpsProxiesSetSslCertificatesCall {
  110191. c := &TargetHttpsProxiesSetSslCertificatesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  110192. c.project = project
  110193. c.targetHttpsProxy = targetHttpsProxy
  110194. c.targethttpsproxiessetsslcertificatesrequest = targethttpsproxiessetsslcertificatesrequest
  110195. return c
  110196. }
  110197. // RequestId sets the optional parameter "requestId": An optional
  110198. // request ID to identify requests. Specify a unique request ID so that
  110199. // if you must retry your request, the server will know to ignore the
  110200. // request if it has already been completed.
  110201. //
  110202. // For example, consider a situation where you make an initial request
  110203. // and the request times out. If you make the request again with the
  110204. // same request ID, the server can check if original operation with the
  110205. // same request ID was received, and if so, will ignore the second
  110206. // request. This prevents clients from accidentally creating duplicate
  110207. // commitments.
  110208. //
  110209. // The request ID must be a valid UUID with the exception that zero UUID
  110210. // is not supported (00000000-0000-0000-0000-000000000000).
  110211. func (c *TargetHttpsProxiesSetSslCertificatesCall) RequestId(requestId string) *TargetHttpsProxiesSetSslCertificatesCall {
  110212. c.urlParams_.Set("requestId", requestId)
  110213. return c
  110214. }
  110215. // Fields allows partial responses to be retrieved. See
  110216. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  110217. // for more information.
  110218. func (c *TargetHttpsProxiesSetSslCertificatesCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesSetSslCertificatesCall {
  110219. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  110220. return c
  110221. }
  110222. // Context sets the context to be used in this call's Do method. Any
  110223. // pending HTTP request will be aborted if the provided context is
  110224. // canceled.
  110225. func (c *TargetHttpsProxiesSetSslCertificatesCall) Context(ctx context.Context) *TargetHttpsProxiesSetSslCertificatesCall {
  110226. c.ctx_ = ctx
  110227. return c
  110228. }
  110229. // Header returns an http.Header that can be modified by the caller to
  110230. // add HTTP headers to the request.
  110231. func (c *TargetHttpsProxiesSetSslCertificatesCall) Header() http.Header {
  110232. if c.header_ == nil {
  110233. c.header_ = make(http.Header)
  110234. }
  110235. return c.header_
  110236. }
  110237. func (c *TargetHttpsProxiesSetSslCertificatesCall) doRequest(alt string) (*http.Response, error) {
  110238. reqHeaders := make(http.Header)
  110239. for k, v := range c.header_ {
  110240. reqHeaders[k] = v
  110241. }
  110242. reqHeaders.Set("User-Agent", c.s.userAgent())
  110243. var body io.Reader = nil
  110244. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxiessetsslcertificatesrequest)
  110245. if err != nil {
  110246. return nil, err
  110247. }
  110248. reqHeaders.Set("Content-Type", "application/json")
  110249. c.urlParams_.Set("alt", alt)
  110250. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/targetHttpsProxies/{targetHttpsProxy}/setSslCertificates")
  110251. urls += "?" + c.urlParams_.Encode()
  110252. req, _ := http.NewRequest("POST", urls, body)
  110253. req.Header = reqHeaders
  110254. googleapi.Expand(req.URL, map[string]string{
  110255. "project": c.project,
  110256. "targetHttpsProxy": c.targetHttpsProxy,
  110257. })
  110258. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  110259. }
  110260. // Do executes the "compute.targetHttpsProxies.setSslCertificates" call.
  110261. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  110262. // status code is an error. Response headers are in either
  110263. // *Operation.ServerResponse.Header or (if a response was returned at
  110264. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  110265. // to check whether the returned error was because
  110266. // http.StatusNotModified was returned.
  110267. func (c *TargetHttpsProxiesSetSslCertificatesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  110268. gensupport.SetOptions(c.urlParams_, opts...)
  110269. res, err := c.doRequest("json")
  110270. if res != nil && res.StatusCode == http.StatusNotModified {
  110271. if res.Body != nil {
  110272. res.Body.Close()
  110273. }
  110274. return nil, &googleapi.Error{
  110275. Code: res.StatusCode,
  110276. Header: res.Header,
  110277. }
  110278. }
  110279. if err != nil {
  110280. return nil, err
  110281. }
  110282. defer googleapi.CloseBody(res)
  110283. if err := googleapi.CheckResponse(res); err != nil {
  110284. return nil, err
  110285. }
  110286. ret := &Operation{
  110287. ServerResponse: googleapi.ServerResponse{
  110288. Header: res.Header,
  110289. HTTPStatusCode: res.StatusCode,
  110290. },
  110291. }
  110292. target := &ret
  110293. if err := gensupport.DecodeResponse(target, res); err != nil {
  110294. return nil, err
  110295. }
  110296. return ret, nil
  110297. // {
  110298. // "description": "Replaces SslCertificates for TargetHttpsProxy.",
  110299. // "httpMethod": "POST",
  110300. // "id": "compute.targetHttpsProxies.setSslCertificates",
  110301. // "parameterOrder": [
  110302. // "project",
  110303. // "targetHttpsProxy"
  110304. // ],
  110305. // "parameters": {
  110306. // "project": {
  110307. // "description": "Project ID for this request.",
  110308. // "location": "path",
  110309. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  110310. // "required": true,
  110311. // "type": "string"
  110312. // },
  110313. // "requestId": {
  110314. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  110315. // "location": "query",
  110316. // "type": "string"
  110317. // },
  110318. // "targetHttpsProxy": {
  110319. // "description": "Name of the TargetHttpsProxy resource to set an SslCertificates resource for.",
  110320. // "location": "path",
  110321. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  110322. // "required": true,
  110323. // "type": "string"
  110324. // }
  110325. // },
  110326. // "path": "{project}/targetHttpsProxies/{targetHttpsProxy}/setSslCertificates",
  110327. // "request": {
  110328. // "$ref": "TargetHttpsProxiesSetSslCertificatesRequest"
  110329. // },
  110330. // "response": {
  110331. // "$ref": "Operation"
  110332. // },
  110333. // "scopes": [
  110334. // "https://www.googleapis.com/auth/cloud-platform",
  110335. // "https://www.googleapis.com/auth/compute"
  110336. // ]
  110337. // }
  110338. }
  110339. // method id "compute.targetHttpsProxies.setSslPolicy":
  110340. type TargetHttpsProxiesSetSslPolicyCall struct {
  110341. s *Service
  110342. project string
  110343. targetHttpsProxy string
  110344. sslpolicyreference *SslPolicyReference
  110345. urlParams_ gensupport.URLParams
  110346. ctx_ context.Context
  110347. header_ http.Header
  110348. }
  110349. // SetSslPolicy: Sets the SSL policy for TargetHttpsProxy. The SSL
  110350. // policy specifies the server-side support for SSL features. This
  110351. // affects connections between clients and the HTTPS proxy load
  110352. // balancer. They do not affect the connection between the load balancer
  110353. // and the backends.
  110354. func (r *TargetHttpsProxiesService) SetSslPolicy(project string, targetHttpsProxy string, sslpolicyreference *SslPolicyReference) *TargetHttpsProxiesSetSslPolicyCall {
  110355. c := &TargetHttpsProxiesSetSslPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  110356. c.project = project
  110357. c.targetHttpsProxy = targetHttpsProxy
  110358. c.sslpolicyreference = sslpolicyreference
  110359. return c
  110360. }
  110361. // RequestId sets the optional parameter "requestId": An optional
  110362. // request ID to identify requests. Specify a unique request ID so that
  110363. // if you must retry your request, the server will know to ignore the
  110364. // request if it has already been completed.
  110365. //
  110366. // For example, consider a situation where you make an initial request
  110367. // and the request times out. If you make the request again with the
  110368. // same request ID, the server can check if original operation with the
  110369. // same request ID was received, and if so, will ignore the second
  110370. // request. This prevents clients from accidentally creating duplicate
  110371. // commitments.
  110372. //
  110373. // The request ID must be a valid UUID with the exception that zero UUID
  110374. // is not supported (00000000-0000-0000-0000-000000000000).
  110375. func (c *TargetHttpsProxiesSetSslPolicyCall) RequestId(requestId string) *TargetHttpsProxiesSetSslPolicyCall {
  110376. c.urlParams_.Set("requestId", requestId)
  110377. return c
  110378. }
  110379. // Fields allows partial responses to be retrieved. See
  110380. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  110381. // for more information.
  110382. func (c *TargetHttpsProxiesSetSslPolicyCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesSetSslPolicyCall {
  110383. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  110384. return c
  110385. }
  110386. // Context sets the context to be used in this call's Do method. Any
  110387. // pending HTTP request will be aborted if the provided context is
  110388. // canceled.
  110389. func (c *TargetHttpsProxiesSetSslPolicyCall) Context(ctx context.Context) *TargetHttpsProxiesSetSslPolicyCall {
  110390. c.ctx_ = ctx
  110391. return c
  110392. }
  110393. // Header returns an http.Header that can be modified by the caller to
  110394. // add HTTP headers to the request.
  110395. func (c *TargetHttpsProxiesSetSslPolicyCall) Header() http.Header {
  110396. if c.header_ == nil {
  110397. c.header_ = make(http.Header)
  110398. }
  110399. return c.header_
  110400. }
  110401. func (c *TargetHttpsProxiesSetSslPolicyCall) doRequest(alt string) (*http.Response, error) {
  110402. reqHeaders := make(http.Header)
  110403. for k, v := range c.header_ {
  110404. reqHeaders[k] = v
  110405. }
  110406. reqHeaders.Set("User-Agent", c.s.userAgent())
  110407. var body io.Reader = nil
  110408. body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslpolicyreference)
  110409. if err != nil {
  110410. return nil, err
  110411. }
  110412. reqHeaders.Set("Content-Type", "application/json")
  110413. c.urlParams_.Set("alt", alt)
  110414. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies/{targetHttpsProxy}/setSslPolicy")
  110415. urls += "?" + c.urlParams_.Encode()
  110416. req, _ := http.NewRequest("POST", urls, body)
  110417. req.Header = reqHeaders
  110418. googleapi.Expand(req.URL, map[string]string{
  110419. "project": c.project,
  110420. "targetHttpsProxy": c.targetHttpsProxy,
  110421. })
  110422. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  110423. }
  110424. // Do executes the "compute.targetHttpsProxies.setSslPolicy" call.
  110425. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  110426. // status code is an error. Response headers are in either
  110427. // *Operation.ServerResponse.Header or (if a response was returned at
  110428. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  110429. // to check whether the returned error was because
  110430. // http.StatusNotModified was returned.
  110431. func (c *TargetHttpsProxiesSetSslPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  110432. gensupport.SetOptions(c.urlParams_, opts...)
  110433. res, err := c.doRequest("json")
  110434. if res != nil && res.StatusCode == http.StatusNotModified {
  110435. if res.Body != nil {
  110436. res.Body.Close()
  110437. }
  110438. return nil, &googleapi.Error{
  110439. Code: res.StatusCode,
  110440. Header: res.Header,
  110441. }
  110442. }
  110443. if err != nil {
  110444. return nil, err
  110445. }
  110446. defer googleapi.CloseBody(res)
  110447. if err := googleapi.CheckResponse(res); err != nil {
  110448. return nil, err
  110449. }
  110450. ret := &Operation{
  110451. ServerResponse: googleapi.ServerResponse{
  110452. Header: res.Header,
  110453. HTTPStatusCode: res.StatusCode,
  110454. },
  110455. }
  110456. target := &ret
  110457. if err := gensupport.DecodeResponse(target, res); err != nil {
  110458. return nil, err
  110459. }
  110460. return ret, nil
  110461. // {
  110462. // "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.",
  110463. // "httpMethod": "POST",
  110464. // "id": "compute.targetHttpsProxies.setSslPolicy",
  110465. // "parameterOrder": [
  110466. // "project",
  110467. // "targetHttpsProxy"
  110468. // ],
  110469. // "parameters": {
  110470. // "project": {
  110471. // "description": "Project ID for this request.",
  110472. // "location": "path",
  110473. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  110474. // "required": true,
  110475. // "type": "string"
  110476. // },
  110477. // "requestId": {
  110478. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  110479. // "location": "query",
  110480. // "type": "string"
  110481. // },
  110482. // "targetHttpsProxy": {
  110483. // "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.",
  110484. // "location": "path",
  110485. // "required": true,
  110486. // "type": "string"
  110487. // }
  110488. // },
  110489. // "path": "{project}/global/targetHttpsProxies/{targetHttpsProxy}/setSslPolicy",
  110490. // "request": {
  110491. // "$ref": "SslPolicyReference"
  110492. // },
  110493. // "response": {
  110494. // "$ref": "Operation"
  110495. // },
  110496. // "scopes": [
  110497. // "https://www.googleapis.com/auth/cloud-platform",
  110498. // "https://www.googleapis.com/auth/compute"
  110499. // ]
  110500. // }
  110501. }
  110502. // method id "compute.targetHttpsProxies.setUrlMap":
  110503. type TargetHttpsProxiesSetUrlMapCall struct {
  110504. s *Service
  110505. project string
  110506. targetHttpsProxy string
  110507. urlmapreference *UrlMapReference
  110508. urlParams_ gensupport.URLParams
  110509. ctx_ context.Context
  110510. header_ http.Header
  110511. }
  110512. // SetUrlMap: Changes the URL map for TargetHttpsProxy.
  110513. func (r *TargetHttpsProxiesService) SetUrlMap(project string, targetHttpsProxy string, urlmapreference *UrlMapReference) *TargetHttpsProxiesSetUrlMapCall {
  110514. c := &TargetHttpsProxiesSetUrlMapCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  110515. c.project = project
  110516. c.targetHttpsProxy = targetHttpsProxy
  110517. c.urlmapreference = urlmapreference
  110518. return c
  110519. }
  110520. // RequestId sets the optional parameter "requestId": An optional
  110521. // request ID to identify requests. Specify a unique request ID so that
  110522. // if you must retry your request, the server will know to ignore the
  110523. // request if it has already been completed.
  110524. //
  110525. // For example, consider a situation where you make an initial request
  110526. // and the request times out. If you make the request again with the
  110527. // same request ID, the server can check if original operation with the
  110528. // same request ID was received, and if so, will ignore the second
  110529. // request. This prevents clients from accidentally creating duplicate
  110530. // commitments.
  110531. //
  110532. // The request ID must be a valid UUID with the exception that zero UUID
  110533. // is not supported (00000000-0000-0000-0000-000000000000).
  110534. func (c *TargetHttpsProxiesSetUrlMapCall) RequestId(requestId string) *TargetHttpsProxiesSetUrlMapCall {
  110535. c.urlParams_.Set("requestId", requestId)
  110536. return c
  110537. }
  110538. // Fields allows partial responses to be retrieved. See
  110539. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  110540. // for more information.
  110541. func (c *TargetHttpsProxiesSetUrlMapCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesSetUrlMapCall {
  110542. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  110543. return c
  110544. }
  110545. // Context sets the context to be used in this call's Do method. Any
  110546. // pending HTTP request will be aborted if the provided context is
  110547. // canceled.
  110548. func (c *TargetHttpsProxiesSetUrlMapCall) Context(ctx context.Context) *TargetHttpsProxiesSetUrlMapCall {
  110549. c.ctx_ = ctx
  110550. return c
  110551. }
  110552. // Header returns an http.Header that can be modified by the caller to
  110553. // add HTTP headers to the request.
  110554. func (c *TargetHttpsProxiesSetUrlMapCall) Header() http.Header {
  110555. if c.header_ == nil {
  110556. c.header_ = make(http.Header)
  110557. }
  110558. return c.header_
  110559. }
  110560. func (c *TargetHttpsProxiesSetUrlMapCall) doRequest(alt string) (*http.Response, error) {
  110561. reqHeaders := make(http.Header)
  110562. for k, v := range c.header_ {
  110563. reqHeaders[k] = v
  110564. }
  110565. reqHeaders.Set("User-Agent", c.s.userAgent())
  110566. var body io.Reader = nil
  110567. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapreference)
  110568. if err != nil {
  110569. return nil, err
  110570. }
  110571. reqHeaders.Set("Content-Type", "application/json")
  110572. c.urlParams_.Set("alt", alt)
  110573. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/targetHttpsProxies/{targetHttpsProxy}/setUrlMap")
  110574. urls += "?" + c.urlParams_.Encode()
  110575. req, _ := http.NewRequest("POST", urls, body)
  110576. req.Header = reqHeaders
  110577. googleapi.Expand(req.URL, map[string]string{
  110578. "project": c.project,
  110579. "targetHttpsProxy": c.targetHttpsProxy,
  110580. })
  110581. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  110582. }
  110583. // Do executes the "compute.targetHttpsProxies.setUrlMap" call.
  110584. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  110585. // status code is an error. Response headers are in either
  110586. // *Operation.ServerResponse.Header or (if a response was returned at
  110587. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  110588. // to check whether the returned error was because
  110589. // http.StatusNotModified was returned.
  110590. func (c *TargetHttpsProxiesSetUrlMapCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  110591. gensupport.SetOptions(c.urlParams_, opts...)
  110592. res, err := c.doRequest("json")
  110593. if res != nil && res.StatusCode == http.StatusNotModified {
  110594. if res.Body != nil {
  110595. res.Body.Close()
  110596. }
  110597. return nil, &googleapi.Error{
  110598. Code: res.StatusCode,
  110599. Header: res.Header,
  110600. }
  110601. }
  110602. if err != nil {
  110603. return nil, err
  110604. }
  110605. defer googleapi.CloseBody(res)
  110606. if err := googleapi.CheckResponse(res); err != nil {
  110607. return nil, err
  110608. }
  110609. ret := &Operation{
  110610. ServerResponse: googleapi.ServerResponse{
  110611. Header: res.Header,
  110612. HTTPStatusCode: res.StatusCode,
  110613. },
  110614. }
  110615. target := &ret
  110616. if err := gensupport.DecodeResponse(target, res); err != nil {
  110617. return nil, err
  110618. }
  110619. return ret, nil
  110620. // {
  110621. // "description": "Changes the URL map for TargetHttpsProxy.",
  110622. // "httpMethod": "POST",
  110623. // "id": "compute.targetHttpsProxies.setUrlMap",
  110624. // "parameterOrder": [
  110625. // "project",
  110626. // "targetHttpsProxy"
  110627. // ],
  110628. // "parameters": {
  110629. // "project": {
  110630. // "description": "Project ID for this request.",
  110631. // "location": "path",
  110632. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  110633. // "required": true,
  110634. // "type": "string"
  110635. // },
  110636. // "requestId": {
  110637. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  110638. // "location": "query",
  110639. // "type": "string"
  110640. // },
  110641. // "targetHttpsProxy": {
  110642. // "description": "Name of the TargetHttpsProxy resource whose URL map is to be set.",
  110643. // "location": "path",
  110644. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  110645. // "required": true,
  110646. // "type": "string"
  110647. // }
  110648. // },
  110649. // "path": "{project}/targetHttpsProxies/{targetHttpsProxy}/setUrlMap",
  110650. // "request": {
  110651. // "$ref": "UrlMapReference"
  110652. // },
  110653. // "response": {
  110654. // "$ref": "Operation"
  110655. // },
  110656. // "scopes": [
  110657. // "https://www.googleapis.com/auth/cloud-platform",
  110658. // "https://www.googleapis.com/auth/compute"
  110659. // ]
  110660. // }
  110661. }
  110662. // method id "compute.targetHttpsProxies.testIamPermissions":
  110663. type TargetHttpsProxiesTestIamPermissionsCall struct {
  110664. s *Service
  110665. project string
  110666. resource string
  110667. testpermissionsrequest *TestPermissionsRequest
  110668. urlParams_ gensupport.URLParams
  110669. ctx_ context.Context
  110670. header_ http.Header
  110671. }
  110672. // TestIamPermissions: Returns permissions that a caller has on the
  110673. // specified resource.
  110674. func (r *TargetHttpsProxiesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *TargetHttpsProxiesTestIamPermissionsCall {
  110675. c := &TargetHttpsProxiesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  110676. c.project = project
  110677. c.resource = resource
  110678. c.testpermissionsrequest = testpermissionsrequest
  110679. return c
  110680. }
  110681. // Fields allows partial responses to be retrieved. See
  110682. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  110683. // for more information.
  110684. func (c *TargetHttpsProxiesTestIamPermissionsCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesTestIamPermissionsCall {
  110685. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  110686. return c
  110687. }
  110688. // Context sets the context to be used in this call's Do method. Any
  110689. // pending HTTP request will be aborted if the provided context is
  110690. // canceled.
  110691. func (c *TargetHttpsProxiesTestIamPermissionsCall) Context(ctx context.Context) *TargetHttpsProxiesTestIamPermissionsCall {
  110692. c.ctx_ = ctx
  110693. return c
  110694. }
  110695. // Header returns an http.Header that can be modified by the caller to
  110696. // add HTTP headers to the request.
  110697. func (c *TargetHttpsProxiesTestIamPermissionsCall) Header() http.Header {
  110698. if c.header_ == nil {
  110699. c.header_ = make(http.Header)
  110700. }
  110701. return c.header_
  110702. }
  110703. func (c *TargetHttpsProxiesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  110704. reqHeaders := make(http.Header)
  110705. for k, v := range c.header_ {
  110706. reqHeaders[k] = v
  110707. }
  110708. reqHeaders.Set("User-Agent", c.s.userAgent())
  110709. var body io.Reader = nil
  110710. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  110711. if err != nil {
  110712. return nil, err
  110713. }
  110714. reqHeaders.Set("Content-Type", "application/json")
  110715. c.urlParams_.Set("alt", alt)
  110716. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies/{resource}/testIamPermissions")
  110717. urls += "?" + c.urlParams_.Encode()
  110718. req, _ := http.NewRequest("POST", urls, body)
  110719. req.Header = reqHeaders
  110720. googleapi.Expand(req.URL, map[string]string{
  110721. "project": c.project,
  110722. "resource": c.resource,
  110723. })
  110724. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  110725. }
  110726. // Do executes the "compute.targetHttpsProxies.testIamPermissions" call.
  110727. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  110728. // non-2xx status code is an error. Response headers are in either
  110729. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  110730. // returned at all) in error.(*googleapi.Error).Header. Use
  110731. // googleapi.IsNotModified to check whether the returned error was
  110732. // because http.StatusNotModified was returned.
  110733. func (c *TargetHttpsProxiesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  110734. gensupport.SetOptions(c.urlParams_, opts...)
  110735. res, err := c.doRequest("json")
  110736. if res != nil && res.StatusCode == http.StatusNotModified {
  110737. if res.Body != nil {
  110738. res.Body.Close()
  110739. }
  110740. return nil, &googleapi.Error{
  110741. Code: res.StatusCode,
  110742. Header: res.Header,
  110743. }
  110744. }
  110745. if err != nil {
  110746. return nil, err
  110747. }
  110748. defer googleapi.CloseBody(res)
  110749. if err := googleapi.CheckResponse(res); err != nil {
  110750. return nil, err
  110751. }
  110752. ret := &TestPermissionsResponse{
  110753. ServerResponse: googleapi.ServerResponse{
  110754. Header: res.Header,
  110755. HTTPStatusCode: res.StatusCode,
  110756. },
  110757. }
  110758. target := &ret
  110759. if err := gensupport.DecodeResponse(target, res); err != nil {
  110760. return nil, err
  110761. }
  110762. return ret, nil
  110763. // {
  110764. // "description": "Returns permissions that a caller has on the specified resource.",
  110765. // "httpMethod": "POST",
  110766. // "id": "compute.targetHttpsProxies.testIamPermissions",
  110767. // "parameterOrder": [
  110768. // "project",
  110769. // "resource"
  110770. // ],
  110771. // "parameters": {
  110772. // "project": {
  110773. // "description": "Project ID for this request.",
  110774. // "location": "path",
  110775. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  110776. // "required": true,
  110777. // "type": "string"
  110778. // },
  110779. // "resource": {
  110780. // "description": "Name of the resource for this request.",
  110781. // "location": "path",
  110782. // "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?",
  110783. // "required": true,
  110784. // "type": "string"
  110785. // }
  110786. // },
  110787. // "path": "{project}/global/targetHttpsProxies/{resource}/testIamPermissions",
  110788. // "request": {
  110789. // "$ref": "TestPermissionsRequest"
  110790. // },
  110791. // "response": {
  110792. // "$ref": "TestPermissionsResponse"
  110793. // },
  110794. // "scopes": [
  110795. // "https://www.googleapis.com/auth/cloud-platform",
  110796. // "https://www.googleapis.com/auth/compute",
  110797. // "https://www.googleapis.com/auth/compute.readonly"
  110798. // ]
  110799. // }
  110800. }
  110801. // method id "compute.targetInstances.aggregatedList":
  110802. type TargetInstancesAggregatedListCall struct {
  110803. s *Service
  110804. project string
  110805. urlParams_ gensupport.URLParams
  110806. ifNoneMatch_ string
  110807. ctx_ context.Context
  110808. header_ http.Header
  110809. }
  110810. // AggregatedList: Retrieves an aggregated list of target instances.
  110811. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/aggregatedList
  110812. func (r *TargetInstancesService) AggregatedList(project string) *TargetInstancesAggregatedListCall {
  110813. c := &TargetInstancesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  110814. c.project = project
  110815. return c
  110816. }
  110817. // Filter sets the optional parameter "filter": A filter expression that
  110818. // filters resources listed in the response. The expression must specify
  110819. // the field name, a comparison operator, and the value that you want to
  110820. // use for filtering. The value must be a string, a number, or a
  110821. // boolean. The comparison operator must be either =, !=, >, or <.
  110822. //
  110823. // For example, if you are filtering Compute Engine instances, you can
  110824. // exclude instances named example-instance by specifying name !=
  110825. // example-instance.
  110826. //
  110827. // You can also filter nested fields. For example, you could specify
  110828. // scheduling.automaticRestart = false to include instances only if they
  110829. // are not scheduled for automatic restarts. You can use filtering on
  110830. // nested fields to filter based on resource labels.
  110831. //
  110832. // To filter on multiple expressions, provide each separate expression
  110833. // within parentheses. For example, (scheduling.automaticRestart = true)
  110834. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  110835. // AND expression. However, you can include AND and OR expressions
  110836. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  110837. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  110838. // true).
  110839. func (c *TargetInstancesAggregatedListCall) Filter(filter string) *TargetInstancesAggregatedListCall {
  110840. c.urlParams_.Set("filter", filter)
  110841. return c
  110842. }
  110843. // MaxResults sets the optional parameter "maxResults": The maximum
  110844. // number of results per page that should be returned. If the number of
  110845. // available results is larger than maxResults, Compute Engine returns a
  110846. // nextPageToken that can be used to get the next page of results in
  110847. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  110848. // (Default: 500)
  110849. func (c *TargetInstancesAggregatedListCall) MaxResults(maxResults int64) *TargetInstancesAggregatedListCall {
  110850. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  110851. return c
  110852. }
  110853. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  110854. // a certain order. By default, results are returned in alphanumerical
  110855. // order based on the resource name.
  110856. //
  110857. // You can also sort results in descending order based on the creation
  110858. // timestamp using orderBy="creationTimestamp desc". This sorts results
  110859. // based on the creationTimestamp field in reverse chronological order
  110860. // (newest result first). Use this to sort resources like operations so
  110861. // that the newest operation is returned first.
  110862. //
  110863. // Currently, only sorting by name or creationTimestamp desc is
  110864. // supported.
  110865. func (c *TargetInstancesAggregatedListCall) OrderBy(orderBy string) *TargetInstancesAggregatedListCall {
  110866. c.urlParams_.Set("orderBy", orderBy)
  110867. return c
  110868. }
  110869. // PageToken sets the optional parameter "pageToken": Specifies a page
  110870. // token to use. Set pageToken to the nextPageToken returned by a
  110871. // previous list request to get the next page of results.
  110872. func (c *TargetInstancesAggregatedListCall) PageToken(pageToken string) *TargetInstancesAggregatedListCall {
  110873. c.urlParams_.Set("pageToken", pageToken)
  110874. return c
  110875. }
  110876. // Fields allows partial responses to be retrieved. See
  110877. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  110878. // for more information.
  110879. func (c *TargetInstancesAggregatedListCall) Fields(s ...googleapi.Field) *TargetInstancesAggregatedListCall {
  110880. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  110881. return c
  110882. }
  110883. // IfNoneMatch sets the optional parameter which makes the operation
  110884. // fail if the object's ETag matches the given value. This is useful for
  110885. // getting updates only after the object has changed since the last
  110886. // request. Use googleapi.IsNotModified to check whether the response
  110887. // error from Do is the result of In-None-Match.
  110888. func (c *TargetInstancesAggregatedListCall) IfNoneMatch(entityTag string) *TargetInstancesAggregatedListCall {
  110889. c.ifNoneMatch_ = entityTag
  110890. return c
  110891. }
  110892. // Context sets the context to be used in this call's Do method. Any
  110893. // pending HTTP request will be aborted if the provided context is
  110894. // canceled.
  110895. func (c *TargetInstancesAggregatedListCall) Context(ctx context.Context) *TargetInstancesAggregatedListCall {
  110896. c.ctx_ = ctx
  110897. return c
  110898. }
  110899. // Header returns an http.Header that can be modified by the caller to
  110900. // add HTTP headers to the request.
  110901. func (c *TargetInstancesAggregatedListCall) Header() http.Header {
  110902. if c.header_ == nil {
  110903. c.header_ = make(http.Header)
  110904. }
  110905. return c.header_
  110906. }
  110907. func (c *TargetInstancesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  110908. reqHeaders := make(http.Header)
  110909. for k, v := range c.header_ {
  110910. reqHeaders[k] = v
  110911. }
  110912. reqHeaders.Set("User-Agent", c.s.userAgent())
  110913. if c.ifNoneMatch_ != "" {
  110914. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  110915. }
  110916. var body io.Reader = nil
  110917. c.urlParams_.Set("alt", alt)
  110918. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/targetInstances")
  110919. urls += "?" + c.urlParams_.Encode()
  110920. req, _ := http.NewRequest("GET", urls, body)
  110921. req.Header = reqHeaders
  110922. googleapi.Expand(req.URL, map[string]string{
  110923. "project": c.project,
  110924. })
  110925. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  110926. }
  110927. // Do executes the "compute.targetInstances.aggregatedList" call.
  110928. // Exactly one of *TargetInstanceAggregatedList or error will be
  110929. // non-nil. Any non-2xx status code is an error. Response headers are in
  110930. // either *TargetInstanceAggregatedList.ServerResponse.Header or (if a
  110931. // response was returned at all) in error.(*googleapi.Error).Header. Use
  110932. // googleapi.IsNotModified to check whether the returned error was
  110933. // because http.StatusNotModified was returned.
  110934. func (c *TargetInstancesAggregatedListCall) Do(opts ...googleapi.CallOption) (*TargetInstanceAggregatedList, error) {
  110935. gensupport.SetOptions(c.urlParams_, opts...)
  110936. res, err := c.doRequest("json")
  110937. if res != nil && res.StatusCode == http.StatusNotModified {
  110938. if res.Body != nil {
  110939. res.Body.Close()
  110940. }
  110941. return nil, &googleapi.Error{
  110942. Code: res.StatusCode,
  110943. Header: res.Header,
  110944. }
  110945. }
  110946. if err != nil {
  110947. return nil, err
  110948. }
  110949. defer googleapi.CloseBody(res)
  110950. if err := googleapi.CheckResponse(res); err != nil {
  110951. return nil, err
  110952. }
  110953. ret := &TargetInstanceAggregatedList{
  110954. ServerResponse: googleapi.ServerResponse{
  110955. Header: res.Header,
  110956. HTTPStatusCode: res.StatusCode,
  110957. },
  110958. }
  110959. target := &ret
  110960. if err := gensupport.DecodeResponse(target, res); err != nil {
  110961. return nil, err
  110962. }
  110963. return ret, nil
  110964. // {
  110965. // "description": "Retrieves an aggregated list of target instances.",
  110966. // "httpMethod": "GET",
  110967. // "id": "compute.targetInstances.aggregatedList",
  110968. // "parameterOrder": [
  110969. // "project"
  110970. // ],
  110971. // "parameters": {
  110972. // "filter": {
  110973. // "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).",
  110974. // "location": "query",
  110975. // "type": "string"
  110976. // },
  110977. // "maxResults": {
  110978. // "default": "500",
  110979. // "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)",
  110980. // "format": "uint32",
  110981. // "location": "query",
  110982. // "minimum": "0",
  110983. // "type": "integer"
  110984. // },
  110985. // "orderBy": {
  110986. // "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.",
  110987. // "location": "query",
  110988. // "type": "string"
  110989. // },
  110990. // "pageToken": {
  110991. // "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.",
  110992. // "location": "query",
  110993. // "type": "string"
  110994. // },
  110995. // "project": {
  110996. // "description": "Project ID for this request.",
  110997. // "location": "path",
  110998. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  110999. // "required": true,
  111000. // "type": "string"
  111001. // }
  111002. // },
  111003. // "path": "{project}/aggregated/targetInstances",
  111004. // "response": {
  111005. // "$ref": "TargetInstanceAggregatedList"
  111006. // },
  111007. // "scopes": [
  111008. // "https://www.googleapis.com/auth/cloud-platform",
  111009. // "https://www.googleapis.com/auth/compute",
  111010. // "https://www.googleapis.com/auth/compute.readonly"
  111011. // ]
  111012. // }
  111013. }
  111014. // Pages invokes f for each page of results.
  111015. // A non-nil error returned from f will halt the iteration.
  111016. // The provided context supersedes any context provided to the Context method.
  111017. func (c *TargetInstancesAggregatedListCall) Pages(ctx context.Context, f func(*TargetInstanceAggregatedList) error) error {
  111018. c.ctx_ = ctx
  111019. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  111020. for {
  111021. x, err := c.Do()
  111022. if err != nil {
  111023. return err
  111024. }
  111025. if err := f(x); err != nil {
  111026. return err
  111027. }
  111028. if x.NextPageToken == "" {
  111029. return nil
  111030. }
  111031. c.PageToken(x.NextPageToken)
  111032. }
  111033. }
  111034. // method id "compute.targetInstances.delete":
  111035. type TargetInstancesDeleteCall struct {
  111036. s *Service
  111037. project string
  111038. zone string
  111039. targetInstance string
  111040. urlParams_ gensupport.URLParams
  111041. ctx_ context.Context
  111042. header_ http.Header
  111043. }
  111044. // Delete: Deletes the specified TargetInstance resource.
  111045. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/delete
  111046. func (r *TargetInstancesService) Delete(project string, zone string, targetInstance string) *TargetInstancesDeleteCall {
  111047. c := &TargetInstancesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  111048. c.project = project
  111049. c.zone = zone
  111050. c.targetInstance = targetInstance
  111051. return c
  111052. }
  111053. // RequestId sets the optional parameter "requestId": An optional
  111054. // request ID to identify requests. Specify a unique request ID so that
  111055. // if you must retry your request, the server will know to ignore the
  111056. // request if it has already been completed.
  111057. //
  111058. // For example, consider a situation where you make an initial request
  111059. // and the request times out. If you make the request again with the
  111060. // same request ID, the server can check if original operation with the
  111061. // same request ID was received, and if so, will ignore the second
  111062. // request. This prevents clients from accidentally creating duplicate
  111063. // commitments.
  111064. //
  111065. // The request ID must be a valid UUID with the exception that zero UUID
  111066. // is not supported (00000000-0000-0000-0000-000000000000).
  111067. func (c *TargetInstancesDeleteCall) RequestId(requestId string) *TargetInstancesDeleteCall {
  111068. c.urlParams_.Set("requestId", requestId)
  111069. return c
  111070. }
  111071. // Fields allows partial responses to be retrieved. See
  111072. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  111073. // for more information.
  111074. func (c *TargetInstancesDeleteCall) Fields(s ...googleapi.Field) *TargetInstancesDeleteCall {
  111075. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  111076. return c
  111077. }
  111078. // Context sets the context to be used in this call's Do method. Any
  111079. // pending HTTP request will be aborted if the provided context is
  111080. // canceled.
  111081. func (c *TargetInstancesDeleteCall) Context(ctx context.Context) *TargetInstancesDeleteCall {
  111082. c.ctx_ = ctx
  111083. return c
  111084. }
  111085. // Header returns an http.Header that can be modified by the caller to
  111086. // add HTTP headers to the request.
  111087. func (c *TargetInstancesDeleteCall) Header() http.Header {
  111088. if c.header_ == nil {
  111089. c.header_ = make(http.Header)
  111090. }
  111091. return c.header_
  111092. }
  111093. func (c *TargetInstancesDeleteCall) doRequest(alt string) (*http.Response, error) {
  111094. reqHeaders := make(http.Header)
  111095. for k, v := range c.header_ {
  111096. reqHeaders[k] = v
  111097. }
  111098. reqHeaders.Set("User-Agent", c.s.userAgent())
  111099. var body io.Reader = nil
  111100. c.urlParams_.Set("alt", alt)
  111101. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances/{targetInstance}")
  111102. urls += "?" + c.urlParams_.Encode()
  111103. req, _ := http.NewRequest("DELETE", urls, body)
  111104. req.Header = reqHeaders
  111105. googleapi.Expand(req.URL, map[string]string{
  111106. "project": c.project,
  111107. "zone": c.zone,
  111108. "targetInstance": c.targetInstance,
  111109. })
  111110. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  111111. }
  111112. // Do executes the "compute.targetInstances.delete" call.
  111113. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  111114. // status code is an error. Response headers are in either
  111115. // *Operation.ServerResponse.Header or (if a response was returned at
  111116. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  111117. // to check whether the returned error was because
  111118. // http.StatusNotModified was returned.
  111119. func (c *TargetInstancesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  111120. gensupport.SetOptions(c.urlParams_, opts...)
  111121. res, err := c.doRequest("json")
  111122. if res != nil && res.StatusCode == http.StatusNotModified {
  111123. if res.Body != nil {
  111124. res.Body.Close()
  111125. }
  111126. return nil, &googleapi.Error{
  111127. Code: res.StatusCode,
  111128. Header: res.Header,
  111129. }
  111130. }
  111131. if err != nil {
  111132. return nil, err
  111133. }
  111134. defer googleapi.CloseBody(res)
  111135. if err := googleapi.CheckResponse(res); err != nil {
  111136. return nil, err
  111137. }
  111138. ret := &Operation{
  111139. ServerResponse: googleapi.ServerResponse{
  111140. Header: res.Header,
  111141. HTTPStatusCode: res.StatusCode,
  111142. },
  111143. }
  111144. target := &ret
  111145. if err := gensupport.DecodeResponse(target, res); err != nil {
  111146. return nil, err
  111147. }
  111148. return ret, nil
  111149. // {
  111150. // "description": "Deletes the specified TargetInstance resource.",
  111151. // "httpMethod": "DELETE",
  111152. // "id": "compute.targetInstances.delete",
  111153. // "parameterOrder": [
  111154. // "project",
  111155. // "zone",
  111156. // "targetInstance"
  111157. // ],
  111158. // "parameters": {
  111159. // "project": {
  111160. // "description": "Project ID for this request.",
  111161. // "location": "path",
  111162. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  111163. // "required": true,
  111164. // "type": "string"
  111165. // },
  111166. // "requestId": {
  111167. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  111168. // "location": "query",
  111169. // "type": "string"
  111170. // },
  111171. // "targetInstance": {
  111172. // "description": "Name of the TargetInstance resource to delete.",
  111173. // "location": "path",
  111174. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  111175. // "required": true,
  111176. // "type": "string"
  111177. // },
  111178. // "zone": {
  111179. // "description": "Name of the zone scoping this request.",
  111180. // "location": "path",
  111181. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  111182. // "required": true,
  111183. // "type": "string"
  111184. // }
  111185. // },
  111186. // "path": "{project}/zones/{zone}/targetInstances/{targetInstance}",
  111187. // "response": {
  111188. // "$ref": "Operation"
  111189. // },
  111190. // "scopes": [
  111191. // "https://www.googleapis.com/auth/cloud-platform",
  111192. // "https://www.googleapis.com/auth/compute"
  111193. // ]
  111194. // }
  111195. }
  111196. // method id "compute.targetInstances.get":
  111197. type TargetInstancesGetCall struct {
  111198. s *Service
  111199. project string
  111200. zone string
  111201. targetInstance string
  111202. urlParams_ gensupport.URLParams
  111203. ifNoneMatch_ string
  111204. ctx_ context.Context
  111205. header_ http.Header
  111206. }
  111207. // Get: Returns the specified TargetInstance resource. Gets a list of
  111208. // available target instances by making a list() request.
  111209. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/get
  111210. func (r *TargetInstancesService) Get(project string, zone string, targetInstance string) *TargetInstancesGetCall {
  111211. c := &TargetInstancesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  111212. c.project = project
  111213. c.zone = zone
  111214. c.targetInstance = targetInstance
  111215. return c
  111216. }
  111217. // Fields allows partial responses to be retrieved. See
  111218. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  111219. // for more information.
  111220. func (c *TargetInstancesGetCall) Fields(s ...googleapi.Field) *TargetInstancesGetCall {
  111221. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  111222. return c
  111223. }
  111224. // IfNoneMatch sets the optional parameter which makes the operation
  111225. // fail if the object's ETag matches the given value. This is useful for
  111226. // getting updates only after the object has changed since the last
  111227. // request. Use googleapi.IsNotModified to check whether the response
  111228. // error from Do is the result of In-None-Match.
  111229. func (c *TargetInstancesGetCall) IfNoneMatch(entityTag string) *TargetInstancesGetCall {
  111230. c.ifNoneMatch_ = entityTag
  111231. return c
  111232. }
  111233. // Context sets the context to be used in this call's Do method. Any
  111234. // pending HTTP request will be aborted if the provided context is
  111235. // canceled.
  111236. func (c *TargetInstancesGetCall) Context(ctx context.Context) *TargetInstancesGetCall {
  111237. c.ctx_ = ctx
  111238. return c
  111239. }
  111240. // Header returns an http.Header that can be modified by the caller to
  111241. // add HTTP headers to the request.
  111242. func (c *TargetInstancesGetCall) Header() http.Header {
  111243. if c.header_ == nil {
  111244. c.header_ = make(http.Header)
  111245. }
  111246. return c.header_
  111247. }
  111248. func (c *TargetInstancesGetCall) doRequest(alt string) (*http.Response, error) {
  111249. reqHeaders := make(http.Header)
  111250. for k, v := range c.header_ {
  111251. reqHeaders[k] = v
  111252. }
  111253. reqHeaders.Set("User-Agent", c.s.userAgent())
  111254. if c.ifNoneMatch_ != "" {
  111255. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  111256. }
  111257. var body io.Reader = nil
  111258. c.urlParams_.Set("alt", alt)
  111259. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances/{targetInstance}")
  111260. urls += "?" + c.urlParams_.Encode()
  111261. req, _ := http.NewRequest("GET", urls, body)
  111262. req.Header = reqHeaders
  111263. googleapi.Expand(req.URL, map[string]string{
  111264. "project": c.project,
  111265. "zone": c.zone,
  111266. "targetInstance": c.targetInstance,
  111267. })
  111268. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  111269. }
  111270. // Do executes the "compute.targetInstances.get" call.
  111271. // Exactly one of *TargetInstance or error will be non-nil. Any non-2xx
  111272. // status code is an error. Response headers are in either
  111273. // *TargetInstance.ServerResponse.Header or (if a response was returned
  111274. // at all) in error.(*googleapi.Error).Header. Use
  111275. // googleapi.IsNotModified to check whether the returned error was
  111276. // because http.StatusNotModified was returned.
  111277. func (c *TargetInstancesGetCall) Do(opts ...googleapi.CallOption) (*TargetInstance, error) {
  111278. gensupport.SetOptions(c.urlParams_, opts...)
  111279. res, err := c.doRequest("json")
  111280. if res != nil && res.StatusCode == http.StatusNotModified {
  111281. if res.Body != nil {
  111282. res.Body.Close()
  111283. }
  111284. return nil, &googleapi.Error{
  111285. Code: res.StatusCode,
  111286. Header: res.Header,
  111287. }
  111288. }
  111289. if err != nil {
  111290. return nil, err
  111291. }
  111292. defer googleapi.CloseBody(res)
  111293. if err := googleapi.CheckResponse(res); err != nil {
  111294. return nil, err
  111295. }
  111296. ret := &TargetInstance{
  111297. ServerResponse: googleapi.ServerResponse{
  111298. Header: res.Header,
  111299. HTTPStatusCode: res.StatusCode,
  111300. },
  111301. }
  111302. target := &ret
  111303. if err := gensupport.DecodeResponse(target, res); err != nil {
  111304. return nil, err
  111305. }
  111306. return ret, nil
  111307. // {
  111308. // "description": "Returns the specified TargetInstance resource. Gets a list of available target instances by making a list() request.",
  111309. // "httpMethod": "GET",
  111310. // "id": "compute.targetInstances.get",
  111311. // "parameterOrder": [
  111312. // "project",
  111313. // "zone",
  111314. // "targetInstance"
  111315. // ],
  111316. // "parameters": {
  111317. // "project": {
  111318. // "description": "Project ID for this request.",
  111319. // "location": "path",
  111320. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  111321. // "required": true,
  111322. // "type": "string"
  111323. // },
  111324. // "targetInstance": {
  111325. // "description": "Name of the TargetInstance resource to return.",
  111326. // "location": "path",
  111327. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  111328. // "required": true,
  111329. // "type": "string"
  111330. // },
  111331. // "zone": {
  111332. // "description": "Name of the zone scoping this request.",
  111333. // "location": "path",
  111334. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  111335. // "required": true,
  111336. // "type": "string"
  111337. // }
  111338. // },
  111339. // "path": "{project}/zones/{zone}/targetInstances/{targetInstance}",
  111340. // "response": {
  111341. // "$ref": "TargetInstance"
  111342. // },
  111343. // "scopes": [
  111344. // "https://www.googleapis.com/auth/cloud-platform",
  111345. // "https://www.googleapis.com/auth/compute",
  111346. // "https://www.googleapis.com/auth/compute.readonly"
  111347. // ]
  111348. // }
  111349. }
  111350. // method id "compute.targetInstances.insert":
  111351. type TargetInstancesInsertCall struct {
  111352. s *Service
  111353. project string
  111354. zone string
  111355. targetinstance *TargetInstance
  111356. urlParams_ gensupport.URLParams
  111357. ctx_ context.Context
  111358. header_ http.Header
  111359. }
  111360. // Insert: Creates a TargetInstance resource in the specified project
  111361. // and zone using the data included in the request.
  111362. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/insert
  111363. func (r *TargetInstancesService) Insert(project string, zone string, targetinstance *TargetInstance) *TargetInstancesInsertCall {
  111364. c := &TargetInstancesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  111365. c.project = project
  111366. c.zone = zone
  111367. c.targetinstance = targetinstance
  111368. return c
  111369. }
  111370. // RequestId sets the optional parameter "requestId": An optional
  111371. // request ID to identify requests. Specify a unique request ID so that
  111372. // if you must retry your request, the server will know to ignore the
  111373. // request if it has already been completed.
  111374. //
  111375. // For example, consider a situation where you make an initial request
  111376. // and the request times out. If you make the request again with the
  111377. // same request ID, the server can check if original operation with the
  111378. // same request ID was received, and if so, will ignore the second
  111379. // request. This prevents clients from accidentally creating duplicate
  111380. // commitments.
  111381. //
  111382. // The request ID must be a valid UUID with the exception that zero UUID
  111383. // is not supported (00000000-0000-0000-0000-000000000000).
  111384. func (c *TargetInstancesInsertCall) RequestId(requestId string) *TargetInstancesInsertCall {
  111385. c.urlParams_.Set("requestId", requestId)
  111386. return c
  111387. }
  111388. // Fields allows partial responses to be retrieved. See
  111389. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  111390. // for more information.
  111391. func (c *TargetInstancesInsertCall) Fields(s ...googleapi.Field) *TargetInstancesInsertCall {
  111392. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  111393. return c
  111394. }
  111395. // Context sets the context to be used in this call's Do method. Any
  111396. // pending HTTP request will be aborted if the provided context is
  111397. // canceled.
  111398. func (c *TargetInstancesInsertCall) Context(ctx context.Context) *TargetInstancesInsertCall {
  111399. c.ctx_ = ctx
  111400. return c
  111401. }
  111402. // Header returns an http.Header that can be modified by the caller to
  111403. // add HTTP headers to the request.
  111404. func (c *TargetInstancesInsertCall) Header() http.Header {
  111405. if c.header_ == nil {
  111406. c.header_ = make(http.Header)
  111407. }
  111408. return c.header_
  111409. }
  111410. func (c *TargetInstancesInsertCall) doRequest(alt string) (*http.Response, error) {
  111411. reqHeaders := make(http.Header)
  111412. for k, v := range c.header_ {
  111413. reqHeaders[k] = v
  111414. }
  111415. reqHeaders.Set("User-Agent", c.s.userAgent())
  111416. var body io.Reader = nil
  111417. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetinstance)
  111418. if err != nil {
  111419. return nil, err
  111420. }
  111421. reqHeaders.Set("Content-Type", "application/json")
  111422. c.urlParams_.Set("alt", alt)
  111423. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances")
  111424. urls += "?" + c.urlParams_.Encode()
  111425. req, _ := http.NewRequest("POST", urls, body)
  111426. req.Header = reqHeaders
  111427. googleapi.Expand(req.URL, map[string]string{
  111428. "project": c.project,
  111429. "zone": c.zone,
  111430. })
  111431. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  111432. }
  111433. // Do executes the "compute.targetInstances.insert" call.
  111434. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  111435. // status code is an error. Response headers are in either
  111436. // *Operation.ServerResponse.Header or (if a response was returned at
  111437. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  111438. // to check whether the returned error was because
  111439. // http.StatusNotModified was returned.
  111440. func (c *TargetInstancesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  111441. gensupport.SetOptions(c.urlParams_, opts...)
  111442. res, err := c.doRequest("json")
  111443. if res != nil && res.StatusCode == http.StatusNotModified {
  111444. if res.Body != nil {
  111445. res.Body.Close()
  111446. }
  111447. return nil, &googleapi.Error{
  111448. Code: res.StatusCode,
  111449. Header: res.Header,
  111450. }
  111451. }
  111452. if err != nil {
  111453. return nil, err
  111454. }
  111455. defer googleapi.CloseBody(res)
  111456. if err := googleapi.CheckResponse(res); err != nil {
  111457. return nil, err
  111458. }
  111459. ret := &Operation{
  111460. ServerResponse: googleapi.ServerResponse{
  111461. Header: res.Header,
  111462. HTTPStatusCode: res.StatusCode,
  111463. },
  111464. }
  111465. target := &ret
  111466. if err := gensupport.DecodeResponse(target, res); err != nil {
  111467. return nil, err
  111468. }
  111469. return ret, nil
  111470. // {
  111471. // "description": "Creates a TargetInstance resource in the specified project and zone using the data included in the request.",
  111472. // "httpMethod": "POST",
  111473. // "id": "compute.targetInstances.insert",
  111474. // "parameterOrder": [
  111475. // "project",
  111476. // "zone"
  111477. // ],
  111478. // "parameters": {
  111479. // "project": {
  111480. // "description": "Project ID for this request.",
  111481. // "location": "path",
  111482. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  111483. // "required": true,
  111484. // "type": "string"
  111485. // },
  111486. // "requestId": {
  111487. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  111488. // "location": "query",
  111489. // "type": "string"
  111490. // },
  111491. // "zone": {
  111492. // "description": "Name of the zone scoping this request.",
  111493. // "location": "path",
  111494. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  111495. // "required": true,
  111496. // "type": "string"
  111497. // }
  111498. // },
  111499. // "path": "{project}/zones/{zone}/targetInstances",
  111500. // "request": {
  111501. // "$ref": "TargetInstance"
  111502. // },
  111503. // "response": {
  111504. // "$ref": "Operation"
  111505. // },
  111506. // "scopes": [
  111507. // "https://www.googleapis.com/auth/cloud-platform",
  111508. // "https://www.googleapis.com/auth/compute"
  111509. // ]
  111510. // }
  111511. }
  111512. // method id "compute.targetInstances.list":
  111513. type TargetInstancesListCall struct {
  111514. s *Service
  111515. project string
  111516. zone string
  111517. urlParams_ gensupport.URLParams
  111518. ifNoneMatch_ string
  111519. ctx_ context.Context
  111520. header_ http.Header
  111521. }
  111522. // List: Retrieves a list of TargetInstance resources available to the
  111523. // specified project and zone.
  111524. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/list
  111525. func (r *TargetInstancesService) List(project string, zone string) *TargetInstancesListCall {
  111526. c := &TargetInstancesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  111527. c.project = project
  111528. c.zone = zone
  111529. return c
  111530. }
  111531. // Filter sets the optional parameter "filter": A filter expression that
  111532. // filters resources listed in the response. The expression must specify
  111533. // the field name, a comparison operator, and the value that you want to
  111534. // use for filtering. The value must be a string, a number, or a
  111535. // boolean. The comparison operator must be either =, !=, >, or <.
  111536. //
  111537. // For example, if you are filtering Compute Engine instances, you can
  111538. // exclude instances named example-instance by specifying name !=
  111539. // example-instance.
  111540. //
  111541. // You can also filter nested fields. For example, you could specify
  111542. // scheduling.automaticRestart = false to include instances only if they
  111543. // are not scheduled for automatic restarts. You can use filtering on
  111544. // nested fields to filter based on resource labels.
  111545. //
  111546. // To filter on multiple expressions, provide each separate expression
  111547. // within parentheses. For example, (scheduling.automaticRestart = true)
  111548. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  111549. // AND expression. However, you can include AND and OR expressions
  111550. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  111551. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  111552. // true).
  111553. func (c *TargetInstancesListCall) Filter(filter string) *TargetInstancesListCall {
  111554. c.urlParams_.Set("filter", filter)
  111555. return c
  111556. }
  111557. // MaxResults sets the optional parameter "maxResults": The maximum
  111558. // number of results per page that should be returned. If the number of
  111559. // available results is larger than maxResults, Compute Engine returns a
  111560. // nextPageToken that can be used to get the next page of results in
  111561. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  111562. // (Default: 500)
  111563. func (c *TargetInstancesListCall) MaxResults(maxResults int64) *TargetInstancesListCall {
  111564. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  111565. return c
  111566. }
  111567. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  111568. // a certain order. By default, results are returned in alphanumerical
  111569. // order based on the resource name.
  111570. //
  111571. // You can also sort results in descending order based on the creation
  111572. // timestamp using orderBy="creationTimestamp desc". This sorts results
  111573. // based on the creationTimestamp field in reverse chronological order
  111574. // (newest result first). Use this to sort resources like operations so
  111575. // that the newest operation is returned first.
  111576. //
  111577. // Currently, only sorting by name or creationTimestamp desc is
  111578. // supported.
  111579. func (c *TargetInstancesListCall) OrderBy(orderBy string) *TargetInstancesListCall {
  111580. c.urlParams_.Set("orderBy", orderBy)
  111581. return c
  111582. }
  111583. // PageToken sets the optional parameter "pageToken": Specifies a page
  111584. // token to use. Set pageToken to the nextPageToken returned by a
  111585. // previous list request to get the next page of results.
  111586. func (c *TargetInstancesListCall) PageToken(pageToken string) *TargetInstancesListCall {
  111587. c.urlParams_.Set("pageToken", pageToken)
  111588. return c
  111589. }
  111590. // Fields allows partial responses to be retrieved. See
  111591. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  111592. // for more information.
  111593. func (c *TargetInstancesListCall) Fields(s ...googleapi.Field) *TargetInstancesListCall {
  111594. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  111595. return c
  111596. }
  111597. // IfNoneMatch sets the optional parameter which makes the operation
  111598. // fail if the object's ETag matches the given value. This is useful for
  111599. // getting updates only after the object has changed since the last
  111600. // request. Use googleapi.IsNotModified to check whether the response
  111601. // error from Do is the result of In-None-Match.
  111602. func (c *TargetInstancesListCall) IfNoneMatch(entityTag string) *TargetInstancesListCall {
  111603. c.ifNoneMatch_ = entityTag
  111604. return c
  111605. }
  111606. // Context sets the context to be used in this call's Do method. Any
  111607. // pending HTTP request will be aborted if the provided context is
  111608. // canceled.
  111609. func (c *TargetInstancesListCall) Context(ctx context.Context) *TargetInstancesListCall {
  111610. c.ctx_ = ctx
  111611. return c
  111612. }
  111613. // Header returns an http.Header that can be modified by the caller to
  111614. // add HTTP headers to the request.
  111615. func (c *TargetInstancesListCall) Header() http.Header {
  111616. if c.header_ == nil {
  111617. c.header_ = make(http.Header)
  111618. }
  111619. return c.header_
  111620. }
  111621. func (c *TargetInstancesListCall) doRequest(alt string) (*http.Response, error) {
  111622. reqHeaders := make(http.Header)
  111623. for k, v := range c.header_ {
  111624. reqHeaders[k] = v
  111625. }
  111626. reqHeaders.Set("User-Agent", c.s.userAgent())
  111627. if c.ifNoneMatch_ != "" {
  111628. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  111629. }
  111630. var body io.Reader = nil
  111631. c.urlParams_.Set("alt", alt)
  111632. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances")
  111633. urls += "?" + c.urlParams_.Encode()
  111634. req, _ := http.NewRequest("GET", urls, body)
  111635. req.Header = reqHeaders
  111636. googleapi.Expand(req.URL, map[string]string{
  111637. "project": c.project,
  111638. "zone": c.zone,
  111639. })
  111640. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  111641. }
  111642. // Do executes the "compute.targetInstances.list" call.
  111643. // Exactly one of *TargetInstanceList or error will be non-nil. Any
  111644. // non-2xx status code is an error. Response headers are in either
  111645. // *TargetInstanceList.ServerResponse.Header or (if a response was
  111646. // returned at all) in error.(*googleapi.Error).Header. Use
  111647. // googleapi.IsNotModified to check whether the returned error was
  111648. // because http.StatusNotModified was returned.
  111649. func (c *TargetInstancesListCall) Do(opts ...googleapi.CallOption) (*TargetInstanceList, error) {
  111650. gensupport.SetOptions(c.urlParams_, opts...)
  111651. res, err := c.doRequest("json")
  111652. if res != nil && res.StatusCode == http.StatusNotModified {
  111653. if res.Body != nil {
  111654. res.Body.Close()
  111655. }
  111656. return nil, &googleapi.Error{
  111657. Code: res.StatusCode,
  111658. Header: res.Header,
  111659. }
  111660. }
  111661. if err != nil {
  111662. return nil, err
  111663. }
  111664. defer googleapi.CloseBody(res)
  111665. if err := googleapi.CheckResponse(res); err != nil {
  111666. return nil, err
  111667. }
  111668. ret := &TargetInstanceList{
  111669. ServerResponse: googleapi.ServerResponse{
  111670. Header: res.Header,
  111671. HTTPStatusCode: res.StatusCode,
  111672. },
  111673. }
  111674. target := &ret
  111675. if err := gensupport.DecodeResponse(target, res); err != nil {
  111676. return nil, err
  111677. }
  111678. return ret, nil
  111679. // {
  111680. // "description": "Retrieves a list of TargetInstance resources available to the specified project and zone.",
  111681. // "httpMethod": "GET",
  111682. // "id": "compute.targetInstances.list",
  111683. // "parameterOrder": [
  111684. // "project",
  111685. // "zone"
  111686. // ],
  111687. // "parameters": {
  111688. // "filter": {
  111689. // "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).",
  111690. // "location": "query",
  111691. // "type": "string"
  111692. // },
  111693. // "maxResults": {
  111694. // "default": "500",
  111695. // "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)",
  111696. // "format": "uint32",
  111697. // "location": "query",
  111698. // "minimum": "0",
  111699. // "type": "integer"
  111700. // },
  111701. // "orderBy": {
  111702. // "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.",
  111703. // "location": "query",
  111704. // "type": "string"
  111705. // },
  111706. // "pageToken": {
  111707. // "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.",
  111708. // "location": "query",
  111709. // "type": "string"
  111710. // },
  111711. // "project": {
  111712. // "description": "Project ID for this request.",
  111713. // "location": "path",
  111714. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  111715. // "required": true,
  111716. // "type": "string"
  111717. // },
  111718. // "zone": {
  111719. // "description": "Name of the zone scoping this request.",
  111720. // "location": "path",
  111721. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  111722. // "required": true,
  111723. // "type": "string"
  111724. // }
  111725. // },
  111726. // "path": "{project}/zones/{zone}/targetInstances",
  111727. // "response": {
  111728. // "$ref": "TargetInstanceList"
  111729. // },
  111730. // "scopes": [
  111731. // "https://www.googleapis.com/auth/cloud-platform",
  111732. // "https://www.googleapis.com/auth/compute",
  111733. // "https://www.googleapis.com/auth/compute.readonly"
  111734. // ]
  111735. // }
  111736. }
  111737. // Pages invokes f for each page of results.
  111738. // A non-nil error returned from f will halt the iteration.
  111739. // The provided context supersedes any context provided to the Context method.
  111740. func (c *TargetInstancesListCall) Pages(ctx context.Context, f func(*TargetInstanceList) error) error {
  111741. c.ctx_ = ctx
  111742. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  111743. for {
  111744. x, err := c.Do()
  111745. if err != nil {
  111746. return err
  111747. }
  111748. if err := f(x); err != nil {
  111749. return err
  111750. }
  111751. if x.NextPageToken == "" {
  111752. return nil
  111753. }
  111754. c.PageToken(x.NextPageToken)
  111755. }
  111756. }
  111757. // method id "compute.targetInstances.testIamPermissions":
  111758. type TargetInstancesTestIamPermissionsCall struct {
  111759. s *Service
  111760. project string
  111761. zone string
  111762. resource string
  111763. testpermissionsrequest *TestPermissionsRequest
  111764. urlParams_ gensupport.URLParams
  111765. ctx_ context.Context
  111766. header_ http.Header
  111767. }
  111768. // TestIamPermissions: Returns permissions that a caller has on the
  111769. // specified resource.
  111770. func (r *TargetInstancesService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *TargetInstancesTestIamPermissionsCall {
  111771. c := &TargetInstancesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  111772. c.project = project
  111773. c.zone = zone
  111774. c.resource = resource
  111775. c.testpermissionsrequest = testpermissionsrequest
  111776. return c
  111777. }
  111778. // Fields allows partial responses to be retrieved. See
  111779. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  111780. // for more information.
  111781. func (c *TargetInstancesTestIamPermissionsCall) Fields(s ...googleapi.Field) *TargetInstancesTestIamPermissionsCall {
  111782. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  111783. return c
  111784. }
  111785. // Context sets the context to be used in this call's Do method. Any
  111786. // pending HTTP request will be aborted if the provided context is
  111787. // canceled.
  111788. func (c *TargetInstancesTestIamPermissionsCall) Context(ctx context.Context) *TargetInstancesTestIamPermissionsCall {
  111789. c.ctx_ = ctx
  111790. return c
  111791. }
  111792. // Header returns an http.Header that can be modified by the caller to
  111793. // add HTTP headers to the request.
  111794. func (c *TargetInstancesTestIamPermissionsCall) Header() http.Header {
  111795. if c.header_ == nil {
  111796. c.header_ = make(http.Header)
  111797. }
  111798. return c.header_
  111799. }
  111800. func (c *TargetInstancesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  111801. reqHeaders := make(http.Header)
  111802. for k, v := range c.header_ {
  111803. reqHeaders[k] = v
  111804. }
  111805. reqHeaders.Set("User-Agent", c.s.userAgent())
  111806. var body io.Reader = nil
  111807. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  111808. if err != nil {
  111809. return nil, err
  111810. }
  111811. reqHeaders.Set("Content-Type", "application/json")
  111812. c.urlParams_.Set("alt", alt)
  111813. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances/{resource}/testIamPermissions")
  111814. urls += "?" + c.urlParams_.Encode()
  111815. req, _ := http.NewRequest("POST", urls, body)
  111816. req.Header = reqHeaders
  111817. googleapi.Expand(req.URL, map[string]string{
  111818. "project": c.project,
  111819. "zone": c.zone,
  111820. "resource": c.resource,
  111821. })
  111822. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  111823. }
  111824. // Do executes the "compute.targetInstances.testIamPermissions" call.
  111825. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  111826. // non-2xx status code is an error. Response headers are in either
  111827. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  111828. // returned at all) in error.(*googleapi.Error).Header. Use
  111829. // googleapi.IsNotModified to check whether the returned error was
  111830. // because http.StatusNotModified was returned.
  111831. func (c *TargetInstancesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  111832. gensupport.SetOptions(c.urlParams_, opts...)
  111833. res, err := c.doRequest("json")
  111834. if res != nil && res.StatusCode == http.StatusNotModified {
  111835. if res.Body != nil {
  111836. res.Body.Close()
  111837. }
  111838. return nil, &googleapi.Error{
  111839. Code: res.StatusCode,
  111840. Header: res.Header,
  111841. }
  111842. }
  111843. if err != nil {
  111844. return nil, err
  111845. }
  111846. defer googleapi.CloseBody(res)
  111847. if err := googleapi.CheckResponse(res); err != nil {
  111848. return nil, err
  111849. }
  111850. ret := &TestPermissionsResponse{
  111851. ServerResponse: googleapi.ServerResponse{
  111852. Header: res.Header,
  111853. HTTPStatusCode: res.StatusCode,
  111854. },
  111855. }
  111856. target := &ret
  111857. if err := gensupport.DecodeResponse(target, res); err != nil {
  111858. return nil, err
  111859. }
  111860. return ret, nil
  111861. // {
  111862. // "description": "Returns permissions that a caller has on the specified resource.",
  111863. // "httpMethod": "POST",
  111864. // "id": "compute.targetInstances.testIamPermissions",
  111865. // "parameterOrder": [
  111866. // "project",
  111867. // "zone",
  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 of the resource for this request.",
  111880. // "location": "path",
  111881. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  111882. // "required": true,
  111883. // "type": "string"
  111884. // },
  111885. // "zone": {
  111886. // "description": "The name of the zone for this request.",
  111887. // "location": "path",
  111888. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  111889. // "required": true,
  111890. // "type": "string"
  111891. // }
  111892. // },
  111893. // "path": "{project}/zones/{zone}/targetInstances/{resource}/testIamPermissions",
  111894. // "request": {
  111895. // "$ref": "TestPermissionsRequest"
  111896. // },
  111897. // "response": {
  111898. // "$ref": "TestPermissionsResponse"
  111899. // },
  111900. // "scopes": [
  111901. // "https://www.googleapis.com/auth/cloud-platform",
  111902. // "https://www.googleapis.com/auth/compute",
  111903. // "https://www.googleapis.com/auth/compute.readonly"
  111904. // ]
  111905. // }
  111906. }
  111907. // method id "compute.targetPools.addHealthCheck":
  111908. type TargetPoolsAddHealthCheckCall struct {
  111909. s *Service
  111910. project string
  111911. region string
  111912. targetPool string
  111913. targetpoolsaddhealthcheckrequest *TargetPoolsAddHealthCheckRequest
  111914. urlParams_ gensupport.URLParams
  111915. ctx_ context.Context
  111916. header_ http.Header
  111917. }
  111918. // AddHealthCheck: Adds health check URLs to a target pool.
  111919. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/addHealthCheck
  111920. func (r *TargetPoolsService) AddHealthCheck(project string, region string, targetPool string, targetpoolsaddhealthcheckrequest *TargetPoolsAddHealthCheckRequest) *TargetPoolsAddHealthCheckCall {
  111921. c := &TargetPoolsAddHealthCheckCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  111922. c.project = project
  111923. c.region = region
  111924. c.targetPool = targetPool
  111925. c.targetpoolsaddhealthcheckrequest = targetpoolsaddhealthcheckrequest
  111926. return c
  111927. }
  111928. // RequestId sets the optional parameter "requestId": An optional
  111929. // request ID to identify requests. Specify a unique request ID so that
  111930. // if you must retry your request, the server will know to ignore the
  111931. // request if it has already been completed.
  111932. //
  111933. // For example, consider a situation where you make an initial request
  111934. // and the request times out. If you make the request again with the
  111935. // same request ID, the server can check if original operation with the
  111936. // same request ID was received, and if so, will ignore the second
  111937. // request. This prevents clients from accidentally creating duplicate
  111938. // commitments.
  111939. //
  111940. // The request ID must be a valid UUID with the exception that zero UUID
  111941. // is not supported (00000000-0000-0000-0000-000000000000).
  111942. func (c *TargetPoolsAddHealthCheckCall) RequestId(requestId string) *TargetPoolsAddHealthCheckCall {
  111943. c.urlParams_.Set("requestId", requestId)
  111944. return c
  111945. }
  111946. // Fields allows partial responses to be retrieved. See
  111947. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  111948. // for more information.
  111949. func (c *TargetPoolsAddHealthCheckCall) Fields(s ...googleapi.Field) *TargetPoolsAddHealthCheckCall {
  111950. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  111951. return c
  111952. }
  111953. // Context sets the context to be used in this call's Do method. Any
  111954. // pending HTTP request will be aborted if the provided context is
  111955. // canceled.
  111956. func (c *TargetPoolsAddHealthCheckCall) Context(ctx context.Context) *TargetPoolsAddHealthCheckCall {
  111957. c.ctx_ = ctx
  111958. return c
  111959. }
  111960. // Header returns an http.Header that can be modified by the caller to
  111961. // add HTTP headers to the request.
  111962. func (c *TargetPoolsAddHealthCheckCall) Header() http.Header {
  111963. if c.header_ == nil {
  111964. c.header_ = make(http.Header)
  111965. }
  111966. return c.header_
  111967. }
  111968. func (c *TargetPoolsAddHealthCheckCall) doRequest(alt string) (*http.Response, error) {
  111969. reqHeaders := make(http.Header)
  111970. for k, v := range c.header_ {
  111971. reqHeaders[k] = v
  111972. }
  111973. reqHeaders.Set("User-Agent", c.s.userAgent())
  111974. var body io.Reader = nil
  111975. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsaddhealthcheckrequest)
  111976. if err != nil {
  111977. return nil, err
  111978. }
  111979. reqHeaders.Set("Content-Type", "application/json")
  111980. c.urlParams_.Set("alt", alt)
  111981. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/addHealthCheck")
  111982. urls += "?" + c.urlParams_.Encode()
  111983. req, _ := http.NewRequest("POST", urls, body)
  111984. req.Header = reqHeaders
  111985. googleapi.Expand(req.URL, map[string]string{
  111986. "project": c.project,
  111987. "region": c.region,
  111988. "targetPool": c.targetPool,
  111989. })
  111990. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  111991. }
  111992. // Do executes the "compute.targetPools.addHealthCheck" call.
  111993. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  111994. // status code is an error. Response headers are in either
  111995. // *Operation.ServerResponse.Header or (if a response was returned at
  111996. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  111997. // to check whether the returned error was because
  111998. // http.StatusNotModified was returned.
  111999. func (c *TargetPoolsAddHealthCheckCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  112000. gensupport.SetOptions(c.urlParams_, opts...)
  112001. res, err := c.doRequest("json")
  112002. if res != nil && res.StatusCode == http.StatusNotModified {
  112003. if res.Body != nil {
  112004. res.Body.Close()
  112005. }
  112006. return nil, &googleapi.Error{
  112007. Code: res.StatusCode,
  112008. Header: res.Header,
  112009. }
  112010. }
  112011. if err != nil {
  112012. return nil, err
  112013. }
  112014. defer googleapi.CloseBody(res)
  112015. if err := googleapi.CheckResponse(res); err != nil {
  112016. return nil, err
  112017. }
  112018. ret := &Operation{
  112019. ServerResponse: googleapi.ServerResponse{
  112020. Header: res.Header,
  112021. HTTPStatusCode: res.StatusCode,
  112022. },
  112023. }
  112024. target := &ret
  112025. if err := gensupport.DecodeResponse(target, res); err != nil {
  112026. return nil, err
  112027. }
  112028. return ret, nil
  112029. // {
  112030. // "description": "Adds health check URLs to a target pool.",
  112031. // "httpMethod": "POST",
  112032. // "id": "compute.targetPools.addHealthCheck",
  112033. // "parameterOrder": [
  112034. // "project",
  112035. // "region",
  112036. // "targetPool"
  112037. // ],
  112038. // "parameters": {
  112039. // "project": {
  112040. // "description": "Project ID for this request.",
  112041. // "location": "path",
  112042. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  112043. // "required": true,
  112044. // "type": "string"
  112045. // },
  112046. // "region": {
  112047. // "description": "Name of the region scoping this request.",
  112048. // "location": "path",
  112049. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  112050. // "required": true,
  112051. // "type": "string"
  112052. // },
  112053. // "requestId": {
  112054. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  112055. // "location": "query",
  112056. // "type": "string"
  112057. // },
  112058. // "targetPool": {
  112059. // "description": "Name of the target pool to add a health check to.",
  112060. // "location": "path",
  112061. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  112062. // "required": true,
  112063. // "type": "string"
  112064. // }
  112065. // },
  112066. // "path": "{project}/regions/{region}/targetPools/{targetPool}/addHealthCheck",
  112067. // "request": {
  112068. // "$ref": "TargetPoolsAddHealthCheckRequest"
  112069. // },
  112070. // "response": {
  112071. // "$ref": "Operation"
  112072. // },
  112073. // "scopes": [
  112074. // "https://www.googleapis.com/auth/cloud-platform",
  112075. // "https://www.googleapis.com/auth/compute"
  112076. // ]
  112077. // }
  112078. }
  112079. // method id "compute.targetPools.addInstance":
  112080. type TargetPoolsAddInstanceCall struct {
  112081. s *Service
  112082. project string
  112083. region string
  112084. targetPool string
  112085. targetpoolsaddinstancerequest *TargetPoolsAddInstanceRequest
  112086. urlParams_ gensupport.URLParams
  112087. ctx_ context.Context
  112088. header_ http.Header
  112089. }
  112090. // AddInstance: Adds an instance to a target pool.
  112091. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/addInstance
  112092. func (r *TargetPoolsService) AddInstance(project string, region string, targetPool string, targetpoolsaddinstancerequest *TargetPoolsAddInstanceRequest) *TargetPoolsAddInstanceCall {
  112093. c := &TargetPoolsAddInstanceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  112094. c.project = project
  112095. c.region = region
  112096. c.targetPool = targetPool
  112097. c.targetpoolsaddinstancerequest = targetpoolsaddinstancerequest
  112098. return c
  112099. }
  112100. // RequestId sets the optional parameter "requestId": An optional
  112101. // request ID to identify requests. Specify a unique request ID so that
  112102. // if you must retry your request, the server will know to ignore the
  112103. // request if it has already been completed.
  112104. //
  112105. // For example, consider a situation where you make an initial request
  112106. // and the request times out. If you make the request again with the
  112107. // same request ID, the server can check if original operation with the
  112108. // same request ID was received, and if so, will ignore the second
  112109. // request. This prevents clients from accidentally creating duplicate
  112110. // commitments.
  112111. //
  112112. // The request ID must be a valid UUID with the exception that zero UUID
  112113. // is not supported (00000000-0000-0000-0000-000000000000).
  112114. func (c *TargetPoolsAddInstanceCall) RequestId(requestId string) *TargetPoolsAddInstanceCall {
  112115. c.urlParams_.Set("requestId", requestId)
  112116. return c
  112117. }
  112118. // Fields allows partial responses to be retrieved. See
  112119. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  112120. // for more information.
  112121. func (c *TargetPoolsAddInstanceCall) Fields(s ...googleapi.Field) *TargetPoolsAddInstanceCall {
  112122. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  112123. return c
  112124. }
  112125. // Context sets the context to be used in this call's Do method. Any
  112126. // pending HTTP request will be aborted if the provided context is
  112127. // canceled.
  112128. func (c *TargetPoolsAddInstanceCall) Context(ctx context.Context) *TargetPoolsAddInstanceCall {
  112129. c.ctx_ = ctx
  112130. return c
  112131. }
  112132. // Header returns an http.Header that can be modified by the caller to
  112133. // add HTTP headers to the request.
  112134. func (c *TargetPoolsAddInstanceCall) Header() http.Header {
  112135. if c.header_ == nil {
  112136. c.header_ = make(http.Header)
  112137. }
  112138. return c.header_
  112139. }
  112140. func (c *TargetPoolsAddInstanceCall) doRequest(alt string) (*http.Response, error) {
  112141. reqHeaders := make(http.Header)
  112142. for k, v := range c.header_ {
  112143. reqHeaders[k] = v
  112144. }
  112145. reqHeaders.Set("User-Agent", c.s.userAgent())
  112146. var body io.Reader = nil
  112147. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsaddinstancerequest)
  112148. if err != nil {
  112149. return nil, err
  112150. }
  112151. reqHeaders.Set("Content-Type", "application/json")
  112152. c.urlParams_.Set("alt", alt)
  112153. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/addInstance")
  112154. urls += "?" + c.urlParams_.Encode()
  112155. req, _ := http.NewRequest("POST", urls, body)
  112156. req.Header = reqHeaders
  112157. googleapi.Expand(req.URL, map[string]string{
  112158. "project": c.project,
  112159. "region": c.region,
  112160. "targetPool": c.targetPool,
  112161. })
  112162. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  112163. }
  112164. // Do executes the "compute.targetPools.addInstance" call.
  112165. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  112166. // status code is an error. Response headers are in either
  112167. // *Operation.ServerResponse.Header or (if a response was returned at
  112168. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  112169. // to check whether the returned error was because
  112170. // http.StatusNotModified was returned.
  112171. func (c *TargetPoolsAddInstanceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  112172. gensupport.SetOptions(c.urlParams_, opts...)
  112173. res, err := c.doRequest("json")
  112174. if res != nil && res.StatusCode == http.StatusNotModified {
  112175. if res.Body != nil {
  112176. res.Body.Close()
  112177. }
  112178. return nil, &googleapi.Error{
  112179. Code: res.StatusCode,
  112180. Header: res.Header,
  112181. }
  112182. }
  112183. if err != nil {
  112184. return nil, err
  112185. }
  112186. defer googleapi.CloseBody(res)
  112187. if err := googleapi.CheckResponse(res); err != nil {
  112188. return nil, err
  112189. }
  112190. ret := &Operation{
  112191. ServerResponse: googleapi.ServerResponse{
  112192. Header: res.Header,
  112193. HTTPStatusCode: res.StatusCode,
  112194. },
  112195. }
  112196. target := &ret
  112197. if err := gensupport.DecodeResponse(target, res); err != nil {
  112198. return nil, err
  112199. }
  112200. return ret, nil
  112201. // {
  112202. // "description": "Adds an instance to a target pool.",
  112203. // "httpMethod": "POST",
  112204. // "id": "compute.targetPools.addInstance",
  112205. // "parameterOrder": [
  112206. // "project",
  112207. // "region",
  112208. // "targetPool"
  112209. // ],
  112210. // "parameters": {
  112211. // "project": {
  112212. // "description": "Project ID for this request.",
  112213. // "location": "path",
  112214. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  112215. // "required": true,
  112216. // "type": "string"
  112217. // },
  112218. // "region": {
  112219. // "description": "Name of the region scoping this request.",
  112220. // "location": "path",
  112221. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  112222. // "required": true,
  112223. // "type": "string"
  112224. // },
  112225. // "requestId": {
  112226. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  112227. // "location": "query",
  112228. // "type": "string"
  112229. // },
  112230. // "targetPool": {
  112231. // "description": "Name of the TargetPool resource to add instances to.",
  112232. // "location": "path",
  112233. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  112234. // "required": true,
  112235. // "type": "string"
  112236. // }
  112237. // },
  112238. // "path": "{project}/regions/{region}/targetPools/{targetPool}/addInstance",
  112239. // "request": {
  112240. // "$ref": "TargetPoolsAddInstanceRequest"
  112241. // },
  112242. // "response": {
  112243. // "$ref": "Operation"
  112244. // },
  112245. // "scopes": [
  112246. // "https://www.googleapis.com/auth/cloud-platform",
  112247. // "https://www.googleapis.com/auth/compute"
  112248. // ]
  112249. // }
  112250. }
  112251. // method id "compute.targetPools.aggregatedList":
  112252. type TargetPoolsAggregatedListCall struct {
  112253. s *Service
  112254. project string
  112255. urlParams_ gensupport.URLParams
  112256. ifNoneMatch_ string
  112257. ctx_ context.Context
  112258. header_ http.Header
  112259. }
  112260. // AggregatedList: Retrieves an aggregated list of target pools.
  112261. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/aggregatedList
  112262. func (r *TargetPoolsService) AggregatedList(project string) *TargetPoolsAggregatedListCall {
  112263. c := &TargetPoolsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  112264. c.project = project
  112265. return c
  112266. }
  112267. // Filter sets the optional parameter "filter": A filter expression that
  112268. // filters resources listed in the response. The expression must specify
  112269. // the field name, a comparison operator, and the value that you want to
  112270. // use for filtering. The value must be a string, a number, or a
  112271. // boolean. The comparison operator must be either =, !=, >, or <.
  112272. //
  112273. // For example, if you are filtering Compute Engine instances, you can
  112274. // exclude instances named example-instance by specifying name !=
  112275. // example-instance.
  112276. //
  112277. // You can also filter nested fields. For example, you could specify
  112278. // scheduling.automaticRestart = false to include instances only if they
  112279. // are not scheduled for automatic restarts. You can use filtering on
  112280. // nested fields to filter based on resource labels.
  112281. //
  112282. // To filter on multiple expressions, provide each separate expression
  112283. // within parentheses. For example, (scheduling.automaticRestart = true)
  112284. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  112285. // AND expression. However, you can include AND and OR expressions
  112286. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  112287. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  112288. // true).
  112289. func (c *TargetPoolsAggregatedListCall) Filter(filter string) *TargetPoolsAggregatedListCall {
  112290. c.urlParams_.Set("filter", filter)
  112291. return c
  112292. }
  112293. // MaxResults sets the optional parameter "maxResults": The maximum
  112294. // number of results per page that should be returned. If the number of
  112295. // available results is larger than maxResults, Compute Engine returns a
  112296. // nextPageToken that can be used to get the next page of results in
  112297. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  112298. // (Default: 500)
  112299. func (c *TargetPoolsAggregatedListCall) MaxResults(maxResults int64) *TargetPoolsAggregatedListCall {
  112300. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  112301. return c
  112302. }
  112303. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  112304. // a certain order. By default, results are returned in alphanumerical
  112305. // order based on the resource name.
  112306. //
  112307. // You can also sort results in descending order based on the creation
  112308. // timestamp using orderBy="creationTimestamp desc". This sorts results
  112309. // based on the creationTimestamp field in reverse chronological order
  112310. // (newest result first). Use this to sort resources like operations so
  112311. // that the newest operation is returned first.
  112312. //
  112313. // Currently, only sorting by name or creationTimestamp desc is
  112314. // supported.
  112315. func (c *TargetPoolsAggregatedListCall) OrderBy(orderBy string) *TargetPoolsAggregatedListCall {
  112316. c.urlParams_.Set("orderBy", orderBy)
  112317. return c
  112318. }
  112319. // PageToken sets the optional parameter "pageToken": Specifies a page
  112320. // token to use. Set pageToken to the nextPageToken returned by a
  112321. // previous list request to get the next page of results.
  112322. func (c *TargetPoolsAggregatedListCall) PageToken(pageToken string) *TargetPoolsAggregatedListCall {
  112323. c.urlParams_.Set("pageToken", pageToken)
  112324. return c
  112325. }
  112326. // Fields allows partial responses to be retrieved. See
  112327. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  112328. // for more information.
  112329. func (c *TargetPoolsAggregatedListCall) Fields(s ...googleapi.Field) *TargetPoolsAggregatedListCall {
  112330. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  112331. return c
  112332. }
  112333. // IfNoneMatch sets the optional parameter which makes the operation
  112334. // fail if the object's ETag matches the given value. This is useful for
  112335. // getting updates only after the object has changed since the last
  112336. // request. Use googleapi.IsNotModified to check whether the response
  112337. // error from Do is the result of In-None-Match.
  112338. func (c *TargetPoolsAggregatedListCall) IfNoneMatch(entityTag string) *TargetPoolsAggregatedListCall {
  112339. c.ifNoneMatch_ = entityTag
  112340. return c
  112341. }
  112342. // Context sets the context to be used in this call's Do method. Any
  112343. // pending HTTP request will be aborted if the provided context is
  112344. // canceled.
  112345. func (c *TargetPoolsAggregatedListCall) Context(ctx context.Context) *TargetPoolsAggregatedListCall {
  112346. c.ctx_ = ctx
  112347. return c
  112348. }
  112349. // Header returns an http.Header that can be modified by the caller to
  112350. // add HTTP headers to the request.
  112351. func (c *TargetPoolsAggregatedListCall) Header() http.Header {
  112352. if c.header_ == nil {
  112353. c.header_ = make(http.Header)
  112354. }
  112355. return c.header_
  112356. }
  112357. func (c *TargetPoolsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  112358. reqHeaders := make(http.Header)
  112359. for k, v := range c.header_ {
  112360. reqHeaders[k] = v
  112361. }
  112362. reqHeaders.Set("User-Agent", c.s.userAgent())
  112363. if c.ifNoneMatch_ != "" {
  112364. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  112365. }
  112366. var body io.Reader = nil
  112367. c.urlParams_.Set("alt", alt)
  112368. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/targetPools")
  112369. urls += "?" + c.urlParams_.Encode()
  112370. req, _ := http.NewRequest("GET", urls, body)
  112371. req.Header = reqHeaders
  112372. googleapi.Expand(req.URL, map[string]string{
  112373. "project": c.project,
  112374. })
  112375. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  112376. }
  112377. // Do executes the "compute.targetPools.aggregatedList" call.
  112378. // Exactly one of *TargetPoolAggregatedList or error will be non-nil.
  112379. // Any non-2xx status code is an error. Response headers are in either
  112380. // *TargetPoolAggregatedList.ServerResponse.Header or (if a response was
  112381. // returned at all) in error.(*googleapi.Error).Header. Use
  112382. // googleapi.IsNotModified to check whether the returned error was
  112383. // because http.StatusNotModified was returned.
  112384. func (c *TargetPoolsAggregatedListCall) Do(opts ...googleapi.CallOption) (*TargetPoolAggregatedList, error) {
  112385. gensupport.SetOptions(c.urlParams_, opts...)
  112386. res, err := c.doRequest("json")
  112387. if res != nil && res.StatusCode == http.StatusNotModified {
  112388. if res.Body != nil {
  112389. res.Body.Close()
  112390. }
  112391. return nil, &googleapi.Error{
  112392. Code: res.StatusCode,
  112393. Header: res.Header,
  112394. }
  112395. }
  112396. if err != nil {
  112397. return nil, err
  112398. }
  112399. defer googleapi.CloseBody(res)
  112400. if err := googleapi.CheckResponse(res); err != nil {
  112401. return nil, err
  112402. }
  112403. ret := &TargetPoolAggregatedList{
  112404. ServerResponse: googleapi.ServerResponse{
  112405. Header: res.Header,
  112406. HTTPStatusCode: res.StatusCode,
  112407. },
  112408. }
  112409. target := &ret
  112410. if err := gensupport.DecodeResponse(target, res); err != nil {
  112411. return nil, err
  112412. }
  112413. return ret, nil
  112414. // {
  112415. // "description": "Retrieves an aggregated list of target pools.",
  112416. // "httpMethod": "GET",
  112417. // "id": "compute.targetPools.aggregatedList",
  112418. // "parameterOrder": [
  112419. // "project"
  112420. // ],
  112421. // "parameters": {
  112422. // "filter": {
  112423. // "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).",
  112424. // "location": "query",
  112425. // "type": "string"
  112426. // },
  112427. // "maxResults": {
  112428. // "default": "500",
  112429. // "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)",
  112430. // "format": "uint32",
  112431. // "location": "query",
  112432. // "minimum": "0",
  112433. // "type": "integer"
  112434. // },
  112435. // "orderBy": {
  112436. // "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.",
  112437. // "location": "query",
  112438. // "type": "string"
  112439. // },
  112440. // "pageToken": {
  112441. // "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.",
  112442. // "location": "query",
  112443. // "type": "string"
  112444. // },
  112445. // "project": {
  112446. // "description": "Project ID for this request.",
  112447. // "location": "path",
  112448. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  112449. // "required": true,
  112450. // "type": "string"
  112451. // }
  112452. // },
  112453. // "path": "{project}/aggregated/targetPools",
  112454. // "response": {
  112455. // "$ref": "TargetPoolAggregatedList"
  112456. // },
  112457. // "scopes": [
  112458. // "https://www.googleapis.com/auth/cloud-platform",
  112459. // "https://www.googleapis.com/auth/compute",
  112460. // "https://www.googleapis.com/auth/compute.readonly"
  112461. // ]
  112462. // }
  112463. }
  112464. // Pages invokes f for each page of results.
  112465. // A non-nil error returned from f will halt the iteration.
  112466. // The provided context supersedes any context provided to the Context method.
  112467. func (c *TargetPoolsAggregatedListCall) Pages(ctx context.Context, f func(*TargetPoolAggregatedList) error) error {
  112468. c.ctx_ = ctx
  112469. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  112470. for {
  112471. x, err := c.Do()
  112472. if err != nil {
  112473. return err
  112474. }
  112475. if err := f(x); err != nil {
  112476. return err
  112477. }
  112478. if x.NextPageToken == "" {
  112479. return nil
  112480. }
  112481. c.PageToken(x.NextPageToken)
  112482. }
  112483. }
  112484. // method id "compute.targetPools.delete":
  112485. type TargetPoolsDeleteCall struct {
  112486. s *Service
  112487. project string
  112488. region string
  112489. targetPool string
  112490. urlParams_ gensupport.URLParams
  112491. ctx_ context.Context
  112492. header_ http.Header
  112493. }
  112494. // Delete: Deletes the specified target pool.
  112495. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/delete
  112496. func (r *TargetPoolsService) Delete(project string, region string, targetPool string) *TargetPoolsDeleteCall {
  112497. c := &TargetPoolsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  112498. c.project = project
  112499. c.region = region
  112500. c.targetPool = targetPool
  112501. return c
  112502. }
  112503. // RequestId sets the optional parameter "requestId": An optional
  112504. // request ID to identify requests. Specify a unique request ID so that
  112505. // if you must retry your request, the server will know to ignore the
  112506. // request if it has already been completed.
  112507. //
  112508. // For example, consider a situation where you make an initial request
  112509. // and the request times out. If you make the request again with the
  112510. // same request ID, the server can check if original operation with the
  112511. // same request ID was received, and if so, will ignore the second
  112512. // request. This prevents clients from accidentally creating duplicate
  112513. // commitments.
  112514. //
  112515. // The request ID must be a valid UUID with the exception that zero UUID
  112516. // is not supported (00000000-0000-0000-0000-000000000000).
  112517. func (c *TargetPoolsDeleteCall) RequestId(requestId string) *TargetPoolsDeleteCall {
  112518. c.urlParams_.Set("requestId", requestId)
  112519. return c
  112520. }
  112521. // Fields allows partial responses to be retrieved. See
  112522. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  112523. // for more information.
  112524. func (c *TargetPoolsDeleteCall) Fields(s ...googleapi.Field) *TargetPoolsDeleteCall {
  112525. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  112526. return c
  112527. }
  112528. // Context sets the context to be used in this call's Do method. Any
  112529. // pending HTTP request will be aborted if the provided context is
  112530. // canceled.
  112531. func (c *TargetPoolsDeleteCall) Context(ctx context.Context) *TargetPoolsDeleteCall {
  112532. c.ctx_ = ctx
  112533. return c
  112534. }
  112535. // Header returns an http.Header that can be modified by the caller to
  112536. // add HTTP headers to the request.
  112537. func (c *TargetPoolsDeleteCall) Header() http.Header {
  112538. if c.header_ == nil {
  112539. c.header_ = make(http.Header)
  112540. }
  112541. return c.header_
  112542. }
  112543. func (c *TargetPoolsDeleteCall) doRequest(alt string) (*http.Response, error) {
  112544. reqHeaders := make(http.Header)
  112545. for k, v := range c.header_ {
  112546. reqHeaders[k] = v
  112547. }
  112548. reqHeaders.Set("User-Agent", c.s.userAgent())
  112549. var body io.Reader = nil
  112550. c.urlParams_.Set("alt", alt)
  112551. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}")
  112552. urls += "?" + c.urlParams_.Encode()
  112553. req, _ := http.NewRequest("DELETE", urls, body)
  112554. req.Header = reqHeaders
  112555. googleapi.Expand(req.URL, map[string]string{
  112556. "project": c.project,
  112557. "region": c.region,
  112558. "targetPool": c.targetPool,
  112559. })
  112560. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  112561. }
  112562. // Do executes the "compute.targetPools.delete" call.
  112563. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  112564. // status code is an error. Response headers are in either
  112565. // *Operation.ServerResponse.Header or (if a response was returned at
  112566. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  112567. // to check whether the returned error was because
  112568. // http.StatusNotModified was returned.
  112569. func (c *TargetPoolsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  112570. gensupport.SetOptions(c.urlParams_, opts...)
  112571. res, err := c.doRequest("json")
  112572. if res != nil && res.StatusCode == http.StatusNotModified {
  112573. if res.Body != nil {
  112574. res.Body.Close()
  112575. }
  112576. return nil, &googleapi.Error{
  112577. Code: res.StatusCode,
  112578. Header: res.Header,
  112579. }
  112580. }
  112581. if err != nil {
  112582. return nil, err
  112583. }
  112584. defer googleapi.CloseBody(res)
  112585. if err := googleapi.CheckResponse(res); err != nil {
  112586. return nil, err
  112587. }
  112588. ret := &Operation{
  112589. ServerResponse: googleapi.ServerResponse{
  112590. Header: res.Header,
  112591. HTTPStatusCode: res.StatusCode,
  112592. },
  112593. }
  112594. target := &ret
  112595. if err := gensupport.DecodeResponse(target, res); err != nil {
  112596. return nil, err
  112597. }
  112598. return ret, nil
  112599. // {
  112600. // "description": "Deletes the specified target pool.",
  112601. // "httpMethod": "DELETE",
  112602. // "id": "compute.targetPools.delete",
  112603. // "parameterOrder": [
  112604. // "project",
  112605. // "region",
  112606. // "targetPool"
  112607. // ],
  112608. // "parameters": {
  112609. // "project": {
  112610. // "description": "Project ID for this request.",
  112611. // "location": "path",
  112612. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  112613. // "required": true,
  112614. // "type": "string"
  112615. // },
  112616. // "region": {
  112617. // "description": "Name of the region scoping this request.",
  112618. // "location": "path",
  112619. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  112620. // "required": true,
  112621. // "type": "string"
  112622. // },
  112623. // "requestId": {
  112624. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  112625. // "location": "query",
  112626. // "type": "string"
  112627. // },
  112628. // "targetPool": {
  112629. // "description": "Name of the TargetPool resource to delete.",
  112630. // "location": "path",
  112631. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  112632. // "required": true,
  112633. // "type": "string"
  112634. // }
  112635. // },
  112636. // "path": "{project}/regions/{region}/targetPools/{targetPool}",
  112637. // "response": {
  112638. // "$ref": "Operation"
  112639. // },
  112640. // "scopes": [
  112641. // "https://www.googleapis.com/auth/cloud-platform",
  112642. // "https://www.googleapis.com/auth/compute"
  112643. // ]
  112644. // }
  112645. }
  112646. // method id "compute.targetPools.get":
  112647. type TargetPoolsGetCall struct {
  112648. s *Service
  112649. project string
  112650. region string
  112651. targetPool string
  112652. urlParams_ gensupport.URLParams
  112653. ifNoneMatch_ string
  112654. ctx_ context.Context
  112655. header_ http.Header
  112656. }
  112657. // Get: Returns the specified target pool. Gets a list of available
  112658. // target pools by making a list() request.
  112659. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/get
  112660. func (r *TargetPoolsService) Get(project string, region string, targetPool string) *TargetPoolsGetCall {
  112661. c := &TargetPoolsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  112662. c.project = project
  112663. c.region = region
  112664. c.targetPool = targetPool
  112665. return c
  112666. }
  112667. // Fields allows partial responses to be retrieved. See
  112668. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  112669. // for more information.
  112670. func (c *TargetPoolsGetCall) Fields(s ...googleapi.Field) *TargetPoolsGetCall {
  112671. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  112672. return c
  112673. }
  112674. // IfNoneMatch sets the optional parameter which makes the operation
  112675. // fail if the object's ETag matches the given value. This is useful for
  112676. // getting updates only after the object has changed since the last
  112677. // request. Use googleapi.IsNotModified to check whether the response
  112678. // error from Do is the result of In-None-Match.
  112679. func (c *TargetPoolsGetCall) IfNoneMatch(entityTag string) *TargetPoolsGetCall {
  112680. c.ifNoneMatch_ = entityTag
  112681. return c
  112682. }
  112683. // Context sets the context to be used in this call's Do method. Any
  112684. // pending HTTP request will be aborted if the provided context is
  112685. // canceled.
  112686. func (c *TargetPoolsGetCall) Context(ctx context.Context) *TargetPoolsGetCall {
  112687. c.ctx_ = ctx
  112688. return c
  112689. }
  112690. // Header returns an http.Header that can be modified by the caller to
  112691. // add HTTP headers to the request.
  112692. func (c *TargetPoolsGetCall) Header() http.Header {
  112693. if c.header_ == nil {
  112694. c.header_ = make(http.Header)
  112695. }
  112696. return c.header_
  112697. }
  112698. func (c *TargetPoolsGetCall) doRequest(alt string) (*http.Response, error) {
  112699. reqHeaders := make(http.Header)
  112700. for k, v := range c.header_ {
  112701. reqHeaders[k] = v
  112702. }
  112703. reqHeaders.Set("User-Agent", c.s.userAgent())
  112704. if c.ifNoneMatch_ != "" {
  112705. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  112706. }
  112707. var body io.Reader = nil
  112708. c.urlParams_.Set("alt", alt)
  112709. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}")
  112710. urls += "?" + c.urlParams_.Encode()
  112711. req, _ := http.NewRequest("GET", urls, body)
  112712. req.Header = reqHeaders
  112713. googleapi.Expand(req.URL, map[string]string{
  112714. "project": c.project,
  112715. "region": c.region,
  112716. "targetPool": c.targetPool,
  112717. })
  112718. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  112719. }
  112720. // Do executes the "compute.targetPools.get" call.
  112721. // Exactly one of *TargetPool or error will be non-nil. Any non-2xx
  112722. // status code is an error. Response headers are in either
  112723. // *TargetPool.ServerResponse.Header or (if a response was returned at
  112724. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  112725. // to check whether the returned error was because
  112726. // http.StatusNotModified was returned.
  112727. func (c *TargetPoolsGetCall) Do(opts ...googleapi.CallOption) (*TargetPool, error) {
  112728. gensupport.SetOptions(c.urlParams_, opts...)
  112729. res, err := c.doRequest("json")
  112730. if res != nil && res.StatusCode == http.StatusNotModified {
  112731. if res.Body != nil {
  112732. res.Body.Close()
  112733. }
  112734. return nil, &googleapi.Error{
  112735. Code: res.StatusCode,
  112736. Header: res.Header,
  112737. }
  112738. }
  112739. if err != nil {
  112740. return nil, err
  112741. }
  112742. defer googleapi.CloseBody(res)
  112743. if err := googleapi.CheckResponse(res); err != nil {
  112744. return nil, err
  112745. }
  112746. ret := &TargetPool{
  112747. ServerResponse: googleapi.ServerResponse{
  112748. Header: res.Header,
  112749. HTTPStatusCode: res.StatusCode,
  112750. },
  112751. }
  112752. target := &ret
  112753. if err := gensupport.DecodeResponse(target, res); err != nil {
  112754. return nil, err
  112755. }
  112756. return ret, nil
  112757. // {
  112758. // "description": "Returns the specified target pool. Gets a list of available target pools by making a list() request.",
  112759. // "httpMethod": "GET",
  112760. // "id": "compute.targetPools.get",
  112761. // "parameterOrder": [
  112762. // "project",
  112763. // "region",
  112764. // "targetPool"
  112765. // ],
  112766. // "parameters": {
  112767. // "project": {
  112768. // "description": "Project ID for this request.",
  112769. // "location": "path",
  112770. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  112771. // "required": true,
  112772. // "type": "string"
  112773. // },
  112774. // "region": {
  112775. // "description": "Name of the region scoping this request.",
  112776. // "location": "path",
  112777. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  112778. // "required": true,
  112779. // "type": "string"
  112780. // },
  112781. // "targetPool": {
  112782. // "description": "Name of the TargetPool resource to return.",
  112783. // "location": "path",
  112784. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  112785. // "required": true,
  112786. // "type": "string"
  112787. // }
  112788. // },
  112789. // "path": "{project}/regions/{region}/targetPools/{targetPool}",
  112790. // "response": {
  112791. // "$ref": "TargetPool"
  112792. // },
  112793. // "scopes": [
  112794. // "https://www.googleapis.com/auth/cloud-platform",
  112795. // "https://www.googleapis.com/auth/compute",
  112796. // "https://www.googleapis.com/auth/compute.readonly"
  112797. // ]
  112798. // }
  112799. }
  112800. // method id "compute.targetPools.getHealth":
  112801. type TargetPoolsGetHealthCall struct {
  112802. s *Service
  112803. project string
  112804. region string
  112805. targetPool string
  112806. instancereference *InstanceReference
  112807. urlParams_ gensupport.URLParams
  112808. ctx_ context.Context
  112809. header_ http.Header
  112810. }
  112811. // GetHealth: Gets the most recent health check results for each IP for
  112812. // the instance that is referenced by the given target pool.
  112813. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/getHealth
  112814. func (r *TargetPoolsService) GetHealth(project string, region string, targetPool string, instancereference *InstanceReference) *TargetPoolsGetHealthCall {
  112815. c := &TargetPoolsGetHealthCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  112816. c.project = project
  112817. c.region = region
  112818. c.targetPool = targetPool
  112819. c.instancereference = instancereference
  112820. return c
  112821. }
  112822. // Fields allows partial responses to be retrieved. See
  112823. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  112824. // for more information.
  112825. func (c *TargetPoolsGetHealthCall) Fields(s ...googleapi.Field) *TargetPoolsGetHealthCall {
  112826. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  112827. return c
  112828. }
  112829. // Context sets the context to be used in this call's Do method. Any
  112830. // pending HTTP request will be aborted if the provided context is
  112831. // canceled.
  112832. func (c *TargetPoolsGetHealthCall) Context(ctx context.Context) *TargetPoolsGetHealthCall {
  112833. c.ctx_ = ctx
  112834. return c
  112835. }
  112836. // Header returns an http.Header that can be modified by the caller to
  112837. // add HTTP headers to the request.
  112838. func (c *TargetPoolsGetHealthCall) Header() http.Header {
  112839. if c.header_ == nil {
  112840. c.header_ = make(http.Header)
  112841. }
  112842. return c.header_
  112843. }
  112844. func (c *TargetPoolsGetHealthCall) doRequest(alt string) (*http.Response, error) {
  112845. reqHeaders := make(http.Header)
  112846. for k, v := range c.header_ {
  112847. reqHeaders[k] = v
  112848. }
  112849. reqHeaders.Set("User-Agent", c.s.userAgent())
  112850. var body io.Reader = nil
  112851. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancereference)
  112852. if err != nil {
  112853. return nil, err
  112854. }
  112855. reqHeaders.Set("Content-Type", "application/json")
  112856. c.urlParams_.Set("alt", alt)
  112857. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/getHealth")
  112858. urls += "?" + c.urlParams_.Encode()
  112859. req, _ := http.NewRequest("POST", urls, body)
  112860. req.Header = reqHeaders
  112861. googleapi.Expand(req.URL, map[string]string{
  112862. "project": c.project,
  112863. "region": c.region,
  112864. "targetPool": c.targetPool,
  112865. })
  112866. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  112867. }
  112868. // Do executes the "compute.targetPools.getHealth" call.
  112869. // Exactly one of *TargetPoolInstanceHealth or error will be non-nil.
  112870. // Any non-2xx status code is an error. Response headers are in either
  112871. // *TargetPoolInstanceHealth.ServerResponse.Header or (if a response was
  112872. // returned at all) in error.(*googleapi.Error).Header. Use
  112873. // googleapi.IsNotModified to check whether the returned error was
  112874. // because http.StatusNotModified was returned.
  112875. func (c *TargetPoolsGetHealthCall) Do(opts ...googleapi.CallOption) (*TargetPoolInstanceHealth, error) {
  112876. gensupport.SetOptions(c.urlParams_, opts...)
  112877. res, err := c.doRequest("json")
  112878. if res != nil && res.StatusCode == http.StatusNotModified {
  112879. if res.Body != nil {
  112880. res.Body.Close()
  112881. }
  112882. return nil, &googleapi.Error{
  112883. Code: res.StatusCode,
  112884. Header: res.Header,
  112885. }
  112886. }
  112887. if err != nil {
  112888. return nil, err
  112889. }
  112890. defer googleapi.CloseBody(res)
  112891. if err := googleapi.CheckResponse(res); err != nil {
  112892. return nil, err
  112893. }
  112894. ret := &TargetPoolInstanceHealth{
  112895. ServerResponse: googleapi.ServerResponse{
  112896. Header: res.Header,
  112897. HTTPStatusCode: res.StatusCode,
  112898. },
  112899. }
  112900. target := &ret
  112901. if err := gensupport.DecodeResponse(target, res); err != nil {
  112902. return nil, err
  112903. }
  112904. return ret, nil
  112905. // {
  112906. // "description": "Gets the most recent health check results for each IP for the instance that is referenced by the given target pool.",
  112907. // "httpMethod": "POST",
  112908. // "id": "compute.targetPools.getHealth",
  112909. // "parameterOrder": [
  112910. // "project",
  112911. // "region",
  112912. // "targetPool"
  112913. // ],
  112914. // "parameters": {
  112915. // "project": {
  112916. // "description": "Project ID for this request.",
  112917. // "location": "path",
  112918. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  112919. // "required": true,
  112920. // "type": "string"
  112921. // },
  112922. // "region": {
  112923. // "description": "Name of the region scoping this request.",
  112924. // "location": "path",
  112925. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  112926. // "required": true,
  112927. // "type": "string"
  112928. // },
  112929. // "targetPool": {
  112930. // "description": "Name of the TargetPool resource to which the queried instance belongs.",
  112931. // "location": "path",
  112932. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  112933. // "required": true,
  112934. // "type": "string"
  112935. // }
  112936. // },
  112937. // "path": "{project}/regions/{region}/targetPools/{targetPool}/getHealth",
  112938. // "request": {
  112939. // "$ref": "InstanceReference"
  112940. // },
  112941. // "response": {
  112942. // "$ref": "TargetPoolInstanceHealth"
  112943. // },
  112944. // "scopes": [
  112945. // "https://www.googleapis.com/auth/cloud-platform",
  112946. // "https://www.googleapis.com/auth/compute",
  112947. // "https://www.googleapis.com/auth/compute.readonly"
  112948. // ]
  112949. // }
  112950. }
  112951. // method id "compute.targetPools.insert":
  112952. type TargetPoolsInsertCall struct {
  112953. s *Service
  112954. project string
  112955. region string
  112956. targetpool *TargetPool
  112957. urlParams_ gensupport.URLParams
  112958. ctx_ context.Context
  112959. header_ http.Header
  112960. }
  112961. // Insert: Creates a target pool in the specified project and region
  112962. // using the data included in the request.
  112963. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/insert
  112964. func (r *TargetPoolsService) Insert(project string, region string, targetpool *TargetPool) *TargetPoolsInsertCall {
  112965. c := &TargetPoolsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  112966. c.project = project
  112967. c.region = region
  112968. c.targetpool = targetpool
  112969. return c
  112970. }
  112971. // RequestId sets the optional parameter "requestId": An optional
  112972. // request ID to identify requests. Specify a unique request ID so that
  112973. // if you must retry your request, the server will know to ignore the
  112974. // request if it has already been completed.
  112975. //
  112976. // For example, consider a situation where you make an initial request
  112977. // and the request times out. If you make the request again with the
  112978. // same request ID, the server can check if original operation with the
  112979. // same request ID was received, and if so, will ignore the second
  112980. // request. This prevents clients from accidentally creating duplicate
  112981. // commitments.
  112982. //
  112983. // The request ID must be a valid UUID with the exception that zero UUID
  112984. // is not supported (00000000-0000-0000-0000-000000000000).
  112985. func (c *TargetPoolsInsertCall) RequestId(requestId string) *TargetPoolsInsertCall {
  112986. c.urlParams_.Set("requestId", requestId)
  112987. return c
  112988. }
  112989. // Fields allows partial responses to be retrieved. See
  112990. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  112991. // for more information.
  112992. func (c *TargetPoolsInsertCall) Fields(s ...googleapi.Field) *TargetPoolsInsertCall {
  112993. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  112994. return c
  112995. }
  112996. // Context sets the context to be used in this call's Do method. Any
  112997. // pending HTTP request will be aborted if the provided context is
  112998. // canceled.
  112999. func (c *TargetPoolsInsertCall) Context(ctx context.Context) *TargetPoolsInsertCall {
  113000. c.ctx_ = ctx
  113001. return c
  113002. }
  113003. // Header returns an http.Header that can be modified by the caller to
  113004. // add HTTP headers to the request.
  113005. func (c *TargetPoolsInsertCall) Header() http.Header {
  113006. if c.header_ == nil {
  113007. c.header_ = make(http.Header)
  113008. }
  113009. return c.header_
  113010. }
  113011. func (c *TargetPoolsInsertCall) doRequest(alt string) (*http.Response, error) {
  113012. reqHeaders := make(http.Header)
  113013. for k, v := range c.header_ {
  113014. reqHeaders[k] = v
  113015. }
  113016. reqHeaders.Set("User-Agent", c.s.userAgent())
  113017. var body io.Reader = nil
  113018. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpool)
  113019. if err != nil {
  113020. return nil, err
  113021. }
  113022. reqHeaders.Set("Content-Type", "application/json")
  113023. c.urlParams_.Set("alt", alt)
  113024. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools")
  113025. urls += "?" + c.urlParams_.Encode()
  113026. req, _ := http.NewRequest("POST", urls, body)
  113027. req.Header = reqHeaders
  113028. googleapi.Expand(req.URL, map[string]string{
  113029. "project": c.project,
  113030. "region": c.region,
  113031. })
  113032. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  113033. }
  113034. // Do executes the "compute.targetPools.insert" call.
  113035. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  113036. // status code is an error. Response headers are in either
  113037. // *Operation.ServerResponse.Header or (if a response was returned at
  113038. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  113039. // to check whether the returned error was because
  113040. // http.StatusNotModified was returned.
  113041. func (c *TargetPoolsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  113042. gensupport.SetOptions(c.urlParams_, opts...)
  113043. res, err := c.doRequest("json")
  113044. if res != nil && res.StatusCode == http.StatusNotModified {
  113045. if res.Body != nil {
  113046. res.Body.Close()
  113047. }
  113048. return nil, &googleapi.Error{
  113049. Code: res.StatusCode,
  113050. Header: res.Header,
  113051. }
  113052. }
  113053. if err != nil {
  113054. return nil, err
  113055. }
  113056. defer googleapi.CloseBody(res)
  113057. if err := googleapi.CheckResponse(res); err != nil {
  113058. return nil, err
  113059. }
  113060. ret := &Operation{
  113061. ServerResponse: googleapi.ServerResponse{
  113062. Header: res.Header,
  113063. HTTPStatusCode: res.StatusCode,
  113064. },
  113065. }
  113066. target := &ret
  113067. if err := gensupport.DecodeResponse(target, res); err != nil {
  113068. return nil, err
  113069. }
  113070. return ret, nil
  113071. // {
  113072. // "description": "Creates a target pool in the specified project and region using the data included in the request.",
  113073. // "httpMethod": "POST",
  113074. // "id": "compute.targetPools.insert",
  113075. // "parameterOrder": [
  113076. // "project",
  113077. // "region"
  113078. // ],
  113079. // "parameters": {
  113080. // "project": {
  113081. // "description": "Project ID for this request.",
  113082. // "location": "path",
  113083. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  113084. // "required": true,
  113085. // "type": "string"
  113086. // },
  113087. // "region": {
  113088. // "description": "Name of the region scoping this request.",
  113089. // "location": "path",
  113090. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  113091. // "required": true,
  113092. // "type": "string"
  113093. // },
  113094. // "requestId": {
  113095. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  113096. // "location": "query",
  113097. // "type": "string"
  113098. // }
  113099. // },
  113100. // "path": "{project}/regions/{region}/targetPools",
  113101. // "request": {
  113102. // "$ref": "TargetPool"
  113103. // },
  113104. // "response": {
  113105. // "$ref": "Operation"
  113106. // },
  113107. // "scopes": [
  113108. // "https://www.googleapis.com/auth/cloud-platform",
  113109. // "https://www.googleapis.com/auth/compute"
  113110. // ]
  113111. // }
  113112. }
  113113. // method id "compute.targetPools.list":
  113114. type TargetPoolsListCall struct {
  113115. s *Service
  113116. project string
  113117. region string
  113118. urlParams_ gensupport.URLParams
  113119. ifNoneMatch_ string
  113120. ctx_ context.Context
  113121. header_ http.Header
  113122. }
  113123. // List: Retrieves a list of target pools available to the specified
  113124. // project and region.
  113125. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/list
  113126. func (r *TargetPoolsService) List(project string, region string) *TargetPoolsListCall {
  113127. c := &TargetPoolsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  113128. c.project = project
  113129. c.region = region
  113130. return c
  113131. }
  113132. // Filter sets the optional parameter "filter": A filter expression that
  113133. // filters resources listed in the response. The expression must specify
  113134. // the field name, a comparison operator, and the value that you want to
  113135. // use for filtering. The value must be a string, a number, or a
  113136. // boolean. The comparison operator must be either =, !=, >, or <.
  113137. //
  113138. // For example, if you are filtering Compute Engine instances, you can
  113139. // exclude instances named example-instance by specifying name !=
  113140. // example-instance.
  113141. //
  113142. // You can also filter nested fields. For example, you could specify
  113143. // scheduling.automaticRestart = false to include instances only if they
  113144. // are not scheduled for automatic restarts. You can use filtering on
  113145. // nested fields to filter based on resource labels.
  113146. //
  113147. // To filter on multiple expressions, provide each separate expression
  113148. // within parentheses. For example, (scheduling.automaticRestart = true)
  113149. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  113150. // AND expression. However, you can include AND and OR expressions
  113151. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  113152. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  113153. // true).
  113154. func (c *TargetPoolsListCall) Filter(filter string) *TargetPoolsListCall {
  113155. c.urlParams_.Set("filter", filter)
  113156. return c
  113157. }
  113158. // MaxResults sets the optional parameter "maxResults": The maximum
  113159. // number of results per page that should be returned. If the number of
  113160. // available results is larger than maxResults, Compute Engine returns a
  113161. // nextPageToken that can be used to get the next page of results in
  113162. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  113163. // (Default: 500)
  113164. func (c *TargetPoolsListCall) MaxResults(maxResults int64) *TargetPoolsListCall {
  113165. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  113166. return c
  113167. }
  113168. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  113169. // a certain order. By default, results are returned in alphanumerical
  113170. // order based on the resource name.
  113171. //
  113172. // You can also sort results in descending order based on the creation
  113173. // timestamp using orderBy="creationTimestamp desc". This sorts results
  113174. // based on the creationTimestamp field in reverse chronological order
  113175. // (newest result first). Use this to sort resources like operations so
  113176. // that the newest operation is returned first.
  113177. //
  113178. // Currently, only sorting by name or creationTimestamp desc is
  113179. // supported.
  113180. func (c *TargetPoolsListCall) OrderBy(orderBy string) *TargetPoolsListCall {
  113181. c.urlParams_.Set("orderBy", orderBy)
  113182. return c
  113183. }
  113184. // PageToken sets the optional parameter "pageToken": Specifies a page
  113185. // token to use. Set pageToken to the nextPageToken returned by a
  113186. // previous list request to get the next page of results.
  113187. func (c *TargetPoolsListCall) PageToken(pageToken string) *TargetPoolsListCall {
  113188. c.urlParams_.Set("pageToken", pageToken)
  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 *TargetPoolsListCall) Fields(s ...googleapi.Field) *TargetPoolsListCall {
  113195. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  113196. return c
  113197. }
  113198. // IfNoneMatch sets the optional parameter which makes the operation
  113199. // fail if the object's ETag matches the given value. This is useful for
  113200. // getting updates only after the object has changed since the last
  113201. // request. Use googleapi.IsNotModified to check whether the response
  113202. // error from Do is the result of In-None-Match.
  113203. func (c *TargetPoolsListCall) IfNoneMatch(entityTag string) *TargetPoolsListCall {
  113204. c.ifNoneMatch_ = entityTag
  113205. return c
  113206. }
  113207. // Context sets the context to be used in this call's Do method. Any
  113208. // pending HTTP request will be aborted if the provided context is
  113209. // canceled.
  113210. func (c *TargetPoolsListCall) Context(ctx context.Context) *TargetPoolsListCall {
  113211. c.ctx_ = ctx
  113212. return c
  113213. }
  113214. // Header returns an http.Header that can be modified by the caller to
  113215. // add HTTP headers to the request.
  113216. func (c *TargetPoolsListCall) Header() http.Header {
  113217. if c.header_ == nil {
  113218. c.header_ = make(http.Header)
  113219. }
  113220. return c.header_
  113221. }
  113222. func (c *TargetPoolsListCall) doRequest(alt string) (*http.Response, error) {
  113223. reqHeaders := make(http.Header)
  113224. for k, v := range c.header_ {
  113225. reqHeaders[k] = v
  113226. }
  113227. reqHeaders.Set("User-Agent", c.s.userAgent())
  113228. if c.ifNoneMatch_ != "" {
  113229. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  113230. }
  113231. var body io.Reader = nil
  113232. c.urlParams_.Set("alt", alt)
  113233. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools")
  113234. urls += "?" + c.urlParams_.Encode()
  113235. req, _ := http.NewRequest("GET", urls, body)
  113236. req.Header = reqHeaders
  113237. googleapi.Expand(req.URL, map[string]string{
  113238. "project": c.project,
  113239. "region": c.region,
  113240. })
  113241. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  113242. }
  113243. // Do executes the "compute.targetPools.list" call.
  113244. // Exactly one of *TargetPoolList or error will be non-nil. Any non-2xx
  113245. // status code is an error. Response headers are in either
  113246. // *TargetPoolList.ServerResponse.Header or (if a response was returned
  113247. // at all) in error.(*googleapi.Error).Header. Use
  113248. // googleapi.IsNotModified to check whether the returned error was
  113249. // because http.StatusNotModified was returned.
  113250. func (c *TargetPoolsListCall) Do(opts ...googleapi.CallOption) (*TargetPoolList, error) {
  113251. gensupport.SetOptions(c.urlParams_, opts...)
  113252. res, err := c.doRequest("json")
  113253. if res != nil && res.StatusCode == http.StatusNotModified {
  113254. if res.Body != nil {
  113255. res.Body.Close()
  113256. }
  113257. return nil, &googleapi.Error{
  113258. Code: res.StatusCode,
  113259. Header: res.Header,
  113260. }
  113261. }
  113262. if err != nil {
  113263. return nil, err
  113264. }
  113265. defer googleapi.CloseBody(res)
  113266. if err := googleapi.CheckResponse(res); err != nil {
  113267. return nil, err
  113268. }
  113269. ret := &TargetPoolList{
  113270. ServerResponse: googleapi.ServerResponse{
  113271. Header: res.Header,
  113272. HTTPStatusCode: res.StatusCode,
  113273. },
  113274. }
  113275. target := &ret
  113276. if err := gensupport.DecodeResponse(target, res); err != nil {
  113277. return nil, err
  113278. }
  113279. return ret, nil
  113280. // {
  113281. // "description": "Retrieves a list of target pools available to the specified project and region.",
  113282. // "httpMethod": "GET",
  113283. // "id": "compute.targetPools.list",
  113284. // "parameterOrder": [
  113285. // "project",
  113286. // "region"
  113287. // ],
  113288. // "parameters": {
  113289. // "filter": {
  113290. // "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).",
  113291. // "location": "query",
  113292. // "type": "string"
  113293. // },
  113294. // "maxResults": {
  113295. // "default": "500",
  113296. // "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)",
  113297. // "format": "uint32",
  113298. // "location": "query",
  113299. // "minimum": "0",
  113300. // "type": "integer"
  113301. // },
  113302. // "orderBy": {
  113303. // "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.",
  113304. // "location": "query",
  113305. // "type": "string"
  113306. // },
  113307. // "pageToken": {
  113308. // "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.",
  113309. // "location": "query",
  113310. // "type": "string"
  113311. // },
  113312. // "project": {
  113313. // "description": "Project ID for this request.",
  113314. // "location": "path",
  113315. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  113316. // "required": true,
  113317. // "type": "string"
  113318. // },
  113319. // "region": {
  113320. // "description": "Name of the region scoping this request.",
  113321. // "location": "path",
  113322. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  113323. // "required": true,
  113324. // "type": "string"
  113325. // }
  113326. // },
  113327. // "path": "{project}/regions/{region}/targetPools",
  113328. // "response": {
  113329. // "$ref": "TargetPoolList"
  113330. // },
  113331. // "scopes": [
  113332. // "https://www.googleapis.com/auth/cloud-platform",
  113333. // "https://www.googleapis.com/auth/compute",
  113334. // "https://www.googleapis.com/auth/compute.readonly"
  113335. // ]
  113336. // }
  113337. }
  113338. // Pages invokes f for each page of results.
  113339. // A non-nil error returned from f will halt the iteration.
  113340. // The provided context supersedes any context provided to the Context method.
  113341. func (c *TargetPoolsListCall) Pages(ctx context.Context, f func(*TargetPoolList) error) error {
  113342. c.ctx_ = ctx
  113343. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  113344. for {
  113345. x, err := c.Do()
  113346. if err != nil {
  113347. return err
  113348. }
  113349. if err := f(x); err != nil {
  113350. return err
  113351. }
  113352. if x.NextPageToken == "" {
  113353. return nil
  113354. }
  113355. c.PageToken(x.NextPageToken)
  113356. }
  113357. }
  113358. // method id "compute.targetPools.removeHealthCheck":
  113359. type TargetPoolsRemoveHealthCheckCall struct {
  113360. s *Service
  113361. project string
  113362. region string
  113363. targetPool string
  113364. targetpoolsremovehealthcheckrequest *TargetPoolsRemoveHealthCheckRequest
  113365. urlParams_ gensupport.URLParams
  113366. ctx_ context.Context
  113367. header_ http.Header
  113368. }
  113369. // RemoveHealthCheck: Removes health check URL from a target pool.
  113370. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/removeHealthCheck
  113371. func (r *TargetPoolsService) RemoveHealthCheck(project string, region string, targetPool string, targetpoolsremovehealthcheckrequest *TargetPoolsRemoveHealthCheckRequest) *TargetPoolsRemoveHealthCheckCall {
  113372. c := &TargetPoolsRemoveHealthCheckCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  113373. c.project = project
  113374. c.region = region
  113375. c.targetPool = targetPool
  113376. c.targetpoolsremovehealthcheckrequest = targetpoolsremovehealthcheckrequest
  113377. return c
  113378. }
  113379. // RequestId sets the optional parameter "requestId": An optional
  113380. // request ID to identify requests. Specify a unique request ID so that
  113381. // if you must retry your request, the server will know to ignore the
  113382. // request if it has already been completed.
  113383. //
  113384. // For example, consider a situation where you make an initial request
  113385. // and the request times out. If you make the request again with the
  113386. // same request ID, the server can check if original operation with the
  113387. // same request ID was received, and if so, will ignore the second
  113388. // request. This prevents clients from accidentally creating duplicate
  113389. // commitments.
  113390. //
  113391. // The request ID must be a valid UUID with the exception that zero UUID
  113392. // is not supported (00000000-0000-0000-0000-000000000000).
  113393. func (c *TargetPoolsRemoveHealthCheckCall) RequestId(requestId string) *TargetPoolsRemoveHealthCheckCall {
  113394. c.urlParams_.Set("requestId", requestId)
  113395. return c
  113396. }
  113397. // Fields allows partial responses to be retrieved. See
  113398. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  113399. // for more information.
  113400. func (c *TargetPoolsRemoveHealthCheckCall) Fields(s ...googleapi.Field) *TargetPoolsRemoveHealthCheckCall {
  113401. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  113402. return c
  113403. }
  113404. // Context sets the context to be used in this call's Do method. Any
  113405. // pending HTTP request will be aborted if the provided context is
  113406. // canceled.
  113407. func (c *TargetPoolsRemoveHealthCheckCall) Context(ctx context.Context) *TargetPoolsRemoveHealthCheckCall {
  113408. c.ctx_ = ctx
  113409. return c
  113410. }
  113411. // Header returns an http.Header that can be modified by the caller to
  113412. // add HTTP headers to the request.
  113413. func (c *TargetPoolsRemoveHealthCheckCall) Header() http.Header {
  113414. if c.header_ == nil {
  113415. c.header_ = make(http.Header)
  113416. }
  113417. return c.header_
  113418. }
  113419. func (c *TargetPoolsRemoveHealthCheckCall) doRequest(alt string) (*http.Response, error) {
  113420. reqHeaders := make(http.Header)
  113421. for k, v := range c.header_ {
  113422. reqHeaders[k] = v
  113423. }
  113424. reqHeaders.Set("User-Agent", c.s.userAgent())
  113425. var body io.Reader = nil
  113426. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsremovehealthcheckrequest)
  113427. if err != nil {
  113428. return nil, err
  113429. }
  113430. reqHeaders.Set("Content-Type", "application/json")
  113431. c.urlParams_.Set("alt", alt)
  113432. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/removeHealthCheck")
  113433. urls += "?" + c.urlParams_.Encode()
  113434. req, _ := http.NewRequest("POST", urls, body)
  113435. req.Header = reqHeaders
  113436. googleapi.Expand(req.URL, map[string]string{
  113437. "project": c.project,
  113438. "region": c.region,
  113439. "targetPool": c.targetPool,
  113440. })
  113441. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  113442. }
  113443. // Do executes the "compute.targetPools.removeHealthCheck" call.
  113444. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  113445. // status code is an error. Response headers are in either
  113446. // *Operation.ServerResponse.Header or (if a response was returned at
  113447. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  113448. // to check whether the returned error was because
  113449. // http.StatusNotModified was returned.
  113450. func (c *TargetPoolsRemoveHealthCheckCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  113451. gensupport.SetOptions(c.urlParams_, opts...)
  113452. res, err := c.doRequest("json")
  113453. if res != nil && res.StatusCode == http.StatusNotModified {
  113454. if res.Body != nil {
  113455. res.Body.Close()
  113456. }
  113457. return nil, &googleapi.Error{
  113458. Code: res.StatusCode,
  113459. Header: res.Header,
  113460. }
  113461. }
  113462. if err != nil {
  113463. return nil, err
  113464. }
  113465. defer googleapi.CloseBody(res)
  113466. if err := googleapi.CheckResponse(res); err != nil {
  113467. return nil, err
  113468. }
  113469. ret := &Operation{
  113470. ServerResponse: googleapi.ServerResponse{
  113471. Header: res.Header,
  113472. HTTPStatusCode: res.StatusCode,
  113473. },
  113474. }
  113475. target := &ret
  113476. if err := gensupport.DecodeResponse(target, res); err != nil {
  113477. return nil, err
  113478. }
  113479. return ret, nil
  113480. // {
  113481. // "description": "Removes health check URL from a target pool.",
  113482. // "httpMethod": "POST",
  113483. // "id": "compute.targetPools.removeHealthCheck",
  113484. // "parameterOrder": [
  113485. // "project",
  113486. // "region",
  113487. // "targetPool"
  113488. // ],
  113489. // "parameters": {
  113490. // "project": {
  113491. // "description": "Project ID for this request.",
  113492. // "location": "path",
  113493. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  113494. // "required": true,
  113495. // "type": "string"
  113496. // },
  113497. // "region": {
  113498. // "description": "Name of the region for this request.",
  113499. // "location": "path",
  113500. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  113501. // "required": true,
  113502. // "type": "string"
  113503. // },
  113504. // "requestId": {
  113505. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  113506. // "location": "query",
  113507. // "type": "string"
  113508. // },
  113509. // "targetPool": {
  113510. // "description": "Name of the target pool to remove health checks from.",
  113511. // "location": "path",
  113512. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  113513. // "required": true,
  113514. // "type": "string"
  113515. // }
  113516. // },
  113517. // "path": "{project}/regions/{region}/targetPools/{targetPool}/removeHealthCheck",
  113518. // "request": {
  113519. // "$ref": "TargetPoolsRemoveHealthCheckRequest"
  113520. // },
  113521. // "response": {
  113522. // "$ref": "Operation"
  113523. // },
  113524. // "scopes": [
  113525. // "https://www.googleapis.com/auth/cloud-platform",
  113526. // "https://www.googleapis.com/auth/compute"
  113527. // ]
  113528. // }
  113529. }
  113530. // method id "compute.targetPools.removeInstance":
  113531. type TargetPoolsRemoveInstanceCall struct {
  113532. s *Service
  113533. project string
  113534. region string
  113535. targetPool string
  113536. targetpoolsremoveinstancerequest *TargetPoolsRemoveInstanceRequest
  113537. urlParams_ gensupport.URLParams
  113538. ctx_ context.Context
  113539. header_ http.Header
  113540. }
  113541. // RemoveInstance: Removes instance URL from a target pool.
  113542. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/removeInstance
  113543. func (r *TargetPoolsService) RemoveInstance(project string, region string, targetPool string, targetpoolsremoveinstancerequest *TargetPoolsRemoveInstanceRequest) *TargetPoolsRemoveInstanceCall {
  113544. c := &TargetPoolsRemoveInstanceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  113545. c.project = project
  113546. c.region = region
  113547. c.targetPool = targetPool
  113548. c.targetpoolsremoveinstancerequest = targetpoolsremoveinstancerequest
  113549. return c
  113550. }
  113551. // RequestId sets the optional parameter "requestId": An optional
  113552. // request ID to identify requests. Specify a unique request ID so that
  113553. // if you must retry your request, the server will know to ignore the
  113554. // request if it has already been completed.
  113555. //
  113556. // For example, consider a situation where you make an initial request
  113557. // and the request times out. If you make the request again with the
  113558. // same request ID, the server can check if original operation with the
  113559. // same request ID was received, and if so, will ignore the second
  113560. // request. This prevents clients from accidentally creating duplicate
  113561. // commitments.
  113562. //
  113563. // The request ID must be a valid UUID with the exception that zero UUID
  113564. // is not supported (00000000-0000-0000-0000-000000000000).
  113565. func (c *TargetPoolsRemoveInstanceCall) RequestId(requestId string) *TargetPoolsRemoveInstanceCall {
  113566. c.urlParams_.Set("requestId", requestId)
  113567. return c
  113568. }
  113569. // Fields allows partial responses to be retrieved. See
  113570. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  113571. // for more information.
  113572. func (c *TargetPoolsRemoveInstanceCall) Fields(s ...googleapi.Field) *TargetPoolsRemoveInstanceCall {
  113573. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  113574. return c
  113575. }
  113576. // Context sets the context to be used in this call's Do method. Any
  113577. // pending HTTP request will be aborted if the provided context is
  113578. // canceled.
  113579. func (c *TargetPoolsRemoveInstanceCall) Context(ctx context.Context) *TargetPoolsRemoveInstanceCall {
  113580. c.ctx_ = ctx
  113581. return c
  113582. }
  113583. // Header returns an http.Header that can be modified by the caller to
  113584. // add HTTP headers to the request.
  113585. func (c *TargetPoolsRemoveInstanceCall) Header() http.Header {
  113586. if c.header_ == nil {
  113587. c.header_ = make(http.Header)
  113588. }
  113589. return c.header_
  113590. }
  113591. func (c *TargetPoolsRemoveInstanceCall) doRequest(alt string) (*http.Response, error) {
  113592. reqHeaders := make(http.Header)
  113593. for k, v := range c.header_ {
  113594. reqHeaders[k] = v
  113595. }
  113596. reqHeaders.Set("User-Agent", c.s.userAgent())
  113597. var body io.Reader = nil
  113598. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsremoveinstancerequest)
  113599. if err != nil {
  113600. return nil, err
  113601. }
  113602. reqHeaders.Set("Content-Type", "application/json")
  113603. c.urlParams_.Set("alt", alt)
  113604. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/removeInstance")
  113605. urls += "?" + c.urlParams_.Encode()
  113606. req, _ := http.NewRequest("POST", urls, body)
  113607. req.Header = reqHeaders
  113608. googleapi.Expand(req.URL, map[string]string{
  113609. "project": c.project,
  113610. "region": c.region,
  113611. "targetPool": c.targetPool,
  113612. })
  113613. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  113614. }
  113615. // Do executes the "compute.targetPools.removeInstance" call.
  113616. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  113617. // status code is an error. Response headers are in either
  113618. // *Operation.ServerResponse.Header or (if a response was returned at
  113619. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  113620. // to check whether the returned error was because
  113621. // http.StatusNotModified was returned.
  113622. func (c *TargetPoolsRemoveInstanceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  113623. gensupport.SetOptions(c.urlParams_, opts...)
  113624. res, err := c.doRequest("json")
  113625. if res != nil && res.StatusCode == http.StatusNotModified {
  113626. if res.Body != nil {
  113627. res.Body.Close()
  113628. }
  113629. return nil, &googleapi.Error{
  113630. Code: res.StatusCode,
  113631. Header: res.Header,
  113632. }
  113633. }
  113634. if err != nil {
  113635. return nil, err
  113636. }
  113637. defer googleapi.CloseBody(res)
  113638. if err := googleapi.CheckResponse(res); err != nil {
  113639. return nil, err
  113640. }
  113641. ret := &Operation{
  113642. ServerResponse: googleapi.ServerResponse{
  113643. Header: res.Header,
  113644. HTTPStatusCode: res.StatusCode,
  113645. },
  113646. }
  113647. target := &ret
  113648. if err := gensupport.DecodeResponse(target, res); err != nil {
  113649. return nil, err
  113650. }
  113651. return ret, nil
  113652. // {
  113653. // "description": "Removes instance URL from a target pool.",
  113654. // "httpMethod": "POST",
  113655. // "id": "compute.targetPools.removeInstance",
  113656. // "parameterOrder": [
  113657. // "project",
  113658. // "region",
  113659. // "targetPool"
  113660. // ],
  113661. // "parameters": {
  113662. // "project": {
  113663. // "description": "Project ID for this request.",
  113664. // "location": "path",
  113665. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  113666. // "required": true,
  113667. // "type": "string"
  113668. // },
  113669. // "region": {
  113670. // "description": "Name of the region scoping this request.",
  113671. // "location": "path",
  113672. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  113673. // "required": true,
  113674. // "type": "string"
  113675. // },
  113676. // "requestId": {
  113677. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  113678. // "location": "query",
  113679. // "type": "string"
  113680. // },
  113681. // "targetPool": {
  113682. // "description": "Name of the TargetPool resource to remove instances from.",
  113683. // "location": "path",
  113684. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  113685. // "required": true,
  113686. // "type": "string"
  113687. // }
  113688. // },
  113689. // "path": "{project}/regions/{region}/targetPools/{targetPool}/removeInstance",
  113690. // "request": {
  113691. // "$ref": "TargetPoolsRemoveInstanceRequest"
  113692. // },
  113693. // "response": {
  113694. // "$ref": "Operation"
  113695. // },
  113696. // "scopes": [
  113697. // "https://www.googleapis.com/auth/cloud-platform",
  113698. // "https://www.googleapis.com/auth/compute"
  113699. // ]
  113700. // }
  113701. }
  113702. // method id "compute.targetPools.setBackup":
  113703. type TargetPoolsSetBackupCall struct {
  113704. s *Service
  113705. project string
  113706. region string
  113707. targetPool string
  113708. targetreference *TargetReference
  113709. urlParams_ gensupport.URLParams
  113710. ctx_ context.Context
  113711. header_ http.Header
  113712. }
  113713. // SetBackup: Changes a backup target pool's configurations.
  113714. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/setBackup
  113715. func (r *TargetPoolsService) SetBackup(project string, region string, targetPool string, targetreference *TargetReference) *TargetPoolsSetBackupCall {
  113716. c := &TargetPoolsSetBackupCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  113717. c.project = project
  113718. c.region = region
  113719. c.targetPool = targetPool
  113720. c.targetreference = targetreference
  113721. return c
  113722. }
  113723. // FailoverRatio sets the optional parameter "failoverRatio": New
  113724. // failoverRatio value for the target pool.
  113725. func (c *TargetPoolsSetBackupCall) FailoverRatio(failoverRatio float64) *TargetPoolsSetBackupCall {
  113726. c.urlParams_.Set("failoverRatio", fmt.Sprint(failoverRatio))
  113727. return c
  113728. }
  113729. // RequestId sets the optional parameter "requestId": An optional
  113730. // request ID to identify requests. Specify a unique request ID so that
  113731. // if you must retry your request, the server will know to ignore the
  113732. // request if it has already been completed.
  113733. //
  113734. // For example, consider a situation where you make an initial request
  113735. // and the request times out. If you make the request again with the
  113736. // same request ID, the server can check if original operation with the
  113737. // same request ID was received, and if so, will ignore the second
  113738. // request. This prevents clients from accidentally creating duplicate
  113739. // commitments.
  113740. //
  113741. // The request ID must be a valid UUID with the exception that zero UUID
  113742. // is not supported (00000000-0000-0000-0000-000000000000).
  113743. func (c *TargetPoolsSetBackupCall) RequestId(requestId string) *TargetPoolsSetBackupCall {
  113744. c.urlParams_.Set("requestId", requestId)
  113745. return c
  113746. }
  113747. // Fields allows partial responses to be retrieved. See
  113748. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  113749. // for more information.
  113750. func (c *TargetPoolsSetBackupCall) Fields(s ...googleapi.Field) *TargetPoolsSetBackupCall {
  113751. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  113752. return c
  113753. }
  113754. // Context sets the context to be used in this call's Do method. Any
  113755. // pending HTTP request will be aborted if the provided context is
  113756. // canceled.
  113757. func (c *TargetPoolsSetBackupCall) Context(ctx context.Context) *TargetPoolsSetBackupCall {
  113758. c.ctx_ = ctx
  113759. return c
  113760. }
  113761. // Header returns an http.Header that can be modified by the caller to
  113762. // add HTTP headers to the request.
  113763. func (c *TargetPoolsSetBackupCall) Header() http.Header {
  113764. if c.header_ == nil {
  113765. c.header_ = make(http.Header)
  113766. }
  113767. return c.header_
  113768. }
  113769. func (c *TargetPoolsSetBackupCall) doRequest(alt string) (*http.Response, error) {
  113770. reqHeaders := make(http.Header)
  113771. for k, v := range c.header_ {
  113772. reqHeaders[k] = v
  113773. }
  113774. reqHeaders.Set("User-Agent", c.s.userAgent())
  113775. var body io.Reader = nil
  113776. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetreference)
  113777. if err != nil {
  113778. return nil, err
  113779. }
  113780. reqHeaders.Set("Content-Type", "application/json")
  113781. c.urlParams_.Set("alt", alt)
  113782. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/setBackup")
  113783. urls += "?" + c.urlParams_.Encode()
  113784. req, _ := http.NewRequest("POST", urls, body)
  113785. req.Header = reqHeaders
  113786. googleapi.Expand(req.URL, map[string]string{
  113787. "project": c.project,
  113788. "region": c.region,
  113789. "targetPool": c.targetPool,
  113790. })
  113791. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  113792. }
  113793. // Do executes the "compute.targetPools.setBackup" call.
  113794. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  113795. // status code is an error. Response headers are in either
  113796. // *Operation.ServerResponse.Header or (if a response was returned at
  113797. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  113798. // to check whether the returned error was because
  113799. // http.StatusNotModified was returned.
  113800. func (c *TargetPoolsSetBackupCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  113801. gensupport.SetOptions(c.urlParams_, opts...)
  113802. res, err := c.doRequest("json")
  113803. if res != nil && res.StatusCode == http.StatusNotModified {
  113804. if res.Body != nil {
  113805. res.Body.Close()
  113806. }
  113807. return nil, &googleapi.Error{
  113808. Code: res.StatusCode,
  113809. Header: res.Header,
  113810. }
  113811. }
  113812. if err != nil {
  113813. return nil, err
  113814. }
  113815. defer googleapi.CloseBody(res)
  113816. if err := googleapi.CheckResponse(res); err != nil {
  113817. return nil, err
  113818. }
  113819. ret := &Operation{
  113820. ServerResponse: googleapi.ServerResponse{
  113821. Header: res.Header,
  113822. HTTPStatusCode: res.StatusCode,
  113823. },
  113824. }
  113825. target := &ret
  113826. if err := gensupport.DecodeResponse(target, res); err != nil {
  113827. return nil, err
  113828. }
  113829. return ret, nil
  113830. // {
  113831. // "description": "Changes a backup target pool's configurations.",
  113832. // "httpMethod": "POST",
  113833. // "id": "compute.targetPools.setBackup",
  113834. // "parameterOrder": [
  113835. // "project",
  113836. // "region",
  113837. // "targetPool"
  113838. // ],
  113839. // "parameters": {
  113840. // "failoverRatio": {
  113841. // "description": "New failoverRatio value for the target pool.",
  113842. // "format": "float",
  113843. // "location": "query",
  113844. // "type": "number"
  113845. // },
  113846. // "project": {
  113847. // "description": "Project ID for this request.",
  113848. // "location": "path",
  113849. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  113850. // "required": true,
  113851. // "type": "string"
  113852. // },
  113853. // "region": {
  113854. // "description": "Name of the region scoping this request.",
  113855. // "location": "path",
  113856. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  113857. // "required": true,
  113858. // "type": "string"
  113859. // },
  113860. // "requestId": {
  113861. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  113862. // "location": "query",
  113863. // "type": "string"
  113864. // },
  113865. // "targetPool": {
  113866. // "description": "Name of the TargetPool resource to set a backup pool for.",
  113867. // "location": "path",
  113868. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  113869. // "required": true,
  113870. // "type": "string"
  113871. // }
  113872. // },
  113873. // "path": "{project}/regions/{region}/targetPools/{targetPool}/setBackup",
  113874. // "request": {
  113875. // "$ref": "TargetReference"
  113876. // },
  113877. // "response": {
  113878. // "$ref": "Operation"
  113879. // },
  113880. // "scopes": [
  113881. // "https://www.googleapis.com/auth/cloud-platform",
  113882. // "https://www.googleapis.com/auth/compute"
  113883. // ]
  113884. // }
  113885. }
  113886. // method id "compute.targetPools.testIamPermissions":
  113887. type TargetPoolsTestIamPermissionsCall struct {
  113888. s *Service
  113889. project string
  113890. region string
  113891. resource string
  113892. testpermissionsrequest *TestPermissionsRequest
  113893. urlParams_ gensupport.URLParams
  113894. ctx_ context.Context
  113895. header_ http.Header
  113896. }
  113897. // TestIamPermissions: Returns permissions that a caller has on the
  113898. // specified resource.
  113899. func (r *TargetPoolsService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *TargetPoolsTestIamPermissionsCall {
  113900. c := &TargetPoolsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  113901. c.project = project
  113902. c.region = region
  113903. c.resource = resource
  113904. c.testpermissionsrequest = testpermissionsrequest
  113905. return c
  113906. }
  113907. // Fields allows partial responses to be retrieved. See
  113908. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  113909. // for more information.
  113910. func (c *TargetPoolsTestIamPermissionsCall) Fields(s ...googleapi.Field) *TargetPoolsTestIamPermissionsCall {
  113911. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  113912. return c
  113913. }
  113914. // Context sets the context to be used in this call's Do method. Any
  113915. // pending HTTP request will be aborted if the provided context is
  113916. // canceled.
  113917. func (c *TargetPoolsTestIamPermissionsCall) Context(ctx context.Context) *TargetPoolsTestIamPermissionsCall {
  113918. c.ctx_ = ctx
  113919. return c
  113920. }
  113921. // Header returns an http.Header that can be modified by the caller to
  113922. // add HTTP headers to the request.
  113923. func (c *TargetPoolsTestIamPermissionsCall) Header() http.Header {
  113924. if c.header_ == nil {
  113925. c.header_ = make(http.Header)
  113926. }
  113927. return c.header_
  113928. }
  113929. func (c *TargetPoolsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  113930. reqHeaders := make(http.Header)
  113931. for k, v := range c.header_ {
  113932. reqHeaders[k] = v
  113933. }
  113934. reqHeaders.Set("User-Agent", c.s.userAgent())
  113935. var body io.Reader = nil
  113936. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  113937. if err != nil {
  113938. return nil, err
  113939. }
  113940. reqHeaders.Set("Content-Type", "application/json")
  113941. c.urlParams_.Set("alt", alt)
  113942. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{resource}/testIamPermissions")
  113943. urls += "?" + c.urlParams_.Encode()
  113944. req, _ := http.NewRequest("POST", urls, body)
  113945. req.Header = reqHeaders
  113946. googleapi.Expand(req.URL, map[string]string{
  113947. "project": c.project,
  113948. "region": c.region,
  113949. "resource": c.resource,
  113950. })
  113951. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  113952. }
  113953. // Do executes the "compute.targetPools.testIamPermissions" call.
  113954. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  113955. // non-2xx status code is an error. Response headers are in either
  113956. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  113957. // returned at all) in error.(*googleapi.Error).Header. Use
  113958. // googleapi.IsNotModified to check whether the returned error was
  113959. // because http.StatusNotModified was returned.
  113960. func (c *TargetPoolsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  113961. gensupport.SetOptions(c.urlParams_, opts...)
  113962. res, err := c.doRequest("json")
  113963. if res != nil && res.StatusCode == http.StatusNotModified {
  113964. if res.Body != nil {
  113965. res.Body.Close()
  113966. }
  113967. return nil, &googleapi.Error{
  113968. Code: res.StatusCode,
  113969. Header: res.Header,
  113970. }
  113971. }
  113972. if err != nil {
  113973. return nil, err
  113974. }
  113975. defer googleapi.CloseBody(res)
  113976. if err := googleapi.CheckResponse(res); err != nil {
  113977. return nil, err
  113978. }
  113979. ret := &TestPermissionsResponse{
  113980. ServerResponse: googleapi.ServerResponse{
  113981. Header: res.Header,
  113982. HTTPStatusCode: res.StatusCode,
  113983. },
  113984. }
  113985. target := &ret
  113986. if err := gensupport.DecodeResponse(target, res); err != nil {
  113987. return nil, err
  113988. }
  113989. return ret, nil
  113990. // {
  113991. // "description": "Returns permissions that a caller has on the specified resource.",
  113992. // "httpMethod": "POST",
  113993. // "id": "compute.targetPools.testIamPermissions",
  113994. // "parameterOrder": [
  113995. // "project",
  113996. // "region",
  113997. // "resource"
  113998. // ],
  113999. // "parameters": {
  114000. // "project": {
  114001. // "description": "Project ID for this request.",
  114002. // "location": "path",
  114003. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  114004. // "required": true,
  114005. // "type": "string"
  114006. // },
  114007. // "region": {
  114008. // "description": "The name of the region for this request.",
  114009. // "location": "path",
  114010. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  114011. // "required": true,
  114012. // "type": "string"
  114013. // },
  114014. // "resource": {
  114015. // "description": "Name of the resource for this request.",
  114016. // "location": "path",
  114017. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  114018. // "required": true,
  114019. // "type": "string"
  114020. // }
  114021. // },
  114022. // "path": "{project}/regions/{region}/targetPools/{resource}/testIamPermissions",
  114023. // "request": {
  114024. // "$ref": "TestPermissionsRequest"
  114025. // },
  114026. // "response": {
  114027. // "$ref": "TestPermissionsResponse"
  114028. // },
  114029. // "scopes": [
  114030. // "https://www.googleapis.com/auth/cloud-platform",
  114031. // "https://www.googleapis.com/auth/compute",
  114032. // "https://www.googleapis.com/auth/compute.readonly"
  114033. // ]
  114034. // }
  114035. }
  114036. // method id "compute.targetSslProxies.delete":
  114037. type TargetSslProxiesDeleteCall struct {
  114038. s *Service
  114039. project string
  114040. targetSslProxy string
  114041. urlParams_ gensupport.URLParams
  114042. ctx_ context.Context
  114043. header_ http.Header
  114044. }
  114045. // Delete: Deletes the specified TargetSslProxy resource.
  114046. func (r *TargetSslProxiesService) Delete(project string, targetSslProxy string) *TargetSslProxiesDeleteCall {
  114047. c := &TargetSslProxiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  114048. c.project = project
  114049. c.targetSslProxy = targetSslProxy
  114050. return c
  114051. }
  114052. // RequestId sets the optional parameter "requestId": An optional
  114053. // request ID to identify requests. Specify a unique request ID so that
  114054. // if you must retry your request, the server will know to ignore the
  114055. // request if it has already been completed.
  114056. //
  114057. // For example, consider a situation where you make an initial request
  114058. // and the request times out. If you make the request again with the
  114059. // same request ID, the server can check if original operation with the
  114060. // same request ID was received, and if so, will ignore the second
  114061. // request. This prevents clients from accidentally creating duplicate
  114062. // commitments.
  114063. //
  114064. // The request ID must be a valid UUID with the exception that zero UUID
  114065. // is not supported (00000000-0000-0000-0000-000000000000).
  114066. func (c *TargetSslProxiesDeleteCall) RequestId(requestId string) *TargetSslProxiesDeleteCall {
  114067. c.urlParams_.Set("requestId", requestId)
  114068. return c
  114069. }
  114070. // Fields allows partial responses to be retrieved. See
  114071. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  114072. // for more information.
  114073. func (c *TargetSslProxiesDeleteCall) Fields(s ...googleapi.Field) *TargetSslProxiesDeleteCall {
  114074. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  114075. return c
  114076. }
  114077. // Context sets the context to be used in this call's Do method. Any
  114078. // pending HTTP request will be aborted if the provided context is
  114079. // canceled.
  114080. func (c *TargetSslProxiesDeleteCall) Context(ctx context.Context) *TargetSslProxiesDeleteCall {
  114081. c.ctx_ = ctx
  114082. return c
  114083. }
  114084. // Header returns an http.Header that can be modified by the caller to
  114085. // add HTTP headers to the request.
  114086. func (c *TargetSslProxiesDeleteCall) Header() http.Header {
  114087. if c.header_ == nil {
  114088. c.header_ = make(http.Header)
  114089. }
  114090. return c.header_
  114091. }
  114092. func (c *TargetSslProxiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  114093. reqHeaders := make(http.Header)
  114094. for k, v := range c.header_ {
  114095. reqHeaders[k] = v
  114096. }
  114097. reqHeaders.Set("User-Agent", c.s.userAgent())
  114098. var body io.Reader = nil
  114099. c.urlParams_.Set("alt", alt)
  114100. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{targetSslProxy}")
  114101. urls += "?" + c.urlParams_.Encode()
  114102. req, _ := http.NewRequest("DELETE", urls, body)
  114103. req.Header = reqHeaders
  114104. googleapi.Expand(req.URL, map[string]string{
  114105. "project": c.project,
  114106. "targetSslProxy": c.targetSslProxy,
  114107. })
  114108. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  114109. }
  114110. // Do executes the "compute.targetSslProxies.delete" call.
  114111. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  114112. // status code is an error. Response headers are in either
  114113. // *Operation.ServerResponse.Header or (if a response was returned at
  114114. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  114115. // to check whether the returned error was because
  114116. // http.StatusNotModified was returned.
  114117. func (c *TargetSslProxiesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  114118. gensupport.SetOptions(c.urlParams_, opts...)
  114119. res, err := c.doRequest("json")
  114120. if res != nil && res.StatusCode == http.StatusNotModified {
  114121. if res.Body != nil {
  114122. res.Body.Close()
  114123. }
  114124. return nil, &googleapi.Error{
  114125. Code: res.StatusCode,
  114126. Header: res.Header,
  114127. }
  114128. }
  114129. if err != nil {
  114130. return nil, err
  114131. }
  114132. defer googleapi.CloseBody(res)
  114133. if err := googleapi.CheckResponse(res); err != nil {
  114134. return nil, err
  114135. }
  114136. ret := &Operation{
  114137. ServerResponse: googleapi.ServerResponse{
  114138. Header: res.Header,
  114139. HTTPStatusCode: res.StatusCode,
  114140. },
  114141. }
  114142. target := &ret
  114143. if err := gensupport.DecodeResponse(target, res); err != nil {
  114144. return nil, err
  114145. }
  114146. return ret, nil
  114147. // {
  114148. // "description": "Deletes the specified TargetSslProxy resource.",
  114149. // "httpMethod": "DELETE",
  114150. // "id": "compute.targetSslProxies.delete",
  114151. // "parameterOrder": [
  114152. // "project",
  114153. // "targetSslProxy"
  114154. // ],
  114155. // "parameters": {
  114156. // "project": {
  114157. // "description": "Project ID for this request.",
  114158. // "location": "path",
  114159. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  114160. // "required": true,
  114161. // "type": "string"
  114162. // },
  114163. // "requestId": {
  114164. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  114165. // "location": "query",
  114166. // "type": "string"
  114167. // },
  114168. // "targetSslProxy": {
  114169. // "description": "Name of the TargetSslProxy resource to delete.",
  114170. // "location": "path",
  114171. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  114172. // "required": true,
  114173. // "type": "string"
  114174. // }
  114175. // },
  114176. // "path": "{project}/global/targetSslProxies/{targetSslProxy}",
  114177. // "response": {
  114178. // "$ref": "Operation"
  114179. // },
  114180. // "scopes": [
  114181. // "https://www.googleapis.com/auth/cloud-platform",
  114182. // "https://www.googleapis.com/auth/compute"
  114183. // ]
  114184. // }
  114185. }
  114186. // method id "compute.targetSslProxies.get":
  114187. type TargetSslProxiesGetCall struct {
  114188. s *Service
  114189. project string
  114190. targetSslProxy string
  114191. urlParams_ gensupport.URLParams
  114192. ifNoneMatch_ string
  114193. ctx_ context.Context
  114194. header_ http.Header
  114195. }
  114196. // Get: Returns the specified TargetSslProxy resource. Gets a list of
  114197. // available target SSL proxies by making a list() request.
  114198. func (r *TargetSslProxiesService) Get(project string, targetSslProxy string) *TargetSslProxiesGetCall {
  114199. c := &TargetSslProxiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  114200. c.project = project
  114201. c.targetSslProxy = targetSslProxy
  114202. return c
  114203. }
  114204. // Fields allows partial responses to be retrieved. See
  114205. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  114206. // for more information.
  114207. func (c *TargetSslProxiesGetCall) Fields(s ...googleapi.Field) *TargetSslProxiesGetCall {
  114208. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  114209. return c
  114210. }
  114211. // IfNoneMatch sets the optional parameter which makes the operation
  114212. // fail if the object's ETag matches the given value. This is useful for
  114213. // getting updates only after the object has changed since the last
  114214. // request. Use googleapi.IsNotModified to check whether the response
  114215. // error from Do is the result of In-None-Match.
  114216. func (c *TargetSslProxiesGetCall) IfNoneMatch(entityTag string) *TargetSslProxiesGetCall {
  114217. c.ifNoneMatch_ = entityTag
  114218. return c
  114219. }
  114220. // Context sets the context to be used in this call's Do method. Any
  114221. // pending HTTP request will be aborted if the provided context is
  114222. // canceled.
  114223. func (c *TargetSslProxiesGetCall) Context(ctx context.Context) *TargetSslProxiesGetCall {
  114224. c.ctx_ = ctx
  114225. return c
  114226. }
  114227. // Header returns an http.Header that can be modified by the caller to
  114228. // add HTTP headers to the request.
  114229. func (c *TargetSslProxiesGetCall) Header() http.Header {
  114230. if c.header_ == nil {
  114231. c.header_ = make(http.Header)
  114232. }
  114233. return c.header_
  114234. }
  114235. func (c *TargetSslProxiesGetCall) doRequest(alt string) (*http.Response, error) {
  114236. reqHeaders := make(http.Header)
  114237. for k, v := range c.header_ {
  114238. reqHeaders[k] = v
  114239. }
  114240. reqHeaders.Set("User-Agent", c.s.userAgent())
  114241. if c.ifNoneMatch_ != "" {
  114242. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  114243. }
  114244. var body io.Reader = nil
  114245. c.urlParams_.Set("alt", alt)
  114246. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{targetSslProxy}")
  114247. urls += "?" + c.urlParams_.Encode()
  114248. req, _ := http.NewRequest("GET", urls, body)
  114249. req.Header = reqHeaders
  114250. googleapi.Expand(req.URL, map[string]string{
  114251. "project": c.project,
  114252. "targetSslProxy": c.targetSslProxy,
  114253. })
  114254. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  114255. }
  114256. // Do executes the "compute.targetSslProxies.get" call.
  114257. // Exactly one of *TargetSslProxy or error will be non-nil. Any non-2xx
  114258. // status code is an error. Response headers are in either
  114259. // *TargetSslProxy.ServerResponse.Header or (if a response was returned
  114260. // at all) in error.(*googleapi.Error).Header. Use
  114261. // googleapi.IsNotModified to check whether the returned error was
  114262. // because http.StatusNotModified was returned.
  114263. func (c *TargetSslProxiesGetCall) Do(opts ...googleapi.CallOption) (*TargetSslProxy, error) {
  114264. gensupport.SetOptions(c.urlParams_, opts...)
  114265. res, err := c.doRequest("json")
  114266. if res != nil && res.StatusCode == http.StatusNotModified {
  114267. if res.Body != nil {
  114268. res.Body.Close()
  114269. }
  114270. return nil, &googleapi.Error{
  114271. Code: res.StatusCode,
  114272. Header: res.Header,
  114273. }
  114274. }
  114275. if err != nil {
  114276. return nil, err
  114277. }
  114278. defer googleapi.CloseBody(res)
  114279. if err := googleapi.CheckResponse(res); err != nil {
  114280. return nil, err
  114281. }
  114282. ret := &TargetSslProxy{
  114283. ServerResponse: googleapi.ServerResponse{
  114284. Header: res.Header,
  114285. HTTPStatusCode: res.StatusCode,
  114286. },
  114287. }
  114288. target := &ret
  114289. if err := gensupport.DecodeResponse(target, res); err != nil {
  114290. return nil, err
  114291. }
  114292. return ret, nil
  114293. // {
  114294. // "description": "Returns the specified TargetSslProxy resource. Gets a list of available target SSL proxies by making a list() request.",
  114295. // "httpMethod": "GET",
  114296. // "id": "compute.targetSslProxies.get",
  114297. // "parameterOrder": [
  114298. // "project",
  114299. // "targetSslProxy"
  114300. // ],
  114301. // "parameters": {
  114302. // "project": {
  114303. // "description": "Project ID for this request.",
  114304. // "location": "path",
  114305. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  114306. // "required": true,
  114307. // "type": "string"
  114308. // },
  114309. // "targetSslProxy": {
  114310. // "description": "Name of the TargetSslProxy resource to return.",
  114311. // "location": "path",
  114312. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  114313. // "required": true,
  114314. // "type": "string"
  114315. // }
  114316. // },
  114317. // "path": "{project}/global/targetSslProxies/{targetSslProxy}",
  114318. // "response": {
  114319. // "$ref": "TargetSslProxy"
  114320. // },
  114321. // "scopes": [
  114322. // "https://www.googleapis.com/auth/cloud-platform",
  114323. // "https://www.googleapis.com/auth/compute",
  114324. // "https://www.googleapis.com/auth/compute.readonly"
  114325. // ]
  114326. // }
  114327. }
  114328. // method id "compute.targetSslProxies.insert":
  114329. type TargetSslProxiesInsertCall struct {
  114330. s *Service
  114331. project string
  114332. targetsslproxy *TargetSslProxy
  114333. urlParams_ gensupport.URLParams
  114334. ctx_ context.Context
  114335. header_ http.Header
  114336. }
  114337. // Insert: Creates a TargetSslProxy resource in the specified project
  114338. // using the data included in the request.
  114339. func (r *TargetSslProxiesService) Insert(project string, targetsslproxy *TargetSslProxy) *TargetSslProxiesInsertCall {
  114340. c := &TargetSslProxiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  114341. c.project = project
  114342. c.targetsslproxy = targetsslproxy
  114343. return c
  114344. }
  114345. // RequestId sets the optional parameter "requestId": An optional
  114346. // request ID to identify requests. Specify a unique request ID so that
  114347. // if you must retry your request, the server will know to ignore the
  114348. // request if it has already been completed.
  114349. //
  114350. // For example, consider a situation where you make an initial request
  114351. // and the request times out. If you make the request again with the
  114352. // same request ID, the server can check if original operation with the
  114353. // same request ID was received, and if so, will ignore the second
  114354. // request. This prevents clients from accidentally creating duplicate
  114355. // commitments.
  114356. //
  114357. // The request ID must be a valid UUID with the exception that zero UUID
  114358. // is not supported (00000000-0000-0000-0000-000000000000).
  114359. func (c *TargetSslProxiesInsertCall) RequestId(requestId string) *TargetSslProxiesInsertCall {
  114360. c.urlParams_.Set("requestId", requestId)
  114361. return c
  114362. }
  114363. // Fields allows partial responses to be retrieved. See
  114364. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  114365. // for more information.
  114366. func (c *TargetSslProxiesInsertCall) Fields(s ...googleapi.Field) *TargetSslProxiesInsertCall {
  114367. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  114368. return c
  114369. }
  114370. // Context sets the context to be used in this call's Do method. Any
  114371. // pending HTTP request will be aborted if the provided context is
  114372. // canceled.
  114373. func (c *TargetSslProxiesInsertCall) Context(ctx context.Context) *TargetSslProxiesInsertCall {
  114374. c.ctx_ = ctx
  114375. return c
  114376. }
  114377. // Header returns an http.Header that can be modified by the caller to
  114378. // add HTTP headers to the request.
  114379. func (c *TargetSslProxiesInsertCall) Header() http.Header {
  114380. if c.header_ == nil {
  114381. c.header_ = make(http.Header)
  114382. }
  114383. return c.header_
  114384. }
  114385. func (c *TargetSslProxiesInsertCall) doRequest(alt string) (*http.Response, error) {
  114386. reqHeaders := make(http.Header)
  114387. for k, v := range c.header_ {
  114388. reqHeaders[k] = v
  114389. }
  114390. reqHeaders.Set("User-Agent", c.s.userAgent())
  114391. var body io.Reader = nil
  114392. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetsslproxy)
  114393. if err != nil {
  114394. return nil, err
  114395. }
  114396. reqHeaders.Set("Content-Type", "application/json")
  114397. c.urlParams_.Set("alt", alt)
  114398. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies")
  114399. urls += "?" + c.urlParams_.Encode()
  114400. req, _ := http.NewRequest("POST", urls, body)
  114401. req.Header = reqHeaders
  114402. googleapi.Expand(req.URL, map[string]string{
  114403. "project": c.project,
  114404. })
  114405. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  114406. }
  114407. // Do executes the "compute.targetSslProxies.insert" call.
  114408. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  114409. // status code is an error. Response headers are in either
  114410. // *Operation.ServerResponse.Header or (if a response was returned at
  114411. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  114412. // to check whether the returned error was because
  114413. // http.StatusNotModified was returned.
  114414. func (c *TargetSslProxiesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  114415. gensupport.SetOptions(c.urlParams_, opts...)
  114416. res, err := c.doRequest("json")
  114417. if res != nil && res.StatusCode == http.StatusNotModified {
  114418. if res.Body != nil {
  114419. res.Body.Close()
  114420. }
  114421. return nil, &googleapi.Error{
  114422. Code: res.StatusCode,
  114423. Header: res.Header,
  114424. }
  114425. }
  114426. if err != nil {
  114427. return nil, err
  114428. }
  114429. defer googleapi.CloseBody(res)
  114430. if err := googleapi.CheckResponse(res); err != nil {
  114431. return nil, err
  114432. }
  114433. ret := &Operation{
  114434. ServerResponse: googleapi.ServerResponse{
  114435. Header: res.Header,
  114436. HTTPStatusCode: res.StatusCode,
  114437. },
  114438. }
  114439. target := &ret
  114440. if err := gensupport.DecodeResponse(target, res); err != nil {
  114441. return nil, err
  114442. }
  114443. return ret, nil
  114444. // {
  114445. // "description": "Creates a TargetSslProxy resource in the specified project using the data included in the request.",
  114446. // "httpMethod": "POST",
  114447. // "id": "compute.targetSslProxies.insert",
  114448. // "parameterOrder": [
  114449. // "project"
  114450. // ],
  114451. // "parameters": {
  114452. // "project": {
  114453. // "description": "Project ID for this request.",
  114454. // "location": "path",
  114455. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  114456. // "required": true,
  114457. // "type": "string"
  114458. // },
  114459. // "requestId": {
  114460. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  114461. // "location": "query",
  114462. // "type": "string"
  114463. // }
  114464. // },
  114465. // "path": "{project}/global/targetSslProxies",
  114466. // "request": {
  114467. // "$ref": "TargetSslProxy"
  114468. // },
  114469. // "response": {
  114470. // "$ref": "Operation"
  114471. // },
  114472. // "scopes": [
  114473. // "https://www.googleapis.com/auth/cloud-platform",
  114474. // "https://www.googleapis.com/auth/compute"
  114475. // ]
  114476. // }
  114477. }
  114478. // method id "compute.targetSslProxies.list":
  114479. type TargetSslProxiesListCall struct {
  114480. s *Service
  114481. project string
  114482. urlParams_ gensupport.URLParams
  114483. ifNoneMatch_ string
  114484. ctx_ context.Context
  114485. header_ http.Header
  114486. }
  114487. // List: Retrieves the list of TargetSslProxy resources available to the
  114488. // specified project.
  114489. func (r *TargetSslProxiesService) List(project string) *TargetSslProxiesListCall {
  114490. c := &TargetSslProxiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  114491. c.project = project
  114492. return c
  114493. }
  114494. // Filter sets the optional parameter "filter": A filter expression that
  114495. // filters resources listed in the response. The expression must specify
  114496. // the field name, a comparison operator, and the value that you want to
  114497. // use for filtering. The value must be a string, a number, or a
  114498. // boolean. The comparison operator must be either =, !=, >, or <.
  114499. //
  114500. // For example, if you are filtering Compute Engine instances, you can
  114501. // exclude instances named example-instance by specifying name !=
  114502. // example-instance.
  114503. //
  114504. // You can also filter nested fields. For example, you could specify
  114505. // scheduling.automaticRestart = false to include instances only if they
  114506. // are not scheduled for automatic restarts. You can use filtering on
  114507. // nested fields to filter based on resource labels.
  114508. //
  114509. // To filter on multiple expressions, provide each separate expression
  114510. // within parentheses. For example, (scheduling.automaticRestart = true)
  114511. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  114512. // AND expression. However, you can include AND and OR expressions
  114513. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  114514. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  114515. // true).
  114516. func (c *TargetSslProxiesListCall) Filter(filter string) *TargetSslProxiesListCall {
  114517. c.urlParams_.Set("filter", filter)
  114518. return c
  114519. }
  114520. // MaxResults sets the optional parameter "maxResults": The maximum
  114521. // number of results per page that should be returned. If the number of
  114522. // available results is larger than maxResults, Compute Engine returns a
  114523. // nextPageToken that can be used to get the next page of results in
  114524. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  114525. // (Default: 500)
  114526. func (c *TargetSslProxiesListCall) MaxResults(maxResults int64) *TargetSslProxiesListCall {
  114527. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  114528. return c
  114529. }
  114530. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  114531. // a certain order. By default, results are returned in alphanumerical
  114532. // order based on the resource name.
  114533. //
  114534. // You can also sort results in descending order based on the creation
  114535. // timestamp using orderBy="creationTimestamp desc". This sorts results
  114536. // based on the creationTimestamp field in reverse chronological order
  114537. // (newest result first). Use this to sort resources like operations so
  114538. // that the newest operation is returned first.
  114539. //
  114540. // Currently, only sorting by name or creationTimestamp desc is
  114541. // supported.
  114542. func (c *TargetSslProxiesListCall) OrderBy(orderBy string) *TargetSslProxiesListCall {
  114543. c.urlParams_.Set("orderBy", orderBy)
  114544. return c
  114545. }
  114546. // PageToken sets the optional parameter "pageToken": Specifies a page
  114547. // token to use. Set pageToken to the nextPageToken returned by a
  114548. // previous list request to get the next page of results.
  114549. func (c *TargetSslProxiesListCall) PageToken(pageToken string) *TargetSslProxiesListCall {
  114550. c.urlParams_.Set("pageToken", pageToken)
  114551. return c
  114552. }
  114553. // Fields allows partial responses to be retrieved. See
  114554. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  114555. // for more information.
  114556. func (c *TargetSslProxiesListCall) Fields(s ...googleapi.Field) *TargetSslProxiesListCall {
  114557. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  114558. return c
  114559. }
  114560. // IfNoneMatch sets the optional parameter which makes the operation
  114561. // fail if the object's ETag matches the given value. This is useful for
  114562. // getting updates only after the object has changed since the last
  114563. // request. Use googleapi.IsNotModified to check whether the response
  114564. // error from Do is the result of In-None-Match.
  114565. func (c *TargetSslProxiesListCall) IfNoneMatch(entityTag string) *TargetSslProxiesListCall {
  114566. c.ifNoneMatch_ = entityTag
  114567. return c
  114568. }
  114569. // Context sets the context to be used in this call's Do method. Any
  114570. // pending HTTP request will be aborted if the provided context is
  114571. // canceled.
  114572. func (c *TargetSslProxiesListCall) Context(ctx context.Context) *TargetSslProxiesListCall {
  114573. c.ctx_ = ctx
  114574. return c
  114575. }
  114576. // Header returns an http.Header that can be modified by the caller to
  114577. // add HTTP headers to the request.
  114578. func (c *TargetSslProxiesListCall) Header() http.Header {
  114579. if c.header_ == nil {
  114580. c.header_ = make(http.Header)
  114581. }
  114582. return c.header_
  114583. }
  114584. func (c *TargetSslProxiesListCall) doRequest(alt string) (*http.Response, error) {
  114585. reqHeaders := make(http.Header)
  114586. for k, v := range c.header_ {
  114587. reqHeaders[k] = v
  114588. }
  114589. reqHeaders.Set("User-Agent", c.s.userAgent())
  114590. if c.ifNoneMatch_ != "" {
  114591. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  114592. }
  114593. var body io.Reader = nil
  114594. c.urlParams_.Set("alt", alt)
  114595. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies")
  114596. urls += "?" + c.urlParams_.Encode()
  114597. req, _ := http.NewRequest("GET", urls, body)
  114598. req.Header = reqHeaders
  114599. googleapi.Expand(req.URL, map[string]string{
  114600. "project": c.project,
  114601. })
  114602. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  114603. }
  114604. // Do executes the "compute.targetSslProxies.list" call.
  114605. // Exactly one of *TargetSslProxyList or error will be non-nil. Any
  114606. // non-2xx status code is an error. Response headers are in either
  114607. // *TargetSslProxyList.ServerResponse.Header or (if a response was
  114608. // returned at all) in error.(*googleapi.Error).Header. Use
  114609. // googleapi.IsNotModified to check whether the returned error was
  114610. // because http.StatusNotModified was returned.
  114611. func (c *TargetSslProxiesListCall) Do(opts ...googleapi.CallOption) (*TargetSslProxyList, error) {
  114612. gensupport.SetOptions(c.urlParams_, opts...)
  114613. res, err := c.doRequest("json")
  114614. if res != nil && res.StatusCode == http.StatusNotModified {
  114615. if res.Body != nil {
  114616. res.Body.Close()
  114617. }
  114618. return nil, &googleapi.Error{
  114619. Code: res.StatusCode,
  114620. Header: res.Header,
  114621. }
  114622. }
  114623. if err != nil {
  114624. return nil, err
  114625. }
  114626. defer googleapi.CloseBody(res)
  114627. if err := googleapi.CheckResponse(res); err != nil {
  114628. return nil, err
  114629. }
  114630. ret := &TargetSslProxyList{
  114631. ServerResponse: googleapi.ServerResponse{
  114632. Header: res.Header,
  114633. HTTPStatusCode: res.StatusCode,
  114634. },
  114635. }
  114636. target := &ret
  114637. if err := gensupport.DecodeResponse(target, res); err != nil {
  114638. return nil, err
  114639. }
  114640. return ret, nil
  114641. // {
  114642. // "description": "Retrieves the list of TargetSslProxy resources available to the specified project.",
  114643. // "httpMethod": "GET",
  114644. // "id": "compute.targetSslProxies.list",
  114645. // "parameterOrder": [
  114646. // "project"
  114647. // ],
  114648. // "parameters": {
  114649. // "filter": {
  114650. // "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).",
  114651. // "location": "query",
  114652. // "type": "string"
  114653. // },
  114654. // "maxResults": {
  114655. // "default": "500",
  114656. // "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)",
  114657. // "format": "uint32",
  114658. // "location": "query",
  114659. // "minimum": "0",
  114660. // "type": "integer"
  114661. // },
  114662. // "orderBy": {
  114663. // "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.",
  114664. // "location": "query",
  114665. // "type": "string"
  114666. // },
  114667. // "pageToken": {
  114668. // "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.",
  114669. // "location": "query",
  114670. // "type": "string"
  114671. // },
  114672. // "project": {
  114673. // "description": "Project ID for this request.",
  114674. // "location": "path",
  114675. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  114676. // "required": true,
  114677. // "type": "string"
  114678. // }
  114679. // },
  114680. // "path": "{project}/global/targetSslProxies",
  114681. // "response": {
  114682. // "$ref": "TargetSslProxyList"
  114683. // },
  114684. // "scopes": [
  114685. // "https://www.googleapis.com/auth/cloud-platform",
  114686. // "https://www.googleapis.com/auth/compute",
  114687. // "https://www.googleapis.com/auth/compute.readonly"
  114688. // ]
  114689. // }
  114690. }
  114691. // Pages invokes f for each page of results.
  114692. // A non-nil error returned from f will halt the iteration.
  114693. // The provided context supersedes any context provided to the Context method.
  114694. func (c *TargetSslProxiesListCall) Pages(ctx context.Context, f func(*TargetSslProxyList) error) error {
  114695. c.ctx_ = ctx
  114696. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  114697. for {
  114698. x, err := c.Do()
  114699. if err != nil {
  114700. return err
  114701. }
  114702. if err := f(x); err != nil {
  114703. return err
  114704. }
  114705. if x.NextPageToken == "" {
  114706. return nil
  114707. }
  114708. c.PageToken(x.NextPageToken)
  114709. }
  114710. }
  114711. // method id "compute.targetSslProxies.setBackendService":
  114712. type TargetSslProxiesSetBackendServiceCall struct {
  114713. s *Service
  114714. project string
  114715. targetSslProxy string
  114716. targetsslproxiessetbackendservicerequest *TargetSslProxiesSetBackendServiceRequest
  114717. urlParams_ gensupport.URLParams
  114718. ctx_ context.Context
  114719. header_ http.Header
  114720. }
  114721. // SetBackendService: Changes the BackendService for TargetSslProxy.
  114722. func (r *TargetSslProxiesService) SetBackendService(project string, targetSslProxy string, targetsslproxiessetbackendservicerequest *TargetSslProxiesSetBackendServiceRequest) *TargetSslProxiesSetBackendServiceCall {
  114723. c := &TargetSslProxiesSetBackendServiceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  114724. c.project = project
  114725. c.targetSslProxy = targetSslProxy
  114726. c.targetsslproxiessetbackendservicerequest = targetsslproxiessetbackendservicerequest
  114727. return c
  114728. }
  114729. // RequestId sets the optional parameter "requestId": An optional
  114730. // request ID to identify requests. Specify a unique request ID so that
  114731. // if you must retry your request, the server will know to ignore the
  114732. // request if it has already been completed.
  114733. //
  114734. // For example, consider a situation where you make an initial request
  114735. // and the request times out. If you make the request again with the
  114736. // same request ID, the server can check if original operation with the
  114737. // same request ID was received, and if so, will ignore the second
  114738. // request. This prevents clients from accidentally creating duplicate
  114739. // commitments.
  114740. //
  114741. // The request ID must be a valid UUID with the exception that zero UUID
  114742. // is not supported (00000000-0000-0000-0000-000000000000).
  114743. func (c *TargetSslProxiesSetBackendServiceCall) RequestId(requestId string) *TargetSslProxiesSetBackendServiceCall {
  114744. c.urlParams_.Set("requestId", requestId)
  114745. return c
  114746. }
  114747. // Fields allows partial responses to be retrieved. See
  114748. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  114749. // for more information.
  114750. func (c *TargetSslProxiesSetBackendServiceCall) Fields(s ...googleapi.Field) *TargetSslProxiesSetBackendServiceCall {
  114751. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  114752. return c
  114753. }
  114754. // Context sets the context to be used in this call's Do method. Any
  114755. // pending HTTP request will be aborted if the provided context is
  114756. // canceled.
  114757. func (c *TargetSslProxiesSetBackendServiceCall) Context(ctx context.Context) *TargetSslProxiesSetBackendServiceCall {
  114758. c.ctx_ = ctx
  114759. return c
  114760. }
  114761. // Header returns an http.Header that can be modified by the caller to
  114762. // add HTTP headers to the request.
  114763. func (c *TargetSslProxiesSetBackendServiceCall) Header() http.Header {
  114764. if c.header_ == nil {
  114765. c.header_ = make(http.Header)
  114766. }
  114767. return c.header_
  114768. }
  114769. func (c *TargetSslProxiesSetBackendServiceCall) doRequest(alt string) (*http.Response, error) {
  114770. reqHeaders := make(http.Header)
  114771. for k, v := range c.header_ {
  114772. reqHeaders[k] = v
  114773. }
  114774. reqHeaders.Set("User-Agent", c.s.userAgent())
  114775. var body io.Reader = nil
  114776. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetsslproxiessetbackendservicerequest)
  114777. if err != nil {
  114778. return nil, err
  114779. }
  114780. reqHeaders.Set("Content-Type", "application/json")
  114781. c.urlParams_.Set("alt", alt)
  114782. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{targetSslProxy}/setBackendService")
  114783. urls += "?" + c.urlParams_.Encode()
  114784. req, _ := http.NewRequest("POST", urls, body)
  114785. req.Header = reqHeaders
  114786. googleapi.Expand(req.URL, map[string]string{
  114787. "project": c.project,
  114788. "targetSslProxy": c.targetSslProxy,
  114789. })
  114790. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  114791. }
  114792. // Do executes the "compute.targetSslProxies.setBackendService" call.
  114793. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  114794. // status code is an error. Response headers are in either
  114795. // *Operation.ServerResponse.Header or (if a response was returned at
  114796. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  114797. // to check whether the returned error was because
  114798. // http.StatusNotModified was returned.
  114799. func (c *TargetSslProxiesSetBackendServiceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  114800. gensupport.SetOptions(c.urlParams_, opts...)
  114801. res, err := c.doRequest("json")
  114802. if res != nil && res.StatusCode == http.StatusNotModified {
  114803. if res.Body != nil {
  114804. res.Body.Close()
  114805. }
  114806. return nil, &googleapi.Error{
  114807. Code: res.StatusCode,
  114808. Header: res.Header,
  114809. }
  114810. }
  114811. if err != nil {
  114812. return nil, err
  114813. }
  114814. defer googleapi.CloseBody(res)
  114815. if err := googleapi.CheckResponse(res); err != nil {
  114816. return nil, err
  114817. }
  114818. ret := &Operation{
  114819. ServerResponse: googleapi.ServerResponse{
  114820. Header: res.Header,
  114821. HTTPStatusCode: res.StatusCode,
  114822. },
  114823. }
  114824. target := &ret
  114825. if err := gensupport.DecodeResponse(target, res); err != nil {
  114826. return nil, err
  114827. }
  114828. return ret, nil
  114829. // {
  114830. // "description": "Changes the BackendService for TargetSslProxy.",
  114831. // "httpMethod": "POST",
  114832. // "id": "compute.targetSslProxies.setBackendService",
  114833. // "parameterOrder": [
  114834. // "project",
  114835. // "targetSslProxy"
  114836. // ],
  114837. // "parameters": {
  114838. // "project": {
  114839. // "description": "Project ID for this request.",
  114840. // "location": "path",
  114841. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  114842. // "required": true,
  114843. // "type": "string"
  114844. // },
  114845. // "requestId": {
  114846. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  114847. // "location": "query",
  114848. // "type": "string"
  114849. // },
  114850. // "targetSslProxy": {
  114851. // "description": "Name of the TargetSslProxy resource whose BackendService resource is to be set.",
  114852. // "location": "path",
  114853. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  114854. // "required": true,
  114855. // "type": "string"
  114856. // }
  114857. // },
  114858. // "path": "{project}/global/targetSslProxies/{targetSslProxy}/setBackendService",
  114859. // "request": {
  114860. // "$ref": "TargetSslProxiesSetBackendServiceRequest"
  114861. // },
  114862. // "response": {
  114863. // "$ref": "Operation"
  114864. // },
  114865. // "scopes": [
  114866. // "https://www.googleapis.com/auth/cloud-platform",
  114867. // "https://www.googleapis.com/auth/compute"
  114868. // ]
  114869. // }
  114870. }
  114871. // method id "compute.targetSslProxies.setProxyHeader":
  114872. type TargetSslProxiesSetProxyHeaderCall struct {
  114873. s *Service
  114874. project string
  114875. targetSslProxy string
  114876. targetsslproxiessetproxyheaderrequest *TargetSslProxiesSetProxyHeaderRequest
  114877. urlParams_ gensupport.URLParams
  114878. ctx_ context.Context
  114879. header_ http.Header
  114880. }
  114881. // SetProxyHeader: Changes the ProxyHeaderType for TargetSslProxy.
  114882. func (r *TargetSslProxiesService) SetProxyHeader(project string, targetSslProxy string, targetsslproxiessetproxyheaderrequest *TargetSslProxiesSetProxyHeaderRequest) *TargetSslProxiesSetProxyHeaderCall {
  114883. c := &TargetSslProxiesSetProxyHeaderCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  114884. c.project = project
  114885. c.targetSslProxy = targetSslProxy
  114886. c.targetsslproxiessetproxyheaderrequest = targetsslproxiessetproxyheaderrequest
  114887. return c
  114888. }
  114889. // RequestId sets the optional parameter "requestId": An optional
  114890. // request ID to identify requests. Specify a unique request ID so that
  114891. // if you must retry your request, the server will know to ignore the
  114892. // request if it has already been completed.
  114893. //
  114894. // For example, consider a situation where you make an initial request
  114895. // and the request times out. If you make the request again with the
  114896. // same request ID, the server can check if original operation with the
  114897. // same request ID was received, and if so, will ignore the second
  114898. // request. This prevents clients from accidentally creating duplicate
  114899. // commitments.
  114900. //
  114901. // The request ID must be a valid UUID with the exception that zero UUID
  114902. // is not supported (00000000-0000-0000-0000-000000000000).
  114903. func (c *TargetSslProxiesSetProxyHeaderCall) RequestId(requestId string) *TargetSslProxiesSetProxyHeaderCall {
  114904. c.urlParams_.Set("requestId", requestId)
  114905. return c
  114906. }
  114907. // Fields allows partial responses to be retrieved. See
  114908. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  114909. // for more information.
  114910. func (c *TargetSslProxiesSetProxyHeaderCall) Fields(s ...googleapi.Field) *TargetSslProxiesSetProxyHeaderCall {
  114911. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  114912. return c
  114913. }
  114914. // Context sets the context to be used in this call's Do method. Any
  114915. // pending HTTP request will be aborted if the provided context is
  114916. // canceled.
  114917. func (c *TargetSslProxiesSetProxyHeaderCall) Context(ctx context.Context) *TargetSslProxiesSetProxyHeaderCall {
  114918. c.ctx_ = ctx
  114919. return c
  114920. }
  114921. // Header returns an http.Header that can be modified by the caller to
  114922. // add HTTP headers to the request.
  114923. func (c *TargetSslProxiesSetProxyHeaderCall) Header() http.Header {
  114924. if c.header_ == nil {
  114925. c.header_ = make(http.Header)
  114926. }
  114927. return c.header_
  114928. }
  114929. func (c *TargetSslProxiesSetProxyHeaderCall) doRequest(alt string) (*http.Response, error) {
  114930. reqHeaders := make(http.Header)
  114931. for k, v := range c.header_ {
  114932. reqHeaders[k] = v
  114933. }
  114934. reqHeaders.Set("User-Agent", c.s.userAgent())
  114935. var body io.Reader = nil
  114936. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetsslproxiessetproxyheaderrequest)
  114937. if err != nil {
  114938. return nil, err
  114939. }
  114940. reqHeaders.Set("Content-Type", "application/json")
  114941. c.urlParams_.Set("alt", alt)
  114942. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{targetSslProxy}/setProxyHeader")
  114943. urls += "?" + c.urlParams_.Encode()
  114944. req, _ := http.NewRequest("POST", urls, body)
  114945. req.Header = reqHeaders
  114946. googleapi.Expand(req.URL, map[string]string{
  114947. "project": c.project,
  114948. "targetSslProxy": c.targetSslProxy,
  114949. })
  114950. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  114951. }
  114952. // Do executes the "compute.targetSslProxies.setProxyHeader" call.
  114953. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  114954. // status code is an error. Response headers are in either
  114955. // *Operation.ServerResponse.Header or (if a response was returned at
  114956. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  114957. // to check whether the returned error was because
  114958. // http.StatusNotModified was returned.
  114959. func (c *TargetSslProxiesSetProxyHeaderCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  114960. gensupport.SetOptions(c.urlParams_, opts...)
  114961. res, err := c.doRequest("json")
  114962. if res != nil && res.StatusCode == http.StatusNotModified {
  114963. if res.Body != nil {
  114964. res.Body.Close()
  114965. }
  114966. return nil, &googleapi.Error{
  114967. Code: res.StatusCode,
  114968. Header: res.Header,
  114969. }
  114970. }
  114971. if err != nil {
  114972. return nil, err
  114973. }
  114974. defer googleapi.CloseBody(res)
  114975. if err := googleapi.CheckResponse(res); err != nil {
  114976. return nil, err
  114977. }
  114978. ret := &Operation{
  114979. ServerResponse: googleapi.ServerResponse{
  114980. Header: res.Header,
  114981. HTTPStatusCode: res.StatusCode,
  114982. },
  114983. }
  114984. target := &ret
  114985. if err := gensupport.DecodeResponse(target, res); err != nil {
  114986. return nil, err
  114987. }
  114988. return ret, nil
  114989. // {
  114990. // "description": "Changes the ProxyHeaderType for TargetSslProxy.",
  114991. // "httpMethod": "POST",
  114992. // "id": "compute.targetSslProxies.setProxyHeader",
  114993. // "parameterOrder": [
  114994. // "project",
  114995. // "targetSslProxy"
  114996. // ],
  114997. // "parameters": {
  114998. // "project": {
  114999. // "description": "Project ID for this request.",
  115000. // "location": "path",
  115001. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  115002. // "required": true,
  115003. // "type": "string"
  115004. // },
  115005. // "requestId": {
  115006. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  115007. // "location": "query",
  115008. // "type": "string"
  115009. // },
  115010. // "targetSslProxy": {
  115011. // "description": "Name of the TargetSslProxy resource whose ProxyHeader is to be set.",
  115012. // "location": "path",
  115013. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  115014. // "required": true,
  115015. // "type": "string"
  115016. // }
  115017. // },
  115018. // "path": "{project}/global/targetSslProxies/{targetSslProxy}/setProxyHeader",
  115019. // "request": {
  115020. // "$ref": "TargetSslProxiesSetProxyHeaderRequest"
  115021. // },
  115022. // "response": {
  115023. // "$ref": "Operation"
  115024. // },
  115025. // "scopes": [
  115026. // "https://www.googleapis.com/auth/cloud-platform",
  115027. // "https://www.googleapis.com/auth/compute"
  115028. // ]
  115029. // }
  115030. }
  115031. // method id "compute.targetSslProxies.setSslCertificates":
  115032. type TargetSslProxiesSetSslCertificatesCall struct {
  115033. s *Service
  115034. project string
  115035. targetSslProxy string
  115036. targetsslproxiessetsslcertificatesrequest *TargetSslProxiesSetSslCertificatesRequest
  115037. urlParams_ gensupport.URLParams
  115038. ctx_ context.Context
  115039. header_ http.Header
  115040. }
  115041. // SetSslCertificates: Changes SslCertificates for TargetSslProxy.
  115042. func (r *TargetSslProxiesService) SetSslCertificates(project string, targetSslProxy string, targetsslproxiessetsslcertificatesrequest *TargetSslProxiesSetSslCertificatesRequest) *TargetSslProxiesSetSslCertificatesCall {
  115043. c := &TargetSslProxiesSetSslCertificatesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  115044. c.project = project
  115045. c.targetSslProxy = targetSslProxy
  115046. c.targetsslproxiessetsslcertificatesrequest = targetsslproxiessetsslcertificatesrequest
  115047. return c
  115048. }
  115049. // RequestId sets the optional parameter "requestId": An optional
  115050. // request ID to identify requests. Specify a unique request ID so that
  115051. // if you must retry your request, the server will know to ignore the
  115052. // request if it has already been completed.
  115053. //
  115054. // For example, consider a situation where you make an initial request
  115055. // and the request times out. If you make the request again with the
  115056. // same request ID, the server can check if original operation with the
  115057. // same request ID was received, and if so, will ignore the second
  115058. // request. This prevents clients from accidentally creating duplicate
  115059. // commitments.
  115060. //
  115061. // The request ID must be a valid UUID with the exception that zero UUID
  115062. // is not supported (00000000-0000-0000-0000-000000000000).
  115063. func (c *TargetSslProxiesSetSslCertificatesCall) RequestId(requestId string) *TargetSslProxiesSetSslCertificatesCall {
  115064. c.urlParams_.Set("requestId", requestId)
  115065. return c
  115066. }
  115067. // Fields allows partial responses to be retrieved. See
  115068. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  115069. // for more information.
  115070. func (c *TargetSslProxiesSetSslCertificatesCall) Fields(s ...googleapi.Field) *TargetSslProxiesSetSslCertificatesCall {
  115071. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  115072. return c
  115073. }
  115074. // Context sets the context to be used in this call's Do method. Any
  115075. // pending HTTP request will be aborted if the provided context is
  115076. // canceled.
  115077. func (c *TargetSslProxiesSetSslCertificatesCall) Context(ctx context.Context) *TargetSslProxiesSetSslCertificatesCall {
  115078. c.ctx_ = ctx
  115079. return c
  115080. }
  115081. // Header returns an http.Header that can be modified by the caller to
  115082. // add HTTP headers to the request.
  115083. func (c *TargetSslProxiesSetSslCertificatesCall) Header() http.Header {
  115084. if c.header_ == nil {
  115085. c.header_ = make(http.Header)
  115086. }
  115087. return c.header_
  115088. }
  115089. func (c *TargetSslProxiesSetSslCertificatesCall) doRequest(alt string) (*http.Response, error) {
  115090. reqHeaders := make(http.Header)
  115091. for k, v := range c.header_ {
  115092. reqHeaders[k] = v
  115093. }
  115094. reqHeaders.Set("User-Agent", c.s.userAgent())
  115095. var body io.Reader = nil
  115096. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetsslproxiessetsslcertificatesrequest)
  115097. if err != nil {
  115098. return nil, err
  115099. }
  115100. reqHeaders.Set("Content-Type", "application/json")
  115101. c.urlParams_.Set("alt", alt)
  115102. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{targetSslProxy}/setSslCertificates")
  115103. urls += "?" + c.urlParams_.Encode()
  115104. req, _ := http.NewRequest("POST", urls, body)
  115105. req.Header = reqHeaders
  115106. googleapi.Expand(req.URL, map[string]string{
  115107. "project": c.project,
  115108. "targetSslProxy": c.targetSslProxy,
  115109. })
  115110. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  115111. }
  115112. // Do executes the "compute.targetSslProxies.setSslCertificates" call.
  115113. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  115114. // status code is an error. Response headers are in either
  115115. // *Operation.ServerResponse.Header or (if a response was returned at
  115116. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  115117. // to check whether the returned error was because
  115118. // http.StatusNotModified was returned.
  115119. func (c *TargetSslProxiesSetSslCertificatesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  115120. gensupport.SetOptions(c.urlParams_, opts...)
  115121. res, err := c.doRequest("json")
  115122. if res != nil && res.StatusCode == http.StatusNotModified {
  115123. if res.Body != nil {
  115124. res.Body.Close()
  115125. }
  115126. return nil, &googleapi.Error{
  115127. Code: res.StatusCode,
  115128. Header: res.Header,
  115129. }
  115130. }
  115131. if err != nil {
  115132. return nil, err
  115133. }
  115134. defer googleapi.CloseBody(res)
  115135. if err := googleapi.CheckResponse(res); err != nil {
  115136. return nil, err
  115137. }
  115138. ret := &Operation{
  115139. ServerResponse: googleapi.ServerResponse{
  115140. Header: res.Header,
  115141. HTTPStatusCode: res.StatusCode,
  115142. },
  115143. }
  115144. target := &ret
  115145. if err := gensupport.DecodeResponse(target, res); err != nil {
  115146. return nil, err
  115147. }
  115148. return ret, nil
  115149. // {
  115150. // "description": "Changes SslCertificates for TargetSslProxy.",
  115151. // "httpMethod": "POST",
  115152. // "id": "compute.targetSslProxies.setSslCertificates",
  115153. // "parameterOrder": [
  115154. // "project",
  115155. // "targetSslProxy"
  115156. // ],
  115157. // "parameters": {
  115158. // "project": {
  115159. // "description": "Project ID for this request.",
  115160. // "location": "path",
  115161. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  115162. // "required": true,
  115163. // "type": "string"
  115164. // },
  115165. // "requestId": {
  115166. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  115167. // "location": "query",
  115168. // "type": "string"
  115169. // },
  115170. // "targetSslProxy": {
  115171. // "description": "Name of the TargetSslProxy resource whose SslCertificate resource is to be set.",
  115172. // "location": "path",
  115173. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  115174. // "required": true,
  115175. // "type": "string"
  115176. // }
  115177. // },
  115178. // "path": "{project}/global/targetSslProxies/{targetSslProxy}/setSslCertificates",
  115179. // "request": {
  115180. // "$ref": "TargetSslProxiesSetSslCertificatesRequest"
  115181. // },
  115182. // "response": {
  115183. // "$ref": "Operation"
  115184. // },
  115185. // "scopes": [
  115186. // "https://www.googleapis.com/auth/cloud-platform",
  115187. // "https://www.googleapis.com/auth/compute"
  115188. // ]
  115189. // }
  115190. }
  115191. // method id "compute.targetSslProxies.setSslPolicy":
  115192. type TargetSslProxiesSetSslPolicyCall struct {
  115193. s *Service
  115194. project string
  115195. targetSslProxy string
  115196. sslpolicyreference *SslPolicyReference
  115197. urlParams_ gensupport.URLParams
  115198. ctx_ context.Context
  115199. header_ http.Header
  115200. }
  115201. // SetSslPolicy: Sets the SSL policy for TargetSslProxy. The SSL policy
  115202. // specifies the server-side support for SSL features. This affects
  115203. // connections between clients and the SSL proxy load balancer. They do
  115204. // not affect the connection between the load balancer and the backends.
  115205. func (r *TargetSslProxiesService) SetSslPolicy(project string, targetSslProxy string, sslpolicyreference *SslPolicyReference) *TargetSslProxiesSetSslPolicyCall {
  115206. c := &TargetSslProxiesSetSslPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  115207. c.project = project
  115208. c.targetSslProxy = targetSslProxy
  115209. c.sslpolicyreference = sslpolicyreference
  115210. return c
  115211. }
  115212. // RequestId sets the optional parameter "requestId": An optional
  115213. // request ID to identify requests. Specify a unique request ID so that
  115214. // if you must retry your request, the server will know to ignore the
  115215. // request if it has already been completed.
  115216. //
  115217. // For example, consider a situation where you make an initial request
  115218. // and the request times out. If you make the request again with the
  115219. // same request ID, the server can check if original operation with the
  115220. // same request ID was received, and if so, will ignore the second
  115221. // request. This prevents clients from accidentally creating duplicate
  115222. // commitments.
  115223. //
  115224. // The request ID must be a valid UUID with the exception that zero UUID
  115225. // is not supported (00000000-0000-0000-0000-000000000000).
  115226. func (c *TargetSslProxiesSetSslPolicyCall) RequestId(requestId string) *TargetSslProxiesSetSslPolicyCall {
  115227. c.urlParams_.Set("requestId", requestId)
  115228. return c
  115229. }
  115230. // Fields allows partial responses to be retrieved. See
  115231. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  115232. // for more information.
  115233. func (c *TargetSslProxiesSetSslPolicyCall) Fields(s ...googleapi.Field) *TargetSslProxiesSetSslPolicyCall {
  115234. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  115235. return c
  115236. }
  115237. // Context sets the context to be used in this call's Do method. Any
  115238. // pending HTTP request will be aborted if the provided context is
  115239. // canceled.
  115240. func (c *TargetSslProxiesSetSslPolicyCall) Context(ctx context.Context) *TargetSslProxiesSetSslPolicyCall {
  115241. c.ctx_ = ctx
  115242. return c
  115243. }
  115244. // Header returns an http.Header that can be modified by the caller to
  115245. // add HTTP headers to the request.
  115246. func (c *TargetSslProxiesSetSslPolicyCall) Header() http.Header {
  115247. if c.header_ == nil {
  115248. c.header_ = make(http.Header)
  115249. }
  115250. return c.header_
  115251. }
  115252. func (c *TargetSslProxiesSetSslPolicyCall) doRequest(alt string) (*http.Response, error) {
  115253. reqHeaders := make(http.Header)
  115254. for k, v := range c.header_ {
  115255. reqHeaders[k] = v
  115256. }
  115257. reqHeaders.Set("User-Agent", c.s.userAgent())
  115258. var body io.Reader = nil
  115259. body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslpolicyreference)
  115260. if err != nil {
  115261. return nil, err
  115262. }
  115263. reqHeaders.Set("Content-Type", "application/json")
  115264. c.urlParams_.Set("alt", alt)
  115265. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{targetSslProxy}/setSslPolicy")
  115266. urls += "?" + c.urlParams_.Encode()
  115267. req, _ := http.NewRequest("POST", urls, body)
  115268. req.Header = reqHeaders
  115269. googleapi.Expand(req.URL, map[string]string{
  115270. "project": c.project,
  115271. "targetSslProxy": c.targetSslProxy,
  115272. })
  115273. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  115274. }
  115275. // Do executes the "compute.targetSslProxies.setSslPolicy" call.
  115276. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  115277. // status code is an error. Response headers are in either
  115278. // *Operation.ServerResponse.Header or (if a response was returned at
  115279. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  115280. // to check whether the returned error was because
  115281. // http.StatusNotModified was returned.
  115282. func (c *TargetSslProxiesSetSslPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  115283. gensupport.SetOptions(c.urlParams_, opts...)
  115284. res, err := c.doRequest("json")
  115285. if res != nil && res.StatusCode == http.StatusNotModified {
  115286. if res.Body != nil {
  115287. res.Body.Close()
  115288. }
  115289. return nil, &googleapi.Error{
  115290. Code: res.StatusCode,
  115291. Header: res.Header,
  115292. }
  115293. }
  115294. if err != nil {
  115295. return nil, err
  115296. }
  115297. defer googleapi.CloseBody(res)
  115298. if err := googleapi.CheckResponse(res); err != nil {
  115299. return nil, err
  115300. }
  115301. ret := &Operation{
  115302. ServerResponse: googleapi.ServerResponse{
  115303. Header: res.Header,
  115304. HTTPStatusCode: res.StatusCode,
  115305. },
  115306. }
  115307. target := &ret
  115308. if err := gensupport.DecodeResponse(target, res); err != nil {
  115309. return nil, err
  115310. }
  115311. return ret, nil
  115312. // {
  115313. // "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.",
  115314. // "httpMethod": "POST",
  115315. // "id": "compute.targetSslProxies.setSslPolicy",
  115316. // "parameterOrder": [
  115317. // "project",
  115318. // "targetSslProxy"
  115319. // ],
  115320. // "parameters": {
  115321. // "project": {
  115322. // "description": "Project ID for this request.",
  115323. // "location": "path",
  115324. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  115325. // "required": true,
  115326. // "type": "string"
  115327. // },
  115328. // "requestId": {
  115329. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  115330. // "location": "query",
  115331. // "type": "string"
  115332. // },
  115333. // "targetSslProxy": {
  115334. // "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.",
  115335. // "location": "path",
  115336. // "required": true,
  115337. // "type": "string"
  115338. // }
  115339. // },
  115340. // "path": "{project}/global/targetSslProxies/{targetSslProxy}/setSslPolicy",
  115341. // "request": {
  115342. // "$ref": "SslPolicyReference"
  115343. // },
  115344. // "response": {
  115345. // "$ref": "Operation"
  115346. // },
  115347. // "scopes": [
  115348. // "https://www.googleapis.com/auth/cloud-platform",
  115349. // "https://www.googleapis.com/auth/compute"
  115350. // ]
  115351. // }
  115352. }
  115353. // method id "compute.targetSslProxies.testIamPermissions":
  115354. type TargetSslProxiesTestIamPermissionsCall struct {
  115355. s *Service
  115356. project string
  115357. resource string
  115358. testpermissionsrequest *TestPermissionsRequest
  115359. urlParams_ gensupport.URLParams
  115360. ctx_ context.Context
  115361. header_ http.Header
  115362. }
  115363. // TestIamPermissions: Returns permissions that a caller has on the
  115364. // specified resource.
  115365. func (r *TargetSslProxiesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *TargetSslProxiesTestIamPermissionsCall {
  115366. c := &TargetSslProxiesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  115367. c.project = project
  115368. c.resource = resource
  115369. c.testpermissionsrequest = testpermissionsrequest
  115370. return c
  115371. }
  115372. // Fields allows partial responses to be retrieved. See
  115373. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  115374. // for more information.
  115375. func (c *TargetSslProxiesTestIamPermissionsCall) Fields(s ...googleapi.Field) *TargetSslProxiesTestIamPermissionsCall {
  115376. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  115377. return c
  115378. }
  115379. // Context sets the context to be used in this call's Do method. Any
  115380. // pending HTTP request will be aborted if the provided context is
  115381. // canceled.
  115382. func (c *TargetSslProxiesTestIamPermissionsCall) Context(ctx context.Context) *TargetSslProxiesTestIamPermissionsCall {
  115383. c.ctx_ = ctx
  115384. return c
  115385. }
  115386. // Header returns an http.Header that can be modified by the caller to
  115387. // add HTTP headers to the request.
  115388. func (c *TargetSslProxiesTestIamPermissionsCall) Header() http.Header {
  115389. if c.header_ == nil {
  115390. c.header_ = make(http.Header)
  115391. }
  115392. return c.header_
  115393. }
  115394. func (c *TargetSslProxiesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  115395. reqHeaders := make(http.Header)
  115396. for k, v := range c.header_ {
  115397. reqHeaders[k] = v
  115398. }
  115399. reqHeaders.Set("User-Agent", c.s.userAgent())
  115400. var body io.Reader = nil
  115401. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  115402. if err != nil {
  115403. return nil, err
  115404. }
  115405. reqHeaders.Set("Content-Type", "application/json")
  115406. c.urlParams_.Set("alt", alt)
  115407. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{resource}/testIamPermissions")
  115408. urls += "?" + c.urlParams_.Encode()
  115409. req, _ := http.NewRequest("POST", urls, body)
  115410. req.Header = reqHeaders
  115411. googleapi.Expand(req.URL, map[string]string{
  115412. "project": c.project,
  115413. "resource": c.resource,
  115414. })
  115415. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  115416. }
  115417. // Do executes the "compute.targetSslProxies.testIamPermissions" call.
  115418. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  115419. // non-2xx status code is an error. Response headers are in either
  115420. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  115421. // returned at all) in error.(*googleapi.Error).Header. Use
  115422. // googleapi.IsNotModified to check whether the returned error was
  115423. // because http.StatusNotModified was returned.
  115424. func (c *TargetSslProxiesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  115425. gensupport.SetOptions(c.urlParams_, opts...)
  115426. res, err := c.doRequest("json")
  115427. if res != nil && res.StatusCode == http.StatusNotModified {
  115428. if res.Body != nil {
  115429. res.Body.Close()
  115430. }
  115431. return nil, &googleapi.Error{
  115432. Code: res.StatusCode,
  115433. Header: res.Header,
  115434. }
  115435. }
  115436. if err != nil {
  115437. return nil, err
  115438. }
  115439. defer googleapi.CloseBody(res)
  115440. if err := googleapi.CheckResponse(res); err != nil {
  115441. return nil, err
  115442. }
  115443. ret := &TestPermissionsResponse{
  115444. ServerResponse: googleapi.ServerResponse{
  115445. Header: res.Header,
  115446. HTTPStatusCode: res.StatusCode,
  115447. },
  115448. }
  115449. target := &ret
  115450. if err := gensupport.DecodeResponse(target, res); err != nil {
  115451. return nil, err
  115452. }
  115453. return ret, nil
  115454. // {
  115455. // "description": "Returns permissions that a caller has on the specified resource.",
  115456. // "httpMethod": "POST",
  115457. // "id": "compute.targetSslProxies.testIamPermissions",
  115458. // "parameterOrder": [
  115459. // "project",
  115460. // "resource"
  115461. // ],
  115462. // "parameters": {
  115463. // "project": {
  115464. // "description": "Project ID for this request.",
  115465. // "location": "path",
  115466. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  115467. // "required": true,
  115468. // "type": "string"
  115469. // },
  115470. // "resource": {
  115471. // "description": "Name of the resource for this request.",
  115472. // "location": "path",
  115473. // "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?",
  115474. // "required": true,
  115475. // "type": "string"
  115476. // }
  115477. // },
  115478. // "path": "{project}/global/targetSslProxies/{resource}/testIamPermissions",
  115479. // "request": {
  115480. // "$ref": "TestPermissionsRequest"
  115481. // },
  115482. // "response": {
  115483. // "$ref": "TestPermissionsResponse"
  115484. // },
  115485. // "scopes": [
  115486. // "https://www.googleapis.com/auth/cloud-platform",
  115487. // "https://www.googleapis.com/auth/compute",
  115488. // "https://www.googleapis.com/auth/compute.readonly"
  115489. // ]
  115490. // }
  115491. }
  115492. // method id "compute.targetTcpProxies.delete":
  115493. type TargetTcpProxiesDeleteCall struct {
  115494. s *Service
  115495. project string
  115496. targetTcpProxy string
  115497. urlParams_ gensupport.URLParams
  115498. ctx_ context.Context
  115499. header_ http.Header
  115500. }
  115501. // Delete: Deletes the specified TargetTcpProxy resource.
  115502. func (r *TargetTcpProxiesService) Delete(project string, targetTcpProxy string) *TargetTcpProxiesDeleteCall {
  115503. c := &TargetTcpProxiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  115504. c.project = project
  115505. c.targetTcpProxy = targetTcpProxy
  115506. return c
  115507. }
  115508. // RequestId sets the optional parameter "requestId": An optional
  115509. // request ID to identify requests. Specify a unique request ID so that
  115510. // if you must retry your request, the server will know to ignore the
  115511. // request if it has already been completed.
  115512. //
  115513. // For example, consider a situation where you make an initial request
  115514. // and the request times out. If you make the request again with the
  115515. // same request ID, the server can check if original operation with the
  115516. // same request ID was received, and if so, will ignore the second
  115517. // request. This prevents clients from accidentally creating duplicate
  115518. // commitments.
  115519. //
  115520. // The request ID must be a valid UUID with the exception that zero UUID
  115521. // is not supported (00000000-0000-0000-0000-000000000000).
  115522. func (c *TargetTcpProxiesDeleteCall) RequestId(requestId string) *TargetTcpProxiesDeleteCall {
  115523. c.urlParams_.Set("requestId", requestId)
  115524. return c
  115525. }
  115526. // Fields allows partial responses to be retrieved. See
  115527. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  115528. // for more information.
  115529. func (c *TargetTcpProxiesDeleteCall) Fields(s ...googleapi.Field) *TargetTcpProxiesDeleteCall {
  115530. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  115531. return c
  115532. }
  115533. // Context sets the context to be used in this call's Do method. Any
  115534. // pending HTTP request will be aborted if the provided context is
  115535. // canceled.
  115536. func (c *TargetTcpProxiesDeleteCall) Context(ctx context.Context) *TargetTcpProxiesDeleteCall {
  115537. c.ctx_ = ctx
  115538. return c
  115539. }
  115540. // Header returns an http.Header that can be modified by the caller to
  115541. // add HTTP headers to the request.
  115542. func (c *TargetTcpProxiesDeleteCall) Header() http.Header {
  115543. if c.header_ == nil {
  115544. c.header_ = make(http.Header)
  115545. }
  115546. return c.header_
  115547. }
  115548. func (c *TargetTcpProxiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  115549. reqHeaders := make(http.Header)
  115550. for k, v := range c.header_ {
  115551. reqHeaders[k] = v
  115552. }
  115553. reqHeaders.Set("User-Agent", c.s.userAgent())
  115554. var body io.Reader = nil
  115555. c.urlParams_.Set("alt", alt)
  115556. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies/{targetTcpProxy}")
  115557. urls += "?" + c.urlParams_.Encode()
  115558. req, _ := http.NewRequest("DELETE", urls, body)
  115559. req.Header = reqHeaders
  115560. googleapi.Expand(req.URL, map[string]string{
  115561. "project": c.project,
  115562. "targetTcpProxy": c.targetTcpProxy,
  115563. })
  115564. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  115565. }
  115566. // Do executes the "compute.targetTcpProxies.delete" call.
  115567. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  115568. // status code is an error. Response headers are in either
  115569. // *Operation.ServerResponse.Header or (if a response was returned at
  115570. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  115571. // to check whether the returned error was because
  115572. // http.StatusNotModified was returned.
  115573. func (c *TargetTcpProxiesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  115574. gensupport.SetOptions(c.urlParams_, opts...)
  115575. res, err := c.doRequest("json")
  115576. if res != nil && res.StatusCode == http.StatusNotModified {
  115577. if res.Body != nil {
  115578. res.Body.Close()
  115579. }
  115580. return nil, &googleapi.Error{
  115581. Code: res.StatusCode,
  115582. Header: res.Header,
  115583. }
  115584. }
  115585. if err != nil {
  115586. return nil, err
  115587. }
  115588. defer googleapi.CloseBody(res)
  115589. if err := googleapi.CheckResponse(res); err != nil {
  115590. return nil, err
  115591. }
  115592. ret := &Operation{
  115593. ServerResponse: googleapi.ServerResponse{
  115594. Header: res.Header,
  115595. HTTPStatusCode: res.StatusCode,
  115596. },
  115597. }
  115598. target := &ret
  115599. if err := gensupport.DecodeResponse(target, res); err != nil {
  115600. return nil, err
  115601. }
  115602. return ret, nil
  115603. // {
  115604. // "description": "Deletes the specified TargetTcpProxy resource.",
  115605. // "httpMethod": "DELETE",
  115606. // "id": "compute.targetTcpProxies.delete",
  115607. // "parameterOrder": [
  115608. // "project",
  115609. // "targetTcpProxy"
  115610. // ],
  115611. // "parameters": {
  115612. // "project": {
  115613. // "description": "Project ID for this request.",
  115614. // "location": "path",
  115615. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  115616. // "required": true,
  115617. // "type": "string"
  115618. // },
  115619. // "requestId": {
  115620. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  115621. // "location": "query",
  115622. // "type": "string"
  115623. // },
  115624. // "targetTcpProxy": {
  115625. // "description": "Name of the TargetTcpProxy resource to delete.",
  115626. // "location": "path",
  115627. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  115628. // "required": true,
  115629. // "type": "string"
  115630. // }
  115631. // },
  115632. // "path": "{project}/global/targetTcpProxies/{targetTcpProxy}",
  115633. // "response": {
  115634. // "$ref": "Operation"
  115635. // },
  115636. // "scopes": [
  115637. // "https://www.googleapis.com/auth/cloud-platform",
  115638. // "https://www.googleapis.com/auth/compute"
  115639. // ]
  115640. // }
  115641. }
  115642. // method id "compute.targetTcpProxies.get":
  115643. type TargetTcpProxiesGetCall struct {
  115644. s *Service
  115645. project string
  115646. targetTcpProxy string
  115647. urlParams_ gensupport.URLParams
  115648. ifNoneMatch_ string
  115649. ctx_ context.Context
  115650. header_ http.Header
  115651. }
  115652. // Get: Returns the specified TargetTcpProxy resource. Gets a list of
  115653. // available target TCP proxies by making a list() request.
  115654. func (r *TargetTcpProxiesService) Get(project string, targetTcpProxy string) *TargetTcpProxiesGetCall {
  115655. c := &TargetTcpProxiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  115656. c.project = project
  115657. c.targetTcpProxy = targetTcpProxy
  115658. return c
  115659. }
  115660. // Fields allows partial responses to be retrieved. See
  115661. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  115662. // for more information.
  115663. func (c *TargetTcpProxiesGetCall) Fields(s ...googleapi.Field) *TargetTcpProxiesGetCall {
  115664. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  115665. return c
  115666. }
  115667. // IfNoneMatch sets the optional parameter which makes the operation
  115668. // fail if the object's ETag matches the given value. This is useful for
  115669. // getting updates only after the object has changed since the last
  115670. // request. Use googleapi.IsNotModified to check whether the response
  115671. // error from Do is the result of In-None-Match.
  115672. func (c *TargetTcpProxiesGetCall) IfNoneMatch(entityTag string) *TargetTcpProxiesGetCall {
  115673. c.ifNoneMatch_ = entityTag
  115674. return c
  115675. }
  115676. // Context sets the context to be used in this call's Do method. Any
  115677. // pending HTTP request will be aborted if the provided context is
  115678. // canceled.
  115679. func (c *TargetTcpProxiesGetCall) Context(ctx context.Context) *TargetTcpProxiesGetCall {
  115680. c.ctx_ = ctx
  115681. return c
  115682. }
  115683. // Header returns an http.Header that can be modified by the caller to
  115684. // add HTTP headers to the request.
  115685. func (c *TargetTcpProxiesGetCall) Header() http.Header {
  115686. if c.header_ == nil {
  115687. c.header_ = make(http.Header)
  115688. }
  115689. return c.header_
  115690. }
  115691. func (c *TargetTcpProxiesGetCall) doRequest(alt string) (*http.Response, error) {
  115692. reqHeaders := make(http.Header)
  115693. for k, v := range c.header_ {
  115694. reqHeaders[k] = v
  115695. }
  115696. reqHeaders.Set("User-Agent", c.s.userAgent())
  115697. if c.ifNoneMatch_ != "" {
  115698. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  115699. }
  115700. var body io.Reader = nil
  115701. c.urlParams_.Set("alt", alt)
  115702. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies/{targetTcpProxy}")
  115703. urls += "?" + c.urlParams_.Encode()
  115704. req, _ := http.NewRequest("GET", urls, body)
  115705. req.Header = reqHeaders
  115706. googleapi.Expand(req.URL, map[string]string{
  115707. "project": c.project,
  115708. "targetTcpProxy": c.targetTcpProxy,
  115709. })
  115710. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  115711. }
  115712. // Do executes the "compute.targetTcpProxies.get" call.
  115713. // Exactly one of *TargetTcpProxy or error will be non-nil. Any non-2xx
  115714. // status code is an error. Response headers are in either
  115715. // *TargetTcpProxy.ServerResponse.Header or (if a response was returned
  115716. // at all) in error.(*googleapi.Error).Header. Use
  115717. // googleapi.IsNotModified to check whether the returned error was
  115718. // because http.StatusNotModified was returned.
  115719. func (c *TargetTcpProxiesGetCall) Do(opts ...googleapi.CallOption) (*TargetTcpProxy, error) {
  115720. gensupport.SetOptions(c.urlParams_, opts...)
  115721. res, err := c.doRequest("json")
  115722. if res != nil && res.StatusCode == http.StatusNotModified {
  115723. if res.Body != nil {
  115724. res.Body.Close()
  115725. }
  115726. return nil, &googleapi.Error{
  115727. Code: res.StatusCode,
  115728. Header: res.Header,
  115729. }
  115730. }
  115731. if err != nil {
  115732. return nil, err
  115733. }
  115734. defer googleapi.CloseBody(res)
  115735. if err := googleapi.CheckResponse(res); err != nil {
  115736. return nil, err
  115737. }
  115738. ret := &TargetTcpProxy{
  115739. ServerResponse: googleapi.ServerResponse{
  115740. Header: res.Header,
  115741. HTTPStatusCode: res.StatusCode,
  115742. },
  115743. }
  115744. target := &ret
  115745. if err := gensupport.DecodeResponse(target, res); err != nil {
  115746. return nil, err
  115747. }
  115748. return ret, nil
  115749. // {
  115750. // "description": "Returns the specified TargetTcpProxy resource. Gets a list of available target TCP proxies by making a list() request.",
  115751. // "httpMethod": "GET",
  115752. // "id": "compute.targetTcpProxies.get",
  115753. // "parameterOrder": [
  115754. // "project",
  115755. // "targetTcpProxy"
  115756. // ],
  115757. // "parameters": {
  115758. // "project": {
  115759. // "description": "Project ID for this request.",
  115760. // "location": "path",
  115761. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  115762. // "required": true,
  115763. // "type": "string"
  115764. // },
  115765. // "targetTcpProxy": {
  115766. // "description": "Name of the TargetTcpProxy resource to return.",
  115767. // "location": "path",
  115768. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  115769. // "required": true,
  115770. // "type": "string"
  115771. // }
  115772. // },
  115773. // "path": "{project}/global/targetTcpProxies/{targetTcpProxy}",
  115774. // "response": {
  115775. // "$ref": "TargetTcpProxy"
  115776. // },
  115777. // "scopes": [
  115778. // "https://www.googleapis.com/auth/cloud-platform",
  115779. // "https://www.googleapis.com/auth/compute",
  115780. // "https://www.googleapis.com/auth/compute.readonly"
  115781. // ]
  115782. // }
  115783. }
  115784. // method id "compute.targetTcpProxies.insert":
  115785. type TargetTcpProxiesInsertCall struct {
  115786. s *Service
  115787. project string
  115788. targettcpproxy *TargetTcpProxy
  115789. urlParams_ gensupport.URLParams
  115790. ctx_ context.Context
  115791. header_ http.Header
  115792. }
  115793. // Insert: Creates a TargetTcpProxy resource in the specified project
  115794. // using the data included in the request.
  115795. func (r *TargetTcpProxiesService) Insert(project string, targettcpproxy *TargetTcpProxy) *TargetTcpProxiesInsertCall {
  115796. c := &TargetTcpProxiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  115797. c.project = project
  115798. c.targettcpproxy = targettcpproxy
  115799. return c
  115800. }
  115801. // RequestId sets the optional parameter "requestId": An optional
  115802. // request ID to identify requests. Specify a unique request ID so that
  115803. // if you must retry your request, the server will know to ignore the
  115804. // request if it has already been completed.
  115805. //
  115806. // For example, consider a situation where you make an initial request
  115807. // and the request times out. If you make the request again with the
  115808. // same request ID, the server can check if original operation with the
  115809. // same request ID was received, and if so, will ignore the second
  115810. // request. This prevents clients from accidentally creating duplicate
  115811. // commitments.
  115812. //
  115813. // The request ID must be a valid UUID with the exception that zero UUID
  115814. // is not supported (00000000-0000-0000-0000-000000000000).
  115815. func (c *TargetTcpProxiesInsertCall) RequestId(requestId string) *TargetTcpProxiesInsertCall {
  115816. c.urlParams_.Set("requestId", requestId)
  115817. return c
  115818. }
  115819. // Fields allows partial responses to be retrieved. See
  115820. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  115821. // for more information.
  115822. func (c *TargetTcpProxiesInsertCall) Fields(s ...googleapi.Field) *TargetTcpProxiesInsertCall {
  115823. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  115824. return c
  115825. }
  115826. // Context sets the context to be used in this call's Do method. Any
  115827. // pending HTTP request will be aborted if the provided context is
  115828. // canceled.
  115829. func (c *TargetTcpProxiesInsertCall) Context(ctx context.Context) *TargetTcpProxiesInsertCall {
  115830. c.ctx_ = ctx
  115831. return c
  115832. }
  115833. // Header returns an http.Header that can be modified by the caller to
  115834. // add HTTP headers to the request.
  115835. func (c *TargetTcpProxiesInsertCall) Header() http.Header {
  115836. if c.header_ == nil {
  115837. c.header_ = make(http.Header)
  115838. }
  115839. return c.header_
  115840. }
  115841. func (c *TargetTcpProxiesInsertCall) doRequest(alt string) (*http.Response, error) {
  115842. reqHeaders := make(http.Header)
  115843. for k, v := range c.header_ {
  115844. reqHeaders[k] = v
  115845. }
  115846. reqHeaders.Set("User-Agent", c.s.userAgent())
  115847. var body io.Reader = nil
  115848. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targettcpproxy)
  115849. if err != nil {
  115850. return nil, err
  115851. }
  115852. reqHeaders.Set("Content-Type", "application/json")
  115853. c.urlParams_.Set("alt", alt)
  115854. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies")
  115855. urls += "?" + c.urlParams_.Encode()
  115856. req, _ := http.NewRequest("POST", urls, body)
  115857. req.Header = reqHeaders
  115858. googleapi.Expand(req.URL, map[string]string{
  115859. "project": c.project,
  115860. })
  115861. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  115862. }
  115863. // Do executes the "compute.targetTcpProxies.insert" call.
  115864. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  115865. // status code is an error. Response headers are in either
  115866. // *Operation.ServerResponse.Header or (if a response was returned at
  115867. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  115868. // to check whether the returned error was because
  115869. // http.StatusNotModified was returned.
  115870. func (c *TargetTcpProxiesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  115871. gensupport.SetOptions(c.urlParams_, opts...)
  115872. res, err := c.doRequest("json")
  115873. if res != nil && res.StatusCode == http.StatusNotModified {
  115874. if res.Body != nil {
  115875. res.Body.Close()
  115876. }
  115877. return nil, &googleapi.Error{
  115878. Code: res.StatusCode,
  115879. Header: res.Header,
  115880. }
  115881. }
  115882. if err != nil {
  115883. return nil, err
  115884. }
  115885. defer googleapi.CloseBody(res)
  115886. if err := googleapi.CheckResponse(res); err != nil {
  115887. return nil, err
  115888. }
  115889. ret := &Operation{
  115890. ServerResponse: googleapi.ServerResponse{
  115891. Header: res.Header,
  115892. HTTPStatusCode: res.StatusCode,
  115893. },
  115894. }
  115895. target := &ret
  115896. if err := gensupport.DecodeResponse(target, res); err != nil {
  115897. return nil, err
  115898. }
  115899. return ret, nil
  115900. // {
  115901. // "description": "Creates a TargetTcpProxy resource in the specified project using the data included in the request.",
  115902. // "httpMethod": "POST",
  115903. // "id": "compute.targetTcpProxies.insert",
  115904. // "parameterOrder": [
  115905. // "project"
  115906. // ],
  115907. // "parameters": {
  115908. // "project": {
  115909. // "description": "Project ID for this request.",
  115910. // "location": "path",
  115911. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  115912. // "required": true,
  115913. // "type": "string"
  115914. // },
  115915. // "requestId": {
  115916. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  115917. // "location": "query",
  115918. // "type": "string"
  115919. // }
  115920. // },
  115921. // "path": "{project}/global/targetTcpProxies",
  115922. // "request": {
  115923. // "$ref": "TargetTcpProxy"
  115924. // },
  115925. // "response": {
  115926. // "$ref": "Operation"
  115927. // },
  115928. // "scopes": [
  115929. // "https://www.googleapis.com/auth/cloud-platform",
  115930. // "https://www.googleapis.com/auth/compute"
  115931. // ]
  115932. // }
  115933. }
  115934. // method id "compute.targetTcpProxies.list":
  115935. type TargetTcpProxiesListCall struct {
  115936. s *Service
  115937. project string
  115938. urlParams_ gensupport.URLParams
  115939. ifNoneMatch_ string
  115940. ctx_ context.Context
  115941. header_ http.Header
  115942. }
  115943. // List: Retrieves the list of TargetTcpProxy resources available to the
  115944. // specified project.
  115945. func (r *TargetTcpProxiesService) List(project string) *TargetTcpProxiesListCall {
  115946. c := &TargetTcpProxiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  115947. c.project = project
  115948. return c
  115949. }
  115950. // Filter sets the optional parameter "filter": A filter expression that
  115951. // filters resources listed in the response. The expression must specify
  115952. // the field name, a comparison operator, and the value that you want to
  115953. // use for filtering. The value must be a string, a number, or a
  115954. // boolean. The comparison operator must be either =, !=, >, or <.
  115955. //
  115956. // For example, if you are filtering Compute Engine instances, you can
  115957. // exclude instances named example-instance by specifying name !=
  115958. // example-instance.
  115959. //
  115960. // You can also filter nested fields. For example, you could specify
  115961. // scheduling.automaticRestart = false to include instances only if they
  115962. // are not scheduled for automatic restarts. You can use filtering on
  115963. // nested fields to filter based on resource labels.
  115964. //
  115965. // To filter on multiple expressions, provide each separate expression
  115966. // within parentheses. For example, (scheduling.automaticRestart = true)
  115967. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  115968. // AND expression. However, you can include AND and OR expressions
  115969. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  115970. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  115971. // true).
  115972. func (c *TargetTcpProxiesListCall) Filter(filter string) *TargetTcpProxiesListCall {
  115973. c.urlParams_.Set("filter", filter)
  115974. return c
  115975. }
  115976. // MaxResults sets the optional parameter "maxResults": The maximum
  115977. // number of results per page that should be returned. If the number of
  115978. // available results is larger than maxResults, Compute Engine returns a
  115979. // nextPageToken that can be used to get the next page of results in
  115980. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  115981. // (Default: 500)
  115982. func (c *TargetTcpProxiesListCall) MaxResults(maxResults int64) *TargetTcpProxiesListCall {
  115983. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  115984. return c
  115985. }
  115986. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  115987. // a certain order. By default, results are returned in alphanumerical
  115988. // order based on the resource name.
  115989. //
  115990. // You can also sort results in descending order based on the creation
  115991. // timestamp using orderBy="creationTimestamp desc". This sorts results
  115992. // based on the creationTimestamp field in reverse chronological order
  115993. // (newest result first). Use this to sort resources like operations so
  115994. // that the newest operation is returned first.
  115995. //
  115996. // Currently, only sorting by name or creationTimestamp desc is
  115997. // supported.
  115998. func (c *TargetTcpProxiesListCall) OrderBy(orderBy string) *TargetTcpProxiesListCall {
  115999. c.urlParams_.Set("orderBy", orderBy)
  116000. return c
  116001. }
  116002. // PageToken sets the optional parameter "pageToken": Specifies a page
  116003. // token to use. Set pageToken to the nextPageToken returned by a
  116004. // previous list request to get the next page of results.
  116005. func (c *TargetTcpProxiesListCall) PageToken(pageToken string) *TargetTcpProxiesListCall {
  116006. c.urlParams_.Set("pageToken", pageToken)
  116007. return c
  116008. }
  116009. // Fields allows partial responses to be retrieved. See
  116010. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  116011. // for more information.
  116012. func (c *TargetTcpProxiesListCall) Fields(s ...googleapi.Field) *TargetTcpProxiesListCall {
  116013. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  116014. return c
  116015. }
  116016. // IfNoneMatch sets the optional parameter which makes the operation
  116017. // fail if the object's ETag matches the given value. This is useful for
  116018. // getting updates only after the object has changed since the last
  116019. // request. Use googleapi.IsNotModified to check whether the response
  116020. // error from Do is the result of In-None-Match.
  116021. func (c *TargetTcpProxiesListCall) IfNoneMatch(entityTag string) *TargetTcpProxiesListCall {
  116022. c.ifNoneMatch_ = entityTag
  116023. return c
  116024. }
  116025. // Context sets the context to be used in this call's Do method. Any
  116026. // pending HTTP request will be aborted if the provided context is
  116027. // canceled.
  116028. func (c *TargetTcpProxiesListCall) Context(ctx context.Context) *TargetTcpProxiesListCall {
  116029. c.ctx_ = ctx
  116030. return c
  116031. }
  116032. // Header returns an http.Header that can be modified by the caller to
  116033. // add HTTP headers to the request.
  116034. func (c *TargetTcpProxiesListCall) Header() http.Header {
  116035. if c.header_ == nil {
  116036. c.header_ = make(http.Header)
  116037. }
  116038. return c.header_
  116039. }
  116040. func (c *TargetTcpProxiesListCall) doRequest(alt string) (*http.Response, error) {
  116041. reqHeaders := make(http.Header)
  116042. for k, v := range c.header_ {
  116043. reqHeaders[k] = v
  116044. }
  116045. reqHeaders.Set("User-Agent", c.s.userAgent())
  116046. if c.ifNoneMatch_ != "" {
  116047. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  116048. }
  116049. var body io.Reader = nil
  116050. c.urlParams_.Set("alt", alt)
  116051. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies")
  116052. urls += "?" + c.urlParams_.Encode()
  116053. req, _ := http.NewRequest("GET", urls, body)
  116054. req.Header = reqHeaders
  116055. googleapi.Expand(req.URL, map[string]string{
  116056. "project": c.project,
  116057. })
  116058. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  116059. }
  116060. // Do executes the "compute.targetTcpProxies.list" call.
  116061. // Exactly one of *TargetTcpProxyList or error will be non-nil. Any
  116062. // non-2xx status code is an error. Response headers are in either
  116063. // *TargetTcpProxyList.ServerResponse.Header or (if a response was
  116064. // returned at all) in error.(*googleapi.Error).Header. Use
  116065. // googleapi.IsNotModified to check whether the returned error was
  116066. // because http.StatusNotModified was returned.
  116067. func (c *TargetTcpProxiesListCall) Do(opts ...googleapi.CallOption) (*TargetTcpProxyList, error) {
  116068. gensupport.SetOptions(c.urlParams_, opts...)
  116069. res, err := c.doRequest("json")
  116070. if res != nil && res.StatusCode == http.StatusNotModified {
  116071. if res.Body != nil {
  116072. res.Body.Close()
  116073. }
  116074. return nil, &googleapi.Error{
  116075. Code: res.StatusCode,
  116076. Header: res.Header,
  116077. }
  116078. }
  116079. if err != nil {
  116080. return nil, err
  116081. }
  116082. defer googleapi.CloseBody(res)
  116083. if err := googleapi.CheckResponse(res); err != nil {
  116084. return nil, err
  116085. }
  116086. ret := &TargetTcpProxyList{
  116087. ServerResponse: googleapi.ServerResponse{
  116088. Header: res.Header,
  116089. HTTPStatusCode: res.StatusCode,
  116090. },
  116091. }
  116092. target := &ret
  116093. if err := gensupport.DecodeResponse(target, res); err != nil {
  116094. return nil, err
  116095. }
  116096. return ret, nil
  116097. // {
  116098. // "description": "Retrieves the list of TargetTcpProxy resources available to the specified project.",
  116099. // "httpMethod": "GET",
  116100. // "id": "compute.targetTcpProxies.list",
  116101. // "parameterOrder": [
  116102. // "project"
  116103. // ],
  116104. // "parameters": {
  116105. // "filter": {
  116106. // "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).",
  116107. // "location": "query",
  116108. // "type": "string"
  116109. // },
  116110. // "maxResults": {
  116111. // "default": "500",
  116112. // "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)",
  116113. // "format": "uint32",
  116114. // "location": "query",
  116115. // "minimum": "0",
  116116. // "type": "integer"
  116117. // },
  116118. // "orderBy": {
  116119. // "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.",
  116120. // "location": "query",
  116121. // "type": "string"
  116122. // },
  116123. // "pageToken": {
  116124. // "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.",
  116125. // "location": "query",
  116126. // "type": "string"
  116127. // },
  116128. // "project": {
  116129. // "description": "Project ID for this request.",
  116130. // "location": "path",
  116131. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  116132. // "required": true,
  116133. // "type": "string"
  116134. // }
  116135. // },
  116136. // "path": "{project}/global/targetTcpProxies",
  116137. // "response": {
  116138. // "$ref": "TargetTcpProxyList"
  116139. // },
  116140. // "scopes": [
  116141. // "https://www.googleapis.com/auth/cloud-platform",
  116142. // "https://www.googleapis.com/auth/compute",
  116143. // "https://www.googleapis.com/auth/compute.readonly"
  116144. // ]
  116145. // }
  116146. }
  116147. // Pages invokes f for each page of results.
  116148. // A non-nil error returned from f will halt the iteration.
  116149. // The provided context supersedes any context provided to the Context method.
  116150. func (c *TargetTcpProxiesListCall) Pages(ctx context.Context, f func(*TargetTcpProxyList) error) error {
  116151. c.ctx_ = ctx
  116152. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  116153. for {
  116154. x, err := c.Do()
  116155. if err != nil {
  116156. return err
  116157. }
  116158. if err := f(x); err != nil {
  116159. return err
  116160. }
  116161. if x.NextPageToken == "" {
  116162. return nil
  116163. }
  116164. c.PageToken(x.NextPageToken)
  116165. }
  116166. }
  116167. // method id "compute.targetTcpProxies.setBackendService":
  116168. type TargetTcpProxiesSetBackendServiceCall struct {
  116169. s *Service
  116170. project string
  116171. targetTcpProxy string
  116172. targettcpproxiessetbackendservicerequest *TargetTcpProxiesSetBackendServiceRequest
  116173. urlParams_ gensupport.URLParams
  116174. ctx_ context.Context
  116175. header_ http.Header
  116176. }
  116177. // SetBackendService: Changes the BackendService for TargetTcpProxy.
  116178. func (r *TargetTcpProxiesService) SetBackendService(project string, targetTcpProxy string, targettcpproxiessetbackendservicerequest *TargetTcpProxiesSetBackendServiceRequest) *TargetTcpProxiesSetBackendServiceCall {
  116179. c := &TargetTcpProxiesSetBackendServiceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  116180. c.project = project
  116181. c.targetTcpProxy = targetTcpProxy
  116182. c.targettcpproxiessetbackendservicerequest = targettcpproxiessetbackendservicerequest
  116183. return c
  116184. }
  116185. // RequestId sets the optional parameter "requestId": An optional
  116186. // request ID to identify requests. Specify a unique request ID so that
  116187. // if you must retry your request, the server will know to ignore the
  116188. // request if it has already been completed.
  116189. //
  116190. // For example, consider a situation where you make an initial request
  116191. // and the request times out. If you make the request again with the
  116192. // same request ID, the server can check if original operation with the
  116193. // same request ID was received, and if so, will ignore the second
  116194. // request. This prevents clients from accidentally creating duplicate
  116195. // commitments.
  116196. //
  116197. // The request ID must be a valid UUID with the exception that zero UUID
  116198. // is not supported (00000000-0000-0000-0000-000000000000).
  116199. func (c *TargetTcpProxiesSetBackendServiceCall) RequestId(requestId string) *TargetTcpProxiesSetBackendServiceCall {
  116200. c.urlParams_.Set("requestId", requestId)
  116201. return c
  116202. }
  116203. // Fields allows partial responses to be retrieved. See
  116204. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  116205. // for more information.
  116206. func (c *TargetTcpProxiesSetBackendServiceCall) Fields(s ...googleapi.Field) *TargetTcpProxiesSetBackendServiceCall {
  116207. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  116208. return c
  116209. }
  116210. // Context sets the context to be used in this call's Do method. Any
  116211. // pending HTTP request will be aborted if the provided context is
  116212. // canceled.
  116213. func (c *TargetTcpProxiesSetBackendServiceCall) Context(ctx context.Context) *TargetTcpProxiesSetBackendServiceCall {
  116214. c.ctx_ = ctx
  116215. return c
  116216. }
  116217. // Header returns an http.Header that can be modified by the caller to
  116218. // add HTTP headers to the request.
  116219. func (c *TargetTcpProxiesSetBackendServiceCall) Header() http.Header {
  116220. if c.header_ == nil {
  116221. c.header_ = make(http.Header)
  116222. }
  116223. return c.header_
  116224. }
  116225. func (c *TargetTcpProxiesSetBackendServiceCall) doRequest(alt string) (*http.Response, error) {
  116226. reqHeaders := make(http.Header)
  116227. for k, v := range c.header_ {
  116228. reqHeaders[k] = v
  116229. }
  116230. reqHeaders.Set("User-Agent", c.s.userAgent())
  116231. var body io.Reader = nil
  116232. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targettcpproxiessetbackendservicerequest)
  116233. if err != nil {
  116234. return nil, err
  116235. }
  116236. reqHeaders.Set("Content-Type", "application/json")
  116237. c.urlParams_.Set("alt", alt)
  116238. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies/{targetTcpProxy}/setBackendService")
  116239. urls += "?" + c.urlParams_.Encode()
  116240. req, _ := http.NewRequest("POST", urls, body)
  116241. req.Header = reqHeaders
  116242. googleapi.Expand(req.URL, map[string]string{
  116243. "project": c.project,
  116244. "targetTcpProxy": c.targetTcpProxy,
  116245. })
  116246. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  116247. }
  116248. // Do executes the "compute.targetTcpProxies.setBackendService" call.
  116249. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  116250. // status code is an error. Response headers are in either
  116251. // *Operation.ServerResponse.Header or (if a response was returned at
  116252. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  116253. // to check whether the returned error was because
  116254. // http.StatusNotModified was returned.
  116255. func (c *TargetTcpProxiesSetBackendServiceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  116256. gensupport.SetOptions(c.urlParams_, opts...)
  116257. res, err := c.doRequest("json")
  116258. if res != nil && res.StatusCode == http.StatusNotModified {
  116259. if res.Body != nil {
  116260. res.Body.Close()
  116261. }
  116262. return nil, &googleapi.Error{
  116263. Code: res.StatusCode,
  116264. Header: res.Header,
  116265. }
  116266. }
  116267. if err != nil {
  116268. return nil, err
  116269. }
  116270. defer googleapi.CloseBody(res)
  116271. if err := googleapi.CheckResponse(res); err != nil {
  116272. return nil, err
  116273. }
  116274. ret := &Operation{
  116275. ServerResponse: googleapi.ServerResponse{
  116276. Header: res.Header,
  116277. HTTPStatusCode: res.StatusCode,
  116278. },
  116279. }
  116280. target := &ret
  116281. if err := gensupport.DecodeResponse(target, res); err != nil {
  116282. return nil, err
  116283. }
  116284. return ret, nil
  116285. // {
  116286. // "description": "Changes the BackendService for TargetTcpProxy.",
  116287. // "httpMethod": "POST",
  116288. // "id": "compute.targetTcpProxies.setBackendService",
  116289. // "parameterOrder": [
  116290. // "project",
  116291. // "targetTcpProxy"
  116292. // ],
  116293. // "parameters": {
  116294. // "project": {
  116295. // "description": "Project ID for this request.",
  116296. // "location": "path",
  116297. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  116298. // "required": true,
  116299. // "type": "string"
  116300. // },
  116301. // "requestId": {
  116302. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  116303. // "location": "query",
  116304. // "type": "string"
  116305. // },
  116306. // "targetTcpProxy": {
  116307. // "description": "Name of the TargetTcpProxy resource whose BackendService resource is to be set.",
  116308. // "location": "path",
  116309. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  116310. // "required": true,
  116311. // "type": "string"
  116312. // }
  116313. // },
  116314. // "path": "{project}/global/targetTcpProxies/{targetTcpProxy}/setBackendService",
  116315. // "request": {
  116316. // "$ref": "TargetTcpProxiesSetBackendServiceRequest"
  116317. // },
  116318. // "response": {
  116319. // "$ref": "Operation"
  116320. // },
  116321. // "scopes": [
  116322. // "https://www.googleapis.com/auth/cloud-platform",
  116323. // "https://www.googleapis.com/auth/compute"
  116324. // ]
  116325. // }
  116326. }
  116327. // method id "compute.targetTcpProxies.setProxyHeader":
  116328. type TargetTcpProxiesSetProxyHeaderCall struct {
  116329. s *Service
  116330. project string
  116331. targetTcpProxy string
  116332. targettcpproxiessetproxyheaderrequest *TargetTcpProxiesSetProxyHeaderRequest
  116333. urlParams_ gensupport.URLParams
  116334. ctx_ context.Context
  116335. header_ http.Header
  116336. }
  116337. // SetProxyHeader: Changes the ProxyHeaderType for TargetTcpProxy.
  116338. func (r *TargetTcpProxiesService) SetProxyHeader(project string, targetTcpProxy string, targettcpproxiessetproxyheaderrequest *TargetTcpProxiesSetProxyHeaderRequest) *TargetTcpProxiesSetProxyHeaderCall {
  116339. c := &TargetTcpProxiesSetProxyHeaderCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  116340. c.project = project
  116341. c.targetTcpProxy = targetTcpProxy
  116342. c.targettcpproxiessetproxyheaderrequest = targettcpproxiessetproxyheaderrequest
  116343. return c
  116344. }
  116345. // RequestId sets the optional parameter "requestId": An optional
  116346. // request ID to identify requests. Specify a unique request ID so that
  116347. // if you must retry your request, the server will know to ignore the
  116348. // request if it has already been completed.
  116349. //
  116350. // For example, consider a situation where you make an initial request
  116351. // and the request times out. If you make the request again with the
  116352. // same request ID, the server can check if original operation with the
  116353. // same request ID was received, and if so, will ignore the second
  116354. // request. This prevents clients from accidentally creating duplicate
  116355. // commitments.
  116356. //
  116357. // The request ID must be a valid UUID with the exception that zero UUID
  116358. // is not supported (00000000-0000-0000-0000-000000000000).
  116359. func (c *TargetTcpProxiesSetProxyHeaderCall) RequestId(requestId string) *TargetTcpProxiesSetProxyHeaderCall {
  116360. c.urlParams_.Set("requestId", requestId)
  116361. return c
  116362. }
  116363. // Fields allows partial responses to be retrieved. See
  116364. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  116365. // for more information.
  116366. func (c *TargetTcpProxiesSetProxyHeaderCall) Fields(s ...googleapi.Field) *TargetTcpProxiesSetProxyHeaderCall {
  116367. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  116368. return c
  116369. }
  116370. // Context sets the context to be used in this call's Do method. Any
  116371. // pending HTTP request will be aborted if the provided context is
  116372. // canceled.
  116373. func (c *TargetTcpProxiesSetProxyHeaderCall) Context(ctx context.Context) *TargetTcpProxiesSetProxyHeaderCall {
  116374. c.ctx_ = ctx
  116375. return c
  116376. }
  116377. // Header returns an http.Header that can be modified by the caller to
  116378. // add HTTP headers to the request.
  116379. func (c *TargetTcpProxiesSetProxyHeaderCall) Header() http.Header {
  116380. if c.header_ == nil {
  116381. c.header_ = make(http.Header)
  116382. }
  116383. return c.header_
  116384. }
  116385. func (c *TargetTcpProxiesSetProxyHeaderCall) doRequest(alt string) (*http.Response, error) {
  116386. reqHeaders := make(http.Header)
  116387. for k, v := range c.header_ {
  116388. reqHeaders[k] = v
  116389. }
  116390. reqHeaders.Set("User-Agent", c.s.userAgent())
  116391. var body io.Reader = nil
  116392. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targettcpproxiessetproxyheaderrequest)
  116393. if err != nil {
  116394. return nil, err
  116395. }
  116396. reqHeaders.Set("Content-Type", "application/json")
  116397. c.urlParams_.Set("alt", alt)
  116398. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies/{targetTcpProxy}/setProxyHeader")
  116399. urls += "?" + c.urlParams_.Encode()
  116400. req, _ := http.NewRequest("POST", urls, body)
  116401. req.Header = reqHeaders
  116402. googleapi.Expand(req.URL, map[string]string{
  116403. "project": c.project,
  116404. "targetTcpProxy": c.targetTcpProxy,
  116405. })
  116406. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  116407. }
  116408. // Do executes the "compute.targetTcpProxies.setProxyHeader" call.
  116409. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  116410. // status code is an error. Response headers are in either
  116411. // *Operation.ServerResponse.Header or (if a response was returned at
  116412. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  116413. // to check whether the returned error was because
  116414. // http.StatusNotModified was returned.
  116415. func (c *TargetTcpProxiesSetProxyHeaderCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  116416. gensupport.SetOptions(c.urlParams_, opts...)
  116417. res, err := c.doRequest("json")
  116418. if res != nil && res.StatusCode == http.StatusNotModified {
  116419. if res.Body != nil {
  116420. res.Body.Close()
  116421. }
  116422. return nil, &googleapi.Error{
  116423. Code: res.StatusCode,
  116424. Header: res.Header,
  116425. }
  116426. }
  116427. if err != nil {
  116428. return nil, err
  116429. }
  116430. defer googleapi.CloseBody(res)
  116431. if err := googleapi.CheckResponse(res); err != nil {
  116432. return nil, err
  116433. }
  116434. ret := &Operation{
  116435. ServerResponse: googleapi.ServerResponse{
  116436. Header: res.Header,
  116437. HTTPStatusCode: res.StatusCode,
  116438. },
  116439. }
  116440. target := &ret
  116441. if err := gensupport.DecodeResponse(target, res); err != nil {
  116442. return nil, err
  116443. }
  116444. return ret, nil
  116445. // {
  116446. // "description": "Changes the ProxyHeaderType for TargetTcpProxy.",
  116447. // "httpMethod": "POST",
  116448. // "id": "compute.targetTcpProxies.setProxyHeader",
  116449. // "parameterOrder": [
  116450. // "project",
  116451. // "targetTcpProxy"
  116452. // ],
  116453. // "parameters": {
  116454. // "project": {
  116455. // "description": "Project ID for this request.",
  116456. // "location": "path",
  116457. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  116458. // "required": true,
  116459. // "type": "string"
  116460. // },
  116461. // "requestId": {
  116462. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  116463. // "location": "query",
  116464. // "type": "string"
  116465. // },
  116466. // "targetTcpProxy": {
  116467. // "description": "Name of the TargetTcpProxy resource whose ProxyHeader is to be set.",
  116468. // "location": "path",
  116469. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  116470. // "required": true,
  116471. // "type": "string"
  116472. // }
  116473. // },
  116474. // "path": "{project}/global/targetTcpProxies/{targetTcpProxy}/setProxyHeader",
  116475. // "request": {
  116476. // "$ref": "TargetTcpProxiesSetProxyHeaderRequest"
  116477. // },
  116478. // "response": {
  116479. // "$ref": "Operation"
  116480. // },
  116481. // "scopes": [
  116482. // "https://www.googleapis.com/auth/cloud-platform",
  116483. // "https://www.googleapis.com/auth/compute"
  116484. // ]
  116485. // }
  116486. }
  116487. // method id "compute.targetTcpProxies.testIamPermissions":
  116488. type TargetTcpProxiesTestIamPermissionsCall struct {
  116489. s *Service
  116490. project string
  116491. resource string
  116492. testpermissionsrequest *TestPermissionsRequest
  116493. urlParams_ gensupport.URLParams
  116494. ctx_ context.Context
  116495. header_ http.Header
  116496. }
  116497. // TestIamPermissions: Returns permissions that a caller has on the
  116498. // specified resource.
  116499. func (r *TargetTcpProxiesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *TargetTcpProxiesTestIamPermissionsCall {
  116500. c := &TargetTcpProxiesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  116501. c.project = project
  116502. c.resource = resource
  116503. c.testpermissionsrequest = testpermissionsrequest
  116504. return c
  116505. }
  116506. // Fields allows partial responses to be retrieved. See
  116507. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  116508. // for more information.
  116509. func (c *TargetTcpProxiesTestIamPermissionsCall) Fields(s ...googleapi.Field) *TargetTcpProxiesTestIamPermissionsCall {
  116510. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  116511. return c
  116512. }
  116513. // Context sets the context to be used in this call's Do method. Any
  116514. // pending HTTP request will be aborted if the provided context is
  116515. // canceled.
  116516. func (c *TargetTcpProxiesTestIamPermissionsCall) Context(ctx context.Context) *TargetTcpProxiesTestIamPermissionsCall {
  116517. c.ctx_ = ctx
  116518. return c
  116519. }
  116520. // Header returns an http.Header that can be modified by the caller to
  116521. // add HTTP headers to the request.
  116522. func (c *TargetTcpProxiesTestIamPermissionsCall) Header() http.Header {
  116523. if c.header_ == nil {
  116524. c.header_ = make(http.Header)
  116525. }
  116526. return c.header_
  116527. }
  116528. func (c *TargetTcpProxiesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  116529. reqHeaders := make(http.Header)
  116530. for k, v := range c.header_ {
  116531. reqHeaders[k] = v
  116532. }
  116533. reqHeaders.Set("User-Agent", c.s.userAgent())
  116534. var body io.Reader = nil
  116535. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  116536. if err != nil {
  116537. return nil, err
  116538. }
  116539. reqHeaders.Set("Content-Type", "application/json")
  116540. c.urlParams_.Set("alt", alt)
  116541. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies/{resource}/testIamPermissions")
  116542. urls += "?" + c.urlParams_.Encode()
  116543. req, _ := http.NewRequest("POST", urls, body)
  116544. req.Header = reqHeaders
  116545. googleapi.Expand(req.URL, map[string]string{
  116546. "project": c.project,
  116547. "resource": c.resource,
  116548. })
  116549. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  116550. }
  116551. // Do executes the "compute.targetTcpProxies.testIamPermissions" call.
  116552. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  116553. // non-2xx status code is an error. Response headers are in either
  116554. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  116555. // returned at all) in error.(*googleapi.Error).Header. Use
  116556. // googleapi.IsNotModified to check whether the returned error was
  116557. // because http.StatusNotModified was returned.
  116558. func (c *TargetTcpProxiesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  116559. gensupport.SetOptions(c.urlParams_, opts...)
  116560. res, err := c.doRequest("json")
  116561. if res != nil && res.StatusCode == http.StatusNotModified {
  116562. if res.Body != nil {
  116563. res.Body.Close()
  116564. }
  116565. return nil, &googleapi.Error{
  116566. Code: res.StatusCode,
  116567. Header: res.Header,
  116568. }
  116569. }
  116570. if err != nil {
  116571. return nil, err
  116572. }
  116573. defer googleapi.CloseBody(res)
  116574. if err := googleapi.CheckResponse(res); err != nil {
  116575. return nil, err
  116576. }
  116577. ret := &TestPermissionsResponse{
  116578. ServerResponse: googleapi.ServerResponse{
  116579. Header: res.Header,
  116580. HTTPStatusCode: res.StatusCode,
  116581. },
  116582. }
  116583. target := &ret
  116584. if err := gensupport.DecodeResponse(target, res); err != nil {
  116585. return nil, err
  116586. }
  116587. return ret, nil
  116588. // {
  116589. // "description": "Returns permissions that a caller has on the specified resource.",
  116590. // "httpMethod": "POST",
  116591. // "id": "compute.targetTcpProxies.testIamPermissions",
  116592. // "parameterOrder": [
  116593. // "project",
  116594. // "resource"
  116595. // ],
  116596. // "parameters": {
  116597. // "project": {
  116598. // "description": "Project ID for this request.",
  116599. // "location": "path",
  116600. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  116601. // "required": true,
  116602. // "type": "string"
  116603. // },
  116604. // "resource": {
  116605. // "description": "Name of the resource for this request.",
  116606. // "location": "path",
  116607. // "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?",
  116608. // "required": true,
  116609. // "type": "string"
  116610. // }
  116611. // },
  116612. // "path": "{project}/global/targetTcpProxies/{resource}/testIamPermissions",
  116613. // "request": {
  116614. // "$ref": "TestPermissionsRequest"
  116615. // },
  116616. // "response": {
  116617. // "$ref": "TestPermissionsResponse"
  116618. // },
  116619. // "scopes": [
  116620. // "https://www.googleapis.com/auth/cloud-platform",
  116621. // "https://www.googleapis.com/auth/compute",
  116622. // "https://www.googleapis.com/auth/compute.readonly"
  116623. // ]
  116624. // }
  116625. }
  116626. // method id "compute.targetVpnGateways.aggregatedList":
  116627. type TargetVpnGatewaysAggregatedListCall struct {
  116628. s *Service
  116629. project string
  116630. urlParams_ gensupport.URLParams
  116631. ifNoneMatch_ string
  116632. ctx_ context.Context
  116633. header_ http.Header
  116634. }
  116635. // AggregatedList: Retrieves an aggregated list of target VPN gateways.
  116636. func (r *TargetVpnGatewaysService) AggregatedList(project string) *TargetVpnGatewaysAggregatedListCall {
  116637. c := &TargetVpnGatewaysAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  116638. c.project = project
  116639. return c
  116640. }
  116641. // Filter sets the optional parameter "filter": A filter expression that
  116642. // filters resources listed in the response. The expression must specify
  116643. // the field name, a comparison operator, and the value that you want to
  116644. // use for filtering. The value must be a string, a number, or a
  116645. // boolean. The comparison operator must be either =, !=, >, or <.
  116646. //
  116647. // For example, if you are filtering Compute Engine instances, you can
  116648. // exclude instances named example-instance by specifying name !=
  116649. // example-instance.
  116650. //
  116651. // You can also filter nested fields. For example, you could specify
  116652. // scheduling.automaticRestart = false to include instances only if they
  116653. // are not scheduled for automatic restarts. You can use filtering on
  116654. // nested fields to filter based on resource labels.
  116655. //
  116656. // To filter on multiple expressions, provide each separate expression
  116657. // within parentheses. For example, (scheduling.automaticRestart = true)
  116658. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  116659. // AND expression. However, you can include AND and OR expressions
  116660. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  116661. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  116662. // true).
  116663. func (c *TargetVpnGatewaysAggregatedListCall) Filter(filter string) *TargetVpnGatewaysAggregatedListCall {
  116664. c.urlParams_.Set("filter", filter)
  116665. return c
  116666. }
  116667. // MaxResults sets the optional parameter "maxResults": The maximum
  116668. // number of results per page that should be returned. If the number of
  116669. // available results is larger than maxResults, Compute Engine returns a
  116670. // nextPageToken that can be used to get the next page of results in
  116671. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  116672. // (Default: 500)
  116673. func (c *TargetVpnGatewaysAggregatedListCall) MaxResults(maxResults int64) *TargetVpnGatewaysAggregatedListCall {
  116674. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  116675. return c
  116676. }
  116677. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  116678. // a certain order. By default, results are returned in alphanumerical
  116679. // order based on the resource name.
  116680. //
  116681. // You can also sort results in descending order based on the creation
  116682. // timestamp using orderBy="creationTimestamp desc". This sorts results
  116683. // based on the creationTimestamp field in reverse chronological order
  116684. // (newest result first). Use this to sort resources like operations so
  116685. // that the newest operation is returned first.
  116686. //
  116687. // Currently, only sorting by name or creationTimestamp desc is
  116688. // supported.
  116689. func (c *TargetVpnGatewaysAggregatedListCall) OrderBy(orderBy string) *TargetVpnGatewaysAggregatedListCall {
  116690. c.urlParams_.Set("orderBy", orderBy)
  116691. return c
  116692. }
  116693. // PageToken sets the optional parameter "pageToken": Specifies a page
  116694. // token to use. Set pageToken to the nextPageToken returned by a
  116695. // previous list request to get the next page of results.
  116696. func (c *TargetVpnGatewaysAggregatedListCall) PageToken(pageToken string) *TargetVpnGatewaysAggregatedListCall {
  116697. c.urlParams_.Set("pageToken", pageToken)
  116698. return c
  116699. }
  116700. // Fields allows partial responses to be retrieved. See
  116701. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  116702. // for more information.
  116703. func (c *TargetVpnGatewaysAggregatedListCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysAggregatedListCall {
  116704. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  116705. return c
  116706. }
  116707. // IfNoneMatch sets the optional parameter which makes the operation
  116708. // fail if the object's ETag matches the given value. This is useful for
  116709. // getting updates only after the object has changed since the last
  116710. // request. Use googleapi.IsNotModified to check whether the response
  116711. // error from Do is the result of In-None-Match.
  116712. func (c *TargetVpnGatewaysAggregatedListCall) IfNoneMatch(entityTag string) *TargetVpnGatewaysAggregatedListCall {
  116713. c.ifNoneMatch_ = entityTag
  116714. return c
  116715. }
  116716. // Context sets the context to be used in this call's Do method. Any
  116717. // pending HTTP request will be aborted if the provided context is
  116718. // canceled.
  116719. func (c *TargetVpnGatewaysAggregatedListCall) Context(ctx context.Context) *TargetVpnGatewaysAggregatedListCall {
  116720. c.ctx_ = ctx
  116721. return c
  116722. }
  116723. // Header returns an http.Header that can be modified by the caller to
  116724. // add HTTP headers to the request.
  116725. func (c *TargetVpnGatewaysAggregatedListCall) Header() http.Header {
  116726. if c.header_ == nil {
  116727. c.header_ = make(http.Header)
  116728. }
  116729. return c.header_
  116730. }
  116731. func (c *TargetVpnGatewaysAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  116732. reqHeaders := make(http.Header)
  116733. for k, v := range c.header_ {
  116734. reqHeaders[k] = v
  116735. }
  116736. reqHeaders.Set("User-Agent", c.s.userAgent())
  116737. if c.ifNoneMatch_ != "" {
  116738. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  116739. }
  116740. var body io.Reader = nil
  116741. c.urlParams_.Set("alt", alt)
  116742. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/targetVpnGateways")
  116743. urls += "?" + c.urlParams_.Encode()
  116744. req, _ := http.NewRequest("GET", urls, body)
  116745. req.Header = reqHeaders
  116746. googleapi.Expand(req.URL, map[string]string{
  116747. "project": c.project,
  116748. })
  116749. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  116750. }
  116751. // Do executes the "compute.targetVpnGateways.aggregatedList" call.
  116752. // Exactly one of *TargetVpnGatewayAggregatedList or error will be
  116753. // non-nil. Any non-2xx status code is an error. Response headers are in
  116754. // either *TargetVpnGatewayAggregatedList.ServerResponse.Header or (if a
  116755. // response was returned at all) in error.(*googleapi.Error).Header. Use
  116756. // googleapi.IsNotModified to check whether the returned error was
  116757. // because http.StatusNotModified was returned.
  116758. func (c *TargetVpnGatewaysAggregatedListCall) Do(opts ...googleapi.CallOption) (*TargetVpnGatewayAggregatedList, error) {
  116759. gensupport.SetOptions(c.urlParams_, opts...)
  116760. res, err := c.doRequest("json")
  116761. if res != nil && res.StatusCode == http.StatusNotModified {
  116762. if res.Body != nil {
  116763. res.Body.Close()
  116764. }
  116765. return nil, &googleapi.Error{
  116766. Code: res.StatusCode,
  116767. Header: res.Header,
  116768. }
  116769. }
  116770. if err != nil {
  116771. return nil, err
  116772. }
  116773. defer googleapi.CloseBody(res)
  116774. if err := googleapi.CheckResponse(res); err != nil {
  116775. return nil, err
  116776. }
  116777. ret := &TargetVpnGatewayAggregatedList{
  116778. ServerResponse: googleapi.ServerResponse{
  116779. Header: res.Header,
  116780. HTTPStatusCode: res.StatusCode,
  116781. },
  116782. }
  116783. target := &ret
  116784. if err := gensupport.DecodeResponse(target, res); err != nil {
  116785. return nil, err
  116786. }
  116787. return ret, nil
  116788. // {
  116789. // "description": "Retrieves an aggregated list of target VPN gateways.",
  116790. // "httpMethod": "GET",
  116791. // "id": "compute.targetVpnGateways.aggregatedList",
  116792. // "parameterOrder": [
  116793. // "project"
  116794. // ],
  116795. // "parameters": {
  116796. // "filter": {
  116797. // "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).",
  116798. // "location": "query",
  116799. // "type": "string"
  116800. // },
  116801. // "maxResults": {
  116802. // "default": "500",
  116803. // "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)",
  116804. // "format": "uint32",
  116805. // "location": "query",
  116806. // "minimum": "0",
  116807. // "type": "integer"
  116808. // },
  116809. // "orderBy": {
  116810. // "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.",
  116811. // "location": "query",
  116812. // "type": "string"
  116813. // },
  116814. // "pageToken": {
  116815. // "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.",
  116816. // "location": "query",
  116817. // "type": "string"
  116818. // },
  116819. // "project": {
  116820. // "description": "Project ID for this request.",
  116821. // "location": "path",
  116822. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  116823. // "required": true,
  116824. // "type": "string"
  116825. // }
  116826. // },
  116827. // "path": "{project}/aggregated/targetVpnGateways",
  116828. // "response": {
  116829. // "$ref": "TargetVpnGatewayAggregatedList"
  116830. // },
  116831. // "scopes": [
  116832. // "https://www.googleapis.com/auth/cloud-platform",
  116833. // "https://www.googleapis.com/auth/compute",
  116834. // "https://www.googleapis.com/auth/compute.readonly"
  116835. // ]
  116836. // }
  116837. }
  116838. // Pages invokes f for each page of results.
  116839. // A non-nil error returned from f will halt the iteration.
  116840. // The provided context supersedes any context provided to the Context method.
  116841. func (c *TargetVpnGatewaysAggregatedListCall) Pages(ctx context.Context, f func(*TargetVpnGatewayAggregatedList) error) error {
  116842. c.ctx_ = ctx
  116843. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  116844. for {
  116845. x, err := c.Do()
  116846. if err != nil {
  116847. return err
  116848. }
  116849. if err := f(x); err != nil {
  116850. return err
  116851. }
  116852. if x.NextPageToken == "" {
  116853. return nil
  116854. }
  116855. c.PageToken(x.NextPageToken)
  116856. }
  116857. }
  116858. // method id "compute.targetVpnGateways.delete":
  116859. type TargetVpnGatewaysDeleteCall struct {
  116860. s *Service
  116861. project string
  116862. region string
  116863. targetVpnGateway string
  116864. urlParams_ gensupport.URLParams
  116865. ctx_ context.Context
  116866. header_ http.Header
  116867. }
  116868. // Delete: Deletes the specified target VPN gateway.
  116869. func (r *TargetVpnGatewaysService) Delete(project string, region string, targetVpnGateway string) *TargetVpnGatewaysDeleteCall {
  116870. c := &TargetVpnGatewaysDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  116871. c.project = project
  116872. c.region = region
  116873. c.targetVpnGateway = targetVpnGateway
  116874. return c
  116875. }
  116876. // RequestId sets the optional parameter "requestId": An optional
  116877. // request ID to identify requests. Specify a unique request ID so that
  116878. // if you must retry your request, the server will know to ignore the
  116879. // request if it has already been completed.
  116880. //
  116881. // For example, consider a situation where you make an initial request
  116882. // and the request times out. If you make the request again with the
  116883. // same request ID, the server can check if original operation with the
  116884. // same request ID was received, and if so, will ignore the second
  116885. // request. This prevents clients from accidentally creating duplicate
  116886. // commitments.
  116887. //
  116888. // The request ID must be a valid UUID with the exception that zero UUID
  116889. // is not supported (00000000-0000-0000-0000-000000000000).
  116890. func (c *TargetVpnGatewaysDeleteCall) RequestId(requestId string) *TargetVpnGatewaysDeleteCall {
  116891. c.urlParams_.Set("requestId", requestId)
  116892. return c
  116893. }
  116894. // Fields allows partial responses to be retrieved. See
  116895. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  116896. // for more information.
  116897. func (c *TargetVpnGatewaysDeleteCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysDeleteCall {
  116898. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  116899. return c
  116900. }
  116901. // Context sets the context to be used in this call's Do method. Any
  116902. // pending HTTP request will be aborted if the provided context is
  116903. // canceled.
  116904. func (c *TargetVpnGatewaysDeleteCall) Context(ctx context.Context) *TargetVpnGatewaysDeleteCall {
  116905. c.ctx_ = ctx
  116906. return c
  116907. }
  116908. // Header returns an http.Header that can be modified by the caller to
  116909. // add HTTP headers to the request.
  116910. func (c *TargetVpnGatewaysDeleteCall) Header() http.Header {
  116911. if c.header_ == nil {
  116912. c.header_ = make(http.Header)
  116913. }
  116914. return c.header_
  116915. }
  116916. func (c *TargetVpnGatewaysDeleteCall) doRequest(alt string) (*http.Response, error) {
  116917. reqHeaders := make(http.Header)
  116918. for k, v := range c.header_ {
  116919. reqHeaders[k] = v
  116920. }
  116921. reqHeaders.Set("User-Agent", c.s.userAgent())
  116922. var body io.Reader = nil
  116923. c.urlParams_.Set("alt", alt)
  116924. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}")
  116925. urls += "?" + c.urlParams_.Encode()
  116926. req, _ := http.NewRequest("DELETE", urls, body)
  116927. req.Header = reqHeaders
  116928. googleapi.Expand(req.URL, map[string]string{
  116929. "project": c.project,
  116930. "region": c.region,
  116931. "targetVpnGateway": c.targetVpnGateway,
  116932. })
  116933. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  116934. }
  116935. // Do executes the "compute.targetVpnGateways.delete" call.
  116936. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  116937. // status code is an error. Response headers are in either
  116938. // *Operation.ServerResponse.Header or (if a response was returned at
  116939. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  116940. // to check whether the returned error was because
  116941. // http.StatusNotModified was returned.
  116942. func (c *TargetVpnGatewaysDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  116943. gensupport.SetOptions(c.urlParams_, opts...)
  116944. res, err := c.doRequest("json")
  116945. if res != nil && res.StatusCode == http.StatusNotModified {
  116946. if res.Body != nil {
  116947. res.Body.Close()
  116948. }
  116949. return nil, &googleapi.Error{
  116950. Code: res.StatusCode,
  116951. Header: res.Header,
  116952. }
  116953. }
  116954. if err != nil {
  116955. return nil, err
  116956. }
  116957. defer googleapi.CloseBody(res)
  116958. if err := googleapi.CheckResponse(res); err != nil {
  116959. return nil, err
  116960. }
  116961. ret := &Operation{
  116962. ServerResponse: googleapi.ServerResponse{
  116963. Header: res.Header,
  116964. HTTPStatusCode: res.StatusCode,
  116965. },
  116966. }
  116967. target := &ret
  116968. if err := gensupport.DecodeResponse(target, res); err != nil {
  116969. return nil, err
  116970. }
  116971. return ret, nil
  116972. // {
  116973. // "description": "Deletes the specified target VPN gateway.",
  116974. // "httpMethod": "DELETE",
  116975. // "id": "compute.targetVpnGateways.delete",
  116976. // "parameterOrder": [
  116977. // "project",
  116978. // "region",
  116979. // "targetVpnGateway"
  116980. // ],
  116981. // "parameters": {
  116982. // "project": {
  116983. // "description": "Project ID for this request.",
  116984. // "location": "path",
  116985. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  116986. // "required": true,
  116987. // "type": "string"
  116988. // },
  116989. // "region": {
  116990. // "description": "Name of the region for this request.",
  116991. // "location": "path",
  116992. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  116993. // "required": true,
  116994. // "type": "string"
  116995. // },
  116996. // "requestId": {
  116997. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  116998. // "location": "query",
  116999. // "type": "string"
  117000. // },
  117001. // "targetVpnGateway": {
  117002. // "description": "Name of the target VPN gateway to delete.",
  117003. // "location": "path",
  117004. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  117005. // "required": true,
  117006. // "type": "string"
  117007. // }
  117008. // },
  117009. // "path": "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}",
  117010. // "response": {
  117011. // "$ref": "Operation"
  117012. // },
  117013. // "scopes": [
  117014. // "https://www.googleapis.com/auth/cloud-platform",
  117015. // "https://www.googleapis.com/auth/compute"
  117016. // ]
  117017. // }
  117018. }
  117019. // method id "compute.targetVpnGateways.get":
  117020. type TargetVpnGatewaysGetCall struct {
  117021. s *Service
  117022. project string
  117023. region string
  117024. targetVpnGateway string
  117025. urlParams_ gensupport.URLParams
  117026. ifNoneMatch_ string
  117027. ctx_ context.Context
  117028. header_ http.Header
  117029. }
  117030. // Get: Returns the specified target VPN gateway. Gets a list of
  117031. // available target VPN gateways by making a list() request.
  117032. func (r *TargetVpnGatewaysService) Get(project string, region string, targetVpnGateway string) *TargetVpnGatewaysGetCall {
  117033. c := &TargetVpnGatewaysGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  117034. c.project = project
  117035. c.region = region
  117036. c.targetVpnGateway = targetVpnGateway
  117037. return c
  117038. }
  117039. // Fields allows partial responses to be retrieved. See
  117040. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  117041. // for more information.
  117042. func (c *TargetVpnGatewaysGetCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysGetCall {
  117043. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  117044. return c
  117045. }
  117046. // IfNoneMatch sets the optional parameter which makes the operation
  117047. // fail if the object's ETag matches the given value. This is useful for
  117048. // getting updates only after the object has changed since the last
  117049. // request. Use googleapi.IsNotModified to check whether the response
  117050. // error from Do is the result of In-None-Match.
  117051. func (c *TargetVpnGatewaysGetCall) IfNoneMatch(entityTag string) *TargetVpnGatewaysGetCall {
  117052. c.ifNoneMatch_ = entityTag
  117053. return c
  117054. }
  117055. // Context sets the context to be used in this call's Do method. Any
  117056. // pending HTTP request will be aborted if the provided context is
  117057. // canceled.
  117058. func (c *TargetVpnGatewaysGetCall) Context(ctx context.Context) *TargetVpnGatewaysGetCall {
  117059. c.ctx_ = ctx
  117060. return c
  117061. }
  117062. // Header returns an http.Header that can be modified by the caller to
  117063. // add HTTP headers to the request.
  117064. func (c *TargetVpnGatewaysGetCall) Header() http.Header {
  117065. if c.header_ == nil {
  117066. c.header_ = make(http.Header)
  117067. }
  117068. return c.header_
  117069. }
  117070. func (c *TargetVpnGatewaysGetCall) doRequest(alt string) (*http.Response, error) {
  117071. reqHeaders := make(http.Header)
  117072. for k, v := range c.header_ {
  117073. reqHeaders[k] = v
  117074. }
  117075. reqHeaders.Set("User-Agent", c.s.userAgent())
  117076. if c.ifNoneMatch_ != "" {
  117077. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  117078. }
  117079. var body io.Reader = nil
  117080. c.urlParams_.Set("alt", alt)
  117081. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}")
  117082. urls += "?" + c.urlParams_.Encode()
  117083. req, _ := http.NewRequest("GET", urls, body)
  117084. req.Header = reqHeaders
  117085. googleapi.Expand(req.URL, map[string]string{
  117086. "project": c.project,
  117087. "region": c.region,
  117088. "targetVpnGateway": c.targetVpnGateway,
  117089. })
  117090. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  117091. }
  117092. // Do executes the "compute.targetVpnGateways.get" call.
  117093. // Exactly one of *TargetVpnGateway or error will be non-nil. Any
  117094. // non-2xx status code is an error. Response headers are in either
  117095. // *TargetVpnGateway.ServerResponse.Header or (if a response was
  117096. // returned at all) in error.(*googleapi.Error).Header. Use
  117097. // googleapi.IsNotModified to check whether the returned error was
  117098. // because http.StatusNotModified was returned.
  117099. func (c *TargetVpnGatewaysGetCall) Do(opts ...googleapi.CallOption) (*TargetVpnGateway, error) {
  117100. gensupport.SetOptions(c.urlParams_, opts...)
  117101. res, err := c.doRequest("json")
  117102. if res != nil && res.StatusCode == http.StatusNotModified {
  117103. if res.Body != nil {
  117104. res.Body.Close()
  117105. }
  117106. return nil, &googleapi.Error{
  117107. Code: res.StatusCode,
  117108. Header: res.Header,
  117109. }
  117110. }
  117111. if err != nil {
  117112. return nil, err
  117113. }
  117114. defer googleapi.CloseBody(res)
  117115. if err := googleapi.CheckResponse(res); err != nil {
  117116. return nil, err
  117117. }
  117118. ret := &TargetVpnGateway{
  117119. ServerResponse: googleapi.ServerResponse{
  117120. Header: res.Header,
  117121. HTTPStatusCode: res.StatusCode,
  117122. },
  117123. }
  117124. target := &ret
  117125. if err := gensupport.DecodeResponse(target, res); err != nil {
  117126. return nil, err
  117127. }
  117128. return ret, nil
  117129. // {
  117130. // "description": "Returns the specified target VPN gateway. Gets a list of available target VPN gateways by making a list() request.",
  117131. // "httpMethod": "GET",
  117132. // "id": "compute.targetVpnGateways.get",
  117133. // "parameterOrder": [
  117134. // "project",
  117135. // "region",
  117136. // "targetVpnGateway"
  117137. // ],
  117138. // "parameters": {
  117139. // "project": {
  117140. // "description": "Project ID for this request.",
  117141. // "location": "path",
  117142. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  117143. // "required": true,
  117144. // "type": "string"
  117145. // },
  117146. // "region": {
  117147. // "description": "Name of the region for this request.",
  117148. // "location": "path",
  117149. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  117150. // "required": true,
  117151. // "type": "string"
  117152. // },
  117153. // "targetVpnGateway": {
  117154. // "description": "Name of the target VPN gateway to return.",
  117155. // "location": "path",
  117156. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  117157. // "required": true,
  117158. // "type": "string"
  117159. // }
  117160. // },
  117161. // "path": "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}",
  117162. // "response": {
  117163. // "$ref": "TargetVpnGateway"
  117164. // },
  117165. // "scopes": [
  117166. // "https://www.googleapis.com/auth/cloud-platform",
  117167. // "https://www.googleapis.com/auth/compute",
  117168. // "https://www.googleapis.com/auth/compute.readonly"
  117169. // ]
  117170. // }
  117171. }
  117172. // method id "compute.targetVpnGateways.insert":
  117173. type TargetVpnGatewaysInsertCall struct {
  117174. s *Service
  117175. project string
  117176. region string
  117177. targetvpngateway *TargetVpnGateway
  117178. urlParams_ gensupport.URLParams
  117179. ctx_ context.Context
  117180. header_ http.Header
  117181. }
  117182. // Insert: Creates a target VPN gateway in the specified project and
  117183. // region using the data included in the request.
  117184. func (r *TargetVpnGatewaysService) Insert(project string, region string, targetvpngateway *TargetVpnGateway) *TargetVpnGatewaysInsertCall {
  117185. c := &TargetVpnGatewaysInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  117186. c.project = project
  117187. c.region = region
  117188. c.targetvpngateway = targetvpngateway
  117189. return c
  117190. }
  117191. // RequestId sets the optional parameter "requestId": An optional
  117192. // request ID to identify requests. Specify a unique request ID so that
  117193. // if you must retry your request, the server will know to ignore the
  117194. // request if it has already been completed.
  117195. //
  117196. // For example, consider a situation where you make an initial request
  117197. // and the request times out. If you make the request again with the
  117198. // same request ID, the server can check if original operation with the
  117199. // same request ID was received, and if so, will ignore the second
  117200. // request. This prevents clients from accidentally creating duplicate
  117201. // commitments.
  117202. //
  117203. // The request ID must be a valid UUID with the exception that zero UUID
  117204. // is not supported (00000000-0000-0000-0000-000000000000).
  117205. func (c *TargetVpnGatewaysInsertCall) RequestId(requestId string) *TargetVpnGatewaysInsertCall {
  117206. c.urlParams_.Set("requestId", requestId)
  117207. return c
  117208. }
  117209. // Fields allows partial responses to be retrieved. See
  117210. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  117211. // for more information.
  117212. func (c *TargetVpnGatewaysInsertCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysInsertCall {
  117213. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  117214. return c
  117215. }
  117216. // Context sets the context to be used in this call's Do method. Any
  117217. // pending HTTP request will be aborted if the provided context is
  117218. // canceled.
  117219. func (c *TargetVpnGatewaysInsertCall) Context(ctx context.Context) *TargetVpnGatewaysInsertCall {
  117220. c.ctx_ = ctx
  117221. return c
  117222. }
  117223. // Header returns an http.Header that can be modified by the caller to
  117224. // add HTTP headers to the request.
  117225. func (c *TargetVpnGatewaysInsertCall) Header() http.Header {
  117226. if c.header_ == nil {
  117227. c.header_ = make(http.Header)
  117228. }
  117229. return c.header_
  117230. }
  117231. func (c *TargetVpnGatewaysInsertCall) doRequest(alt string) (*http.Response, error) {
  117232. reqHeaders := make(http.Header)
  117233. for k, v := range c.header_ {
  117234. reqHeaders[k] = v
  117235. }
  117236. reqHeaders.Set("User-Agent", c.s.userAgent())
  117237. var body io.Reader = nil
  117238. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetvpngateway)
  117239. if err != nil {
  117240. return nil, err
  117241. }
  117242. reqHeaders.Set("Content-Type", "application/json")
  117243. c.urlParams_.Set("alt", alt)
  117244. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways")
  117245. urls += "?" + c.urlParams_.Encode()
  117246. req, _ := http.NewRequest("POST", urls, body)
  117247. req.Header = reqHeaders
  117248. googleapi.Expand(req.URL, map[string]string{
  117249. "project": c.project,
  117250. "region": c.region,
  117251. })
  117252. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  117253. }
  117254. // Do executes the "compute.targetVpnGateways.insert" call.
  117255. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  117256. // status code is an error. Response headers are in either
  117257. // *Operation.ServerResponse.Header or (if a response was returned at
  117258. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  117259. // to check whether the returned error was because
  117260. // http.StatusNotModified was returned.
  117261. func (c *TargetVpnGatewaysInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  117262. gensupport.SetOptions(c.urlParams_, opts...)
  117263. res, err := c.doRequest("json")
  117264. if res != nil && res.StatusCode == http.StatusNotModified {
  117265. if res.Body != nil {
  117266. res.Body.Close()
  117267. }
  117268. return nil, &googleapi.Error{
  117269. Code: res.StatusCode,
  117270. Header: res.Header,
  117271. }
  117272. }
  117273. if err != nil {
  117274. return nil, err
  117275. }
  117276. defer googleapi.CloseBody(res)
  117277. if err := googleapi.CheckResponse(res); err != nil {
  117278. return nil, err
  117279. }
  117280. ret := &Operation{
  117281. ServerResponse: googleapi.ServerResponse{
  117282. Header: res.Header,
  117283. HTTPStatusCode: res.StatusCode,
  117284. },
  117285. }
  117286. target := &ret
  117287. if err := gensupport.DecodeResponse(target, res); err != nil {
  117288. return nil, err
  117289. }
  117290. return ret, nil
  117291. // {
  117292. // "description": "Creates a target VPN gateway in the specified project and region using the data included in the request.",
  117293. // "httpMethod": "POST",
  117294. // "id": "compute.targetVpnGateways.insert",
  117295. // "parameterOrder": [
  117296. // "project",
  117297. // "region"
  117298. // ],
  117299. // "parameters": {
  117300. // "project": {
  117301. // "description": "Project ID for this request.",
  117302. // "location": "path",
  117303. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  117304. // "required": true,
  117305. // "type": "string"
  117306. // },
  117307. // "region": {
  117308. // "description": "Name of the region for this request.",
  117309. // "location": "path",
  117310. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  117311. // "required": true,
  117312. // "type": "string"
  117313. // },
  117314. // "requestId": {
  117315. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  117316. // "location": "query",
  117317. // "type": "string"
  117318. // }
  117319. // },
  117320. // "path": "{project}/regions/{region}/targetVpnGateways",
  117321. // "request": {
  117322. // "$ref": "TargetVpnGateway"
  117323. // },
  117324. // "response": {
  117325. // "$ref": "Operation"
  117326. // },
  117327. // "scopes": [
  117328. // "https://www.googleapis.com/auth/cloud-platform",
  117329. // "https://www.googleapis.com/auth/compute"
  117330. // ]
  117331. // }
  117332. }
  117333. // method id "compute.targetVpnGateways.list":
  117334. type TargetVpnGatewaysListCall struct {
  117335. s *Service
  117336. project string
  117337. region string
  117338. urlParams_ gensupport.URLParams
  117339. ifNoneMatch_ string
  117340. ctx_ context.Context
  117341. header_ http.Header
  117342. }
  117343. // List: Retrieves a list of target VPN gateways available to the
  117344. // specified project and region.
  117345. func (r *TargetVpnGatewaysService) List(project string, region string) *TargetVpnGatewaysListCall {
  117346. c := &TargetVpnGatewaysListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  117347. c.project = project
  117348. c.region = region
  117349. return c
  117350. }
  117351. // Filter sets the optional parameter "filter": A filter expression that
  117352. // filters resources listed in the response. The expression must specify
  117353. // the field name, a comparison operator, and the value that you want to
  117354. // use for filtering. The value must be a string, a number, or a
  117355. // boolean. The comparison operator must be either =, !=, >, or <.
  117356. //
  117357. // For example, if you are filtering Compute Engine instances, you can
  117358. // exclude instances named example-instance by specifying name !=
  117359. // example-instance.
  117360. //
  117361. // You can also filter nested fields. For example, you could specify
  117362. // scheduling.automaticRestart = false to include instances only if they
  117363. // are not scheduled for automatic restarts. You can use filtering on
  117364. // nested fields to filter based on resource labels.
  117365. //
  117366. // To filter on multiple expressions, provide each separate expression
  117367. // within parentheses. For example, (scheduling.automaticRestart = true)
  117368. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  117369. // AND expression. However, you can include AND and OR expressions
  117370. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  117371. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  117372. // true).
  117373. func (c *TargetVpnGatewaysListCall) Filter(filter string) *TargetVpnGatewaysListCall {
  117374. c.urlParams_.Set("filter", filter)
  117375. return c
  117376. }
  117377. // MaxResults sets the optional parameter "maxResults": The maximum
  117378. // number of results per page that should be returned. If the number of
  117379. // available results is larger than maxResults, Compute Engine returns a
  117380. // nextPageToken that can be used to get the next page of results in
  117381. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  117382. // (Default: 500)
  117383. func (c *TargetVpnGatewaysListCall) MaxResults(maxResults int64) *TargetVpnGatewaysListCall {
  117384. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  117385. return c
  117386. }
  117387. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  117388. // a certain order. By default, results are returned in alphanumerical
  117389. // order based on the resource name.
  117390. //
  117391. // You can also sort results in descending order based on the creation
  117392. // timestamp using orderBy="creationTimestamp desc". This sorts results
  117393. // based on the creationTimestamp field in reverse chronological order
  117394. // (newest result first). Use this to sort resources like operations so
  117395. // that the newest operation is returned first.
  117396. //
  117397. // Currently, only sorting by name or creationTimestamp desc is
  117398. // supported.
  117399. func (c *TargetVpnGatewaysListCall) OrderBy(orderBy string) *TargetVpnGatewaysListCall {
  117400. c.urlParams_.Set("orderBy", orderBy)
  117401. return c
  117402. }
  117403. // PageToken sets the optional parameter "pageToken": Specifies a page
  117404. // token to use. Set pageToken to the nextPageToken returned by a
  117405. // previous list request to get the next page of results.
  117406. func (c *TargetVpnGatewaysListCall) PageToken(pageToken string) *TargetVpnGatewaysListCall {
  117407. c.urlParams_.Set("pageToken", pageToken)
  117408. return c
  117409. }
  117410. // Fields allows partial responses to be retrieved. See
  117411. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  117412. // for more information.
  117413. func (c *TargetVpnGatewaysListCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysListCall {
  117414. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  117415. return c
  117416. }
  117417. // IfNoneMatch sets the optional parameter which makes the operation
  117418. // fail if the object's ETag matches the given value. This is useful for
  117419. // getting updates only after the object has changed since the last
  117420. // request. Use googleapi.IsNotModified to check whether the response
  117421. // error from Do is the result of In-None-Match.
  117422. func (c *TargetVpnGatewaysListCall) IfNoneMatch(entityTag string) *TargetVpnGatewaysListCall {
  117423. c.ifNoneMatch_ = entityTag
  117424. return c
  117425. }
  117426. // Context sets the context to be used in this call's Do method. Any
  117427. // pending HTTP request will be aborted if the provided context is
  117428. // canceled.
  117429. func (c *TargetVpnGatewaysListCall) Context(ctx context.Context) *TargetVpnGatewaysListCall {
  117430. c.ctx_ = ctx
  117431. return c
  117432. }
  117433. // Header returns an http.Header that can be modified by the caller to
  117434. // add HTTP headers to the request.
  117435. func (c *TargetVpnGatewaysListCall) Header() http.Header {
  117436. if c.header_ == nil {
  117437. c.header_ = make(http.Header)
  117438. }
  117439. return c.header_
  117440. }
  117441. func (c *TargetVpnGatewaysListCall) doRequest(alt string) (*http.Response, error) {
  117442. reqHeaders := make(http.Header)
  117443. for k, v := range c.header_ {
  117444. reqHeaders[k] = v
  117445. }
  117446. reqHeaders.Set("User-Agent", c.s.userAgent())
  117447. if c.ifNoneMatch_ != "" {
  117448. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  117449. }
  117450. var body io.Reader = nil
  117451. c.urlParams_.Set("alt", alt)
  117452. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways")
  117453. urls += "?" + c.urlParams_.Encode()
  117454. req, _ := http.NewRequest("GET", urls, body)
  117455. req.Header = reqHeaders
  117456. googleapi.Expand(req.URL, map[string]string{
  117457. "project": c.project,
  117458. "region": c.region,
  117459. })
  117460. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  117461. }
  117462. // Do executes the "compute.targetVpnGateways.list" call.
  117463. // Exactly one of *TargetVpnGatewayList or error will be non-nil. Any
  117464. // non-2xx status code is an error. Response headers are in either
  117465. // *TargetVpnGatewayList.ServerResponse.Header or (if a response was
  117466. // returned at all) in error.(*googleapi.Error).Header. Use
  117467. // googleapi.IsNotModified to check whether the returned error was
  117468. // because http.StatusNotModified was returned.
  117469. func (c *TargetVpnGatewaysListCall) Do(opts ...googleapi.CallOption) (*TargetVpnGatewayList, error) {
  117470. gensupport.SetOptions(c.urlParams_, opts...)
  117471. res, err := c.doRequest("json")
  117472. if res != nil && res.StatusCode == http.StatusNotModified {
  117473. if res.Body != nil {
  117474. res.Body.Close()
  117475. }
  117476. return nil, &googleapi.Error{
  117477. Code: res.StatusCode,
  117478. Header: res.Header,
  117479. }
  117480. }
  117481. if err != nil {
  117482. return nil, err
  117483. }
  117484. defer googleapi.CloseBody(res)
  117485. if err := googleapi.CheckResponse(res); err != nil {
  117486. return nil, err
  117487. }
  117488. ret := &TargetVpnGatewayList{
  117489. ServerResponse: googleapi.ServerResponse{
  117490. Header: res.Header,
  117491. HTTPStatusCode: res.StatusCode,
  117492. },
  117493. }
  117494. target := &ret
  117495. if err := gensupport.DecodeResponse(target, res); err != nil {
  117496. return nil, err
  117497. }
  117498. return ret, nil
  117499. // {
  117500. // "description": "Retrieves a list of target VPN gateways available to the specified project and region.",
  117501. // "httpMethod": "GET",
  117502. // "id": "compute.targetVpnGateways.list",
  117503. // "parameterOrder": [
  117504. // "project",
  117505. // "region"
  117506. // ],
  117507. // "parameters": {
  117508. // "filter": {
  117509. // "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).",
  117510. // "location": "query",
  117511. // "type": "string"
  117512. // },
  117513. // "maxResults": {
  117514. // "default": "500",
  117515. // "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)",
  117516. // "format": "uint32",
  117517. // "location": "query",
  117518. // "minimum": "0",
  117519. // "type": "integer"
  117520. // },
  117521. // "orderBy": {
  117522. // "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.",
  117523. // "location": "query",
  117524. // "type": "string"
  117525. // },
  117526. // "pageToken": {
  117527. // "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.",
  117528. // "location": "query",
  117529. // "type": "string"
  117530. // },
  117531. // "project": {
  117532. // "description": "Project ID for this request.",
  117533. // "location": "path",
  117534. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  117535. // "required": true,
  117536. // "type": "string"
  117537. // },
  117538. // "region": {
  117539. // "description": "Name of the region for this request.",
  117540. // "location": "path",
  117541. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  117542. // "required": true,
  117543. // "type": "string"
  117544. // }
  117545. // },
  117546. // "path": "{project}/regions/{region}/targetVpnGateways",
  117547. // "response": {
  117548. // "$ref": "TargetVpnGatewayList"
  117549. // },
  117550. // "scopes": [
  117551. // "https://www.googleapis.com/auth/cloud-platform",
  117552. // "https://www.googleapis.com/auth/compute",
  117553. // "https://www.googleapis.com/auth/compute.readonly"
  117554. // ]
  117555. // }
  117556. }
  117557. // Pages invokes f for each page of results.
  117558. // A non-nil error returned from f will halt the iteration.
  117559. // The provided context supersedes any context provided to the Context method.
  117560. func (c *TargetVpnGatewaysListCall) Pages(ctx context.Context, f func(*TargetVpnGatewayList) error) error {
  117561. c.ctx_ = ctx
  117562. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  117563. for {
  117564. x, err := c.Do()
  117565. if err != nil {
  117566. return err
  117567. }
  117568. if err := f(x); err != nil {
  117569. return err
  117570. }
  117571. if x.NextPageToken == "" {
  117572. return nil
  117573. }
  117574. c.PageToken(x.NextPageToken)
  117575. }
  117576. }
  117577. // method id "compute.targetVpnGateways.setLabels":
  117578. type TargetVpnGatewaysSetLabelsCall struct {
  117579. s *Service
  117580. project string
  117581. region string
  117582. resource string
  117583. regionsetlabelsrequest *RegionSetLabelsRequest
  117584. urlParams_ gensupport.URLParams
  117585. ctx_ context.Context
  117586. header_ http.Header
  117587. }
  117588. // SetLabels: Sets the labels on a TargetVpnGateway. To learn more about
  117589. // labels, read the Labeling Resources documentation.
  117590. func (r *TargetVpnGatewaysService) SetLabels(project string, region string, resource string, regionsetlabelsrequest *RegionSetLabelsRequest) *TargetVpnGatewaysSetLabelsCall {
  117591. c := &TargetVpnGatewaysSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  117592. c.project = project
  117593. c.region = region
  117594. c.resource = resource
  117595. c.regionsetlabelsrequest = regionsetlabelsrequest
  117596. return c
  117597. }
  117598. // RequestId sets the optional parameter "requestId": An optional
  117599. // request ID to identify requests. Specify a unique request ID so that
  117600. // if you must retry your request, the server will know to ignore the
  117601. // request if it has already been completed.
  117602. //
  117603. // For example, consider a situation where you make an initial request
  117604. // and the request times out. If you make the request again with the
  117605. // same request ID, the server can check if original operation with the
  117606. // same request ID was received, and if so, will ignore the second
  117607. // request. This prevents clients from accidentally creating duplicate
  117608. // commitments.
  117609. //
  117610. // The request ID must be a valid UUID with the exception that zero UUID
  117611. // is not supported (00000000-0000-0000-0000-000000000000).
  117612. func (c *TargetVpnGatewaysSetLabelsCall) RequestId(requestId string) *TargetVpnGatewaysSetLabelsCall {
  117613. c.urlParams_.Set("requestId", requestId)
  117614. return c
  117615. }
  117616. // Fields allows partial responses to be retrieved. See
  117617. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  117618. // for more information.
  117619. func (c *TargetVpnGatewaysSetLabelsCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysSetLabelsCall {
  117620. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  117621. return c
  117622. }
  117623. // Context sets the context to be used in this call's Do method. Any
  117624. // pending HTTP request will be aborted if the provided context is
  117625. // canceled.
  117626. func (c *TargetVpnGatewaysSetLabelsCall) Context(ctx context.Context) *TargetVpnGatewaysSetLabelsCall {
  117627. c.ctx_ = ctx
  117628. return c
  117629. }
  117630. // Header returns an http.Header that can be modified by the caller to
  117631. // add HTTP headers to the request.
  117632. func (c *TargetVpnGatewaysSetLabelsCall) Header() http.Header {
  117633. if c.header_ == nil {
  117634. c.header_ = make(http.Header)
  117635. }
  117636. return c.header_
  117637. }
  117638. func (c *TargetVpnGatewaysSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  117639. reqHeaders := make(http.Header)
  117640. for k, v := range c.header_ {
  117641. reqHeaders[k] = v
  117642. }
  117643. reqHeaders.Set("User-Agent", c.s.userAgent())
  117644. var body io.Reader = nil
  117645. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest)
  117646. if err != nil {
  117647. return nil, err
  117648. }
  117649. reqHeaders.Set("Content-Type", "application/json")
  117650. c.urlParams_.Set("alt", alt)
  117651. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways/{resource}/setLabels")
  117652. urls += "?" + c.urlParams_.Encode()
  117653. req, _ := http.NewRequest("POST", urls, body)
  117654. req.Header = reqHeaders
  117655. googleapi.Expand(req.URL, map[string]string{
  117656. "project": c.project,
  117657. "region": c.region,
  117658. "resource": c.resource,
  117659. })
  117660. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  117661. }
  117662. // Do executes the "compute.targetVpnGateways.setLabels" call.
  117663. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  117664. // status code is an error. Response headers are in either
  117665. // *Operation.ServerResponse.Header or (if a response was returned at
  117666. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  117667. // to check whether the returned error was because
  117668. // http.StatusNotModified was returned.
  117669. func (c *TargetVpnGatewaysSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  117670. gensupport.SetOptions(c.urlParams_, opts...)
  117671. res, err := c.doRequest("json")
  117672. if res != nil && res.StatusCode == http.StatusNotModified {
  117673. if res.Body != nil {
  117674. res.Body.Close()
  117675. }
  117676. return nil, &googleapi.Error{
  117677. Code: res.StatusCode,
  117678. Header: res.Header,
  117679. }
  117680. }
  117681. if err != nil {
  117682. return nil, err
  117683. }
  117684. defer googleapi.CloseBody(res)
  117685. if err := googleapi.CheckResponse(res); err != nil {
  117686. return nil, err
  117687. }
  117688. ret := &Operation{
  117689. ServerResponse: googleapi.ServerResponse{
  117690. Header: res.Header,
  117691. HTTPStatusCode: res.StatusCode,
  117692. },
  117693. }
  117694. target := &ret
  117695. if err := gensupport.DecodeResponse(target, res); err != nil {
  117696. return nil, err
  117697. }
  117698. return ret, nil
  117699. // {
  117700. // "description": "Sets the labels on a TargetVpnGateway. To learn more about labels, read the Labeling Resources documentation.",
  117701. // "httpMethod": "POST",
  117702. // "id": "compute.targetVpnGateways.setLabels",
  117703. // "parameterOrder": [
  117704. // "project",
  117705. // "region",
  117706. // "resource"
  117707. // ],
  117708. // "parameters": {
  117709. // "project": {
  117710. // "description": "Project ID for this request.",
  117711. // "location": "path",
  117712. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  117713. // "required": true,
  117714. // "type": "string"
  117715. // },
  117716. // "region": {
  117717. // "description": "The region for this request.",
  117718. // "location": "path",
  117719. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  117720. // "required": true,
  117721. // "type": "string"
  117722. // },
  117723. // "requestId": {
  117724. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  117725. // "location": "query",
  117726. // "type": "string"
  117727. // },
  117728. // "resource": {
  117729. // "description": "Name of the resource for this request.",
  117730. // "location": "path",
  117731. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  117732. // "required": true,
  117733. // "type": "string"
  117734. // }
  117735. // },
  117736. // "path": "{project}/regions/{region}/targetVpnGateways/{resource}/setLabels",
  117737. // "request": {
  117738. // "$ref": "RegionSetLabelsRequest"
  117739. // },
  117740. // "response": {
  117741. // "$ref": "Operation"
  117742. // },
  117743. // "scopes": [
  117744. // "https://www.googleapis.com/auth/cloud-platform",
  117745. // "https://www.googleapis.com/auth/compute"
  117746. // ]
  117747. // }
  117748. }
  117749. // method id "compute.targetVpnGateways.testIamPermissions":
  117750. type TargetVpnGatewaysTestIamPermissionsCall struct {
  117751. s *Service
  117752. project string
  117753. region string
  117754. resource string
  117755. testpermissionsrequest *TestPermissionsRequest
  117756. urlParams_ gensupport.URLParams
  117757. ctx_ context.Context
  117758. header_ http.Header
  117759. }
  117760. // TestIamPermissions: Returns permissions that a caller has on the
  117761. // specified resource.
  117762. func (r *TargetVpnGatewaysService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *TargetVpnGatewaysTestIamPermissionsCall {
  117763. c := &TargetVpnGatewaysTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  117764. c.project = project
  117765. c.region = region
  117766. c.resource = resource
  117767. c.testpermissionsrequest = testpermissionsrequest
  117768. return c
  117769. }
  117770. // Fields allows partial responses to be retrieved. See
  117771. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  117772. // for more information.
  117773. func (c *TargetVpnGatewaysTestIamPermissionsCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysTestIamPermissionsCall {
  117774. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  117775. return c
  117776. }
  117777. // Context sets the context to be used in this call's Do method. Any
  117778. // pending HTTP request will be aborted if the provided context is
  117779. // canceled.
  117780. func (c *TargetVpnGatewaysTestIamPermissionsCall) Context(ctx context.Context) *TargetVpnGatewaysTestIamPermissionsCall {
  117781. c.ctx_ = ctx
  117782. return c
  117783. }
  117784. // Header returns an http.Header that can be modified by the caller to
  117785. // add HTTP headers to the request.
  117786. func (c *TargetVpnGatewaysTestIamPermissionsCall) Header() http.Header {
  117787. if c.header_ == nil {
  117788. c.header_ = make(http.Header)
  117789. }
  117790. return c.header_
  117791. }
  117792. func (c *TargetVpnGatewaysTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  117793. reqHeaders := make(http.Header)
  117794. for k, v := range c.header_ {
  117795. reqHeaders[k] = v
  117796. }
  117797. reqHeaders.Set("User-Agent", c.s.userAgent())
  117798. var body io.Reader = nil
  117799. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  117800. if err != nil {
  117801. return nil, err
  117802. }
  117803. reqHeaders.Set("Content-Type", "application/json")
  117804. c.urlParams_.Set("alt", alt)
  117805. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways/{resource}/testIamPermissions")
  117806. urls += "?" + c.urlParams_.Encode()
  117807. req, _ := http.NewRequest("POST", urls, body)
  117808. req.Header = reqHeaders
  117809. googleapi.Expand(req.URL, map[string]string{
  117810. "project": c.project,
  117811. "region": c.region,
  117812. "resource": c.resource,
  117813. })
  117814. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  117815. }
  117816. // Do executes the "compute.targetVpnGateways.testIamPermissions" call.
  117817. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  117818. // non-2xx status code is an error. Response headers are in either
  117819. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  117820. // returned at all) in error.(*googleapi.Error).Header. Use
  117821. // googleapi.IsNotModified to check whether the returned error was
  117822. // because http.StatusNotModified was returned.
  117823. func (c *TargetVpnGatewaysTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  117824. gensupport.SetOptions(c.urlParams_, opts...)
  117825. res, err := c.doRequest("json")
  117826. if res != nil && res.StatusCode == http.StatusNotModified {
  117827. if res.Body != nil {
  117828. res.Body.Close()
  117829. }
  117830. return nil, &googleapi.Error{
  117831. Code: res.StatusCode,
  117832. Header: res.Header,
  117833. }
  117834. }
  117835. if err != nil {
  117836. return nil, err
  117837. }
  117838. defer googleapi.CloseBody(res)
  117839. if err := googleapi.CheckResponse(res); err != nil {
  117840. return nil, err
  117841. }
  117842. ret := &TestPermissionsResponse{
  117843. ServerResponse: googleapi.ServerResponse{
  117844. Header: res.Header,
  117845. HTTPStatusCode: res.StatusCode,
  117846. },
  117847. }
  117848. target := &ret
  117849. if err := gensupport.DecodeResponse(target, res); err != nil {
  117850. return nil, err
  117851. }
  117852. return ret, nil
  117853. // {
  117854. // "description": "Returns permissions that a caller has on the specified resource.",
  117855. // "httpMethod": "POST",
  117856. // "id": "compute.targetVpnGateways.testIamPermissions",
  117857. // "parameterOrder": [
  117858. // "project",
  117859. // "region",
  117860. // "resource"
  117861. // ],
  117862. // "parameters": {
  117863. // "project": {
  117864. // "description": "Project ID for this request.",
  117865. // "location": "path",
  117866. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  117867. // "required": true,
  117868. // "type": "string"
  117869. // },
  117870. // "region": {
  117871. // "description": "The name of the region for this request.",
  117872. // "location": "path",
  117873. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  117874. // "required": true,
  117875. // "type": "string"
  117876. // },
  117877. // "resource": {
  117878. // "description": "Name of the resource for this request.",
  117879. // "location": "path",
  117880. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  117881. // "required": true,
  117882. // "type": "string"
  117883. // }
  117884. // },
  117885. // "path": "{project}/regions/{region}/targetVpnGateways/{resource}/testIamPermissions",
  117886. // "request": {
  117887. // "$ref": "TestPermissionsRequest"
  117888. // },
  117889. // "response": {
  117890. // "$ref": "TestPermissionsResponse"
  117891. // },
  117892. // "scopes": [
  117893. // "https://www.googleapis.com/auth/cloud-platform",
  117894. // "https://www.googleapis.com/auth/compute",
  117895. // "https://www.googleapis.com/auth/compute.readonly"
  117896. // ]
  117897. // }
  117898. }
  117899. // method id "compute.urlMaps.delete":
  117900. type UrlMapsDeleteCall struct {
  117901. s *Service
  117902. project string
  117903. urlMap string
  117904. urlParams_ gensupport.URLParams
  117905. ctx_ context.Context
  117906. header_ http.Header
  117907. }
  117908. // Delete: Deletes the specified UrlMap resource.
  117909. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/delete
  117910. func (r *UrlMapsService) Delete(project string, urlMap string) *UrlMapsDeleteCall {
  117911. c := &UrlMapsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  117912. c.project = project
  117913. c.urlMap = urlMap
  117914. return c
  117915. }
  117916. // RequestId sets the optional parameter "requestId": An optional
  117917. // request ID to identify requests. Specify a unique request ID so that
  117918. // if you must retry your request, the server will know to ignore the
  117919. // request if it has already been completed.
  117920. //
  117921. // For example, consider a situation where you make an initial request
  117922. // and the request times out. If you make the request again with the
  117923. // same request ID, the server can check if original operation with the
  117924. // same request ID was received, and if so, will ignore the second
  117925. // request. This prevents clients from accidentally creating duplicate
  117926. // commitments.
  117927. //
  117928. // The request ID must be a valid UUID with the exception that zero UUID
  117929. // is not supported (00000000-0000-0000-0000-000000000000).
  117930. func (c *UrlMapsDeleteCall) RequestId(requestId string) *UrlMapsDeleteCall {
  117931. c.urlParams_.Set("requestId", requestId)
  117932. return c
  117933. }
  117934. // Fields allows partial responses to be retrieved. See
  117935. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  117936. // for more information.
  117937. func (c *UrlMapsDeleteCall) Fields(s ...googleapi.Field) *UrlMapsDeleteCall {
  117938. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  117939. return c
  117940. }
  117941. // Context sets the context to be used in this call's Do method. Any
  117942. // pending HTTP request will be aborted if the provided context is
  117943. // canceled.
  117944. func (c *UrlMapsDeleteCall) Context(ctx context.Context) *UrlMapsDeleteCall {
  117945. c.ctx_ = ctx
  117946. return c
  117947. }
  117948. // Header returns an http.Header that can be modified by the caller to
  117949. // add HTTP headers to the request.
  117950. func (c *UrlMapsDeleteCall) Header() http.Header {
  117951. if c.header_ == nil {
  117952. c.header_ = make(http.Header)
  117953. }
  117954. return c.header_
  117955. }
  117956. func (c *UrlMapsDeleteCall) doRequest(alt string) (*http.Response, error) {
  117957. reqHeaders := make(http.Header)
  117958. for k, v := range c.header_ {
  117959. reqHeaders[k] = v
  117960. }
  117961. reqHeaders.Set("User-Agent", c.s.userAgent())
  117962. var body io.Reader = nil
  117963. c.urlParams_.Set("alt", alt)
  117964. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}")
  117965. urls += "?" + c.urlParams_.Encode()
  117966. req, _ := http.NewRequest("DELETE", urls, body)
  117967. req.Header = reqHeaders
  117968. googleapi.Expand(req.URL, map[string]string{
  117969. "project": c.project,
  117970. "urlMap": c.urlMap,
  117971. })
  117972. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  117973. }
  117974. // Do executes the "compute.urlMaps.delete" call.
  117975. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  117976. // status code is an error. Response headers are in either
  117977. // *Operation.ServerResponse.Header or (if a response was returned at
  117978. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  117979. // to check whether the returned error was because
  117980. // http.StatusNotModified was returned.
  117981. func (c *UrlMapsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  117982. gensupport.SetOptions(c.urlParams_, opts...)
  117983. res, err := c.doRequest("json")
  117984. if res != nil && res.StatusCode == http.StatusNotModified {
  117985. if res.Body != nil {
  117986. res.Body.Close()
  117987. }
  117988. return nil, &googleapi.Error{
  117989. Code: res.StatusCode,
  117990. Header: res.Header,
  117991. }
  117992. }
  117993. if err != nil {
  117994. return nil, err
  117995. }
  117996. defer googleapi.CloseBody(res)
  117997. if err := googleapi.CheckResponse(res); err != nil {
  117998. return nil, err
  117999. }
  118000. ret := &Operation{
  118001. ServerResponse: googleapi.ServerResponse{
  118002. Header: res.Header,
  118003. HTTPStatusCode: res.StatusCode,
  118004. },
  118005. }
  118006. target := &ret
  118007. if err := gensupport.DecodeResponse(target, res); err != nil {
  118008. return nil, err
  118009. }
  118010. return ret, nil
  118011. // {
  118012. // "description": "Deletes the specified UrlMap resource.",
  118013. // "httpMethod": "DELETE",
  118014. // "id": "compute.urlMaps.delete",
  118015. // "parameterOrder": [
  118016. // "project",
  118017. // "urlMap"
  118018. // ],
  118019. // "parameters": {
  118020. // "project": {
  118021. // "description": "Project ID for this request.",
  118022. // "location": "path",
  118023. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  118024. // "required": true,
  118025. // "type": "string"
  118026. // },
  118027. // "requestId": {
  118028. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  118029. // "location": "query",
  118030. // "type": "string"
  118031. // },
  118032. // "urlMap": {
  118033. // "description": "Name of the UrlMap resource to delete.",
  118034. // "location": "path",
  118035. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  118036. // "required": true,
  118037. // "type": "string"
  118038. // }
  118039. // },
  118040. // "path": "{project}/global/urlMaps/{urlMap}",
  118041. // "response": {
  118042. // "$ref": "Operation"
  118043. // },
  118044. // "scopes": [
  118045. // "https://www.googleapis.com/auth/cloud-platform",
  118046. // "https://www.googleapis.com/auth/compute"
  118047. // ]
  118048. // }
  118049. }
  118050. // method id "compute.urlMaps.get":
  118051. type UrlMapsGetCall struct {
  118052. s *Service
  118053. project string
  118054. urlMap string
  118055. urlParams_ gensupport.URLParams
  118056. ifNoneMatch_ string
  118057. ctx_ context.Context
  118058. header_ http.Header
  118059. }
  118060. // Get: Returns the specified UrlMap resource. Gets a list of available
  118061. // URL maps by making a list() request.
  118062. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/get
  118063. func (r *UrlMapsService) Get(project string, urlMap string) *UrlMapsGetCall {
  118064. c := &UrlMapsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  118065. c.project = project
  118066. c.urlMap = urlMap
  118067. return c
  118068. }
  118069. // Fields allows partial responses to be retrieved. See
  118070. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  118071. // for more information.
  118072. func (c *UrlMapsGetCall) Fields(s ...googleapi.Field) *UrlMapsGetCall {
  118073. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  118074. return c
  118075. }
  118076. // IfNoneMatch sets the optional parameter which makes the operation
  118077. // fail if the object's ETag matches the given value. This is useful for
  118078. // getting updates only after the object has changed since the last
  118079. // request. Use googleapi.IsNotModified to check whether the response
  118080. // error from Do is the result of In-None-Match.
  118081. func (c *UrlMapsGetCall) IfNoneMatch(entityTag string) *UrlMapsGetCall {
  118082. c.ifNoneMatch_ = entityTag
  118083. return c
  118084. }
  118085. // Context sets the context to be used in this call's Do method. Any
  118086. // pending HTTP request will be aborted if the provided context is
  118087. // canceled.
  118088. func (c *UrlMapsGetCall) Context(ctx context.Context) *UrlMapsGetCall {
  118089. c.ctx_ = ctx
  118090. return c
  118091. }
  118092. // Header returns an http.Header that can be modified by the caller to
  118093. // add HTTP headers to the request.
  118094. func (c *UrlMapsGetCall) Header() http.Header {
  118095. if c.header_ == nil {
  118096. c.header_ = make(http.Header)
  118097. }
  118098. return c.header_
  118099. }
  118100. func (c *UrlMapsGetCall) doRequest(alt string) (*http.Response, error) {
  118101. reqHeaders := make(http.Header)
  118102. for k, v := range c.header_ {
  118103. reqHeaders[k] = v
  118104. }
  118105. reqHeaders.Set("User-Agent", c.s.userAgent())
  118106. if c.ifNoneMatch_ != "" {
  118107. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  118108. }
  118109. var body io.Reader = nil
  118110. c.urlParams_.Set("alt", alt)
  118111. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}")
  118112. urls += "?" + c.urlParams_.Encode()
  118113. req, _ := http.NewRequest("GET", urls, body)
  118114. req.Header = reqHeaders
  118115. googleapi.Expand(req.URL, map[string]string{
  118116. "project": c.project,
  118117. "urlMap": c.urlMap,
  118118. })
  118119. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  118120. }
  118121. // Do executes the "compute.urlMaps.get" call.
  118122. // Exactly one of *UrlMap or error will be non-nil. Any non-2xx status
  118123. // code is an error. Response headers are in either
  118124. // *UrlMap.ServerResponse.Header or (if a response was returned at all)
  118125. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  118126. // check whether the returned error was because http.StatusNotModified
  118127. // was returned.
  118128. func (c *UrlMapsGetCall) Do(opts ...googleapi.CallOption) (*UrlMap, error) {
  118129. gensupport.SetOptions(c.urlParams_, opts...)
  118130. res, err := c.doRequest("json")
  118131. if res != nil && res.StatusCode == http.StatusNotModified {
  118132. if res.Body != nil {
  118133. res.Body.Close()
  118134. }
  118135. return nil, &googleapi.Error{
  118136. Code: res.StatusCode,
  118137. Header: res.Header,
  118138. }
  118139. }
  118140. if err != nil {
  118141. return nil, err
  118142. }
  118143. defer googleapi.CloseBody(res)
  118144. if err := googleapi.CheckResponse(res); err != nil {
  118145. return nil, err
  118146. }
  118147. ret := &UrlMap{
  118148. ServerResponse: googleapi.ServerResponse{
  118149. Header: res.Header,
  118150. HTTPStatusCode: res.StatusCode,
  118151. },
  118152. }
  118153. target := &ret
  118154. if err := gensupport.DecodeResponse(target, res); err != nil {
  118155. return nil, err
  118156. }
  118157. return ret, nil
  118158. // {
  118159. // "description": "Returns the specified UrlMap resource. Gets a list of available URL maps by making a list() request.",
  118160. // "httpMethod": "GET",
  118161. // "id": "compute.urlMaps.get",
  118162. // "parameterOrder": [
  118163. // "project",
  118164. // "urlMap"
  118165. // ],
  118166. // "parameters": {
  118167. // "project": {
  118168. // "description": "Project ID for this request.",
  118169. // "location": "path",
  118170. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  118171. // "required": true,
  118172. // "type": "string"
  118173. // },
  118174. // "urlMap": {
  118175. // "description": "Name of the UrlMap resource to return.",
  118176. // "location": "path",
  118177. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  118178. // "required": true,
  118179. // "type": "string"
  118180. // }
  118181. // },
  118182. // "path": "{project}/global/urlMaps/{urlMap}",
  118183. // "response": {
  118184. // "$ref": "UrlMap"
  118185. // },
  118186. // "scopes": [
  118187. // "https://www.googleapis.com/auth/cloud-platform",
  118188. // "https://www.googleapis.com/auth/compute",
  118189. // "https://www.googleapis.com/auth/compute.readonly"
  118190. // ]
  118191. // }
  118192. }
  118193. // method id "compute.urlMaps.insert":
  118194. type UrlMapsInsertCall struct {
  118195. s *Service
  118196. project string
  118197. urlmap *UrlMap
  118198. urlParams_ gensupport.URLParams
  118199. ctx_ context.Context
  118200. header_ http.Header
  118201. }
  118202. // Insert: Creates a UrlMap resource in the specified project using the
  118203. // data included in the request.
  118204. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/insert
  118205. func (r *UrlMapsService) Insert(project string, urlmap *UrlMap) *UrlMapsInsertCall {
  118206. c := &UrlMapsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  118207. c.project = project
  118208. c.urlmap = urlmap
  118209. return c
  118210. }
  118211. // RequestId sets the optional parameter "requestId": An optional
  118212. // request ID to identify requests. Specify a unique request ID so that
  118213. // if you must retry your request, the server will know to ignore the
  118214. // request if it has already been completed.
  118215. //
  118216. // For example, consider a situation where you make an initial request
  118217. // and the request times out. If you make the request again with the
  118218. // same request ID, the server can check if original operation with the
  118219. // same request ID was received, and if so, will ignore the second
  118220. // request. This prevents clients from accidentally creating duplicate
  118221. // commitments.
  118222. //
  118223. // The request ID must be a valid UUID with the exception that zero UUID
  118224. // is not supported (00000000-0000-0000-0000-000000000000).
  118225. func (c *UrlMapsInsertCall) RequestId(requestId string) *UrlMapsInsertCall {
  118226. c.urlParams_.Set("requestId", requestId)
  118227. return c
  118228. }
  118229. // Fields allows partial responses to be retrieved. See
  118230. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  118231. // for more information.
  118232. func (c *UrlMapsInsertCall) Fields(s ...googleapi.Field) *UrlMapsInsertCall {
  118233. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  118234. return c
  118235. }
  118236. // Context sets the context to be used in this call's Do method. Any
  118237. // pending HTTP request will be aborted if the provided context is
  118238. // canceled.
  118239. func (c *UrlMapsInsertCall) Context(ctx context.Context) *UrlMapsInsertCall {
  118240. c.ctx_ = ctx
  118241. return c
  118242. }
  118243. // Header returns an http.Header that can be modified by the caller to
  118244. // add HTTP headers to the request.
  118245. func (c *UrlMapsInsertCall) Header() http.Header {
  118246. if c.header_ == nil {
  118247. c.header_ = make(http.Header)
  118248. }
  118249. return c.header_
  118250. }
  118251. func (c *UrlMapsInsertCall) doRequest(alt string) (*http.Response, error) {
  118252. reqHeaders := make(http.Header)
  118253. for k, v := range c.header_ {
  118254. reqHeaders[k] = v
  118255. }
  118256. reqHeaders.Set("User-Agent", c.s.userAgent())
  118257. var body io.Reader = nil
  118258. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap)
  118259. if err != nil {
  118260. return nil, err
  118261. }
  118262. reqHeaders.Set("Content-Type", "application/json")
  118263. c.urlParams_.Set("alt", alt)
  118264. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps")
  118265. urls += "?" + c.urlParams_.Encode()
  118266. req, _ := http.NewRequest("POST", urls, body)
  118267. req.Header = reqHeaders
  118268. googleapi.Expand(req.URL, map[string]string{
  118269. "project": c.project,
  118270. })
  118271. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  118272. }
  118273. // Do executes the "compute.urlMaps.insert" call.
  118274. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  118275. // status code is an error. Response headers are in either
  118276. // *Operation.ServerResponse.Header or (if a response was returned at
  118277. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  118278. // to check whether the returned error was because
  118279. // http.StatusNotModified was returned.
  118280. func (c *UrlMapsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  118281. gensupport.SetOptions(c.urlParams_, opts...)
  118282. res, err := c.doRequest("json")
  118283. if res != nil && res.StatusCode == http.StatusNotModified {
  118284. if res.Body != nil {
  118285. res.Body.Close()
  118286. }
  118287. return nil, &googleapi.Error{
  118288. Code: res.StatusCode,
  118289. Header: res.Header,
  118290. }
  118291. }
  118292. if err != nil {
  118293. return nil, err
  118294. }
  118295. defer googleapi.CloseBody(res)
  118296. if err := googleapi.CheckResponse(res); err != nil {
  118297. return nil, err
  118298. }
  118299. ret := &Operation{
  118300. ServerResponse: googleapi.ServerResponse{
  118301. Header: res.Header,
  118302. HTTPStatusCode: res.StatusCode,
  118303. },
  118304. }
  118305. target := &ret
  118306. if err := gensupport.DecodeResponse(target, res); err != nil {
  118307. return nil, err
  118308. }
  118309. return ret, nil
  118310. // {
  118311. // "description": "Creates a UrlMap resource in the specified project using the data included in the request.",
  118312. // "httpMethod": "POST",
  118313. // "id": "compute.urlMaps.insert",
  118314. // "parameterOrder": [
  118315. // "project"
  118316. // ],
  118317. // "parameters": {
  118318. // "project": {
  118319. // "description": "Project ID for this request.",
  118320. // "location": "path",
  118321. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  118322. // "required": true,
  118323. // "type": "string"
  118324. // },
  118325. // "requestId": {
  118326. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  118327. // "location": "query",
  118328. // "type": "string"
  118329. // }
  118330. // },
  118331. // "path": "{project}/global/urlMaps",
  118332. // "request": {
  118333. // "$ref": "UrlMap"
  118334. // },
  118335. // "response": {
  118336. // "$ref": "Operation"
  118337. // },
  118338. // "scopes": [
  118339. // "https://www.googleapis.com/auth/cloud-platform",
  118340. // "https://www.googleapis.com/auth/compute"
  118341. // ]
  118342. // }
  118343. }
  118344. // method id "compute.urlMaps.invalidateCache":
  118345. type UrlMapsInvalidateCacheCall struct {
  118346. s *Service
  118347. project string
  118348. urlMap string
  118349. cacheinvalidationrule *CacheInvalidationRule
  118350. urlParams_ gensupport.URLParams
  118351. ctx_ context.Context
  118352. header_ http.Header
  118353. }
  118354. // InvalidateCache: Initiates a cache invalidation operation,
  118355. // invalidating the specified path, scoped to the specified UrlMap.
  118356. func (r *UrlMapsService) InvalidateCache(project string, urlMap string, cacheinvalidationrule *CacheInvalidationRule) *UrlMapsInvalidateCacheCall {
  118357. c := &UrlMapsInvalidateCacheCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  118358. c.project = project
  118359. c.urlMap = urlMap
  118360. c.cacheinvalidationrule = cacheinvalidationrule
  118361. return c
  118362. }
  118363. // RequestId sets the optional parameter "requestId": An optional
  118364. // request ID to identify requests. Specify a unique request ID so that
  118365. // if you must retry your request, the server will know to ignore the
  118366. // request if it has already been completed.
  118367. //
  118368. // For example, consider a situation where you make an initial request
  118369. // and the request times out. If you make the request again with the
  118370. // same request ID, the server can check if original operation with the
  118371. // same request ID was received, and if so, will ignore the second
  118372. // request. This prevents clients from accidentally creating duplicate
  118373. // commitments.
  118374. //
  118375. // The request ID must be a valid UUID with the exception that zero UUID
  118376. // is not supported (00000000-0000-0000-0000-000000000000).
  118377. func (c *UrlMapsInvalidateCacheCall) RequestId(requestId string) *UrlMapsInvalidateCacheCall {
  118378. c.urlParams_.Set("requestId", requestId)
  118379. return c
  118380. }
  118381. // Fields allows partial responses to be retrieved. See
  118382. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  118383. // for more information.
  118384. func (c *UrlMapsInvalidateCacheCall) Fields(s ...googleapi.Field) *UrlMapsInvalidateCacheCall {
  118385. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  118386. return c
  118387. }
  118388. // Context sets the context to be used in this call's Do method. Any
  118389. // pending HTTP request will be aborted if the provided context is
  118390. // canceled.
  118391. func (c *UrlMapsInvalidateCacheCall) Context(ctx context.Context) *UrlMapsInvalidateCacheCall {
  118392. c.ctx_ = ctx
  118393. return c
  118394. }
  118395. // Header returns an http.Header that can be modified by the caller to
  118396. // add HTTP headers to the request.
  118397. func (c *UrlMapsInvalidateCacheCall) Header() http.Header {
  118398. if c.header_ == nil {
  118399. c.header_ = make(http.Header)
  118400. }
  118401. return c.header_
  118402. }
  118403. func (c *UrlMapsInvalidateCacheCall) doRequest(alt string) (*http.Response, error) {
  118404. reqHeaders := make(http.Header)
  118405. for k, v := range c.header_ {
  118406. reqHeaders[k] = v
  118407. }
  118408. reqHeaders.Set("User-Agent", c.s.userAgent())
  118409. var body io.Reader = nil
  118410. body, err := googleapi.WithoutDataWrapper.JSONReader(c.cacheinvalidationrule)
  118411. if err != nil {
  118412. return nil, err
  118413. }
  118414. reqHeaders.Set("Content-Type", "application/json")
  118415. c.urlParams_.Set("alt", alt)
  118416. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}/invalidateCache")
  118417. urls += "?" + c.urlParams_.Encode()
  118418. req, _ := http.NewRequest("POST", urls, body)
  118419. req.Header = reqHeaders
  118420. googleapi.Expand(req.URL, map[string]string{
  118421. "project": c.project,
  118422. "urlMap": c.urlMap,
  118423. })
  118424. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  118425. }
  118426. // Do executes the "compute.urlMaps.invalidateCache" call.
  118427. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  118428. // status code is an error. Response headers are in either
  118429. // *Operation.ServerResponse.Header or (if a response was returned at
  118430. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  118431. // to check whether the returned error was because
  118432. // http.StatusNotModified was returned.
  118433. func (c *UrlMapsInvalidateCacheCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  118434. gensupport.SetOptions(c.urlParams_, opts...)
  118435. res, err := c.doRequest("json")
  118436. if res != nil && res.StatusCode == http.StatusNotModified {
  118437. if res.Body != nil {
  118438. res.Body.Close()
  118439. }
  118440. return nil, &googleapi.Error{
  118441. Code: res.StatusCode,
  118442. Header: res.Header,
  118443. }
  118444. }
  118445. if err != nil {
  118446. return nil, err
  118447. }
  118448. defer googleapi.CloseBody(res)
  118449. if err := googleapi.CheckResponse(res); err != nil {
  118450. return nil, err
  118451. }
  118452. ret := &Operation{
  118453. ServerResponse: googleapi.ServerResponse{
  118454. Header: res.Header,
  118455. HTTPStatusCode: res.StatusCode,
  118456. },
  118457. }
  118458. target := &ret
  118459. if err := gensupport.DecodeResponse(target, res); err != nil {
  118460. return nil, err
  118461. }
  118462. return ret, nil
  118463. // {
  118464. // "description": "Initiates a cache invalidation operation, invalidating the specified path, scoped to the specified UrlMap.",
  118465. // "httpMethod": "POST",
  118466. // "id": "compute.urlMaps.invalidateCache",
  118467. // "parameterOrder": [
  118468. // "project",
  118469. // "urlMap"
  118470. // ],
  118471. // "parameters": {
  118472. // "project": {
  118473. // "description": "Project ID for this request.",
  118474. // "location": "path",
  118475. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  118476. // "required": true,
  118477. // "type": "string"
  118478. // },
  118479. // "requestId": {
  118480. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  118481. // "location": "query",
  118482. // "type": "string"
  118483. // },
  118484. // "urlMap": {
  118485. // "description": "Name of the UrlMap scoping this request.",
  118486. // "location": "path",
  118487. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  118488. // "required": true,
  118489. // "type": "string"
  118490. // }
  118491. // },
  118492. // "path": "{project}/global/urlMaps/{urlMap}/invalidateCache",
  118493. // "request": {
  118494. // "$ref": "CacheInvalidationRule"
  118495. // },
  118496. // "response": {
  118497. // "$ref": "Operation"
  118498. // },
  118499. // "scopes": [
  118500. // "https://www.googleapis.com/auth/cloud-platform",
  118501. // "https://www.googleapis.com/auth/compute"
  118502. // ]
  118503. // }
  118504. }
  118505. // method id "compute.urlMaps.list":
  118506. type UrlMapsListCall struct {
  118507. s *Service
  118508. project string
  118509. urlParams_ gensupport.URLParams
  118510. ifNoneMatch_ string
  118511. ctx_ context.Context
  118512. header_ http.Header
  118513. }
  118514. // List: Retrieves the list of UrlMap resources available to the
  118515. // specified project.
  118516. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/list
  118517. func (r *UrlMapsService) List(project string) *UrlMapsListCall {
  118518. c := &UrlMapsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  118519. c.project = project
  118520. return c
  118521. }
  118522. // Filter sets the optional parameter "filter": A filter expression that
  118523. // filters resources listed in the response. The expression must specify
  118524. // the field name, a comparison operator, and the value that you want to
  118525. // use for filtering. The value must be a string, a number, or a
  118526. // boolean. The comparison operator must be either =, !=, >, or <.
  118527. //
  118528. // For example, if you are filtering Compute Engine instances, you can
  118529. // exclude instances named example-instance by specifying name !=
  118530. // example-instance.
  118531. //
  118532. // You can also filter nested fields. For example, you could specify
  118533. // scheduling.automaticRestart = false to include instances only if they
  118534. // are not scheduled for automatic restarts. You can use filtering on
  118535. // nested fields to filter based on resource labels.
  118536. //
  118537. // To filter on multiple expressions, provide each separate expression
  118538. // within parentheses. For example, (scheduling.automaticRestart = true)
  118539. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  118540. // AND expression. However, you can include AND and OR expressions
  118541. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  118542. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  118543. // true).
  118544. func (c *UrlMapsListCall) Filter(filter string) *UrlMapsListCall {
  118545. c.urlParams_.Set("filter", filter)
  118546. return c
  118547. }
  118548. // MaxResults sets the optional parameter "maxResults": The maximum
  118549. // number of results per page that should be returned. If the number of
  118550. // available results is larger than maxResults, Compute Engine returns a
  118551. // nextPageToken that can be used to get the next page of results in
  118552. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  118553. // (Default: 500)
  118554. func (c *UrlMapsListCall) MaxResults(maxResults int64) *UrlMapsListCall {
  118555. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  118556. return c
  118557. }
  118558. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  118559. // a certain order. By default, results are returned in alphanumerical
  118560. // order based on the resource name.
  118561. //
  118562. // You can also sort results in descending order based on the creation
  118563. // timestamp using orderBy="creationTimestamp desc". This sorts results
  118564. // based on the creationTimestamp field in reverse chronological order
  118565. // (newest result first). Use this to sort resources like operations so
  118566. // that the newest operation is returned first.
  118567. //
  118568. // Currently, only sorting by name or creationTimestamp desc is
  118569. // supported.
  118570. func (c *UrlMapsListCall) OrderBy(orderBy string) *UrlMapsListCall {
  118571. c.urlParams_.Set("orderBy", orderBy)
  118572. return c
  118573. }
  118574. // PageToken sets the optional parameter "pageToken": Specifies a page
  118575. // token to use. Set pageToken to the nextPageToken returned by a
  118576. // previous list request to get the next page of results.
  118577. func (c *UrlMapsListCall) PageToken(pageToken string) *UrlMapsListCall {
  118578. c.urlParams_.Set("pageToken", pageToken)
  118579. return c
  118580. }
  118581. // Fields allows partial responses to be retrieved. See
  118582. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  118583. // for more information.
  118584. func (c *UrlMapsListCall) Fields(s ...googleapi.Field) *UrlMapsListCall {
  118585. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  118586. return c
  118587. }
  118588. // IfNoneMatch sets the optional parameter which makes the operation
  118589. // fail if the object's ETag matches the given value. This is useful for
  118590. // getting updates only after the object has changed since the last
  118591. // request. Use googleapi.IsNotModified to check whether the response
  118592. // error from Do is the result of In-None-Match.
  118593. func (c *UrlMapsListCall) IfNoneMatch(entityTag string) *UrlMapsListCall {
  118594. c.ifNoneMatch_ = entityTag
  118595. return c
  118596. }
  118597. // Context sets the context to be used in this call's Do method. Any
  118598. // pending HTTP request will be aborted if the provided context is
  118599. // canceled.
  118600. func (c *UrlMapsListCall) Context(ctx context.Context) *UrlMapsListCall {
  118601. c.ctx_ = ctx
  118602. return c
  118603. }
  118604. // Header returns an http.Header that can be modified by the caller to
  118605. // add HTTP headers to the request.
  118606. func (c *UrlMapsListCall) Header() http.Header {
  118607. if c.header_ == nil {
  118608. c.header_ = make(http.Header)
  118609. }
  118610. return c.header_
  118611. }
  118612. func (c *UrlMapsListCall) doRequest(alt string) (*http.Response, error) {
  118613. reqHeaders := make(http.Header)
  118614. for k, v := range c.header_ {
  118615. reqHeaders[k] = v
  118616. }
  118617. reqHeaders.Set("User-Agent", c.s.userAgent())
  118618. if c.ifNoneMatch_ != "" {
  118619. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  118620. }
  118621. var body io.Reader = nil
  118622. c.urlParams_.Set("alt", alt)
  118623. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps")
  118624. urls += "?" + c.urlParams_.Encode()
  118625. req, _ := http.NewRequest("GET", urls, body)
  118626. req.Header = reqHeaders
  118627. googleapi.Expand(req.URL, map[string]string{
  118628. "project": c.project,
  118629. })
  118630. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  118631. }
  118632. // Do executes the "compute.urlMaps.list" call.
  118633. // Exactly one of *UrlMapList or error will be non-nil. Any non-2xx
  118634. // status code is an error. Response headers are in either
  118635. // *UrlMapList.ServerResponse.Header or (if a response was returned at
  118636. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  118637. // to check whether the returned error was because
  118638. // http.StatusNotModified was returned.
  118639. func (c *UrlMapsListCall) Do(opts ...googleapi.CallOption) (*UrlMapList, error) {
  118640. gensupport.SetOptions(c.urlParams_, opts...)
  118641. res, err := c.doRequest("json")
  118642. if res != nil && res.StatusCode == http.StatusNotModified {
  118643. if res.Body != nil {
  118644. res.Body.Close()
  118645. }
  118646. return nil, &googleapi.Error{
  118647. Code: res.StatusCode,
  118648. Header: res.Header,
  118649. }
  118650. }
  118651. if err != nil {
  118652. return nil, err
  118653. }
  118654. defer googleapi.CloseBody(res)
  118655. if err := googleapi.CheckResponse(res); err != nil {
  118656. return nil, err
  118657. }
  118658. ret := &UrlMapList{
  118659. ServerResponse: googleapi.ServerResponse{
  118660. Header: res.Header,
  118661. HTTPStatusCode: res.StatusCode,
  118662. },
  118663. }
  118664. target := &ret
  118665. if err := gensupport.DecodeResponse(target, res); err != nil {
  118666. return nil, err
  118667. }
  118668. return ret, nil
  118669. // {
  118670. // "description": "Retrieves the list of UrlMap resources available to the specified project.",
  118671. // "httpMethod": "GET",
  118672. // "id": "compute.urlMaps.list",
  118673. // "parameterOrder": [
  118674. // "project"
  118675. // ],
  118676. // "parameters": {
  118677. // "filter": {
  118678. // "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).",
  118679. // "location": "query",
  118680. // "type": "string"
  118681. // },
  118682. // "maxResults": {
  118683. // "default": "500",
  118684. // "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)",
  118685. // "format": "uint32",
  118686. // "location": "query",
  118687. // "minimum": "0",
  118688. // "type": "integer"
  118689. // },
  118690. // "orderBy": {
  118691. // "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.",
  118692. // "location": "query",
  118693. // "type": "string"
  118694. // },
  118695. // "pageToken": {
  118696. // "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.",
  118697. // "location": "query",
  118698. // "type": "string"
  118699. // },
  118700. // "project": {
  118701. // "description": "Project ID for this request.",
  118702. // "location": "path",
  118703. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  118704. // "required": true,
  118705. // "type": "string"
  118706. // }
  118707. // },
  118708. // "path": "{project}/global/urlMaps",
  118709. // "response": {
  118710. // "$ref": "UrlMapList"
  118711. // },
  118712. // "scopes": [
  118713. // "https://www.googleapis.com/auth/cloud-platform",
  118714. // "https://www.googleapis.com/auth/compute",
  118715. // "https://www.googleapis.com/auth/compute.readonly"
  118716. // ]
  118717. // }
  118718. }
  118719. // Pages invokes f for each page of results.
  118720. // A non-nil error returned from f will halt the iteration.
  118721. // The provided context supersedes any context provided to the Context method.
  118722. func (c *UrlMapsListCall) Pages(ctx context.Context, f func(*UrlMapList) error) error {
  118723. c.ctx_ = ctx
  118724. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  118725. for {
  118726. x, err := c.Do()
  118727. if err != nil {
  118728. return err
  118729. }
  118730. if err := f(x); err != nil {
  118731. return err
  118732. }
  118733. if x.NextPageToken == "" {
  118734. return nil
  118735. }
  118736. c.PageToken(x.NextPageToken)
  118737. }
  118738. }
  118739. // method id "compute.urlMaps.patch":
  118740. type UrlMapsPatchCall struct {
  118741. s *Service
  118742. project string
  118743. urlMap string
  118744. urlmap *UrlMap
  118745. urlParams_ gensupport.URLParams
  118746. ctx_ context.Context
  118747. header_ http.Header
  118748. }
  118749. // Patch: Patches the specified UrlMap resource with the data included
  118750. // in the request. This method supports PATCH semantics and uses the
  118751. // JSON merge patch format and processing rules.
  118752. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/patch
  118753. func (r *UrlMapsService) Patch(project string, urlMap string, urlmap *UrlMap) *UrlMapsPatchCall {
  118754. c := &UrlMapsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  118755. c.project = project
  118756. c.urlMap = urlMap
  118757. c.urlmap = urlmap
  118758. return c
  118759. }
  118760. // RequestId sets the optional parameter "requestId": An optional
  118761. // request ID to identify requests. Specify a unique request ID so that
  118762. // if you must retry your request, the server will know to ignore the
  118763. // request if it has already been completed.
  118764. //
  118765. // For example, consider a situation where you make an initial request
  118766. // and the request times out. If you make the request again with the
  118767. // same request ID, the server can check if original operation with the
  118768. // same request ID was received, and if so, will ignore the second
  118769. // request. This prevents clients from accidentally creating duplicate
  118770. // commitments.
  118771. //
  118772. // The request ID must be a valid UUID with the exception that zero UUID
  118773. // is not supported (00000000-0000-0000-0000-000000000000).
  118774. func (c *UrlMapsPatchCall) RequestId(requestId string) *UrlMapsPatchCall {
  118775. c.urlParams_.Set("requestId", requestId)
  118776. return c
  118777. }
  118778. // Fields allows partial responses to be retrieved. See
  118779. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  118780. // for more information.
  118781. func (c *UrlMapsPatchCall) Fields(s ...googleapi.Field) *UrlMapsPatchCall {
  118782. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  118783. return c
  118784. }
  118785. // Context sets the context to be used in this call's Do method. Any
  118786. // pending HTTP request will be aborted if the provided context is
  118787. // canceled.
  118788. func (c *UrlMapsPatchCall) Context(ctx context.Context) *UrlMapsPatchCall {
  118789. c.ctx_ = ctx
  118790. return c
  118791. }
  118792. // Header returns an http.Header that can be modified by the caller to
  118793. // add HTTP headers to the request.
  118794. func (c *UrlMapsPatchCall) Header() http.Header {
  118795. if c.header_ == nil {
  118796. c.header_ = make(http.Header)
  118797. }
  118798. return c.header_
  118799. }
  118800. func (c *UrlMapsPatchCall) doRequest(alt string) (*http.Response, error) {
  118801. reqHeaders := make(http.Header)
  118802. for k, v := range c.header_ {
  118803. reqHeaders[k] = v
  118804. }
  118805. reqHeaders.Set("User-Agent", c.s.userAgent())
  118806. var body io.Reader = nil
  118807. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap)
  118808. if err != nil {
  118809. return nil, err
  118810. }
  118811. reqHeaders.Set("Content-Type", "application/json")
  118812. c.urlParams_.Set("alt", alt)
  118813. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}")
  118814. urls += "?" + c.urlParams_.Encode()
  118815. req, _ := http.NewRequest("PATCH", urls, body)
  118816. req.Header = reqHeaders
  118817. googleapi.Expand(req.URL, map[string]string{
  118818. "project": c.project,
  118819. "urlMap": c.urlMap,
  118820. })
  118821. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  118822. }
  118823. // Do executes the "compute.urlMaps.patch" call.
  118824. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  118825. // status code is an error. Response headers are in either
  118826. // *Operation.ServerResponse.Header or (if a response was returned at
  118827. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  118828. // to check whether the returned error was because
  118829. // http.StatusNotModified was returned.
  118830. func (c *UrlMapsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  118831. gensupport.SetOptions(c.urlParams_, opts...)
  118832. res, err := c.doRequest("json")
  118833. if res != nil && res.StatusCode == http.StatusNotModified {
  118834. if res.Body != nil {
  118835. res.Body.Close()
  118836. }
  118837. return nil, &googleapi.Error{
  118838. Code: res.StatusCode,
  118839. Header: res.Header,
  118840. }
  118841. }
  118842. if err != nil {
  118843. return nil, err
  118844. }
  118845. defer googleapi.CloseBody(res)
  118846. if err := googleapi.CheckResponse(res); err != nil {
  118847. return nil, err
  118848. }
  118849. ret := &Operation{
  118850. ServerResponse: googleapi.ServerResponse{
  118851. Header: res.Header,
  118852. HTTPStatusCode: res.StatusCode,
  118853. },
  118854. }
  118855. target := &ret
  118856. if err := gensupport.DecodeResponse(target, res); err != nil {
  118857. return nil, err
  118858. }
  118859. return ret, nil
  118860. // {
  118861. // "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.",
  118862. // "httpMethod": "PATCH",
  118863. // "id": "compute.urlMaps.patch",
  118864. // "parameterOrder": [
  118865. // "project",
  118866. // "urlMap"
  118867. // ],
  118868. // "parameters": {
  118869. // "project": {
  118870. // "description": "Project ID for this request.",
  118871. // "location": "path",
  118872. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  118873. // "required": true,
  118874. // "type": "string"
  118875. // },
  118876. // "requestId": {
  118877. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  118878. // "location": "query",
  118879. // "type": "string"
  118880. // },
  118881. // "urlMap": {
  118882. // "description": "Name of the UrlMap resource to patch.",
  118883. // "location": "path",
  118884. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  118885. // "required": true,
  118886. // "type": "string"
  118887. // }
  118888. // },
  118889. // "path": "{project}/global/urlMaps/{urlMap}",
  118890. // "request": {
  118891. // "$ref": "UrlMap"
  118892. // },
  118893. // "response": {
  118894. // "$ref": "Operation"
  118895. // },
  118896. // "scopes": [
  118897. // "https://www.googleapis.com/auth/cloud-platform",
  118898. // "https://www.googleapis.com/auth/compute"
  118899. // ]
  118900. // }
  118901. }
  118902. // method id "compute.urlMaps.testIamPermissions":
  118903. type UrlMapsTestIamPermissionsCall struct {
  118904. s *Service
  118905. project string
  118906. resource string
  118907. testpermissionsrequest *TestPermissionsRequest
  118908. urlParams_ gensupport.URLParams
  118909. ctx_ context.Context
  118910. header_ http.Header
  118911. }
  118912. // TestIamPermissions: Returns permissions that a caller has on the
  118913. // specified resource.
  118914. func (r *UrlMapsService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *UrlMapsTestIamPermissionsCall {
  118915. c := &UrlMapsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  118916. c.project = project
  118917. c.resource = resource
  118918. c.testpermissionsrequest = testpermissionsrequest
  118919. return c
  118920. }
  118921. // Fields allows partial responses to be retrieved. See
  118922. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  118923. // for more information.
  118924. func (c *UrlMapsTestIamPermissionsCall) Fields(s ...googleapi.Field) *UrlMapsTestIamPermissionsCall {
  118925. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  118926. return c
  118927. }
  118928. // Context sets the context to be used in this call's Do method. Any
  118929. // pending HTTP request will be aborted if the provided context is
  118930. // canceled.
  118931. func (c *UrlMapsTestIamPermissionsCall) Context(ctx context.Context) *UrlMapsTestIamPermissionsCall {
  118932. c.ctx_ = ctx
  118933. return c
  118934. }
  118935. // Header returns an http.Header that can be modified by the caller to
  118936. // add HTTP headers to the request.
  118937. func (c *UrlMapsTestIamPermissionsCall) Header() http.Header {
  118938. if c.header_ == nil {
  118939. c.header_ = make(http.Header)
  118940. }
  118941. return c.header_
  118942. }
  118943. func (c *UrlMapsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  118944. reqHeaders := make(http.Header)
  118945. for k, v := range c.header_ {
  118946. reqHeaders[k] = v
  118947. }
  118948. reqHeaders.Set("User-Agent", c.s.userAgent())
  118949. var body io.Reader = nil
  118950. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  118951. if err != nil {
  118952. return nil, err
  118953. }
  118954. reqHeaders.Set("Content-Type", "application/json")
  118955. c.urlParams_.Set("alt", alt)
  118956. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{resource}/testIamPermissions")
  118957. urls += "?" + c.urlParams_.Encode()
  118958. req, _ := http.NewRequest("POST", urls, body)
  118959. req.Header = reqHeaders
  118960. googleapi.Expand(req.URL, map[string]string{
  118961. "project": c.project,
  118962. "resource": c.resource,
  118963. })
  118964. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  118965. }
  118966. // Do executes the "compute.urlMaps.testIamPermissions" call.
  118967. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  118968. // non-2xx status code is an error. Response headers are in either
  118969. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  118970. // returned at all) in error.(*googleapi.Error).Header. Use
  118971. // googleapi.IsNotModified to check whether the returned error was
  118972. // because http.StatusNotModified was returned.
  118973. func (c *UrlMapsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  118974. gensupport.SetOptions(c.urlParams_, opts...)
  118975. res, err := c.doRequest("json")
  118976. if res != nil && res.StatusCode == http.StatusNotModified {
  118977. if res.Body != nil {
  118978. res.Body.Close()
  118979. }
  118980. return nil, &googleapi.Error{
  118981. Code: res.StatusCode,
  118982. Header: res.Header,
  118983. }
  118984. }
  118985. if err != nil {
  118986. return nil, err
  118987. }
  118988. defer googleapi.CloseBody(res)
  118989. if err := googleapi.CheckResponse(res); err != nil {
  118990. return nil, err
  118991. }
  118992. ret := &TestPermissionsResponse{
  118993. ServerResponse: googleapi.ServerResponse{
  118994. Header: res.Header,
  118995. HTTPStatusCode: res.StatusCode,
  118996. },
  118997. }
  118998. target := &ret
  118999. if err := gensupport.DecodeResponse(target, res); err != nil {
  119000. return nil, err
  119001. }
  119002. return ret, nil
  119003. // {
  119004. // "description": "Returns permissions that a caller has on the specified resource.",
  119005. // "httpMethod": "POST",
  119006. // "id": "compute.urlMaps.testIamPermissions",
  119007. // "parameterOrder": [
  119008. // "project",
  119009. // "resource"
  119010. // ],
  119011. // "parameters": {
  119012. // "project": {
  119013. // "description": "Project ID for this request.",
  119014. // "location": "path",
  119015. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  119016. // "required": true,
  119017. // "type": "string"
  119018. // },
  119019. // "resource": {
  119020. // "description": "Name of the resource for this request.",
  119021. // "location": "path",
  119022. // "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?",
  119023. // "required": true,
  119024. // "type": "string"
  119025. // }
  119026. // },
  119027. // "path": "{project}/global/urlMaps/{resource}/testIamPermissions",
  119028. // "request": {
  119029. // "$ref": "TestPermissionsRequest"
  119030. // },
  119031. // "response": {
  119032. // "$ref": "TestPermissionsResponse"
  119033. // },
  119034. // "scopes": [
  119035. // "https://www.googleapis.com/auth/cloud-platform",
  119036. // "https://www.googleapis.com/auth/compute",
  119037. // "https://www.googleapis.com/auth/compute.readonly"
  119038. // ]
  119039. // }
  119040. }
  119041. // method id "compute.urlMaps.update":
  119042. type UrlMapsUpdateCall struct {
  119043. s *Service
  119044. project string
  119045. urlMap string
  119046. urlmap *UrlMap
  119047. urlParams_ gensupport.URLParams
  119048. ctx_ context.Context
  119049. header_ http.Header
  119050. }
  119051. // Update: Updates the specified UrlMap resource with the data included
  119052. // in the request.
  119053. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/update
  119054. func (r *UrlMapsService) Update(project string, urlMap string, urlmap *UrlMap) *UrlMapsUpdateCall {
  119055. c := &UrlMapsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  119056. c.project = project
  119057. c.urlMap = urlMap
  119058. c.urlmap = urlmap
  119059. return c
  119060. }
  119061. // RequestId sets the optional parameter "requestId": An optional
  119062. // request ID to identify requests. Specify a unique request ID so that
  119063. // if you must retry your request, the server will know to ignore the
  119064. // request if it has already been completed.
  119065. //
  119066. // For example, consider a situation where you make an initial request
  119067. // and the request times out. If you make the request again with the
  119068. // same request ID, the server can check if original operation with the
  119069. // same request ID was received, and if so, will ignore the second
  119070. // request. This prevents clients from accidentally creating duplicate
  119071. // commitments.
  119072. //
  119073. // The request ID must be a valid UUID with the exception that zero UUID
  119074. // is not supported (00000000-0000-0000-0000-000000000000).
  119075. func (c *UrlMapsUpdateCall) RequestId(requestId string) *UrlMapsUpdateCall {
  119076. c.urlParams_.Set("requestId", requestId)
  119077. return c
  119078. }
  119079. // Fields allows partial responses to be retrieved. See
  119080. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  119081. // for more information.
  119082. func (c *UrlMapsUpdateCall) Fields(s ...googleapi.Field) *UrlMapsUpdateCall {
  119083. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  119084. return c
  119085. }
  119086. // Context sets the context to be used in this call's Do method. Any
  119087. // pending HTTP request will be aborted if the provided context is
  119088. // canceled.
  119089. func (c *UrlMapsUpdateCall) Context(ctx context.Context) *UrlMapsUpdateCall {
  119090. c.ctx_ = ctx
  119091. return c
  119092. }
  119093. // Header returns an http.Header that can be modified by the caller to
  119094. // add HTTP headers to the request.
  119095. func (c *UrlMapsUpdateCall) Header() http.Header {
  119096. if c.header_ == nil {
  119097. c.header_ = make(http.Header)
  119098. }
  119099. return c.header_
  119100. }
  119101. func (c *UrlMapsUpdateCall) doRequest(alt string) (*http.Response, error) {
  119102. reqHeaders := make(http.Header)
  119103. for k, v := range c.header_ {
  119104. reqHeaders[k] = v
  119105. }
  119106. reqHeaders.Set("User-Agent", c.s.userAgent())
  119107. var body io.Reader = nil
  119108. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap)
  119109. if err != nil {
  119110. return nil, err
  119111. }
  119112. reqHeaders.Set("Content-Type", "application/json")
  119113. c.urlParams_.Set("alt", alt)
  119114. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}")
  119115. urls += "?" + c.urlParams_.Encode()
  119116. req, _ := http.NewRequest("PUT", urls, body)
  119117. req.Header = reqHeaders
  119118. googleapi.Expand(req.URL, map[string]string{
  119119. "project": c.project,
  119120. "urlMap": c.urlMap,
  119121. })
  119122. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  119123. }
  119124. // Do executes the "compute.urlMaps.update" call.
  119125. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  119126. // status code is an error. Response headers are in either
  119127. // *Operation.ServerResponse.Header or (if a response was returned at
  119128. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  119129. // to check whether the returned error was because
  119130. // http.StatusNotModified was returned.
  119131. func (c *UrlMapsUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  119132. gensupport.SetOptions(c.urlParams_, opts...)
  119133. res, err := c.doRequest("json")
  119134. if res != nil && res.StatusCode == http.StatusNotModified {
  119135. if res.Body != nil {
  119136. res.Body.Close()
  119137. }
  119138. return nil, &googleapi.Error{
  119139. Code: res.StatusCode,
  119140. Header: res.Header,
  119141. }
  119142. }
  119143. if err != nil {
  119144. return nil, err
  119145. }
  119146. defer googleapi.CloseBody(res)
  119147. if err := googleapi.CheckResponse(res); err != nil {
  119148. return nil, err
  119149. }
  119150. ret := &Operation{
  119151. ServerResponse: googleapi.ServerResponse{
  119152. Header: res.Header,
  119153. HTTPStatusCode: res.StatusCode,
  119154. },
  119155. }
  119156. target := &ret
  119157. if err := gensupport.DecodeResponse(target, res); err != nil {
  119158. return nil, err
  119159. }
  119160. return ret, nil
  119161. // {
  119162. // "description": "Updates the specified UrlMap resource with the data included in the request.",
  119163. // "httpMethod": "PUT",
  119164. // "id": "compute.urlMaps.update",
  119165. // "parameterOrder": [
  119166. // "project",
  119167. // "urlMap"
  119168. // ],
  119169. // "parameters": {
  119170. // "project": {
  119171. // "description": "Project ID for this request.",
  119172. // "location": "path",
  119173. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  119174. // "required": true,
  119175. // "type": "string"
  119176. // },
  119177. // "requestId": {
  119178. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  119179. // "location": "query",
  119180. // "type": "string"
  119181. // },
  119182. // "urlMap": {
  119183. // "description": "Name of the UrlMap resource to update.",
  119184. // "location": "path",
  119185. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  119186. // "required": true,
  119187. // "type": "string"
  119188. // }
  119189. // },
  119190. // "path": "{project}/global/urlMaps/{urlMap}",
  119191. // "request": {
  119192. // "$ref": "UrlMap"
  119193. // },
  119194. // "response": {
  119195. // "$ref": "Operation"
  119196. // },
  119197. // "scopes": [
  119198. // "https://www.googleapis.com/auth/cloud-platform",
  119199. // "https://www.googleapis.com/auth/compute"
  119200. // ]
  119201. // }
  119202. }
  119203. // method id "compute.urlMaps.validate":
  119204. type UrlMapsValidateCall struct {
  119205. s *Service
  119206. project string
  119207. urlMap string
  119208. urlmapsvalidaterequest *UrlMapsValidateRequest
  119209. urlParams_ gensupport.URLParams
  119210. ctx_ context.Context
  119211. header_ http.Header
  119212. }
  119213. // Validate: Runs static validation for the UrlMap. In particular, the
  119214. // tests of the provided UrlMap will be run. Calling this method does
  119215. // NOT create the UrlMap.
  119216. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/validate
  119217. func (r *UrlMapsService) Validate(project string, urlMap string, urlmapsvalidaterequest *UrlMapsValidateRequest) *UrlMapsValidateCall {
  119218. c := &UrlMapsValidateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  119219. c.project = project
  119220. c.urlMap = urlMap
  119221. c.urlmapsvalidaterequest = urlmapsvalidaterequest
  119222. return c
  119223. }
  119224. // Fields allows partial responses to be retrieved. See
  119225. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  119226. // for more information.
  119227. func (c *UrlMapsValidateCall) Fields(s ...googleapi.Field) *UrlMapsValidateCall {
  119228. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  119229. return c
  119230. }
  119231. // Context sets the context to be used in this call's Do method. Any
  119232. // pending HTTP request will be aborted if the provided context is
  119233. // canceled.
  119234. func (c *UrlMapsValidateCall) Context(ctx context.Context) *UrlMapsValidateCall {
  119235. c.ctx_ = ctx
  119236. return c
  119237. }
  119238. // Header returns an http.Header that can be modified by the caller to
  119239. // add HTTP headers to the request.
  119240. func (c *UrlMapsValidateCall) Header() http.Header {
  119241. if c.header_ == nil {
  119242. c.header_ = make(http.Header)
  119243. }
  119244. return c.header_
  119245. }
  119246. func (c *UrlMapsValidateCall) doRequest(alt string) (*http.Response, error) {
  119247. reqHeaders := make(http.Header)
  119248. for k, v := range c.header_ {
  119249. reqHeaders[k] = v
  119250. }
  119251. reqHeaders.Set("User-Agent", c.s.userAgent())
  119252. var body io.Reader = nil
  119253. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapsvalidaterequest)
  119254. if err != nil {
  119255. return nil, err
  119256. }
  119257. reqHeaders.Set("Content-Type", "application/json")
  119258. c.urlParams_.Set("alt", alt)
  119259. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}/validate")
  119260. urls += "?" + c.urlParams_.Encode()
  119261. req, _ := http.NewRequest("POST", urls, body)
  119262. req.Header = reqHeaders
  119263. googleapi.Expand(req.URL, map[string]string{
  119264. "project": c.project,
  119265. "urlMap": c.urlMap,
  119266. })
  119267. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  119268. }
  119269. // Do executes the "compute.urlMaps.validate" call.
  119270. // Exactly one of *UrlMapsValidateResponse or error will be non-nil. Any
  119271. // non-2xx status code is an error. Response headers are in either
  119272. // *UrlMapsValidateResponse.ServerResponse.Header or (if a response was
  119273. // returned at all) in error.(*googleapi.Error).Header. Use
  119274. // googleapi.IsNotModified to check whether the returned error was
  119275. // because http.StatusNotModified was returned.
  119276. func (c *UrlMapsValidateCall) Do(opts ...googleapi.CallOption) (*UrlMapsValidateResponse, error) {
  119277. gensupport.SetOptions(c.urlParams_, opts...)
  119278. res, err := c.doRequest("json")
  119279. if res != nil && res.StatusCode == http.StatusNotModified {
  119280. if res.Body != nil {
  119281. res.Body.Close()
  119282. }
  119283. return nil, &googleapi.Error{
  119284. Code: res.StatusCode,
  119285. Header: res.Header,
  119286. }
  119287. }
  119288. if err != nil {
  119289. return nil, err
  119290. }
  119291. defer googleapi.CloseBody(res)
  119292. if err := googleapi.CheckResponse(res); err != nil {
  119293. return nil, err
  119294. }
  119295. ret := &UrlMapsValidateResponse{
  119296. ServerResponse: googleapi.ServerResponse{
  119297. Header: res.Header,
  119298. HTTPStatusCode: res.StatusCode,
  119299. },
  119300. }
  119301. target := &ret
  119302. if err := gensupport.DecodeResponse(target, res); err != nil {
  119303. return nil, err
  119304. }
  119305. return ret, nil
  119306. // {
  119307. // "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.",
  119308. // "httpMethod": "POST",
  119309. // "id": "compute.urlMaps.validate",
  119310. // "parameterOrder": [
  119311. // "project",
  119312. // "urlMap"
  119313. // ],
  119314. // "parameters": {
  119315. // "project": {
  119316. // "description": "Project ID for this request.",
  119317. // "location": "path",
  119318. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  119319. // "required": true,
  119320. // "type": "string"
  119321. // },
  119322. // "urlMap": {
  119323. // "description": "Name of the UrlMap resource to be validated as.",
  119324. // "location": "path",
  119325. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  119326. // "required": true,
  119327. // "type": "string"
  119328. // }
  119329. // },
  119330. // "path": "{project}/global/urlMaps/{urlMap}/validate",
  119331. // "request": {
  119332. // "$ref": "UrlMapsValidateRequest"
  119333. // },
  119334. // "response": {
  119335. // "$ref": "UrlMapsValidateResponse"
  119336. // },
  119337. // "scopes": [
  119338. // "https://www.googleapis.com/auth/cloud-platform",
  119339. // "https://www.googleapis.com/auth/compute"
  119340. // ]
  119341. // }
  119342. }
  119343. // method id "compute.vpnGateways.aggregatedList":
  119344. type VpnGatewaysAggregatedListCall struct {
  119345. s *Service
  119346. project string
  119347. urlParams_ gensupport.URLParams
  119348. ifNoneMatch_ string
  119349. ctx_ context.Context
  119350. header_ http.Header
  119351. }
  119352. // AggregatedList: Retrieves an aggregated list of VPN gateways.
  119353. func (r *VpnGatewaysService) AggregatedList(project string) *VpnGatewaysAggregatedListCall {
  119354. c := &VpnGatewaysAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  119355. c.project = project
  119356. return c
  119357. }
  119358. // Filter sets the optional parameter "filter": A filter expression that
  119359. // filters resources listed in the response. The expression must specify
  119360. // the field name, a comparison operator, and the value that you want to
  119361. // use for filtering. The value must be a string, a number, or a
  119362. // boolean. The comparison operator must be either =, !=, >, or <.
  119363. //
  119364. // For example, if you are filtering Compute Engine instances, you can
  119365. // exclude instances named example-instance by specifying name !=
  119366. // example-instance.
  119367. //
  119368. // You can also filter nested fields. For example, you could specify
  119369. // scheduling.automaticRestart = false to include instances only if they
  119370. // are not scheduled for automatic restarts. You can use filtering on
  119371. // nested fields to filter based on resource labels.
  119372. //
  119373. // To filter on multiple expressions, provide each separate expression
  119374. // within parentheses. For example, (scheduling.automaticRestart = true)
  119375. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  119376. // AND expression. However, you can include AND and OR expressions
  119377. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  119378. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  119379. // true).
  119380. func (c *VpnGatewaysAggregatedListCall) Filter(filter string) *VpnGatewaysAggregatedListCall {
  119381. c.urlParams_.Set("filter", filter)
  119382. return c
  119383. }
  119384. // MaxResults sets the optional parameter "maxResults": The maximum
  119385. // number of results per page that should be returned. If the number of
  119386. // available results is larger than maxResults, Compute Engine returns a
  119387. // nextPageToken that can be used to get the next page of results in
  119388. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  119389. // (Default: 500)
  119390. func (c *VpnGatewaysAggregatedListCall) MaxResults(maxResults int64) *VpnGatewaysAggregatedListCall {
  119391. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  119392. return c
  119393. }
  119394. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  119395. // a certain order. By default, results are returned in alphanumerical
  119396. // order based on the resource name.
  119397. //
  119398. // You can also sort results in descending order based on the creation
  119399. // timestamp using orderBy="creationTimestamp desc". This sorts results
  119400. // based on the creationTimestamp field in reverse chronological order
  119401. // (newest result first). Use this to sort resources like operations so
  119402. // that the newest operation is returned first.
  119403. //
  119404. // Currently, only sorting by name or creationTimestamp desc is
  119405. // supported.
  119406. func (c *VpnGatewaysAggregatedListCall) OrderBy(orderBy string) *VpnGatewaysAggregatedListCall {
  119407. c.urlParams_.Set("orderBy", orderBy)
  119408. return c
  119409. }
  119410. // PageToken sets the optional parameter "pageToken": Specifies a page
  119411. // token to use. Set pageToken to the nextPageToken returned by a
  119412. // previous list request to get the next page of results.
  119413. func (c *VpnGatewaysAggregatedListCall) PageToken(pageToken string) *VpnGatewaysAggregatedListCall {
  119414. c.urlParams_.Set("pageToken", pageToken)
  119415. return c
  119416. }
  119417. // Fields allows partial responses to be retrieved. See
  119418. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  119419. // for more information.
  119420. func (c *VpnGatewaysAggregatedListCall) Fields(s ...googleapi.Field) *VpnGatewaysAggregatedListCall {
  119421. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  119422. return c
  119423. }
  119424. // IfNoneMatch sets the optional parameter which makes the operation
  119425. // fail if the object's ETag matches the given value. This is useful for
  119426. // getting updates only after the object has changed since the last
  119427. // request. Use googleapi.IsNotModified to check whether the response
  119428. // error from Do is the result of In-None-Match.
  119429. func (c *VpnGatewaysAggregatedListCall) IfNoneMatch(entityTag string) *VpnGatewaysAggregatedListCall {
  119430. c.ifNoneMatch_ = entityTag
  119431. return c
  119432. }
  119433. // Context sets the context to be used in this call's Do method. Any
  119434. // pending HTTP request will be aborted if the provided context is
  119435. // canceled.
  119436. func (c *VpnGatewaysAggregatedListCall) Context(ctx context.Context) *VpnGatewaysAggregatedListCall {
  119437. c.ctx_ = ctx
  119438. return c
  119439. }
  119440. // Header returns an http.Header that can be modified by the caller to
  119441. // add HTTP headers to the request.
  119442. func (c *VpnGatewaysAggregatedListCall) Header() http.Header {
  119443. if c.header_ == nil {
  119444. c.header_ = make(http.Header)
  119445. }
  119446. return c.header_
  119447. }
  119448. func (c *VpnGatewaysAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  119449. reqHeaders := make(http.Header)
  119450. for k, v := range c.header_ {
  119451. reqHeaders[k] = v
  119452. }
  119453. reqHeaders.Set("User-Agent", c.s.userAgent())
  119454. if c.ifNoneMatch_ != "" {
  119455. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  119456. }
  119457. var body io.Reader = nil
  119458. c.urlParams_.Set("alt", alt)
  119459. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/vpnGateways")
  119460. urls += "?" + c.urlParams_.Encode()
  119461. req, _ := http.NewRequest("GET", urls, body)
  119462. req.Header = reqHeaders
  119463. googleapi.Expand(req.URL, map[string]string{
  119464. "project": c.project,
  119465. })
  119466. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  119467. }
  119468. // Do executes the "compute.vpnGateways.aggregatedList" call.
  119469. // Exactly one of *VpnGatewayAggregatedList or error will be non-nil.
  119470. // Any non-2xx status code is an error. Response headers are in either
  119471. // *VpnGatewayAggregatedList.ServerResponse.Header or (if a response was
  119472. // returned at all) in error.(*googleapi.Error).Header. Use
  119473. // googleapi.IsNotModified to check whether the returned error was
  119474. // because http.StatusNotModified was returned.
  119475. func (c *VpnGatewaysAggregatedListCall) Do(opts ...googleapi.CallOption) (*VpnGatewayAggregatedList, error) {
  119476. gensupport.SetOptions(c.urlParams_, opts...)
  119477. res, err := c.doRequest("json")
  119478. if res != nil && res.StatusCode == http.StatusNotModified {
  119479. if res.Body != nil {
  119480. res.Body.Close()
  119481. }
  119482. return nil, &googleapi.Error{
  119483. Code: res.StatusCode,
  119484. Header: res.Header,
  119485. }
  119486. }
  119487. if err != nil {
  119488. return nil, err
  119489. }
  119490. defer googleapi.CloseBody(res)
  119491. if err := googleapi.CheckResponse(res); err != nil {
  119492. return nil, err
  119493. }
  119494. ret := &VpnGatewayAggregatedList{
  119495. ServerResponse: googleapi.ServerResponse{
  119496. Header: res.Header,
  119497. HTTPStatusCode: res.StatusCode,
  119498. },
  119499. }
  119500. target := &ret
  119501. if err := gensupport.DecodeResponse(target, res); err != nil {
  119502. return nil, err
  119503. }
  119504. return ret, nil
  119505. // {
  119506. // "description": "Retrieves an aggregated list of VPN gateways.",
  119507. // "httpMethod": "GET",
  119508. // "id": "compute.vpnGateways.aggregatedList",
  119509. // "parameterOrder": [
  119510. // "project"
  119511. // ],
  119512. // "parameters": {
  119513. // "filter": {
  119514. // "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).",
  119515. // "location": "query",
  119516. // "type": "string"
  119517. // },
  119518. // "maxResults": {
  119519. // "default": "500",
  119520. // "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)",
  119521. // "format": "uint32",
  119522. // "location": "query",
  119523. // "minimum": "0",
  119524. // "type": "integer"
  119525. // },
  119526. // "orderBy": {
  119527. // "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.",
  119528. // "location": "query",
  119529. // "type": "string"
  119530. // },
  119531. // "pageToken": {
  119532. // "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.",
  119533. // "location": "query",
  119534. // "type": "string"
  119535. // },
  119536. // "project": {
  119537. // "description": "Project ID for this request.",
  119538. // "location": "path",
  119539. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  119540. // "required": true,
  119541. // "type": "string"
  119542. // }
  119543. // },
  119544. // "path": "{project}/aggregated/vpnGateways",
  119545. // "response": {
  119546. // "$ref": "VpnGatewayAggregatedList"
  119547. // },
  119548. // "scopes": [
  119549. // "https://www.googleapis.com/auth/cloud-platform",
  119550. // "https://www.googleapis.com/auth/compute",
  119551. // "https://www.googleapis.com/auth/compute.readonly"
  119552. // ]
  119553. // }
  119554. }
  119555. // Pages invokes f for each page of results.
  119556. // A non-nil error returned from f will halt the iteration.
  119557. // The provided context supersedes any context provided to the Context method.
  119558. func (c *VpnGatewaysAggregatedListCall) Pages(ctx context.Context, f func(*VpnGatewayAggregatedList) error) error {
  119559. c.ctx_ = ctx
  119560. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  119561. for {
  119562. x, err := c.Do()
  119563. if err != nil {
  119564. return err
  119565. }
  119566. if err := f(x); err != nil {
  119567. return err
  119568. }
  119569. if x.NextPageToken == "" {
  119570. return nil
  119571. }
  119572. c.PageToken(x.NextPageToken)
  119573. }
  119574. }
  119575. // method id "compute.vpnGateways.delete":
  119576. type VpnGatewaysDeleteCall struct {
  119577. s *Service
  119578. project string
  119579. region string
  119580. vpnGateway string
  119581. urlParams_ gensupport.URLParams
  119582. ctx_ context.Context
  119583. header_ http.Header
  119584. }
  119585. // Delete: Deletes the specified VPN gateway.
  119586. func (r *VpnGatewaysService) Delete(project string, region string, vpnGateway string) *VpnGatewaysDeleteCall {
  119587. c := &VpnGatewaysDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  119588. c.project = project
  119589. c.region = region
  119590. c.vpnGateway = vpnGateway
  119591. return c
  119592. }
  119593. // RequestId sets the optional parameter "requestId": An optional
  119594. // request ID to identify requests. Specify a unique request ID so that
  119595. // if you must retry your request, the server will know to ignore the
  119596. // request if it has already been completed.
  119597. //
  119598. // For example, consider a situation where you make an initial request
  119599. // and the request times out. If you make the request again with the
  119600. // same request ID, the server can check if original operation with the
  119601. // same request ID was received, and if so, will ignore the second
  119602. // request. This prevents clients from accidentally creating duplicate
  119603. // commitments.
  119604. //
  119605. // The request ID must be a valid UUID with the exception that zero UUID
  119606. // is not supported (00000000-0000-0000-0000-000000000000).
  119607. func (c *VpnGatewaysDeleteCall) RequestId(requestId string) *VpnGatewaysDeleteCall {
  119608. c.urlParams_.Set("requestId", requestId)
  119609. return c
  119610. }
  119611. // Fields allows partial responses to be retrieved. See
  119612. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  119613. // for more information.
  119614. func (c *VpnGatewaysDeleteCall) Fields(s ...googleapi.Field) *VpnGatewaysDeleteCall {
  119615. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  119616. return c
  119617. }
  119618. // Context sets the context to be used in this call's Do method. Any
  119619. // pending HTTP request will be aborted if the provided context is
  119620. // canceled.
  119621. func (c *VpnGatewaysDeleteCall) Context(ctx context.Context) *VpnGatewaysDeleteCall {
  119622. c.ctx_ = ctx
  119623. return c
  119624. }
  119625. // Header returns an http.Header that can be modified by the caller to
  119626. // add HTTP headers to the request.
  119627. func (c *VpnGatewaysDeleteCall) Header() http.Header {
  119628. if c.header_ == nil {
  119629. c.header_ = make(http.Header)
  119630. }
  119631. return c.header_
  119632. }
  119633. func (c *VpnGatewaysDeleteCall) doRequest(alt string) (*http.Response, error) {
  119634. reqHeaders := make(http.Header)
  119635. for k, v := range c.header_ {
  119636. reqHeaders[k] = v
  119637. }
  119638. reqHeaders.Set("User-Agent", c.s.userAgent())
  119639. var body io.Reader = nil
  119640. c.urlParams_.Set("alt", alt)
  119641. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnGateways/{vpnGateway}")
  119642. urls += "?" + c.urlParams_.Encode()
  119643. req, _ := http.NewRequest("DELETE", urls, body)
  119644. req.Header = reqHeaders
  119645. googleapi.Expand(req.URL, map[string]string{
  119646. "project": c.project,
  119647. "region": c.region,
  119648. "vpnGateway": c.vpnGateway,
  119649. })
  119650. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  119651. }
  119652. // Do executes the "compute.vpnGateways.delete" call.
  119653. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  119654. // status code is an error. Response headers are in either
  119655. // *Operation.ServerResponse.Header or (if a response was returned at
  119656. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  119657. // to check whether the returned error was because
  119658. // http.StatusNotModified was returned.
  119659. func (c *VpnGatewaysDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  119660. gensupport.SetOptions(c.urlParams_, opts...)
  119661. res, err := c.doRequest("json")
  119662. if res != nil && res.StatusCode == http.StatusNotModified {
  119663. if res.Body != nil {
  119664. res.Body.Close()
  119665. }
  119666. return nil, &googleapi.Error{
  119667. Code: res.StatusCode,
  119668. Header: res.Header,
  119669. }
  119670. }
  119671. if err != nil {
  119672. return nil, err
  119673. }
  119674. defer googleapi.CloseBody(res)
  119675. if err := googleapi.CheckResponse(res); err != nil {
  119676. return nil, err
  119677. }
  119678. ret := &Operation{
  119679. ServerResponse: googleapi.ServerResponse{
  119680. Header: res.Header,
  119681. HTTPStatusCode: res.StatusCode,
  119682. },
  119683. }
  119684. target := &ret
  119685. if err := gensupport.DecodeResponse(target, res); err != nil {
  119686. return nil, err
  119687. }
  119688. return ret, nil
  119689. // {
  119690. // "description": "Deletes the specified VPN gateway.",
  119691. // "httpMethod": "DELETE",
  119692. // "id": "compute.vpnGateways.delete",
  119693. // "parameterOrder": [
  119694. // "project",
  119695. // "region",
  119696. // "vpnGateway"
  119697. // ],
  119698. // "parameters": {
  119699. // "project": {
  119700. // "description": "Project ID for this request.",
  119701. // "location": "path",
  119702. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  119703. // "required": true,
  119704. // "type": "string"
  119705. // },
  119706. // "region": {
  119707. // "description": "Name of the region for this request.",
  119708. // "location": "path",
  119709. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  119710. // "required": true,
  119711. // "type": "string"
  119712. // },
  119713. // "requestId": {
  119714. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  119715. // "location": "query",
  119716. // "type": "string"
  119717. // },
  119718. // "vpnGateway": {
  119719. // "description": "Name of the VPN gateway to delete.",
  119720. // "location": "path",
  119721. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  119722. // "required": true,
  119723. // "type": "string"
  119724. // }
  119725. // },
  119726. // "path": "{project}/regions/{region}/vpnGateways/{vpnGateway}",
  119727. // "response": {
  119728. // "$ref": "Operation"
  119729. // },
  119730. // "scopes": [
  119731. // "https://www.googleapis.com/auth/cloud-platform",
  119732. // "https://www.googleapis.com/auth/compute"
  119733. // ]
  119734. // }
  119735. }
  119736. // method id "compute.vpnGateways.get":
  119737. type VpnGatewaysGetCall struct {
  119738. s *Service
  119739. project string
  119740. region string
  119741. vpnGateway string
  119742. urlParams_ gensupport.URLParams
  119743. ifNoneMatch_ string
  119744. ctx_ context.Context
  119745. header_ http.Header
  119746. }
  119747. // Get: Returns the specified VPN gateway. Gets a list of available VPN
  119748. // gateways by making a list() request.
  119749. func (r *VpnGatewaysService) Get(project string, region string, vpnGateway string) *VpnGatewaysGetCall {
  119750. c := &VpnGatewaysGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  119751. c.project = project
  119752. c.region = region
  119753. c.vpnGateway = vpnGateway
  119754. return c
  119755. }
  119756. // Fields allows partial responses to be retrieved. See
  119757. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  119758. // for more information.
  119759. func (c *VpnGatewaysGetCall) Fields(s ...googleapi.Field) *VpnGatewaysGetCall {
  119760. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  119761. return c
  119762. }
  119763. // IfNoneMatch sets the optional parameter which makes the operation
  119764. // fail if the object's ETag matches the given value. This is useful for
  119765. // getting updates only after the object has changed since the last
  119766. // request. Use googleapi.IsNotModified to check whether the response
  119767. // error from Do is the result of In-None-Match.
  119768. func (c *VpnGatewaysGetCall) IfNoneMatch(entityTag string) *VpnGatewaysGetCall {
  119769. c.ifNoneMatch_ = entityTag
  119770. return c
  119771. }
  119772. // Context sets the context to be used in this call's Do method. Any
  119773. // pending HTTP request will be aborted if the provided context is
  119774. // canceled.
  119775. func (c *VpnGatewaysGetCall) Context(ctx context.Context) *VpnGatewaysGetCall {
  119776. c.ctx_ = ctx
  119777. return c
  119778. }
  119779. // Header returns an http.Header that can be modified by the caller to
  119780. // add HTTP headers to the request.
  119781. func (c *VpnGatewaysGetCall) Header() http.Header {
  119782. if c.header_ == nil {
  119783. c.header_ = make(http.Header)
  119784. }
  119785. return c.header_
  119786. }
  119787. func (c *VpnGatewaysGetCall) doRequest(alt string) (*http.Response, error) {
  119788. reqHeaders := make(http.Header)
  119789. for k, v := range c.header_ {
  119790. reqHeaders[k] = v
  119791. }
  119792. reqHeaders.Set("User-Agent", c.s.userAgent())
  119793. if c.ifNoneMatch_ != "" {
  119794. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  119795. }
  119796. var body io.Reader = nil
  119797. c.urlParams_.Set("alt", alt)
  119798. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnGateways/{vpnGateway}")
  119799. urls += "?" + c.urlParams_.Encode()
  119800. req, _ := http.NewRequest("GET", urls, body)
  119801. req.Header = reqHeaders
  119802. googleapi.Expand(req.URL, map[string]string{
  119803. "project": c.project,
  119804. "region": c.region,
  119805. "vpnGateway": c.vpnGateway,
  119806. })
  119807. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  119808. }
  119809. // Do executes the "compute.vpnGateways.get" call.
  119810. // Exactly one of *VpnGateway or error will be non-nil. Any non-2xx
  119811. // status code is an error. Response headers are in either
  119812. // *VpnGateway.ServerResponse.Header or (if a response was returned at
  119813. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  119814. // to check whether the returned error was because
  119815. // http.StatusNotModified was returned.
  119816. func (c *VpnGatewaysGetCall) Do(opts ...googleapi.CallOption) (*VpnGateway, error) {
  119817. gensupport.SetOptions(c.urlParams_, opts...)
  119818. res, err := c.doRequest("json")
  119819. if res != nil && res.StatusCode == http.StatusNotModified {
  119820. if res.Body != nil {
  119821. res.Body.Close()
  119822. }
  119823. return nil, &googleapi.Error{
  119824. Code: res.StatusCode,
  119825. Header: res.Header,
  119826. }
  119827. }
  119828. if err != nil {
  119829. return nil, err
  119830. }
  119831. defer googleapi.CloseBody(res)
  119832. if err := googleapi.CheckResponse(res); err != nil {
  119833. return nil, err
  119834. }
  119835. ret := &VpnGateway{
  119836. ServerResponse: googleapi.ServerResponse{
  119837. Header: res.Header,
  119838. HTTPStatusCode: res.StatusCode,
  119839. },
  119840. }
  119841. target := &ret
  119842. if err := gensupport.DecodeResponse(target, res); err != nil {
  119843. return nil, err
  119844. }
  119845. return ret, nil
  119846. // {
  119847. // "description": "Returns the specified VPN gateway. Gets a list of available VPN gateways by making a list() request.",
  119848. // "httpMethod": "GET",
  119849. // "id": "compute.vpnGateways.get",
  119850. // "parameterOrder": [
  119851. // "project",
  119852. // "region",
  119853. // "vpnGateway"
  119854. // ],
  119855. // "parameters": {
  119856. // "project": {
  119857. // "description": "Project ID for this request.",
  119858. // "location": "path",
  119859. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  119860. // "required": true,
  119861. // "type": "string"
  119862. // },
  119863. // "region": {
  119864. // "description": "Name of the region for this request.",
  119865. // "location": "path",
  119866. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  119867. // "required": true,
  119868. // "type": "string"
  119869. // },
  119870. // "vpnGateway": {
  119871. // "description": "Name of the VPN gateway to return.",
  119872. // "location": "path",
  119873. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  119874. // "required": true,
  119875. // "type": "string"
  119876. // }
  119877. // },
  119878. // "path": "{project}/regions/{region}/vpnGateways/{vpnGateway}",
  119879. // "response": {
  119880. // "$ref": "VpnGateway"
  119881. // },
  119882. // "scopes": [
  119883. // "https://www.googleapis.com/auth/cloud-platform",
  119884. // "https://www.googleapis.com/auth/compute",
  119885. // "https://www.googleapis.com/auth/compute.readonly"
  119886. // ]
  119887. // }
  119888. }
  119889. // method id "compute.vpnGateways.insert":
  119890. type VpnGatewaysInsertCall struct {
  119891. s *Service
  119892. project string
  119893. region string
  119894. vpngateway *VpnGateway
  119895. urlParams_ gensupport.URLParams
  119896. ctx_ context.Context
  119897. header_ http.Header
  119898. }
  119899. // Insert: Creates a VPN gateway in the specified project and region
  119900. // using the data included in the request.
  119901. func (r *VpnGatewaysService) Insert(project string, region string, vpngateway *VpnGateway) *VpnGatewaysInsertCall {
  119902. c := &VpnGatewaysInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  119903. c.project = project
  119904. c.region = region
  119905. c.vpngateway = vpngateway
  119906. return c
  119907. }
  119908. // RequestId sets the optional parameter "requestId": An optional
  119909. // request ID to identify requests. Specify a unique request ID so that
  119910. // if you must retry your request, the server will know to ignore the
  119911. // request if it has already been completed.
  119912. //
  119913. // For example, consider a situation where you make an initial request
  119914. // and the request times out. If you make the request again with the
  119915. // same request ID, the server can check if original operation with the
  119916. // same request ID was received, and if so, will ignore the second
  119917. // request. This prevents clients from accidentally creating duplicate
  119918. // commitments.
  119919. //
  119920. // The request ID must be a valid UUID with the exception that zero UUID
  119921. // is not supported (00000000-0000-0000-0000-000000000000).
  119922. func (c *VpnGatewaysInsertCall) RequestId(requestId string) *VpnGatewaysInsertCall {
  119923. c.urlParams_.Set("requestId", requestId)
  119924. return c
  119925. }
  119926. // Fields allows partial responses to be retrieved. See
  119927. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  119928. // for more information.
  119929. func (c *VpnGatewaysInsertCall) Fields(s ...googleapi.Field) *VpnGatewaysInsertCall {
  119930. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  119931. return c
  119932. }
  119933. // Context sets the context to be used in this call's Do method. Any
  119934. // pending HTTP request will be aborted if the provided context is
  119935. // canceled.
  119936. func (c *VpnGatewaysInsertCall) Context(ctx context.Context) *VpnGatewaysInsertCall {
  119937. c.ctx_ = ctx
  119938. return c
  119939. }
  119940. // Header returns an http.Header that can be modified by the caller to
  119941. // add HTTP headers to the request.
  119942. func (c *VpnGatewaysInsertCall) Header() http.Header {
  119943. if c.header_ == nil {
  119944. c.header_ = make(http.Header)
  119945. }
  119946. return c.header_
  119947. }
  119948. func (c *VpnGatewaysInsertCall) doRequest(alt string) (*http.Response, error) {
  119949. reqHeaders := make(http.Header)
  119950. for k, v := range c.header_ {
  119951. reqHeaders[k] = v
  119952. }
  119953. reqHeaders.Set("User-Agent", c.s.userAgent())
  119954. var body io.Reader = nil
  119955. body, err := googleapi.WithoutDataWrapper.JSONReader(c.vpngateway)
  119956. if err != nil {
  119957. return nil, err
  119958. }
  119959. reqHeaders.Set("Content-Type", "application/json")
  119960. c.urlParams_.Set("alt", alt)
  119961. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnGateways")
  119962. urls += "?" + c.urlParams_.Encode()
  119963. req, _ := http.NewRequest("POST", urls, body)
  119964. req.Header = reqHeaders
  119965. googleapi.Expand(req.URL, map[string]string{
  119966. "project": c.project,
  119967. "region": c.region,
  119968. })
  119969. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  119970. }
  119971. // Do executes the "compute.vpnGateways.insert" call.
  119972. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  119973. // status code is an error. Response headers are in either
  119974. // *Operation.ServerResponse.Header or (if a response was returned at
  119975. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  119976. // to check whether the returned error was because
  119977. // http.StatusNotModified was returned.
  119978. func (c *VpnGatewaysInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  119979. gensupport.SetOptions(c.urlParams_, opts...)
  119980. res, err := c.doRequest("json")
  119981. if res != nil && res.StatusCode == http.StatusNotModified {
  119982. if res.Body != nil {
  119983. res.Body.Close()
  119984. }
  119985. return nil, &googleapi.Error{
  119986. Code: res.StatusCode,
  119987. Header: res.Header,
  119988. }
  119989. }
  119990. if err != nil {
  119991. return nil, err
  119992. }
  119993. defer googleapi.CloseBody(res)
  119994. if err := googleapi.CheckResponse(res); err != nil {
  119995. return nil, err
  119996. }
  119997. ret := &Operation{
  119998. ServerResponse: googleapi.ServerResponse{
  119999. Header: res.Header,
  120000. HTTPStatusCode: res.StatusCode,
  120001. },
  120002. }
  120003. target := &ret
  120004. if err := gensupport.DecodeResponse(target, res); err != nil {
  120005. return nil, err
  120006. }
  120007. return ret, nil
  120008. // {
  120009. // "description": "Creates a VPN gateway in the specified project and region using the data included in the request.",
  120010. // "httpMethod": "POST",
  120011. // "id": "compute.vpnGateways.insert",
  120012. // "parameterOrder": [
  120013. // "project",
  120014. // "region"
  120015. // ],
  120016. // "parameters": {
  120017. // "project": {
  120018. // "description": "Project ID for this request.",
  120019. // "location": "path",
  120020. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  120021. // "required": true,
  120022. // "type": "string"
  120023. // },
  120024. // "region": {
  120025. // "description": "Name of the region for this request.",
  120026. // "location": "path",
  120027. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  120028. // "required": true,
  120029. // "type": "string"
  120030. // },
  120031. // "requestId": {
  120032. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  120033. // "location": "query",
  120034. // "type": "string"
  120035. // }
  120036. // },
  120037. // "path": "{project}/regions/{region}/vpnGateways",
  120038. // "request": {
  120039. // "$ref": "VpnGateway"
  120040. // },
  120041. // "response": {
  120042. // "$ref": "Operation"
  120043. // },
  120044. // "scopes": [
  120045. // "https://www.googleapis.com/auth/cloud-platform",
  120046. // "https://www.googleapis.com/auth/compute"
  120047. // ]
  120048. // }
  120049. }
  120050. // method id "compute.vpnGateways.list":
  120051. type VpnGatewaysListCall struct {
  120052. s *Service
  120053. project string
  120054. region string
  120055. urlParams_ gensupport.URLParams
  120056. ifNoneMatch_ string
  120057. ctx_ context.Context
  120058. header_ http.Header
  120059. }
  120060. // List: Retrieves a list of VPN gateways available to the specified
  120061. // project and region.
  120062. func (r *VpnGatewaysService) List(project string, region string) *VpnGatewaysListCall {
  120063. c := &VpnGatewaysListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  120064. c.project = project
  120065. c.region = region
  120066. return c
  120067. }
  120068. // Filter sets the optional parameter "filter": A filter expression that
  120069. // filters resources listed in the response. The expression must specify
  120070. // the field name, a comparison operator, and the value that you want to
  120071. // use for filtering. The value must be a string, a number, or a
  120072. // boolean. The comparison operator must be either =, !=, >, or <.
  120073. //
  120074. // For example, if you are filtering Compute Engine instances, you can
  120075. // exclude instances named example-instance by specifying name !=
  120076. // example-instance.
  120077. //
  120078. // You can also filter nested fields. For example, you could specify
  120079. // scheduling.automaticRestart = false to include instances only if they
  120080. // are not scheduled for automatic restarts. You can use filtering on
  120081. // nested fields to filter based on resource labels.
  120082. //
  120083. // To filter on multiple expressions, provide each separate expression
  120084. // within parentheses. For example, (scheduling.automaticRestart = true)
  120085. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  120086. // AND expression. However, you can include AND and OR expressions
  120087. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  120088. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  120089. // true).
  120090. func (c *VpnGatewaysListCall) Filter(filter string) *VpnGatewaysListCall {
  120091. c.urlParams_.Set("filter", filter)
  120092. return c
  120093. }
  120094. // MaxResults sets the optional parameter "maxResults": The maximum
  120095. // number of results per page that should be returned. If the number of
  120096. // available results is larger than maxResults, Compute Engine returns a
  120097. // nextPageToken that can be used to get the next page of results in
  120098. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  120099. // (Default: 500)
  120100. func (c *VpnGatewaysListCall) MaxResults(maxResults int64) *VpnGatewaysListCall {
  120101. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  120102. return c
  120103. }
  120104. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  120105. // a certain order. By default, results are returned in alphanumerical
  120106. // order based on the resource name.
  120107. //
  120108. // You can also sort results in descending order based on the creation
  120109. // timestamp using orderBy="creationTimestamp desc". This sorts results
  120110. // based on the creationTimestamp field in reverse chronological order
  120111. // (newest result first). Use this to sort resources like operations so
  120112. // that the newest operation is returned first.
  120113. //
  120114. // Currently, only sorting by name or creationTimestamp desc is
  120115. // supported.
  120116. func (c *VpnGatewaysListCall) OrderBy(orderBy string) *VpnGatewaysListCall {
  120117. c.urlParams_.Set("orderBy", orderBy)
  120118. return c
  120119. }
  120120. // PageToken sets the optional parameter "pageToken": Specifies a page
  120121. // token to use. Set pageToken to the nextPageToken returned by a
  120122. // previous list request to get the next page of results.
  120123. func (c *VpnGatewaysListCall) PageToken(pageToken string) *VpnGatewaysListCall {
  120124. c.urlParams_.Set("pageToken", pageToken)
  120125. return c
  120126. }
  120127. // Fields allows partial responses to be retrieved. See
  120128. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  120129. // for more information.
  120130. func (c *VpnGatewaysListCall) Fields(s ...googleapi.Field) *VpnGatewaysListCall {
  120131. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  120132. return c
  120133. }
  120134. // IfNoneMatch sets the optional parameter which makes the operation
  120135. // fail if the object's ETag matches the given value. This is useful for
  120136. // getting updates only after the object has changed since the last
  120137. // request. Use googleapi.IsNotModified to check whether the response
  120138. // error from Do is the result of In-None-Match.
  120139. func (c *VpnGatewaysListCall) IfNoneMatch(entityTag string) *VpnGatewaysListCall {
  120140. c.ifNoneMatch_ = entityTag
  120141. return c
  120142. }
  120143. // Context sets the context to be used in this call's Do method. Any
  120144. // pending HTTP request will be aborted if the provided context is
  120145. // canceled.
  120146. func (c *VpnGatewaysListCall) Context(ctx context.Context) *VpnGatewaysListCall {
  120147. c.ctx_ = ctx
  120148. return c
  120149. }
  120150. // Header returns an http.Header that can be modified by the caller to
  120151. // add HTTP headers to the request.
  120152. func (c *VpnGatewaysListCall) Header() http.Header {
  120153. if c.header_ == nil {
  120154. c.header_ = make(http.Header)
  120155. }
  120156. return c.header_
  120157. }
  120158. func (c *VpnGatewaysListCall) doRequest(alt string) (*http.Response, error) {
  120159. reqHeaders := make(http.Header)
  120160. for k, v := range c.header_ {
  120161. reqHeaders[k] = v
  120162. }
  120163. reqHeaders.Set("User-Agent", c.s.userAgent())
  120164. if c.ifNoneMatch_ != "" {
  120165. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  120166. }
  120167. var body io.Reader = nil
  120168. c.urlParams_.Set("alt", alt)
  120169. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnGateways")
  120170. urls += "?" + c.urlParams_.Encode()
  120171. req, _ := http.NewRequest("GET", urls, body)
  120172. req.Header = reqHeaders
  120173. googleapi.Expand(req.URL, map[string]string{
  120174. "project": c.project,
  120175. "region": c.region,
  120176. })
  120177. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  120178. }
  120179. // Do executes the "compute.vpnGateways.list" call.
  120180. // Exactly one of *VpnGatewayList or error will be non-nil. Any non-2xx
  120181. // status code is an error. Response headers are in either
  120182. // *VpnGatewayList.ServerResponse.Header or (if a response was returned
  120183. // at all) in error.(*googleapi.Error).Header. Use
  120184. // googleapi.IsNotModified to check whether the returned error was
  120185. // because http.StatusNotModified was returned.
  120186. func (c *VpnGatewaysListCall) Do(opts ...googleapi.CallOption) (*VpnGatewayList, error) {
  120187. gensupport.SetOptions(c.urlParams_, opts...)
  120188. res, err := c.doRequest("json")
  120189. if res != nil && res.StatusCode == http.StatusNotModified {
  120190. if res.Body != nil {
  120191. res.Body.Close()
  120192. }
  120193. return nil, &googleapi.Error{
  120194. Code: res.StatusCode,
  120195. Header: res.Header,
  120196. }
  120197. }
  120198. if err != nil {
  120199. return nil, err
  120200. }
  120201. defer googleapi.CloseBody(res)
  120202. if err := googleapi.CheckResponse(res); err != nil {
  120203. return nil, err
  120204. }
  120205. ret := &VpnGatewayList{
  120206. ServerResponse: googleapi.ServerResponse{
  120207. Header: res.Header,
  120208. HTTPStatusCode: res.StatusCode,
  120209. },
  120210. }
  120211. target := &ret
  120212. if err := gensupport.DecodeResponse(target, res); err != nil {
  120213. return nil, err
  120214. }
  120215. return ret, nil
  120216. // {
  120217. // "description": "Retrieves a list of VPN gateways available to the specified project and region.",
  120218. // "httpMethod": "GET",
  120219. // "id": "compute.vpnGateways.list",
  120220. // "parameterOrder": [
  120221. // "project",
  120222. // "region"
  120223. // ],
  120224. // "parameters": {
  120225. // "filter": {
  120226. // "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).",
  120227. // "location": "query",
  120228. // "type": "string"
  120229. // },
  120230. // "maxResults": {
  120231. // "default": "500",
  120232. // "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)",
  120233. // "format": "uint32",
  120234. // "location": "query",
  120235. // "minimum": "0",
  120236. // "type": "integer"
  120237. // },
  120238. // "orderBy": {
  120239. // "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.",
  120240. // "location": "query",
  120241. // "type": "string"
  120242. // },
  120243. // "pageToken": {
  120244. // "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.",
  120245. // "location": "query",
  120246. // "type": "string"
  120247. // },
  120248. // "project": {
  120249. // "description": "Project ID for this request.",
  120250. // "location": "path",
  120251. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  120252. // "required": true,
  120253. // "type": "string"
  120254. // },
  120255. // "region": {
  120256. // "description": "Name of the region for this request.",
  120257. // "location": "path",
  120258. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  120259. // "required": true,
  120260. // "type": "string"
  120261. // }
  120262. // },
  120263. // "path": "{project}/regions/{region}/vpnGateways",
  120264. // "response": {
  120265. // "$ref": "VpnGatewayList"
  120266. // },
  120267. // "scopes": [
  120268. // "https://www.googleapis.com/auth/cloud-platform",
  120269. // "https://www.googleapis.com/auth/compute",
  120270. // "https://www.googleapis.com/auth/compute.readonly"
  120271. // ]
  120272. // }
  120273. }
  120274. // Pages invokes f for each page of results.
  120275. // A non-nil error returned from f will halt the iteration.
  120276. // The provided context supersedes any context provided to the Context method.
  120277. func (c *VpnGatewaysListCall) Pages(ctx context.Context, f func(*VpnGatewayList) error) error {
  120278. c.ctx_ = ctx
  120279. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  120280. for {
  120281. x, err := c.Do()
  120282. if err != nil {
  120283. return err
  120284. }
  120285. if err := f(x); err != nil {
  120286. return err
  120287. }
  120288. if x.NextPageToken == "" {
  120289. return nil
  120290. }
  120291. c.PageToken(x.NextPageToken)
  120292. }
  120293. }
  120294. // method id "compute.vpnGateways.setLabels":
  120295. type VpnGatewaysSetLabelsCall struct {
  120296. s *Service
  120297. project string
  120298. region string
  120299. resource string
  120300. regionsetlabelsrequest *RegionSetLabelsRequest
  120301. urlParams_ gensupport.URLParams
  120302. ctx_ context.Context
  120303. header_ http.Header
  120304. }
  120305. // SetLabels: Sets the labels on a VpnGateway. To learn more about
  120306. // labels, read the Labeling Resources documentation.
  120307. func (r *VpnGatewaysService) SetLabels(project string, region string, resource string, regionsetlabelsrequest *RegionSetLabelsRequest) *VpnGatewaysSetLabelsCall {
  120308. c := &VpnGatewaysSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  120309. c.project = project
  120310. c.region = region
  120311. c.resource = resource
  120312. c.regionsetlabelsrequest = regionsetlabelsrequest
  120313. return c
  120314. }
  120315. // RequestId sets the optional parameter "requestId": An optional
  120316. // request ID to identify requests. Specify a unique request ID so that
  120317. // if you must retry your request, the server will know to ignore the
  120318. // request if it has already been completed.
  120319. //
  120320. // For example, consider a situation where you make an initial request
  120321. // and the request times out. If you make the request again with the
  120322. // same request ID, the server can check if original operation with the
  120323. // same request ID was received, and if so, will ignore the second
  120324. // request. This prevents clients from accidentally creating duplicate
  120325. // commitments.
  120326. //
  120327. // The request ID must be a valid UUID with the exception that zero UUID
  120328. // is not supported (00000000-0000-0000-0000-000000000000).
  120329. func (c *VpnGatewaysSetLabelsCall) RequestId(requestId string) *VpnGatewaysSetLabelsCall {
  120330. c.urlParams_.Set("requestId", requestId)
  120331. return c
  120332. }
  120333. // Fields allows partial responses to be retrieved. See
  120334. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  120335. // for more information.
  120336. func (c *VpnGatewaysSetLabelsCall) Fields(s ...googleapi.Field) *VpnGatewaysSetLabelsCall {
  120337. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  120338. return c
  120339. }
  120340. // Context sets the context to be used in this call's Do method. Any
  120341. // pending HTTP request will be aborted if the provided context is
  120342. // canceled.
  120343. func (c *VpnGatewaysSetLabelsCall) Context(ctx context.Context) *VpnGatewaysSetLabelsCall {
  120344. c.ctx_ = ctx
  120345. return c
  120346. }
  120347. // Header returns an http.Header that can be modified by the caller to
  120348. // add HTTP headers to the request.
  120349. func (c *VpnGatewaysSetLabelsCall) Header() http.Header {
  120350. if c.header_ == nil {
  120351. c.header_ = make(http.Header)
  120352. }
  120353. return c.header_
  120354. }
  120355. func (c *VpnGatewaysSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  120356. reqHeaders := make(http.Header)
  120357. for k, v := range c.header_ {
  120358. reqHeaders[k] = v
  120359. }
  120360. reqHeaders.Set("User-Agent", c.s.userAgent())
  120361. var body io.Reader = nil
  120362. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest)
  120363. if err != nil {
  120364. return nil, err
  120365. }
  120366. reqHeaders.Set("Content-Type", "application/json")
  120367. c.urlParams_.Set("alt", alt)
  120368. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnGateways/{resource}/setLabels")
  120369. urls += "?" + c.urlParams_.Encode()
  120370. req, _ := http.NewRequest("POST", urls, body)
  120371. req.Header = reqHeaders
  120372. googleapi.Expand(req.URL, map[string]string{
  120373. "project": c.project,
  120374. "region": c.region,
  120375. "resource": c.resource,
  120376. })
  120377. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  120378. }
  120379. // Do executes the "compute.vpnGateways.setLabels" call.
  120380. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  120381. // status code is an error. Response headers are in either
  120382. // *Operation.ServerResponse.Header or (if a response was returned at
  120383. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  120384. // to check whether the returned error was because
  120385. // http.StatusNotModified was returned.
  120386. func (c *VpnGatewaysSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  120387. gensupport.SetOptions(c.urlParams_, opts...)
  120388. res, err := c.doRequest("json")
  120389. if res != nil && res.StatusCode == http.StatusNotModified {
  120390. if res.Body != nil {
  120391. res.Body.Close()
  120392. }
  120393. return nil, &googleapi.Error{
  120394. Code: res.StatusCode,
  120395. Header: res.Header,
  120396. }
  120397. }
  120398. if err != nil {
  120399. return nil, err
  120400. }
  120401. defer googleapi.CloseBody(res)
  120402. if err := googleapi.CheckResponse(res); err != nil {
  120403. return nil, err
  120404. }
  120405. ret := &Operation{
  120406. ServerResponse: googleapi.ServerResponse{
  120407. Header: res.Header,
  120408. HTTPStatusCode: res.StatusCode,
  120409. },
  120410. }
  120411. target := &ret
  120412. if err := gensupport.DecodeResponse(target, res); err != nil {
  120413. return nil, err
  120414. }
  120415. return ret, nil
  120416. // {
  120417. // "description": "Sets the labels on a VpnGateway. To learn more about labels, read the Labeling Resources documentation.",
  120418. // "httpMethod": "POST",
  120419. // "id": "compute.vpnGateways.setLabels",
  120420. // "parameterOrder": [
  120421. // "project",
  120422. // "region",
  120423. // "resource"
  120424. // ],
  120425. // "parameters": {
  120426. // "project": {
  120427. // "description": "Project ID for this request.",
  120428. // "location": "path",
  120429. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  120430. // "required": true,
  120431. // "type": "string"
  120432. // },
  120433. // "region": {
  120434. // "description": "The region for this request.",
  120435. // "location": "path",
  120436. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  120437. // "required": true,
  120438. // "type": "string"
  120439. // },
  120440. // "requestId": {
  120441. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  120442. // "location": "query",
  120443. // "type": "string"
  120444. // },
  120445. // "resource": {
  120446. // "description": "Name of the resource for this request.",
  120447. // "location": "path",
  120448. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  120449. // "required": true,
  120450. // "type": "string"
  120451. // }
  120452. // },
  120453. // "path": "{project}/regions/{region}/vpnGateways/{resource}/setLabels",
  120454. // "request": {
  120455. // "$ref": "RegionSetLabelsRequest"
  120456. // },
  120457. // "response": {
  120458. // "$ref": "Operation"
  120459. // },
  120460. // "scopes": [
  120461. // "https://www.googleapis.com/auth/cloud-platform",
  120462. // "https://www.googleapis.com/auth/compute"
  120463. // ]
  120464. // }
  120465. }
  120466. // method id "compute.vpnGateways.testIamPermissions":
  120467. type VpnGatewaysTestIamPermissionsCall struct {
  120468. s *Service
  120469. project string
  120470. region string
  120471. resource string
  120472. testpermissionsrequest *TestPermissionsRequest
  120473. urlParams_ gensupport.URLParams
  120474. ctx_ context.Context
  120475. header_ http.Header
  120476. }
  120477. // TestIamPermissions: Returns permissions that a caller has on the
  120478. // specified resource.
  120479. func (r *VpnGatewaysService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *VpnGatewaysTestIamPermissionsCall {
  120480. c := &VpnGatewaysTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  120481. c.project = project
  120482. c.region = region
  120483. c.resource = resource
  120484. c.testpermissionsrequest = testpermissionsrequest
  120485. return c
  120486. }
  120487. // Fields allows partial responses to be retrieved. See
  120488. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  120489. // for more information.
  120490. func (c *VpnGatewaysTestIamPermissionsCall) Fields(s ...googleapi.Field) *VpnGatewaysTestIamPermissionsCall {
  120491. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  120492. return c
  120493. }
  120494. // Context sets the context to be used in this call's Do method. Any
  120495. // pending HTTP request will be aborted if the provided context is
  120496. // canceled.
  120497. func (c *VpnGatewaysTestIamPermissionsCall) Context(ctx context.Context) *VpnGatewaysTestIamPermissionsCall {
  120498. c.ctx_ = ctx
  120499. return c
  120500. }
  120501. // Header returns an http.Header that can be modified by the caller to
  120502. // add HTTP headers to the request.
  120503. func (c *VpnGatewaysTestIamPermissionsCall) Header() http.Header {
  120504. if c.header_ == nil {
  120505. c.header_ = make(http.Header)
  120506. }
  120507. return c.header_
  120508. }
  120509. func (c *VpnGatewaysTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  120510. reqHeaders := make(http.Header)
  120511. for k, v := range c.header_ {
  120512. reqHeaders[k] = v
  120513. }
  120514. reqHeaders.Set("User-Agent", c.s.userAgent())
  120515. var body io.Reader = nil
  120516. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  120517. if err != nil {
  120518. return nil, err
  120519. }
  120520. reqHeaders.Set("Content-Type", "application/json")
  120521. c.urlParams_.Set("alt", alt)
  120522. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnGateways/{resource}/testIamPermissions")
  120523. urls += "?" + c.urlParams_.Encode()
  120524. req, _ := http.NewRequest("POST", urls, body)
  120525. req.Header = reqHeaders
  120526. googleapi.Expand(req.URL, map[string]string{
  120527. "project": c.project,
  120528. "region": c.region,
  120529. "resource": c.resource,
  120530. })
  120531. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  120532. }
  120533. // Do executes the "compute.vpnGateways.testIamPermissions" call.
  120534. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  120535. // non-2xx status code is an error. Response headers are in either
  120536. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  120537. // returned at all) in error.(*googleapi.Error).Header. Use
  120538. // googleapi.IsNotModified to check whether the returned error was
  120539. // because http.StatusNotModified was returned.
  120540. func (c *VpnGatewaysTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  120541. gensupport.SetOptions(c.urlParams_, opts...)
  120542. res, err := c.doRequest("json")
  120543. if res != nil && res.StatusCode == http.StatusNotModified {
  120544. if res.Body != nil {
  120545. res.Body.Close()
  120546. }
  120547. return nil, &googleapi.Error{
  120548. Code: res.StatusCode,
  120549. Header: res.Header,
  120550. }
  120551. }
  120552. if err != nil {
  120553. return nil, err
  120554. }
  120555. defer googleapi.CloseBody(res)
  120556. if err := googleapi.CheckResponse(res); err != nil {
  120557. return nil, err
  120558. }
  120559. ret := &TestPermissionsResponse{
  120560. ServerResponse: googleapi.ServerResponse{
  120561. Header: res.Header,
  120562. HTTPStatusCode: res.StatusCode,
  120563. },
  120564. }
  120565. target := &ret
  120566. if err := gensupport.DecodeResponse(target, res); err != nil {
  120567. return nil, err
  120568. }
  120569. return ret, nil
  120570. // {
  120571. // "description": "Returns permissions that a caller has on the specified resource.",
  120572. // "httpMethod": "POST",
  120573. // "id": "compute.vpnGateways.testIamPermissions",
  120574. // "parameterOrder": [
  120575. // "project",
  120576. // "region",
  120577. // "resource"
  120578. // ],
  120579. // "parameters": {
  120580. // "project": {
  120581. // "description": "Project ID for this request.",
  120582. // "location": "path",
  120583. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  120584. // "required": true,
  120585. // "type": "string"
  120586. // },
  120587. // "region": {
  120588. // "description": "The name of the region for this request.",
  120589. // "location": "path",
  120590. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  120591. // "required": true,
  120592. // "type": "string"
  120593. // },
  120594. // "resource": {
  120595. // "description": "Name of the resource for this request.",
  120596. // "location": "path",
  120597. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  120598. // "required": true,
  120599. // "type": "string"
  120600. // }
  120601. // },
  120602. // "path": "{project}/regions/{region}/vpnGateways/{resource}/testIamPermissions",
  120603. // "request": {
  120604. // "$ref": "TestPermissionsRequest"
  120605. // },
  120606. // "response": {
  120607. // "$ref": "TestPermissionsResponse"
  120608. // },
  120609. // "scopes": [
  120610. // "https://www.googleapis.com/auth/cloud-platform",
  120611. // "https://www.googleapis.com/auth/compute",
  120612. // "https://www.googleapis.com/auth/compute.readonly"
  120613. // ]
  120614. // }
  120615. }
  120616. // method id "compute.vpnTunnels.aggregatedList":
  120617. type VpnTunnelsAggregatedListCall struct {
  120618. s *Service
  120619. project string
  120620. urlParams_ gensupport.URLParams
  120621. ifNoneMatch_ string
  120622. ctx_ context.Context
  120623. header_ http.Header
  120624. }
  120625. // AggregatedList: Retrieves an aggregated list of VPN tunnels.
  120626. func (r *VpnTunnelsService) AggregatedList(project string) *VpnTunnelsAggregatedListCall {
  120627. c := &VpnTunnelsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  120628. c.project = project
  120629. return c
  120630. }
  120631. // Filter sets the optional parameter "filter": A filter expression that
  120632. // filters resources listed in the response. The expression must specify
  120633. // the field name, a comparison operator, and the value that you want to
  120634. // use for filtering. The value must be a string, a number, or a
  120635. // boolean. The comparison operator must be either =, !=, >, or <.
  120636. //
  120637. // For example, if you are filtering Compute Engine instances, you can
  120638. // exclude instances named example-instance by specifying name !=
  120639. // example-instance.
  120640. //
  120641. // You can also filter nested fields. For example, you could specify
  120642. // scheduling.automaticRestart = false to include instances only if they
  120643. // are not scheduled for automatic restarts. You can use filtering on
  120644. // nested fields to filter based on resource labels.
  120645. //
  120646. // To filter on multiple expressions, provide each separate expression
  120647. // within parentheses. For example, (scheduling.automaticRestart = true)
  120648. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  120649. // AND expression. However, you can include AND and OR expressions
  120650. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  120651. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  120652. // true).
  120653. func (c *VpnTunnelsAggregatedListCall) Filter(filter string) *VpnTunnelsAggregatedListCall {
  120654. c.urlParams_.Set("filter", filter)
  120655. return c
  120656. }
  120657. // MaxResults sets the optional parameter "maxResults": The maximum
  120658. // number of results per page that should be returned. If the number of
  120659. // available results is larger than maxResults, Compute Engine returns a
  120660. // nextPageToken that can be used to get the next page of results in
  120661. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  120662. // (Default: 500)
  120663. func (c *VpnTunnelsAggregatedListCall) MaxResults(maxResults int64) *VpnTunnelsAggregatedListCall {
  120664. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  120665. return c
  120666. }
  120667. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  120668. // a certain order. By default, results are returned in alphanumerical
  120669. // order based on the resource name.
  120670. //
  120671. // You can also sort results in descending order based on the creation
  120672. // timestamp using orderBy="creationTimestamp desc". This sorts results
  120673. // based on the creationTimestamp field in reverse chronological order
  120674. // (newest result first). Use this to sort resources like operations so
  120675. // that the newest operation is returned first.
  120676. //
  120677. // Currently, only sorting by name or creationTimestamp desc is
  120678. // supported.
  120679. func (c *VpnTunnelsAggregatedListCall) OrderBy(orderBy string) *VpnTunnelsAggregatedListCall {
  120680. c.urlParams_.Set("orderBy", orderBy)
  120681. return c
  120682. }
  120683. // PageToken sets the optional parameter "pageToken": Specifies a page
  120684. // token to use. Set pageToken to the nextPageToken returned by a
  120685. // previous list request to get the next page of results.
  120686. func (c *VpnTunnelsAggregatedListCall) PageToken(pageToken string) *VpnTunnelsAggregatedListCall {
  120687. c.urlParams_.Set("pageToken", pageToken)
  120688. return c
  120689. }
  120690. // Fields allows partial responses to be retrieved. See
  120691. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  120692. // for more information.
  120693. func (c *VpnTunnelsAggregatedListCall) Fields(s ...googleapi.Field) *VpnTunnelsAggregatedListCall {
  120694. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  120695. return c
  120696. }
  120697. // IfNoneMatch sets the optional parameter which makes the operation
  120698. // fail if the object's ETag matches the given value. This is useful for
  120699. // getting updates only after the object has changed since the last
  120700. // request. Use googleapi.IsNotModified to check whether the response
  120701. // error from Do is the result of In-None-Match.
  120702. func (c *VpnTunnelsAggregatedListCall) IfNoneMatch(entityTag string) *VpnTunnelsAggregatedListCall {
  120703. c.ifNoneMatch_ = entityTag
  120704. return c
  120705. }
  120706. // Context sets the context to be used in this call's Do method. Any
  120707. // pending HTTP request will be aborted if the provided context is
  120708. // canceled.
  120709. func (c *VpnTunnelsAggregatedListCall) Context(ctx context.Context) *VpnTunnelsAggregatedListCall {
  120710. c.ctx_ = ctx
  120711. return c
  120712. }
  120713. // Header returns an http.Header that can be modified by the caller to
  120714. // add HTTP headers to the request.
  120715. func (c *VpnTunnelsAggregatedListCall) Header() http.Header {
  120716. if c.header_ == nil {
  120717. c.header_ = make(http.Header)
  120718. }
  120719. return c.header_
  120720. }
  120721. func (c *VpnTunnelsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  120722. reqHeaders := make(http.Header)
  120723. for k, v := range c.header_ {
  120724. reqHeaders[k] = v
  120725. }
  120726. reqHeaders.Set("User-Agent", c.s.userAgent())
  120727. if c.ifNoneMatch_ != "" {
  120728. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  120729. }
  120730. var body io.Reader = nil
  120731. c.urlParams_.Set("alt", alt)
  120732. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/vpnTunnels")
  120733. urls += "?" + c.urlParams_.Encode()
  120734. req, _ := http.NewRequest("GET", urls, body)
  120735. req.Header = reqHeaders
  120736. googleapi.Expand(req.URL, map[string]string{
  120737. "project": c.project,
  120738. })
  120739. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  120740. }
  120741. // Do executes the "compute.vpnTunnels.aggregatedList" call.
  120742. // Exactly one of *VpnTunnelAggregatedList or error will be non-nil. Any
  120743. // non-2xx status code is an error. Response headers are in either
  120744. // *VpnTunnelAggregatedList.ServerResponse.Header or (if a response was
  120745. // returned at all) in error.(*googleapi.Error).Header. Use
  120746. // googleapi.IsNotModified to check whether the returned error was
  120747. // because http.StatusNotModified was returned.
  120748. func (c *VpnTunnelsAggregatedListCall) Do(opts ...googleapi.CallOption) (*VpnTunnelAggregatedList, error) {
  120749. gensupport.SetOptions(c.urlParams_, opts...)
  120750. res, err := c.doRequest("json")
  120751. if res != nil && res.StatusCode == http.StatusNotModified {
  120752. if res.Body != nil {
  120753. res.Body.Close()
  120754. }
  120755. return nil, &googleapi.Error{
  120756. Code: res.StatusCode,
  120757. Header: res.Header,
  120758. }
  120759. }
  120760. if err != nil {
  120761. return nil, err
  120762. }
  120763. defer googleapi.CloseBody(res)
  120764. if err := googleapi.CheckResponse(res); err != nil {
  120765. return nil, err
  120766. }
  120767. ret := &VpnTunnelAggregatedList{
  120768. ServerResponse: googleapi.ServerResponse{
  120769. Header: res.Header,
  120770. HTTPStatusCode: res.StatusCode,
  120771. },
  120772. }
  120773. target := &ret
  120774. if err := gensupport.DecodeResponse(target, res); err != nil {
  120775. return nil, err
  120776. }
  120777. return ret, nil
  120778. // {
  120779. // "description": "Retrieves an aggregated list of VPN tunnels.",
  120780. // "httpMethod": "GET",
  120781. // "id": "compute.vpnTunnels.aggregatedList",
  120782. // "parameterOrder": [
  120783. // "project"
  120784. // ],
  120785. // "parameters": {
  120786. // "filter": {
  120787. // "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).",
  120788. // "location": "query",
  120789. // "type": "string"
  120790. // },
  120791. // "maxResults": {
  120792. // "default": "500",
  120793. // "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)",
  120794. // "format": "uint32",
  120795. // "location": "query",
  120796. // "minimum": "0",
  120797. // "type": "integer"
  120798. // },
  120799. // "orderBy": {
  120800. // "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.",
  120801. // "location": "query",
  120802. // "type": "string"
  120803. // },
  120804. // "pageToken": {
  120805. // "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.",
  120806. // "location": "query",
  120807. // "type": "string"
  120808. // },
  120809. // "project": {
  120810. // "description": "Project ID for this request.",
  120811. // "location": "path",
  120812. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  120813. // "required": true,
  120814. // "type": "string"
  120815. // }
  120816. // },
  120817. // "path": "{project}/aggregated/vpnTunnels",
  120818. // "response": {
  120819. // "$ref": "VpnTunnelAggregatedList"
  120820. // },
  120821. // "scopes": [
  120822. // "https://www.googleapis.com/auth/cloud-platform",
  120823. // "https://www.googleapis.com/auth/compute",
  120824. // "https://www.googleapis.com/auth/compute.readonly"
  120825. // ]
  120826. // }
  120827. }
  120828. // Pages invokes f for each page of results.
  120829. // A non-nil error returned from f will halt the iteration.
  120830. // The provided context supersedes any context provided to the Context method.
  120831. func (c *VpnTunnelsAggregatedListCall) Pages(ctx context.Context, f func(*VpnTunnelAggregatedList) error) error {
  120832. c.ctx_ = ctx
  120833. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  120834. for {
  120835. x, err := c.Do()
  120836. if err != nil {
  120837. return err
  120838. }
  120839. if err := f(x); err != nil {
  120840. return err
  120841. }
  120842. if x.NextPageToken == "" {
  120843. return nil
  120844. }
  120845. c.PageToken(x.NextPageToken)
  120846. }
  120847. }
  120848. // method id "compute.vpnTunnels.delete":
  120849. type VpnTunnelsDeleteCall struct {
  120850. s *Service
  120851. project string
  120852. region string
  120853. vpnTunnel string
  120854. urlParams_ gensupport.URLParams
  120855. ctx_ context.Context
  120856. header_ http.Header
  120857. }
  120858. // Delete: Deletes the specified VpnTunnel resource.
  120859. func (r *VpnTunnelsService) Delete(project string, region string, vpnTunnel string) *VpnTunnelsDeleteCall {
  120860. c := &VpnTunnelsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  120861. c.project = project
  120862. c.region = region
  120863. c.vpnTunnel = vpnTunnel
  120864. return c
  120865. }
  120866. // RequestId sets the optional parameter "requestId": An optional
  120867. // request ID to identify requests. Specify a unique request ID so that
  120868. // if you must retry your request, the server will know to ignore the
  120869. // request if it has already been completed.
  120870. //
  120871. // For example, consider a situation where you make an initial request
  120872. // and the request times out. If you make the request again with the
  120873. // same request ID, the server can check if original operation with the
  120874. // same request ID was received, and if so, will ignore the second
  120875. // request. This prevents clients from accidentally creating duplicate
  120876. // commitments.
  120877. //
  120878. // The request ID must be a valid UUID with the exception that zero UUID
  120879. // is not supported (00000000-0000-0000-0000-000000000000).
  120880. func (c *VpnTunnelsDeleteCall) RequestId(requestId string) *VpnTunnelsDeleteCall {
  120881. c.urlParams_.Set("requestId", requestId)
  120882. return c
  120883. }
  120884. // Fields allows partial responses to be retrieved. See
  120885. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  120886. // for more information.
  120887. func (c *VpnTunnelsDeleteCall) Fields(s ...googleapi.Field) *VpnTunnelsDeleteCall {
  120888. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  120889. return c
  120890. }
  120891. // Context sets the context to be used in this call's Do method. Any
  120892. // pending HTTP request will be aborted if the provided context is
  120893. // canceled.
  120894. func (c *VpnTunnelsDeleteCall) Context(ctx context.Context) *VpnTunnelsDeleteCall {
  120895. c.ctx_ = ctx
  120896. return c
  120897. }
  120898. // Header returns an http.Header that can be modified by the caller to
  120899. // add HTTP headers to the request.
  120900. func (c *VpnTunnelsDeleteCall) Header() http.Header {
  120901. if c.header_ == nil {
  120902. c.header_ = make(http.Header)
  120903. }
  120904. return c.header_
  120905. }
  120906. func (c *VpnTunnelsDeleteCall) doRequest(alt string) (*http.Response, error) {
  120907. reqHeaders := make(http.Header)
  120908. for k, v := range c.header_ {
  120909. reqHeaders[k] = v
  120910. }
  120911. reqHeaders.Set("User-Agent", c.s.userAgent())
  120912. var body io.Reader = nil
  120913. c.urlParams_.Set("alt", alt)
  120914. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels/{vpnTunnel}")
  120915. urls += "?" + c.urlParams_.Encode()
  120916. req, _ := http.NewRequest("DELETE", urls, body)
  120917. req.Header = reqHeaders
  120918. googleapi.Expand(req.URL, map[string]string{
  120919. "project": c.project,
  120920. "region": c.region,
  120921. "vpnTunnel": c.vpnTunnel,
  120922. })
  120923. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  120924. }
  120925. // Do executes the "compute.vpnTunnels.delete" call.
  120926. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  120927. // status code is an error. Response headers are in either
  120928. // *Operation.ServerResponse.Header or (if a response was returned at
  120929. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  120930. // to check whether the returned error was because
  120931. // http.StatusNotModified was returned.
  120932. func (c *VpnTunnelsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  120933. gensupport.SetOptions(c.urlParams_, opts...)
  120934. res, err := c.doRequest("json")
  120935. if res != nil && res.StatusCode == http.StatusNotModified {
  120936. if res.Body != nil {
  120937. res.Body.Close()
  120938. }
  120939. return nil, &googleapi.Error{
  120940. Code: res.StatusCode,
  120941. Header: res.Header,
  120942. }
  120943. }
  120944. if err != nil {
  120945. return nil, err
  120946. }
  120947. defer googleapi.CloseBody(res)
  120948. if err := googleapi.CheckResponse(res); err != nil {
  120949. return nil, err
  120950. }
  120951. ret := &Operation{
  120952. ServerResponse: googleapi.ServerResponse{
  120953. Header: res.Header,
  120954. HTTPStatusCode: res.StatusCode,
  120955. },
  120956. }
  120957. target := &ret
  120958. if err := gensupport.DecodeResponse(target, res); err != nil {
  120959. return nil, err
  120960. }
  120961. return ret, nil
  120962. // {
  120963. // "description": "Deletes the specified VpnTunnel resource.",
  120964. // "httpMethod": "DELETE",
  120965. // "id": "compute.vpnTunnels.delete",
  120966. // "parameterOrder": [
  120967. // "project",
  120968. // "region",
  120969. // "vpnTunnel"
  120970. // ],
  120971. // "parameters": {
  120972. // "project": {
  120973. // "description": "Project ID for this request.",
  120974. // "location": "path",
  120975. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  120976. // "required": true,
  120977. // "type": "string"
  120978. // },
  120979. // "region": {
  120980. // "description": "Name of the region for this request.",
  120981. // "location": "path",
  120982. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  120983. // "required": true,
  120984. // "type": "string"
  120985. // },
  120986. // "requestId": {
  120987. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  120988. // "location": "query",
  120989. // "type": "string"
  120990. // },
  120991. // "vpnTunnel": {
  120992. // "description": "Name of the VpnTunnel resource to delete.",
  120993. // "location": "path",
  120994. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  120995. // "required": true,
  120996. // "type": "string"
  120997. // }
  120998. // },
  120999. // "path": "{project}/regions/{region}/vpnTunnels/{vpnTunnel}",
  121000. // "response": {
  121001. // "$ref": "Operation"
  121002. // },
  121003. // "scopes": [
  121004. // "https://www.googleapis.com/auth/cloud-platform",
  121005. // "https://www.googleapis.com/auth/compute"
  121006. // ]
  121007. // }
  121008. }
  121009. // method id "compute.vpnTunnels.get":
  121010. type VpnTunnelsGetCall struct {
  121011. s *Service
  121012. project string
  121013. region string
  121014. vpnTunnel string
  121015. urlParams_ gensupport.URLParams
  121016. ifNoneMatch_ string
  121017. ctx_ context.Context
  121018. header_ http.Header
  121019. }
  121020. // Get: Returns the specified VpnTunnel resource. Gets a list of
  121021. // available VPN tunnels by making a list() request.
  121022. func (r *VpnTunnelsService) Get(project string, region string, vpnTunnel string) *VpnTunnelsGetCall {
  121023. c := &VpnTunnelsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  121024. c.project = project
  121025. c.region = region
  121026. c.vpnTunnel = vpnTunnel
  121027. return c
  121028. }
  121029. // Fields allows partial responses to be retrieved. See
  121030. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  121031. // for more information.
  121032. func (c *VpnTunnelsGetCall) Fields(s ...googleapi.Field) *VpnTunnelsGetCall {
  121033. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  121034. return c
  121035. }
  121036. // IfNoneMatch sets the optional parameter which makes the operation
  121037. // fail if the object's ETag matches the given value. This is useful for
  121038. // getting updates only after the object has changed since the last
  121039. // request. Use googleapi.IsNotModified to check whether the response
  121040. // error from Do is the result of In-None-Match.
  121041. func (c *VpnTunnelsGetCall) IfNoneMatch(entityTag string) *VpnTunnelsGetCall {
  121042. c.ifNoneMatch_ = entityTag
  121043. return c
  121044. }
  121045. // Context sets the context to be used in this call's Do method. Any
  121046. // pending HTTP request will be aborted if the provided context is
  121047. // canceled.
  121048. func (c *VpnTunnelsGetCall) Context(ctx context.Context) *VpnTunnelsGetCall {
  121049. c.ctx_ = ctx
  121050. return c
  121051. }
  121052. // Header returns an http.Header that can be modified by the caller to
  121053. // add HTTP headers to the request.
  121054. func (c *VpnTunnelsGetCall) Header() http.Header {
  121055. if c.header_ == nil {
  121056. c.header_ = make(http.Header)
  121057. }
  121058. return c.header_
  121059. }
  121060. func (c *VpnTunnelsGetCall) doRequest(alt string) (*http.Response, error) {
  121061. reqHeaders := make(http.Header)
  121062. for k, v := range c.header_ {
  121063. reqHeaders[k] = v
  121064. }
  121065. reqHeaders.Set("User-Agent", c.s.userAgent())
  121066. if c.ifNoneMatch_ != "" {
  121067. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  121068. }
  121069. var body io.Reader = nil
  121070. c.urlParams_.Set("alt", alt)
  121071. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels/{vpnTunnel}")
  121072. urls += "?" + c.urlParams_.Encode()
  121073. req, _ := http.NewRequest("GET", urls, body)
  121074. req.Header = reqHeaders
  121075. googleapi.Expand(req.URL, map[string]string{
  121076. "project": c.project,
  121077. "region": c.region,
  121078. "vpnTunnel": c.vpnTunnel,
  121079. })
  121080. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  121081. }
  121082. // Do executes the "compute.vpnTunnels.get" call.
  121083. // Exactly one of *VpnTunnel or error will be non-nil. Any non-2xx
  121084. // status code is an error. Response headers are in either
  121085. // *VpnTunnel.ServerResponse.Header or (if a response was returned at
  121086. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  121087. // to check whether the returned error was because
  121088. // http.StatusNotModified was returned.
  121089. func (c *VpnTunnelsGetCall) Do(opts ...googleapi.CallOption) (*VpnTunnel, error) {
  121090. gensupport.SetOptions(c.urlParams_, opts...)
  121091. res, err := c.doRequest("json")
  121092. if res != nil && res.StatusCode == http.StatusNotModified {
  121093. if res.Body != nil {
  121094. res.Body.Close()
  121095. }
  121096. return nil, &googleapi.Error{
  121097. Code: res.StatusCode,
  121098. Header: res.Header,
  121099. }
  121100. }
  121101. if err != nil {
  121102. return nil, err
  121103. }
  121104. defer googleapi.CloseBody(res)
  121105. if err := googleapi.CheckResponse(res); err != nil {
  121106. return nil, err
  121107. }
  121108. ret := &VpnTunnel{
  121109. ServerResponse: googleapi.ServerResponse{
  121110. Header: res.Header,
  121111. HTTPStatusCode: res.StatusCode,
  121112. },
  121113. }
  121114. target := &ret
  121115. if err := gensupport.DecodeResponse(target, res); err != nil {
  121116. return nil, err
  121117. }
  121118. return ret, nil
  121119. // {
  121120. // "description": "Returns the specified VpnTunnel resource. Gets a list of available VPN tunnels by making a list() request.",
  121121. // "httpMethod": "GET",
  121122. // "id": "compute.vpnTunnels.get",
  121123. // "parameterOrder": [
  121124. // "project",
  121125. // "region",
  121126. // "vpnTunnel"
  121127. // ],
  121128. // "parameters": {
  121129. // "project": {
  121130. // "description": "Project ID for this request.",
  121131. // "location": "path",
  121132. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  121133. // "required": true,
  121134. // "type": "string"
  121135. // },
  121136. // "region": {
  121137. // "description": "Name of the region for this request.",
  121138. // "location": "path",
  121139. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  121140. // "required": true,
  121141. // "type": "string"
  121142. // },
  121143. // "vpnTunnel": {
  121144. // "description": "Name of the VpnTunnel resource to return.",
  121145. // "location": "path",
  121146. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  121147. // "required": true,
  121148. // "type": "string"
  121149. // }
  121150. // },
  121151. // "path": "{project}/regions/{region}/vpnTunnels/{vpnTunnel}",
  121152. // "response": {
  121153. // "$ref": "VpnTunnel"
  121154. // },
  121155. // "scopes": [
  121156. // "https://www.googleapis.com/auth/cloud-platform",
  121157. // "https://www.googleapis.com/auth/compute",
  121158. // "https://www.googleapis.com/auth/compute.readonly"
  121159. // ]
  121160. // }
  121161. }
  121162. // method id "compute.vpnTunnels.insert":
  121163. type VpnTunnelsInsertCall struct {
  121164. s *Service
  121165. project string
  121166. region string
  121167. vpntunnel *VpnTunnel
  121168. urlParams_ gensupport.URLParams
  121169. ctx_ context.Context
  121170. header_ http.Header
  121171. }
  121172. // Insert: Creates a VpnTunnel resource in the specified project and
  121173. // region using the data included in the request.
  121174. func (r *VpnTunnelsService) Insert(project string, region string, vpntunnel *VpnTunnel) *VpnTunnelsInsertCall {
  121175. c := &VpnTunnelsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  121176. c.project = project
  121177. c.region = region
  121178. c.vpntunnel = vpntunnel
  121179. return c
  121180. }
  121181. // RequestId sets the optional parameter "requestId": An optional
  121182. // request ID to identify requests. Specify a unique request ID so that
  121183. // if you must retry your request, the server will know to ignore the
  121184. // request if it has already been completed.
  121185. //
  121186. // For example, consider a situation where you make an initial request
  121187. // and the request times out. If you make the request again with the
  121188. // same request ID, the server can check if original operation with the
  121189. // same request ID was received, and if so, will ignore the second
  121190. // request. This prevents clients from accidentally creating duplicate
  121191. // commitments.
  121192. //
  121193. // The request ID must be a valid UUID with the exception that zero UUID
  121194. // is not supported (00000000-0000-0000-0000-000000000000).
  121195. func (c *VpnTunnelsInsertCall) RequestId(requestId string) *VpnTunnelsInsertCall {
  121196. c.urlParams_.Set("requestId", requestId)
  121197. return c
  121198. }
  121199. // Fields allows partial responses to be retrieved. See
  121200. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  121201. // for more information.
  121202. func (c *VpnTunnelsInsertCall) Fields(s ...googleapi.Field) *VpnTunnelsInsertCall {
  121203. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  121204. return c
  121205. }
  121206. // Context sets the context to be used in this call's Do method. Any
  121207. // pending HTTP request will be aborted if the provided context is
  121208. // canceled.
  121209. func (c *VpnTunnelsInsertCall) Context(ctx context.Context) *VpnTunnelsInsertCall {
  121210. c.ctx_ = ctx
  121211. return c
  121212. }
  121213. // Header returns an http.Header that can be modified by the caller to
  121214. // add HTTP headers to the request.
  121215. func (c *VpnTunnelsInsertCall) Header() http.Header {
  121216. if c.header_ == nil {
  121217. c.header_ = make(http.Header)
  121218. }
  121219. return c.header_
  121220. }
  121221. func (c *VpnTunnelsInsertCall) doRequest(alt string) (*http.Response, error) {
  121222. reqHeaders := make(http.Header)
  121223. for k, v := range c.header_ {
  121224. reqHeaders[k] = v
  121225. }
  121226. reqHeaders.Set("User-Agent", c.s.userAgent())
  121227. var body io.Reader = nil
  121228. body, err := googleapi.WithoutDataWrapper.JSONReader(c.vpntunnel)
  121229. if err != nil {
  121230. return nil, err
  121231. }
  121232. reqHeaders.Set("Content-Type", "application/json")
  121233. c.urlParams_.Set("alt", alt)
  121234. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels")
  121235. urls += "?" + c.urlParams_.Encode()
  121236. req, _ := http.NewRequest("POST", urls, body)
  121237. req.Header = reqHeaders
  121238. googleapi.Expand(req.URL, map[string]string{
  121239. "project": c.project,
  121240. "region": c.region,
  121241. })
  121242. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  121243. }
  121244. // Do executes the "compute.vpnTunnels.insert" call.
  121245. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  121246. // status code is an error. Response headers are in either
  121247. // *Operation.ServerResponse.Header or (if a response was returned at
  121248. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  121249. // to check whether the returned error was because
  121250. // http.StatusNotModified was returned.
  121251. func (c *VpnTunnelsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  121252. gensupport.SetOptions(c.urlParams_, opts...)
  121253. res, err := c.doRequest("json")
  121254. if res != nil && res.StatusCode == http.StatusNotModified {
  121255. if res.Body != nil {
  121256. res.Body.Close()
  121257. }
  121258. return nil, &googleapi.Error{
  121259. Code: res.StatusCode,
  121260. Header: res.Header,
  121261. }
  121262. }
  121263. if err != nil {
  121264. return nil, err
  121265. }
  121266. defer googleapi.CloseBody(res)
  121267. if err := googleapi.CheckResponse(res); err != nil {
  121268. return nil, err
  121269. }
  121270. ret := &Operation{
  121271. ServerResponse: googleapi.ServerResponse{
  121272. Header: res.Header,
  121273. HTTPStatusCode: res.StatusCode,
  121274. },
  121275. }
  121276. target := &ret
  121277. if err := gensupport.DecodeResponse(target, res); err != nil {
  121278. return nil, err
  121279. }
  121280. return ret, nil
  121281. // {
  121282. // "description": "Creates a VpnTunnel resource in the specified project and region using the data included in the request.",
  121283. // "httpMethod": "POST",
  121284. // "id": "compute.vpnTunnels.insert",
  121285. // "parameterOrder": [
  121286. // "project",
  121287. // "region"
  121288. // ],
  121289. // "parameters": {
  121290. // "project": {
  121291. // "description": "Project ID for this request.",
  121292. // "location": "path",
  121293. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  121294. // "required": true,
  121295. // "type": "string"
  121296. // },
  121297. // "region": {
  121298. // "description": "Name of the region for this request.",
  121299. // "location": "path",
  121300. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  121301. // "required": true,
  121302. // "type": "string"
  121303. // },
  121304. // "requestId": {
  121305. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  121306. // "location": "query",
  121307. // "type": "string"
  121308. // }
  121309. // },
  121310. // "path": "{project}/regions/{region}/vpnTunnels",
  121311. // "request": {
  121312. // "$ref": "VpnTunnel"
  121313. // },
  121314. // "response": {
  121315. // "$ref": "Operation"
  121316. // },
  121317. // "scopes": [
  121318. // "https://www.googleapis.com/auth/cloud-platform",
  121319. // "https://www.googleapis.com/auth/compute"
  121320. // ]
  121321. // }
  121322. }
  121323. // method id "compute.vpnTunnels.list":
  121324. type VpnTunnelsListCall struct {
  121325. s *Service
  121326. project string
  121327. region string
  121328. urlParams_ gensupport.URLParams
  121329. ifNoneMatch_ string
  121330. ctx_ context.Context
  121331. header_ http.Header
  121332. }
  121333. // List: Retrieves a list of VpnTunnel resources contained in the
  121334. // specified project and region.
  121335. func (r *VpnTunnelsService) List(project string, region string) *VpnTunnelsListCall {
  121336. c := &VpnTunnelsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  121337. c.project = project
  121338. c.region = region
  121339. return c
  121340. }
  121341. // Filter sets the optional parameter "filter": A filter expression that
  121342. // filters resources listed in the response. The expression must specify
  121343. // the field name, a comparison operator, and the value that you want to
  121344. // use for filtering. The value must be a string, a number, or a
  121345. // boolean. The comparison operator must be either =, !=, >, or <.
  121346. //
  121347. // For example, if you are filtering Compute Engine instances, you can
  121348. // exclude instances named example-instance by specifying name !=
  121349. // example-instance.
  121350. //
  121351. // You can also filter nested fields. For example, you could specify
  121352. // scheduling.automaticRestart = false to include instances only if they
  121353. // are not scheduled for automatic restarts. You can use filtering on
  121354. // nested fields to filter based on resource labels.
  121355. //
  121356. // To filter on multiple expressions, provide each separate expression
  121357. // within parentheses. For example, (scheduling.automaticRestart = true)
  121358. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  121359. // AND expression. However, you can include AND and OR expressions
  121360. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  121361. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  121362. // true).
  121363. func (c *VpnTunnelsListCall) Filter(filter string) *VpnTunnelsListCall {
  121364. c.urlParams_.Set("filter", filter)
  121365. return c
  121366. }
  121367. // MaxResults sets the optional parameter "maxResults": The maximum
  121368. // number of results per page that should be returned. If the number of
  121369. // available results is larger than maxResults, Compute Engine returns a
  121370. // nextPageToken that can be used to get the next page of results in
  121371. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  121372. // (Default: 500)
  121373. func (c *VpnTunnelsListCall) MaxResults(maxResults int64) *VpnTunnelsListCall {
  121374. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  121375. return c
  121376. }
  121377. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  121378. // a certain order. By default, results are returned in alphanumerical
  121379. // order based on the resource name.
  121380. //
  121381. // You can also sort results in descending order based on the creation
  121382. // timestamp using orderBy="creationTimestamp desc". This sorts results
  121383. // based on the creationTimestamp field in reverse chronological order
  121384. // (newest result first). Use this to sort resources like operations so
  121385. // that the newest operation is returned first.
  121386. //
  121387. // Currently, only sorting by name or creationTimestamp desc is
  121388. // supported.
  121389. func (c *VpnTunnelsListCall) OrderBy(orderBy string) *VpnTunnelsListCall {
  121390. c.urlParams_.Set("orderBy", orderBy)
  121391. return c
  121392. }
  121393. // PageToken sets the optional parameter "pageToken": Specifies a page
  121394. // token to use. Set pageToken to the nextPageToken returned by a
  121395. // previous list request to get the next page of results.
  121396. func (c *VpnTunnelsListCall) PageToken(pageToken string) *VpnTunnelsListCall {
  121397. c.urlParams_.Set("pageToken", pageToken)
  121398. return c
  121399. }
  121400. // Fields allows partial responses to be retrieved. See
  121401. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  121402. // for more information.
  121403. func (c *VpnTunnelsListCall) Fields(s ...googleapi.Field) *VpnTunnelsListCall {
  121404. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  121405. return c
  121406. }
  121407. // IfNoneMatch sets the optional parameter which makes the operation
  121408. // fail if the object's ETag matches the given value. This is useful for
  121409. // getting updates only after the object has changed since the last
  121410. // request. Use googleapi.IsNotModified to check whether the response
  121411. // error from Do is the result of In-None-Match.
  121412. func (c *VpnTunnelsListCall) IfNoneMatch(entityTag string) *VpnTunnelsListCall {
  121413. c.ifNoneMatch_ = entityTag
  121414. return c
  121415. }
  121416. // Context sets the context to be used in this call's Do method. Any
  121417. // pending HTTP request will be aborted if the provided context is
  121418. // canceled.
  121419. func (c *VpnTunnelsListCall) Context(ctx context.Context) *VpnTunnelsListCall {
  121420. c.ctx_ = ctx
  121421. return c
  121422. }
  121423. // Header returns an http.Header that can be modified by the caller to
  121424. // add HTTP headers to the request.
  121425. func (c *VpnTunnelsListCall) Header() http.Header {
  121426. if c.header_ == nil {
  121427. c.header_ = make(http.Header)
  121428. }
  121429. return c.header_
  121430. }
  121431. func (c *VpnTunnelsListCall) doRequest(alt string) (*http.Response, error) {
  121432. reqHeaders := make(http.Header)
  121433. for k, v := range c.header_ {
  121434. reqHeaders[k] = v
  121435. }
  121436. reqHeaders.Set("User-Agent", c.s.userAgent())
  121437. if c.ifNoneMatch_ != "" {
  121438. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  121439. }
  121440. var body io.Reader = nil
  121441. c.urlParams_.Set("alt", alt)
  121442. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels")
  121443. urls += "?" + c.urlParams_.Encode()
  121444. req, _ := http.NewRequest("GET", urls, body)
  121445. req.Header = reqHeaders
  121446. googleapi.Expand(req.URL, map[string]string{
  121447. "project": c.project,
  121448. "region": c.region,
  121449. })
  121450. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  121451. }
  121452. // Do executes the "compute.vpnTunnels.list" call.
  121453. // Exactly one of *VpnTunnelList or error will be non-nil. Any non-2xx
  121454. // status code is an error. Response headers are in either
  121455. // *VpnTunnelList.ServerResponse.Header or (if a response was returned
  121456. // at all) in error.(*googleapi.Error).Header. Use
  121457. // googleapi.IsNotModified to check whether the returned error was
  121458. // because http.StatusNotModified was returned.
  121459. func (c *VpnTunnelsListCall) Do(opts ...googleapi.CallOption) (*VpnTunnelList, error) {
  121460. gensupport.SetOptions(c.urlParams_, opts...)
  121461. res, err := c.doRequest("json")
  121462. if res != nil && res.StatusCode == http.StatusNotModified {
  121463. if res.Body != nil {
  121464. res.Body.Close()
  121465. }
  121466. return nil, &googleapi.Error{
  121467. Code: res.StatusCode,
  121468. Header: res.Header,
  121469. }
  121470. }
  121471. if err != nil {
  121472. return nil, err
  121473. }
  121474. defer googleapi.CloseBody(res)
  121475. if err := googleapi.CheckResponse(res); err != nil {
  121476. return nil, err
  121477. }
  121478. ret := &VpnTunnelList{
  121479. ServerResponse: googleapi.ServerResponse{
  121480. Header: res.Header,
  121481. HTTPStatusCode: res.StatusCode,
  121482. },
  121483. }
  121484. target := &ret
  121485. if err := gensupport.DecodeResponse(target, res); err != nil {
  121486. return nil, err
  121487. }
  121488. return ret, nil
  121489. // {
  121490. // "description": "Retrieves a list of VpnTunnel resources contained in the specified project and region.",
  121491. // "httpMethod": "GET",
  121492. // "id": "compute.vpnTunnels.list",
  121493. // "parameterOrder": [
  121494. // "project",
  121495. // "region"
  121496. // ],
  121497. // "parameters": {
  121498. // "filter": {
  121499. // "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).",
  121500. // "location": "query",
  121501. // "type": "string"
  121502. // },
  121503. // "maxResults": {
  121504. // "default": "500",
  121505. // "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)",
  121506. // "format": "uint32",
  121507. // "location": "query",
  121508. // "minimum": "0",
  121509. // "type": "integer"
  121510. // },
  121511. // "orderBy": {
  121512. // "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.",
  121513. // "location": "query",
  121514. // "type": "string"
  121515. // },
  121516. // "pageToken": {
  121517. // "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.",
  121518. // "location": "query",
  121519. // "type": "string"
  121520. // },
  121521. // "project": {
  121522. // "description": "Project ID for this request.",
  121523. // "location": "path",
  121524. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  121525. // "required": true,
  121526. // "type": "string"
  121527. // },
  121528. // "region": {
  121529. // "description": "Name of the region for this request.",
  121530. // "location": "path",
  121531. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  121532. // "required": true,
  121533. // "type": "string"
  121534. // }
  121535. // },
  121536. // "path": "{project}/regions/{region}/vpnTunnels",
  121537. // "response": {
  121538. // "$ref": "VpnTunnelList"
  121539. // },
  121540. // "scopes": [
  121541. // "https://www.googleapis.com/auth/cloud-platform",
  121542. // "https://www.googleapis.com/auth/compute",
  121543. // "https://www.googleapis.com/auth/compute.readonly"
  121544. // ]
  121545. // }
  121546. }
  121547. // Pages invokes f for each page of results.
  121548. // A non-nil error returned from f will halt the iteration.
  121549. // The provided context supersedes any context provided to the Context method.
  121550. func (c *VpnTunnelsListCall) Pages(ctx context.Context, f func(*VpnTunnelList) error) error {
  121551. c.ctx_ = ctx
  121552. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  121553. for {
  121554. x, err := c.Do()
  121555. if err != nil {
  121556. return err
  121557. }
  121558. if err := f(x); err != nil {
  121559. return err
  121560. }
  121561. if x.NextPageToken == "" {
  121562. return nil
  121563. }
  121564. c.PageToken(x.NextPageToken)
  121565. }
  121566. }
  121567. // method id "compute.vpnTunnels.setLabels":
  121568. type VpnTunnelsSetLabelsCall struct {
  121569. s *Service
  121570. project string
  121571. region string
  121572. resource string
  121573. regionsetlabelsrequest *RegionSetLabelsRequest
  121574. urlParams_ gensupport.URLParams
  121575. ctx_ context.Context
  121576. header_ http.Header
  121577. }
  121578. // SetLabels: Sets the labels on a VpnTunnel. To learn more about
  121579. // labels, read the Labeling Resources documentation.
  121580. func (r *VpnTunnelsService) SetLabels(project string, region string, resource string, regionsetlabelsrequest *RegionSetLabelsRequest) *VpnTunnelsSetLabelsCall {
  121581. c := &VpnTunnelsSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  121582. c.project = project
  121583. c.region = region
  121584. c.resource = resource
  121585. c.regionsetlabelsrequest = regionsetlabelsrequest
  121586. return c
  121587. }
  121588. // RequestId sets the optional parameter "requestId": An optional
  121589. // request ID to identify requests. Specify a unique request ID so that
  121590. // if you must retry your request, the server will know to ignore the
  121591. // request if it has already been completed.
  121592. //
  121593. // For example, consider a situation where you make an initial request
  121594. // and the request times out. If you make the request again with the
  121595. // same request ID, the server can check if original operation with the
  121596. // same request ID was received, and if so, will ignore the second
  121597. // request. This prevents clients from accidentally creating duplicate
  121598. // commitments.
  121599. //
  121600. // The request ID must be a valid UUID with the exception that zero UUID
  121601. // is not supported (00000000-0000-0000-0000-000000000000).
  121602. func (c *VpnTunnelsSetLabelsCall) RequestId(requestId string) *VpnTunnelsSetLabelsCall {
  121603. c.urlParams_.Set("requestId", requestId)
  121604. return c
  121605. }
  121606. // Fields allows partial responses to be retrieved. See
  121607. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  121608. // for more information.
  121609. func (c *VpnTunnelsSetLabelsCall) Fields(s ...googleapi.Field) *VpnTunnelsSetLabelsCall {
  121610. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  121611. return c
  121612. }
  121613. // Context sets the context to be used in this call's Do method. Any
  121614. // pending HTTP request will be aborted if the provided context is
  121615. // canceled.
  121616. func (c *VpnTunnelsSetLabelsCall) Context(ctx context.Context) *VpnTunnelsSetLabelsCall {
  121617. c.ctx_ = ctx
  121618. return c
  121619. }
  121620. // Header returns an http.Header that can be modified by the caller to
  121621. // add HTTP headers to the request.
  121622. func (c *VpnTunnelsSetLabelsCall) Header() http.Header {
  121623. if c.header_ == nil {
  121624. c.header_ = make(http.Header)
  121625. }
  121626. return c.header_
  121627. }
  121628. func (c *VpnTunnelsSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  121629. reqHeaders := make(http.Header)
  121630. for k, v := range c.header_ {
  121631. reqHeaders[k] = v
  121632. }
  121633. reqHeaders.Set("User-Agent", c.s.userAgent())
  121634. var body io.Reader = nil
  121635. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest)
  121636. if err != nil {
  121637. return nil, err
  121638. }
  121639. reqHeaders.Set("Content-Type", "application/json")
  121640. c.urlParams_.Set("alt", alt)
  121641. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels/{resource}/setLabels")
  121642. urls += "?" + c.urlParams_.Encode()
  121643. req, _ := http.NewRequest("POST", urls, body)
  121644. req.Header = reqHeaders
  121645. googleapi.Expand(req.URL, map[string]string{
  121646. "project": c.project,
  121647. "region": c.region,
  121648. "resource": c.resource,
  121649. })
  121650. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  121651. }
  121652. // Do executes the "compute.vpnTunnels.setLabels" call.
  121653. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  121654. // status code is an error. Response headers are in either
  121655. // *Operation.ServerResponse.Header or (if a response was returned at
  121656. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  121657. // to check whether the returned error was because
  121658. // http.StatusNotModified was returned.
  121659. func (c *VpnTunnelsSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  121660. gensupport.SetOptions(c.urlParams_, opts...)
  121661. res, err := c.doRequest("json")
  121662. if res != nil && res.StatusCode == http.StatusNotModified {
  121663. if res.Body != nil {
  121664. res.Body.Close()
  121665. }
  121666. return nil, &googleapi.Error{
  121667. Code: res.StatusCode,
  121668. Header: res.Header,
  121669. }
  121670. }
  121671. if err != nil {
  121672. return nil, err
  121673. }
  121674. defer googleapi.CloseBody(res)
  121675. if err := googleapi.CheckResponse(res); err != nil {
  121676. return nil, err
  121677. }
  121678. ret := &Operation{
  121679. ServerResponse: googleapi.ServerResponse{
  121680. Header: res.Header,
  121681. HTTPStatusCode: res.StatusCode,
  121682. },
  121683. }
  121684. target := &ret
  121685. if err := gensupport.DecodeResponse(target, res); err != nil {
  121686. return nil, err
  121687. }
  121688. return ret, nil
  121689. // {
  121690. // "description": "Sets the labels on a VpnTunnel. To learn more about labels, read the Labeling Resources documentation.",
  121691. // "httpMethod": "POST",
  121692. // "id": "compute.vpnTunnels.setLabels",
  121693. // "parameterOrder": [
  121694. // "project",
  121695. // "region",
  121696. // "resource"
  121697. // ],
  121698. // "parameters": {
  121699. // "project": {
  121700. // "description": "Project ID for this request.",
  121701. // "location": "path",
  121702. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  121703. // "required": true,
  121704. // "type": "string"
  121705. // },
  121706. // "region": {
  121707. // "description": "The region for this request.",
  121708. // "location": "path",
  121709. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  121710. // "required": true,
  121711. // "type": "string"
  121712. // },
  121713. // "requestId": {
  121714. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  121715. // "location": "query",
  121716. // "type": "string"
  121717. // },
  121718. // "resource": {
  121719. // "description": "Name of the resource for this request.",
  121720. // "location": "path",
  121721. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  121722. // "required": true,
  121723. // "type": "string"
  121724. // }
  121725. // },
  121726. // "path": "{project}/regions/{region}/vpnTunnels/{resource}/setLabels",
  121727. // "request": {
  121728. // "$ref": "RegionSetLabelsRequest"
  121729. // },
  121730. // "response": {
  121731. // "$ref": "Operation"
  121732. // },
  121733. // "scopes": [
  121734. // "https://www.googleapis.com/auth/cloud-platform",
  121735. // "https://www.googleapis.com/auth/compute"
  121736. // ]
  121737. // }
  121738. }
  121739. // method id "compute.vpnTunnels.testIamPermissions":
  121740. type VpnTunnelsTestIamPermissionsCall struct {
  121741. s *Service
  121742. project string
  121743. region string
  121744. resource string
  121745. testpermissionsrequest *TestPermissionsRequest
  121746. urlParams_ gensupport.URLParams
  121747. ctx_ context.Context
  121748. header_ http.Header
  121749. }
  121750. // TestIamPermissions: Returns permissions that a caller has on the
  121751. // specified resource.
  121752. func (r *VpnTunnelsService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *VpnTunnelsTestIamPermissionsCall {
  121753. c := &VpnTunnelsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  121754. c.project = project
  121755. c.region = region
  121756. c.resource = resource
  121757. c.testpermissionsrequest = testpermissionsrequest
  121758. return c
  121759. }
  121760. // Fields allows partial responses to be retrieved. See
  121761. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  121762. // for more information.
  121763. func (c *VpnTunnelsTestIamPermissionsCall) Fields(s ...googleapi.Field) *VpnTunnelsTestIamPermissionsCall {
  121764. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  121765. return c
  121766. }
  121767. // Context sets the context to be used in this call's Do method. Any
  121768. // pending HTTP request will be aborted if the provided context is
  121769. // canceled.
  121770. func (c *VpnTunnelsTestIamPermissionsCall) Context(ctx context.Context) *VpnTunnelsTestIamPermissionsCall {
  121771. c.ctx_ = ctx
  121772. return c
  121773. }
  121774. // Header returns an http.Header that can be modified by the caller to
  121775. // add HTTP headers to the request.
  121776. func (c *VpnTunnelsTestIamPermissionsCall) Header() http.Header {
  121777. if c.header_ == nil {
  121778. c.header_ = make(http.Header)
  121779. }
  121780. return c.header_
  121781. }
  121782. func (c *VpnTunnelsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  121783. reqHeaders := make(http.Header)
  121784. for k, v := range c.header_ {
  121785. reqHeaders[k] = v
  121786. }
  121787. reqHeaders.Set("User-Agent", c.s.userAgent())
  121788. var body io.Reader = nil
  121789. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  121790. if err != nil {
  121791. return nil, err
  121792. }
  121793. reqHeaders.Set("Content-Type", "application/json")
  121794. c.urlParams_.Set("alt", alt)
  121795. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels/{resource}/testIamPermissions")
  121796. urls += "?" + c.urlParams_.Encode()
  121797. req, _ := http.NewRequest("POST", urls, body)
  121798. req.Header = reqHeaders
  121799. googleapi.Expand(req.URL, map[string]string{
  121800. "project": c.project,
  121801. "region": c.region,
  121802. "resource": c.resource,
  121803. })
  121804. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  121805. }
  121806. // Do executes the "compute.vpnTunnels.testIamPermissions" call.
  121807. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  121808. // non-2xx status code is an error. Response headers are in either
  121809. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  121810. // returned at all) in error.(*googleapi.Error).Header. Use
  121811. // googleapi.IsNotModified to check whether the returned error was
  121812. // because http.StatusNotModified was returned.
  121813. func (c *VpnTunnelsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  121814. gensupport.SetOptions(c.urlParams_, opts...)
  121815. res, err := c.doRequest("json")
  121816. if res != nil && res.StatusCode == http.StatusNotModified {
  121817. if res.Body != nil {
  121818. res.Body.Close()
  121819. }
  121820. return nil, &googleapi.Error{
  121821. Code: res.StatusCode,
  121822. Header: res.Header,
  121823. }
  121824. }
  121825. if err != nil {
  121826. return nil, err
  121827. }
  121828. defer googleapi.CloseBody(res)
  121829. if err := googleapi.CheckResponse(res); err != nil {
  121830. return nil, err
  121831. }
  121832. ret := &TestPermissionsResponse{
  121833. ServerResponse: googleapi.ServerResponse{
  121834. Header: res.Header,
  121835. HTTPStatusCode: res.StatusCode,
  121836. },
  121837. }
  121838. target := &ret
  121839. if err := gensupport.DecodeResponse(target, res); err != nil {
  121840. return nil, err
  121841. }
  121842. return ret, nil
  121843. // {
  121844. // "description": "Returns permissions that a caller has on the specified resource.",
  121845. // "httpMethod": "POST",
  121846. // "id": "compute.vpnTunnels.testIamPermissions",
  121847. // "parameterOrder": [
  121848. // "project",
  121849. // "region",
  121850. // "resource"
  121851. // ],
  121852. // "parameters": {
  121853. // "project": {
  121854. // "description": "Project ID for this request.",
  121855. // "location": "path",
  121856. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  121857. // "required": true,
  121858. // "type": "string"
  121859. // },
  121860. // "region": {
  121861. // "description": "The name of the region for this request.",
  121862. // "location": "path",
  121863. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  121864. // "required": true,
  121865. // "type": "string"
  121866. // },
  121867. // "resource": {
  121868. // "description": "Name of the resource for this request.",
  121869. // "location": "path",
  121870. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  121871. // "required": true,
  121872. // "type": "string"
  121873. // }
  121874. // },
  121875. // "path": "{project}/regions/{region}/vpnTunnels/{resource}/testIamPermissions",
  121876. // "request": {
  121877. // "$ref": "TestPermissionsRequest"
  121878. // },
  121879. // "response": {
  121880. // "$ref": "TestPermissionsResponse"
  121881. // },
  121882. // "scopes": [
  121883. // "https://www.googleapis.com/auth/cloud-platform",
  121884. // "https://www.googleapis.com/auth/compute",
  121885. // "https://www.googleapis.com/auth/compute.readonly"
  121886. // ]
  121887. // }
  121888. }
  121889. // method id "compute.zoneOperations.delete":
  121890. type ZoneOperationsDeleteCall struct {
  121891. s *Service
  121892. project string
  121893. zone string
  121894. operation string
  121895. urlParams_ gensupport.URLParams
  121896. ctx_ context.Context
  121897. header_ http.Header
  121898. }
  121899. // Delete: Deletes the specified zone-specific Operations resource.
  121900. // For details, see https://cloud.google.com/compute/docs/reference/latest/zoneOperations/delete
  121901. func (r *ZoneOperationsService) Delete(project string, zone string, operation string) *ZoneOperationsDeleteCall {
  121902. c := &ZoneOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  121903. c.project = project
  121904. c.zone = zone
  121905. c.operation = operation
  121906. return c
  121907. }
  121908. // Fields allows partial responses to be retrieved. See
  121909. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  121910. // for more information.
  121911. func (c *ZoneOperationsDeleteCall) Fields(s ...googleapi.Field) *ZoneOperationsDeleteCall {
  121912. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  121913. return c
  121914. }
  121915. // Context sets the context to be used in this call's Do method. Any
  121916. // pending HTTP request will be aborted if the provided context is
  121917. // canceled.
  121918. func (c *ZoneOperationsDeleteCall) Context(ctx context.Context) *ZoneOperationsDeleteCall {
  121919. c.ctx_ = ctx
  121920. return c
  121921. }
  121922. // Header returns an http.Header that can be modified by the caller to
  121923. // add HTTP headers to the request.
  121924. func (c *ZoneOperationsDeleteCall) Header() http.Header {
  121925. if c.header_ == nil {
  121926. c.header_ = make(http.Header)
  121927. }
  121928. return c.header_
  121929. }
  121930. func (c *ZoneOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  121931. reqHeaders := make(http.Header)
  121932. for k, v := range c.header_ {
  121933. reqHeaders[k] = v
  121934. }
  121935. reqHeaders.Set("User-Agent", c.s.userAgent())
  121936. var body io.Reader = nil
  121937. c.urlParams_.Set("alt", alt)
  121938. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/operations/{operation}")
  121939. urls += "?" + c.urlParams_.Encode()
  121940. req, _ := http.NewRequest("DELETE", urls, body)
  121941. req.Header = reqHeaders
  121942. googleapi.Expand(req.URL, map[string]string{
  121943. "project": c.project,
  121944. "zone": c.zone,
  121945. "operation": c.operation,
  121946. })
  121947. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  121948. }
  121949. // Do executes the "compute.zoneOperations.delete" call.
  121950. func (c *ZoneOperationsDeleteCall) Do(opts ...googleapi.CallOption) error {
  121951. gensupport.SetOptions(c.urlParams_, opts...)
  121952. res, err := c.doRequest("json")
  121953. if err != nil {
  121954. return err
  121955. }
  121956. defer googleapi.CloseBody(res)
  121957. if err := googleapi.CheckResponse(res); err != nil {
  121958. return err
  121959. }
  121960. return nil
  121961. // {
  121962. // "description": "Deletes the specified zone-specific Operations resource.",
  121963. // "httpMethod": "DELETE",
  121964. // "id": "compute.zoneOperations.delete",
  121965. // "parameterOrder": [
  121966. // "project",
  121967. // "zone",
  121968. // "operation"
  121969. // ],
  121970. // "parameters": {
  121971. // "operation": {
  121972. // "description": "Name of the Operations resource to delete.",
  121973. // "location": "path",
  121974. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  121975. // "required": true,
  121976. // "type": "string"
  121977. // },
  121978. // "project": {
  121979. // "description": "Project ID for this request.",
  121980. // "location": "path",
  121981. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  121982. // "required": true,
  121983. // "type": "string"
  121984. // },
  121985. // "zone": {
  121986. // "description": "Name of the zone for this request.",
  121987. // "location": "path",
  121988. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  121989. // "required": true,
  121990. // "type": "string"
  121991. // }
  121992. // },
  121993. // "path": "{project}/zones/{zone}/operations/{operation}",
  121994. // "scopes": [
  121995. // "https://www.googleapis.com/auth/cloud-platform",
  121996. // "https://www.googleapis.com/auth/compute"
  121997. // ]
  121998. // }
  121999. }
  122000. // method id "compute.zoneOperations.get":
  122001. type ZoneOperationsGetCall struct {
  122002. s *Service
  122003. project string
  122004. zone string
  122005. operation string
  122006. urlParams_ gensupport.URLParams
  122007. ifNoneMatch_ string
  122008. ctx_ context.Context
  122009. header_ http.Header
  122010. }
  122011. // Get: Retrieves the specified zone-specific Operations resource.
  122012. // For details, see https://cloud.google.com/compute/docs/reference/latest/zoneOperations/get
  122013. func (r *ZoneOperationsService) Get(project string, zone string, operation string) *ZoneOperationsGetCall {
  122014. c := &ZoneOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  122015. c.project = project
  122016. c.zone = zone
  122017. c.operation = operation
  122018. return c
  122019. }
  122020. // Fields allows partial responses to be retrieved. See
  122021. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  122022. // for more information.
  122023. func (c *ZoneOperationsGetCall) Fields(s ...googleapi.Field) *ZoneOperationsGetCall {
  122024. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  122025. return c
  122026. }
  122027. // IfNoneMatch sets the optional parameter which makes the operation
  122028. // fail if the object's ETag matches the given value. This is useful for
  122029. // getting updates only after the object has changed since the last
  122030. // request. Use googleapi.IsNotModified to check whether the response
  122031. // error from Do is the result of In-None-Match.
  122032. func (c *ZoneOperationsGetCall) IfNoneMatch(entityTag string) *ZoneOperationsGetCall {
  122033. c.ifNoneMatch_ = entityTag
  122034. return c
  122035. }
  122036. // Context sets the context to be used in this call's Do method. Any
  122037. // pending HTTP request will be aborted if the provided context is
  122038. // canceled.
  122039. func (c *ZoneOperationsGetCall) Context(ctx context.Context) *ZoneOperationsGetCall {
  122040. c.ctx_ = ctx
  122041. return c
  122042. }
  122043. // Header returns an http.Header that can be modified by the caller to
  122044. // add HTTP headers to the request.
  122045. func (c *ZoneOperationsGetCall) Header() http.Header {
  122046. if c.header_ == nil {
  122047. c.header_ = make(http.Header)
  122048. }
  122049. return c.header_
  122050. }
  122051. func (c *ZoneOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  122052. reqHeaders := make(http.Header)
  122053. for k, v := range c.header_ {
  122054. reqHeaders[k] = v
  122055. }
  122056. reqHeaders.Set("User-Agent", c.s.userAgent())
  122057. if c.ifNoneMatch_ != "" {
  122058. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  122059. }
  122060. var body io.Reader = nil
  122061. c.urlParams_.Set("alt", alt)
  122062. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/operations/{operation}")
  122063. urls += "?" + c.urlParams_.Encode()
  122064. req, _ := http.NewRequest("GET", urls, body)
  122065. req.Header = reqHeaders
  122066. googleapi.Expand(req.URL, map[string]string{
  122067. "project": c.project,
  122068. "zone": c.zone,
  122069. "operation": c.operation,
  122070. })
  122071. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  122072. }
  122073. // Do executes the "compute.zoneOperations.get" call.
  122074. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  122075. // status code is an error. Response headers are in either
  122076. // *Operation.ServerResponse.Header or (if a response was returned at
  122077. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  122078. // to check whether the returned error was because
  122079. // http.StatusNotModified was returned.
  122080. func (c *ZoneOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  122081. gensupport.SetOptions(c.urlParams_, opts...)
  122082. res, err := c.doRequest("json")
  122083. if res != nil && res.StatusCode == http.StatusNotModified {
  122084. if res.Body != nil {
  122085. res.Body.Close()
  122086. }
  122087. return nil, &googleapi.Error{
  122088. Code: res.StatusCode,
  122089. Header: res.Header,
  122090. }
  122091. }
  122092. if err != nil {
  122093. return nil, err
  122094. }
  122095. defer googleapi.CloseBody(res)
  122096. if err := googleapi.CheckResponse(res); err != nil {
  122097. return nil, err
  122098. }
  122099. ret := &Operation{
  122100. ServerResponse: googleapi.ServerResponse{
  122101. Header: res.Header,
  122102. HTTPStatusCode: res.StatusCode,
  122103. },
  122104. }
  122105. target := &ret
  122106. if err := gensupport.DecodeResponse(target, res); err != nil {
  122107. return nil, err
  122108. }
  122109. return ret, nil
  122110. // {
  122111. // "description": "Retrieves the specified zone-specific Operations resource.",
  122112. // "httpMethod": "GET",
  122113. // "id": "compute.zoneOperations.get",
  122114. // "parameterOrder": [
  122115. // "project",
  122116. // "zone",
  122117. // "operation"
  122118. // ],
  122119. // "parameters": {
  122120. // "operation": {
  122121. // "description": "Name of the Operations resource to return.",
  122122. // "location": "path",
  122123. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  122124. // "required": true,
  122125. // "type": "string"
  122126. // },
  122127. // "project": {
  122128. // "description": "Project ID for this request.",
  122129. // "location": "path",
  122130. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  122131. // "required": true,
  122132. // "type": "string"
  122133. // },
  122134. // "zone": {
  122135. // "description": "Name of the zone for this request.",
  122136. // "location": "path",
  122137. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  122138. // "required": true,
  122139. // "type": "string"
  122140. // }
  122141. // },
  122142. // "path": "{project}/zones/{zone}/operations/{operation}",
  122143. // "response": {
  122144. // "$ref": "Operation"
  122145. // },
  122146. // "scopes": [
  122147. // "https://www.googleapis.com/auth/cloud-platform",
  122148. // "https://www.googleapis.com/auth/compute",
  122149. // "https://www.googleapis.com/auth/compute.readonly"
  122150. // ]
  122151. // }
  122152. }
  122153. // method id "compute.zoneOperations.list":
  122154. type ZoneOperationsListCall struct {
  122155. s *Service
  122156. project string
  122157. zone string
  122158. urlParams_ gensupport.URLParams
  122159. ifNoneMatch_ string
  122160. ctx_ context.Context
  122161. header_ http.Header
  122162. }
  122163. // List: Retrieves a list of Operation resources contained within the
  122164. // specified zone.
  122165. // For details, see https://cloud.google.com/compute/docs/reference/latest/zoneOperations/list
  122166. func (r *ZoneOperationsService) List(project string, zone string) *ZoneOperationsListCall {
  122167. c := &ZoneOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  122168. c.project = project
  122169. c.zone = zone
  122170. return c
  122171. }
  122172. // Filter sets the optional parameter "filter": A filter expression that
  122173. // filters resources listed in the response. The expression must specify
  122174. // the field name, a comparison operator, and the value that you want to
  122175. // use for filtering. The value must be a string, a number, or a
  122176. // boolean. The comparison operator must be either =, !=, >, or <.
  122177. //
  122178. // For example, if you are filtering Compute Engine instances, you can
  122179. // exclude instances named example-instance by specifying name !=
  122180. // example-instance.
  122181. //
  122182. // You can also filter nested fields. For example, you could specify
  122183. // scheduling.automaticRestart = false to include instances only if they
  122184. // are not scheduled for automatic restarts. You can use filtering on
  122185. // nested fields to filter based on resource labels.
  122186. //
  122187. // To filter on multiple expressions, provide each separate expression
  122188. // within parentheses. For example, (scheduling.automaticRestart = true)
  122189. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  122190. // AND expression. However, you can include AND and OR expressions
  122191. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  122192. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  122193. // true).
  122194. func (c *ZoneOperationsListCall) Filter(filter string) *ZoneOperationsListCall {
  122195. c.urlParams_.Set("filter", filter)
  122196. return c
  122197. }
  122198. // MaxResults sets the optional parameter "maxResults": The maximum
  122199. // number of results per page that should be returned. If the number of
  122200. // available results is larger than maxResults, Compute Engine returns a
  122201. // nextPageToken that can be used to get the next page of results in
  122202. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  122203. // (Default: 500)
  122204. func (c *ZoneOperationsListCall) MaxResults(maxResults int64) *ZoneOperationsListCall {
  122205. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  122206. return c
  122207. }
  122208. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  122209. // a certain order. By default, results are returned in alphanumerical
  122210. // order based on the resource name.
  122211. //
  122212. // You can also sort results in descending order based on the creation
  122213. // timestamp using orderBy="creationTimestamp desc". This sorts results
  122214. // based on the creationTimestamp field in reverse chronological order
  122215. // (newest result first). Use this to sort resources like operations so
  122216. // that the newest operation is returned first.
  122217. //
  122218. // Currently, only sorting by name or creationTimestamp desc is
  122219. // supported.
  122220. func (c *ZoneOperationsListCall) OrderBy(orderBy string) *ZoneOperationsListCall {
  122221. c.urlParams_.Set("orderBy", orderBy)
  122222. return c
  122223. }
  122224. // PageToken sets the optional parameter "pageToken": Specifies a page
  122225. // token to use. Set pageToken to the nextPageToken returned by a
  122226. // previous list request to get the next page of results.
  122227. func (c *ZoneOperationsListCall) PageToken(pageToken string) *ZoneOperationsListCall {
  122228. c.urlParams_.Set("pageToken", pageToken)
  122229. return c
  122230. }
  122231. // Fields allows partial responses to be retrieved. See
  122232. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  122233. // for more information.
  122234. func (c *ZoneOperationsListCall) Fields(s ...googleapi.Field) *ZoneOperationsListCall {
  122235. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  122236. return c
  122237. }
  122238. // IfNoneMatch sets the optional parameter which makes the operation
  122239. // fail if the object's ETag matches the given value. This is useful for
  122240. // getting updates only after the object has changed since the last
  122241. // request. Use googleapi.IsNotModified to check whether the response
  122242. // error from Do is the result of In-None-Match.
  122243. func (c *ZoneOperationsListCall) IfNoneMatch(entityTag string) *ZoneOperationsListCall {
  122244. c.ifNoneMatch_ = entityTag
  122245. return c
  122246. }
  122247. // Context sets the context to be used in this call's Do method. Any
  122248. // pending HTTP request will be aborted if the provided context is
  122249. // canceled.
  122250. func (c *ZoneOperationsListCall) Context(ctx context.Context) *ZoneOperationsListCall {
  122251. c.ctx_ = ctx
  122252. return c
  122253. }
  122254. // Header returns an http.Header that can be modified by the caller to
  122255. // add HTTP headers to the request.
  122256. func (c *ZoneOperationsListCall) Header() http.Header {
  122257. if c.header_ == nil {
  122258. c.header_ = make(http.Header)
  122259. }
  122260. return c.header_
  122261. }
  122262. func (c *ZoneOperationsListCall) doRequest(alt string) (*http.Response, error) {
  122263. reqHeaders := make(http.Header)
  122264. for k, v := range c.header_ {
  122265. reqHeaders[k] = v
  122266. }
  122267. reqHeaders.Set("User-Agent", c.s.userAgent())
  122268. if c.ifNoneMatch_ != "" {
  122269. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  122270. }
  122271. var body io.Reader = nil
  122272. c.urlParams_.Set("alt", alt)
  122273. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/operations")
  122274. urls += "?" + c.urlParams_.Encode()
  122275. req, _ := http.NewRequest("GET", urls, body)
  122276. req.Header = reqHeaders
  122277. googleapi.Expand(req.URL, map[string]string{
  122278. "project": c.project,
  122279. "zone": c.zone,
  122280. })
  122281. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  122282. }
  122283. // Do executes the "compute.zoneOperations.list" call.
  122284. // Exactly one of *OperationList or error will be non-nil. Any non-2xx
  122285. // status code is an error. Response headers are in either
  122286. // *OperationList.ServerResponse.Header or (if a response was returned
  122287. // at all) in error.(*googleapi.Error).Header. Use
  122288. // googleapi.IsNotModified to check whether the returned error was
  122289. // because http.StatusNotModified was returned.
  122290. func (c *ZoneOperationsListCall) Do(opts ...googleapi.CallOption) (*OperationList, error) {
  122291. gensupport.SetOptions(c.urlParams_, opts...)
  122292. res, err := c.doRequest("json")
  122293. if res != nil && res.StatusCode == http.StatusNotModified {
  122294. if res.Body != nil {
  122295. res.Body.Close()
  122296. }
  122297. return nil, &googleapi.Error{
  122298. Code: res.StatusCode,
  122299. Header: res.Header,
  122300. }
  122301. }
  122302. if err != nil {
  122303. return nil, err
  122304. }
  122305. defer googleapi.CloseBody(res)
  122306. if err := googleapi.CheckResponse(res); err != nil {
  122307. return nil, err
  122308. }
  122309. ret := &OperationList{
  122310. ServerResponse: googleapi.ServerResponse{
  122311. Header: res.Header,
  122312. HTTPStatusCode: res.StatusCode,
  122313. },
  122314. }
  122315. target := &ret
  122316. if err := gensupport.DecodeResponse(target, res); err != nil {
  122317. return nil, err
  122318. }
  122319. return ret, nil
  122320. // {
  122321. // "description": "Retrieves a list of Operation resources contained within the specified zone.",
  122322. // "httpMethod": "GET",
  122323. // "id": "compute.zoneOperations.list",
  122324. // "parameterOrder": [
  122325. // "project",
  122326. // "zone"
  122327. // ],
  122328. // "parameters": {
  122329. // "filter": {
  122330. // "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).",
  122331. // "location": "query",
  122332. // "type": "string"
  122333. // },
  122334. // "maxResults": {
  122335. // "default": "500",
  122336. // "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)",
  122337. // "format": "uint32",
  122338. // "location": "query",
  122339. // "minimum": "0",
  122340. // "type": "integer"
  122341. // },
  122342. // "orderBy": {
  122343. // "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.",
  122344. // "location": "query",
  122345. // "type": "string"
  122346. // },
  122347. // "pageToken": {
  122348. // "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.",
  122349. // "location": "query",
  122350. // "type": "string"
  122351. // },
  122352. // "project": {
  122353. // "description": "Project ID for this request.",
  122354. // "location": "path",
  122355. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  122356. // "required": true,
  122357. // "type": "string"
  122358. // },
  122359. // "zone": {
  122360. // "description": "Name of the zone for request.",
  122361. // "location": "path",
  122362. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  122363. // "required": true,
  122364. // "type": "string"
  122365. // }
  122366. // },
  122367. // "path": "{project}/zones/{zone}/operations",
  122368. // "response": {
  122369. // "$ref": "OperationList"
  122370. // },
  122371. // "scopes": [
  122372. // "https://www.googleapis.com/auth/cloud-platform",
  122373. // "https://www.googleapis.com/auth/compute",
  122374. // "https://www.googleapis.com/auth/compute.readonly"
  122375. // ]
  122376. // }
  122377. }
  122378. // Pages invokes f for each page of results.
  122379. // A non-nil error returned from f will halt the iteration.
  122380. // The provided context supersedes any context provided to the Context method.
  122381. func (c *ZoneOperationsListCall) Pages(ctx context.Context, f func(*OperationList) error) error {
  122382. c.ctx_ = ctx
  122383. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  122384. for {
  122385. x, err := c.Do()
  122386. if err != nil {
  122387. return err
  122388. }
  122389. if err := f(x); err != nil {
  122390. return err
  122391. }
  122392. if x.NextPageToken == "" {
  122393. return nil
  122394. }
  122395. c.PageToken(x.NextPageToken)
  122396. }
  122397. }
  122398. // method id "compute.zoneOperations.wait":
  122399. type ZoneOperationsWaitCall struct {
  122400. s *Service
  122401. project string
  122402. zone string
  122403. operation string
  122404. urlParams_ gensupport.URLParams
  122405. ctx_ context.Context
  122406. header_ http.Header
  122407. }
  122408. // Wait: Waits for the specified zone-specific Operations resource until
  122409. // it is done or timeout, and retrieves the specified Operations
  122410. // resource. 1. Immediately returns when the operation is already done.
  122411. // 2. Waits for no more than the default deadline (2 minutes, subject to
  122412. // change) and then returns the current state of the operation, which
  122413. // may be DONE or still in progress. 3. Is best-effort: a. The server
  122414. // can wait less than the default deadline or zero seconds, in overload
  122415. // situations. b. There is no guarantee that the operation is actually
  122416. // done when returns. 4. User should be prepared to retry if the
  122417. // operation is not DONE.
  122418. func (r *ZoneOperationsService) Wait(project string, zone string, operation string) *ZoneOperationsWaitCall {
  122419. c := &ZoneOperationsWaitCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  122420. c.project = project
  122421. c.zone = zone
  122422. c.operation = operation
  122423. return c
  122424. }
  122425. // Fields allows partial responses to be retrieved. See
  122426. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  122427. // for more information.
  122428. func (c *ZoneOperationsWaitCall) Fields(s ...googleapi.Field) *ZoneOperationsWaitCall {
  122429. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  122430. return c
  122431. }
  122432. // Context sets the context to be used in this call's Do method. Any
  122433. // pending HTTP request will be aborted if the provided context is
  122434. // canceled.
  122435. func (c *ZoneOperationsWaitCall) Context(ctx context.Context) *ZoneOperationsWaitCall {
  122436. c.ctx_ = ctx
  122437. return c
  122438. }
  122439. // Header returns an http.Header that can be modified by the caller to
  122440. // add HTTP headers to the request.
  122441. func (c *ZoneOperationsWaitCall) Header() http.Header {
  122442. if c.header_ == nil {
  122443. c.header_ = make(http.Header)
  122444. }
  122445. return c.header_
  122446. }
  122447. func (c *ZoneOperationsWaitCall) doRequest(alt string) (*http.Response, error) {
  122448. reqHeaders := make(http.Header)
  122449. for k, v := range c.header_ {
  122450. reqHeaders[k] = v
  122451. }
  122452. reqHeaders.Set("User-Agent", c.s.userAgent())
  122453. var body io.Reader = nil
  122454. c.urlParams_.Set("alt", alt)
  122455. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/operations/{operation}/wait")
  122456. urls += "?" + c.urlParams_.Encode()
  122457. req, _ := http.NewRequest("POST", urls, body)
  122458. req.Header = reqHeaders
  122459. googleapi.Expand(req.URL, map[string]string{
  122460. "project": c.project,
  122461. "zone": c.zone,
  122462. "operation": c.operation,
  122463. })
  122464. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  122465. }
  122466. // Do executes the "compute.zoneOperations.wait" call.
  122467. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  122468. // status code is an error. Response headers are in either
  122469. // *Operation.ServerResponse.Header or (if a response was returned at
  122470. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  122471. // to check whether the returned error was because
  122472. // http.StatusNotModified was returned.
  122473. func (c *ZoneOperationsWaitCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  122474. gensupport.SetOptions(c.urlParams_, opts...)
  122475. res, err := c.doRequest("json")
  122476. if res != nil && res.StatusCode == http.StatusNotModified {
  122477. if res.Body != nil {
  122478. res.Body.Close()
  122479. }
  122480. return nil, &googleapi.Error{
  122481. Code: res.StatusCode,
  122482. Header: res.Header,
  122483. }
  122484. }
  122485. if err != nil {
  122486. return nil, err
  122487. }
  122488. defer googleapi.CloseBody(res)
  122489. if err := googleapi.CheckResponse(res); err != nil {
  122490. return nil, err
  122491. }
  122492. ret := &Operation{
  122493. ServerResponse: googleapi.ServerResponse{
  122494. Header: res.Header,
  122495. HTTPStatusCode: res.StatusCode,
  122496. },
  122497. }
  122498. target := &ret
  122499. if err := gensupport.DecodeResponse(target, res); err != nil {
  122500. return nil, err
  122501. }
  122502. return ret, nil
  122503. // {
  122504. // "description": "Waits for the specified zone-specific Operations resource until it is done or timeout, and retrieves the specified Operations resource. 1. Immediately returns when the operation is already done. 2. Waits for no more than the default deadline (2 minutes, subject to change) and then returns the current state of the operation, which may be DONE or still in progress. 3. Is best-effort: a. The server can wait less than the default deadline or zero seconds, in overload situations. b. There is no guarantee that the operation is actually done when returns. 4. User should be prepared to retry if the operation is not DONE.",
  122505. // "httpMethod": "POST",
  122506. // "id": "compute.zoneOperations.wait",
  122507. // "parameterOrder": [
  122508. // "project",
  122509. // "zone",
  122510. // "operation"
  122511. // ],
  122512. // "parameters": {
  122513. // "operation": {
  122514. // "description": "Name of the Operations resource to return.",
  122515. // "location": "path",
  122516. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  122517. // "required": true,
  122518. // "type": "string"
  122519. // },
  122520. // "project": {
  122521. // "description": "Project ID for this request.",
  122522. // "location": "path",
  122523. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  122524. // "required": true,
  122525. // "type": "string"
  122526. // },
  122527. // "zone": {
  122528. // "description": "Name of the zone for this request.",
  122529. // "location": "path",
  122530. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  122531. // "required": true,
  122532. // "type": "string"
  122533. // }
  122534. // },
  122535. // "path": "{project}/zones/{zone}/operations/{operation}/wait",
  122536. // "response": {
  122537. // "$ref": "Operation"
  122538. // },
  122539. // "scopes": [
  122540. // "https://www.googleapis.com/auth/cloud-platform",
  122541. // "https://www.googleapis.com/auth/compute",
  122542. // "https://www.googleapis.com/auth/compute.readonly"
  122543. // ]
  122544. // }
  122545. }
  122546. // method id "compute.zones.get":
  122547. type ZonesGetCall struct {
  122548. s *Service
  122549. project string
  122550. zone string
  122551. urlParams_ gensupport.URLParams
  122552. ifNoneMatch_ string
  122553. ctx_ context.Context
  122554. header_ http.Header
  122555. }
  122556. // Get: Returns the specified Zone resource. Gets a list of available
  122557. // zones by making a list() request.
  122558. // For details, see https://cloud.google.com/compute/docs/reference/latest/zones/get
  122559. func (r *ZonesService) Get(project string, zone string) *ZonesGetCall {
  122560. c := &ZonesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  122561. c.project = project
  122562. c.zone = zone
  122563. return c
  122564. }
  122565. // Fields allows partial responses to be retrieved. See
  122566. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  122567. // for more information.
  122568. func (c *ZonesGetCall) Fields(s ...googleapi.Field) *ZonesGetCall {
  122569. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  122570. return c
  122571. }
  122572. // IfNoneMatch sets the optional parameter which makes the operation
  122573. // fail if the object's ETag matches the given value. This is useful for
  122574. // getting updates only after the object has changed since the last
  122575. // request. Use googleapi.IsNotModified to check whether the response
  122576. // error from Do is the result of In-None-Match.
  122577. func (c *ZonesGetCall) IfNoneMatch(entityTag string) *ZonesGetCall {
  122578. c.ifNoneMatch_ = entityTag
  122579. return c
  122580. }
  122581. // Context sets the context to be used in this call's Do method. Any
  122582. // pending HTTP request will be aborted if the provided context is
  122583. // canceled.
  122584. func (c *ZonesGetCall) Context(ctx context.Context) *ZonesGetCall {
  122585. c.ctx_ = ctx
  122586. return c
  122587. }
  122588. // Header returns an http.Header that can be modified by the caller to
  122589. // add HTTP headers to the request.
  122590. func (c *ZonesGetCall) Header() http.Header {
  122591. if c.header_ == nil {
  122592. c.header_ = make(http.Header)
  122593. }
  122594. return c.header_
  122595. }
  122596. func (c *ZonesGetCall) doRequest(alt string) (*http.Response, error) {
  122597. reqHeaders := make(http.Header)
  122598. for k, v := range c.header_ {
  122599. reqHeaders[k] = v
  122600. }
  122601. reqHeaders.Set("User-Agent", c.s.userAgent())
  122602. if c.ifNoneMatch_ != "" {
  122603. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  122604. }
  122605. var body io.Reader = nil
  122606. c.urlParams_.Set("alt", alt)
  122607. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}")
  122608. urls += "?" + c.urlParams_.Encode()
  122609. req, _ := http.NewRequest("GET", urls, body)
  122610. req.Header = reqHeaders
  122611. googleapi.Expand(req.URL, map[string]string{
  122612. "project": c.project,
  122613. "zone": c.zone,
  122614. })
  122615. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  122616. }
  122617. // Do executes the "compute.zones.get" call.
  122618. // Exactly one of *Zone or error will be non-nil. Any non-2xx status
  122619. // code is an error. Response headers are in either
  122620. // *Zone.ServerResponse.Header or (if a response was returned at all) in
  122621. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  122622. // whether the returned error was because http.StatusNotModified was
  122623. // returned.
  122624. func (c *ZonesGetCall) Do(opts ...googleapi.CallOption) (*Zone, error) {
  122625. gensupport.SetOptions(c.urlParams_, opts...)
  122626. res, err := c.doRequest("json")
  122627. if res != nil && res.StatusCode == http.StatusNotModified {
  122628. if res.Body != nil {
  122629. res.Body.Close()
  122630. }
  122631. return nil, &googleapi.Error{
  122632. Code: res.StatusCode,
  122633. Header: res.Header,
  122634. }
  122635. }
  122636. if err != nil {
  122637. return nil, err
  122638. }
  122639. defer googleapi.CloseBody(res)
  122640. if err := googleapi.CheckResponse(res); err != nil {
  122641. return nil, err
  122642. }
  122643. ret := &Zone{
  122644. ServerResponse: googleapi.ServerResponse{
  122645. Header: res.Header,
  122646. HTTPStatusCode: res.StatusCode,
  122647. },
  122648. }
  122649. target := &ret
  122650. if err := gensupport.DecodeResponse(target, res); err != nil {
  122651. return nil, err
  122652. }
  122653. return ret, nil
  122654. // {
  122655. // "description": "Returns the specified Zone resource. Gets a list of available zones by making a list() request.",
  122656. // "httpMethod": "GET",
  122657. // "id": "compute.zones.get",
  122658. // "parameterOrder": [
  122659. // "project",
  122660. // "zone"
  122661. // ],
  122662. // "parameters": {
  122663. // "project": {
  122664. // "description": "Project ID for this request.",
  122665. // "location": "path",
  122666. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  122667. // "required": true,
  122668. // "type": "string"
  122669. // },
  122670. // "zone": {
  122671. // "description": "Name of the zone resource to return.",
  122672. // "location": "path",
  122673. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  122674. // "required": true,
  122675. // "type": "string"
  122676. // }
  122677. // },
  122678. // "path": "{project}/zones/{zone}",
  122679. // "response": {
  122680. // "$ref": "Zone"
  122681. // },
  122682. // "scopes": [
  122683. // "https://www.googleapis.com/auth/cloud-platform",
  122684. // "https://www.googleapis.com/auth/compute",
  122685. // "https://www.googleapis.com/auth/compute.readonly"
  122686. // ]
  122687. // }
  122688. }
  122689. // method id "compute.zones.list":
  122690. type ZonesListCall struct {
  122691. s *Service
  122692. project string
  122693. urlParams_ gensupport.URLParams
  122694. ifNoneMatch_ string
  122695. ctx_ context.Context
  122696. header_ http.Header
  122697. }
  122698. // List: Retrieves the list of Zone resources available to the specified
  122699. // project.
  122700. // For details, see https://cloud.google.com/compute/docs/reference/latest/zones/list
  122701. func (r *ZonesService) List(project string) *ZonesListCall {
  122702. c := &ZonesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  122703. c.project = project
  122704. return c
  122705. }
  122706. // Filter sets the optional parameter "filter": A filter expression that
  122707. // filters resources listed in the response. The expression must specify
  122708. // the field name, a comparison operator, and the value that you want to
  122709. // use for filtering. The value must be a string, a number, or a
  122710. // boolean. The comparison operator must be either =, !=, >, or <.
  122711. //
  122712. // For example, if you are filtering Compute Engine instances, you can
  122713. // exclude instances named example-instance by specifying name !=
  122714. // example-instance.
  122715. //
  122716. // You can also filter nested fields. For example, you could specify
  122717. // scheduling.automaticRestart = false to include instances only if they
  122718. // are not scheduled for automatic restarts. You can use filtering on
  122719. // nested fields to filter based on resource labels.
  122720. //
  122721. // To filter on multiple expressions, provide each separate expression
  122722. // within parentheses. For example, (scheduling.automaticRestart = true)
  122723. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  122724. // AND expression. However, you can include AND and OR expressions
  122725. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  122726. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  122727. // true).
  122728. func (c *ZonesListCall) Filter(filter string) *ZonesListCall {
  122729. c.urlParams_.Set("filter", filter)
  122730. return c
  122731. }
  122732. // MaxResults sets the optional parameter "maxResults": The maximum
  122733. // number of results per page that should be returned. If the number of
  122734. // available results is larger than maxResults, Compute Engine returns a
  122735. // nextPageToken that can be used to get the next page of results in
  122736. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  122737. // (Default: 500)
  122738. func (c *ZonesListCall) MaxResults(maxResults int64) *ZonesListCall {
  122739. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  122740. return c
  122741. }
  122742. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  122743. // a certain order. By default, results are returned in alphanumerical
  122744. // order based on the resource name.
  122745. //
  122746. // You can also sort results in descending order based on the creation
  122747. // timestamp using orderBy="creationTimestamp desc". This sorts results
  122748. // based on the creationTimestamp field in reverse chronological order
  122749. // (newest result first). Use this to sort resources like operations so
  122750. // that the newest operation is returned first.
  122751. //
  122752. // Currently, only sorting by name or creationTimestamp desc is
  122753. // supported.
  122754. func (c *ZonesListCall) OrderBy(orderBy string) *ZonesListCall {
  122755. c.urlParams_.Set("orderBy", orderBy)
  122756. return c
  122757. }
  122758. // PageToken sets the optional parameter "pageToken": Specifies a page
  122759. // token to use. Set pageToken to the nextPageToken returned by a
  122760. // previous list request to get the next page of results.
  122761. func (c *ZonesListCall) PageToken(pageToken string) *ZonesListCall {
  122762. c.urlParams_.Set("pageToken", pageToken)
  122763. return c
  122764. }
  122765. // Fields allows partial responses to be retrieved. See
  122766. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  122767. // for more information.
  122768. func (c *ZonesListCall) Fields(s ...googleapi.Field) *ZonesListCall {
  122769. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  122770. return c
  122771. }
  122772. // IfNoneMatch sets the optional parameter which makes the operation
  122773. // fail if the object's ETag matches the given value. This is useful for
  122774. // getting updates only after the object has changed since the last
  122775. // request. Use googleapi.IsNotModified to check whether the response
  122776. // error from Do is the result of In-None-Match.
  122777. func (c *ZonesListCall) IfNoneMatch(entityTag string) *ZonesListCall {
  122778. c.ifNoneMatch_ = entityTag
  122779. return c
  122780. }
  122781. // Context sets the context to be used in this call's Do method. Any
  122782. // pending HTTP request will be aborted if the provided context is
  122783. // canceled.
  122784. func (c *ZonesListCall) Context(ctx context.Context) *ZonesListCall {
  122785. c.ctx_ = ctx
  122786. return c
  122787. }
  122788. // Header returns an http.Header that can be modified by the caller to
  122789. // add HTTP headers to the request.
  122790. func (c *ZonesListCall) Header() http.Header {
  122791. if c.header_ == nil {
  122792. c.header_ = make(http.Header)
  122793. }
  122794. return c.header_
  122795. }
  122796. func (c *ZonesListCall) doRequest(alt string) (*http.Response, error) {
  122797. reqHeaders := make(http.Header)
  122798. for k, v := range c.header_ {
  122799. reqHeaders[k] = v
  122800. }
  122801. reqHeaders.Set("User-Agent", c.s.userAgent())
  122802. if c.ifNoneMatch_ != "" {
  122803. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  122804. }
  122805. var body io.Reader = nil
  122806. c.urlParams_.Set("alt", alt)
  122807. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones")
  122808. urls += "?" + c.urlParams_.Encode()
  122809. req, _ := http.NewRequest("GET", urls, body)
  122810. req.Header = reqHeaders
  122811. googleapi.Expand(req.URL, map[string]string{
  122812. "project": c.project,
  122813. })
  122814. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  122815. }
  122816. // Do executes the "compute.zones.list" call.
  122817. // Exactly one of *ZoneList or error will be non-nil. Any non-2xx status
  122818. // code is an error. Response headers are in either
  122819. // *ZoneList.ServerResponse.Header or (if a response was returned at
  122820. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  122821. // to check whether the returned error was because
  122822. // http.StatusNotModified was returned.
  122823. func (c *ZonesListCall) Do(opts ...googleapi.CallOption) (*ZoneList, error) {
  122824. gensupport.SetOptions(c.urlParams_, opts...)
  122825. res, err := c.doRequest("json")
  122826. if res != nil && res.StatusCode == http.StatusNotModified {
  122827. if res.Body != nil {
  122828. res.Body.Close()
  122829. }
  122830. return nil, &googleapi.Error{
  122831. Code: res.StatusCode,
  122832. Header: res.Header,
  122833. }
  122834. }
  122835. if err != nil {
  122836. return nil, err
  122837. }
  122838. defer googleapi.CloseBody(res)
  122839. if err := googleapi.CheckResponse(res); err != nil {
  122840. return nil, err
  122841. }
  122842. ret := &ZoneList{
  122843. ServerResponse: googleapi.ServerResponse{
  122844. Header: res.Header,
  122845. HTTPStatusCode: res.StatusCode,
  122846. },
  122847. }
  122848. target := &ret
  122849. if err := gensupport.DecodeResponse(target, res); err != nil {
  122850. return nil, err
  122851. }
  122852. return ret, nil
  122853. // {
  122854. // "description": "Retrieves the list of Zone resources available to the specified project.",
  122855. // "httpMethod": "GET",
  122856. // "id": "compute.zones.list",
  122857. // "parameterOrder": [
  122858. // "project"
  122859. // ],
  122860. // "parameters": {
  122861. // "filter": {
  122862. // "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).",
  122863. // "location": "query",
  122864. // "type": "string"
  122865. // },
  122866. // "maxResults": {
  122867. // "default": "500",
  122868. // "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)",
  122869. // "format": "uint32",
  122870. // "location": "query",
  122871. // "minimum": "0",
  122872. // "type": "integer"
  122873. // },
  122874. // "orderBy": {
  122875. // "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.",
  122876. // "location": "query",
  122877. // "type": "string"
  122878. // },
  122879. // "pageToken": {
  122880. // "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.",
  122881. // "location": "query",
  122882. // "type": "string"
  122883. // },
  122884. // "project": {
  122885. // "description": "Project ID for this request.",
  122886. // "location": "path",
  122887. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  122888. // "required": true,
  122889. // "type": "string"
  122890. // }
  122891. // },
  122892. // "path": "{project}/zones",
  122893. // "response": {
  122894. // "$ref": "ZoneList"
  122895. // },
  122896. // "scopes": [
  122897. // "https://www.googleapis.com/auth/cloud-platform",
  122898. // "https://www.googleapis.com/auth/compute",
  122899. // "https://www.googleapis.com/auth/compute.readonly"
  122900. // ]
  122901. // }
  122902. }
  122903. // Pages invokes f for each page of results.
  122904. // A non-nil error returned from f will halt the iteration.
  122905. // The provided context supersedes any context provided to the Context method.
  122906. func (c *ZonesListCall) Pages(ctx context.Context, f func(*ZoneList) error) error {
  122907. c.ctx_ = ctx
  122908. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  122909. for {
  122910. x, err := c.Do()
  122911. if err != nil {
  122912. return err
  122913. }
  122914. if err := f(x); err != nil {
  122915. return err
  122916. }
  122917. if x.NextPageToken == "" {
  122918. return nil
  122919. }
  122920. c.PageToken(x.NextPageToken)
  122921. }
  122922. }